From 8cb60a4c298a5e73d471fb192ed6636b303761a3 Mon Sep 17 00:00:00 2001 From: Darren Cooney Date: Fri, 8 Nov 2024 13:59:32 -0500 Subject: [PATCH] Removed .wp-block styles in Instant Images CSS --- README.txt | 5 +- build/admin/index.asset.php | 2 +- build/admin/index.js | 4317 +++++- build/block/index.asset.php | 2 +- build/block/index.js | 19873 +++++++++++++++++++++++- build/instant-images.asset.php | 2 +- build/instant-images.js | 19929 ++++++++++++++++++++++++- build/media-modal/index.asset.php | 2 +- build/media-modal/index.js | 19928 +++++++++++++++++++++++- build/plugin-sidebar/index.asset.php | 2 +- build/plugin-sidebar/index.js | 19861 +++++++++++++++++++++++- build/style-instant-images.css | 3480 ++++- instant-images.php | 4 +- src/scss/style.scss | 5 +- 14 files changed, 86909 insertions(+), 503 deletions(-) diff --git a/README.txt b/README.txt index 3fdfbc2..50873df 100755 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Donate link: Tags: Unsplash, Openverse, Pixabay, Pexels, Stock Photos, photos, stock photo, image upload, upload, free photos Requires at least: 5.0 Tested up to: 6.7 -Stable tag: 6.2.1 +Stable tag: 6.2.2 License: GPLv2 or later License URI: @@ -160,6 +160,9 @@ How to install Instant Images. == Changelog == += 6.2.2 - November 8, 2024 = +* HOTFIX: Removed .wp-block styles in Instant Images CSS. + = 6.2.1 - November 7, 2024 = * NEW: Added support for new Extended add-on feature to maintain search term when switching providers. * UPDATE: WordPress 6.7 compatibility updates. diff --git a/build/admin/index.asset.php b/build/admin/index.asset.php index 434869a..d04bd96 100644 --- a/build/admin/index.asset.php +++ b/build/admin/index.asset.php @@ -1 +1 @@ - array('wp-i18n'), 'version' => '726a54354c57e75edbba'); + array('wp-i18n'), 'version' => 'e5ce34c44d7b02d3e7f5'); diff --git a/build/admin/index.js b/build/admin/index.js index f098b5b..ee38395 100644 --- a/build/admin/index.js +++ b/build/admin/index.js @@ -1 +1,4316 @@ -(()=>{"use strict";function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,r=(o=Object.create(null),e=>{const n=t.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())});var o;const i=e=>(e=e.toLowerCase(),t=>r(t)===e),s=e=>t=>typeof t===e,{isArray:a}=Array,c=s("undefined"),u=i("ArrayBuffer"),l=s("string"),f=s("function"),d=s("number"),p=e=>null!==e&&"object"==typeof e,h=e=>{if("object"!==r(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=i("Date"),g=i("File"),y=i("Blob"),b=i("FileList"),w=i("URLSearchParams");function E(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),a(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,S=e=>!c(e)&&e!==v,R=(A="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>A&&e instanceof A);var A;const T=i("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N=i("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};E(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},x="abcdefghijklmnopqrstuvwxyz",P="0123456789",_={DIGIT:P,ALPHA:x,ALPHA_DIGIT:x+x.toUpperCase()+P},L={isArray:a,isArrayBuffer:u,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const n="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||t.call(e)===n||f(e.toString)&&e.toString()===n)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&u(e.buffer),t},isString:l,isNumber:d,isBoolean:e=>!0===e||!1===e,isObject:p,isPlainObject:h,isUndefined:c,isDate:m,isFile:g,isBlob:y,isRegExp:N,isFunction:f,isStream:e=>p(e)&&f(e.pipe),isURLSearchParams:w,isTypedArray:R,isFileList:b,forEach:E,merge:function e(){const{caseless:t}=S(this)&&this||{},n={},r=(r,o)=>{const i=t&&O(n,o)||o;h(n[i])&&h(r)?n[i]=e(n[i],r):h(r)?n[i]=e({},r):a(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e(E(n,((n,o)=>{r&&f(n)?t[o]=e(n,r):t[o]=n}),{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let i,s,a;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:r,kindOfTest:i,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(a(e))return e;let t=e.length;if(!d(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:T,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];f(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return a(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:O,global:v,isContextDefined:S,ALPHABET:_,generateString:(e=16,t=_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(p(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=a(e)?[]:{};return E(e,((e,t)=>{const i=n(e,r+1);!c(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)}};function U(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}L.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const D=U.prototype,B={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{B[e]={value:e}})),Object.defineProperties(U,B),Object.defineProperty(D,"isAxiosError",{value:!0}),U.from=(e,t,n,r,o,i)=>{const s=Object.create(D);return L.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const F=U;function k(e){return L.isPlainObject(e)||L.isArray(e)}function q(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function I(e,t,n){return e?e.concat(t).map((function(e,t){return e=q(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const z=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)})),M=function(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!a&&L.isBlob(e))throw new F("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(k)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(a=L.toArray(e)))return n=q(n),a.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===s?I([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!k(e)||(t.append(I(o,n,i),c(e)),!1)}const l=[],f=Object.assign(z,{defaultVisitor:u,convertValue:c,isVisitable:k});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),L.forEach(n,(function(n,i){!0===(!(L.isUndefined(n)||null===n)&&o.call(t,n,L.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t};function H(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function J(e,t){this._pairs=[],e&&M(e,this,t)}const W=J.prototype;W.append=function(e,t){this._pairs.push([e,t])},W.toString=function(e){const t=e?function(t){return e.call(this,t,H)}:H;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const K=J;function V(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function G(e,t,n){if(!t)return e;const r=n&&n.encode||V,o=n&&n.serialize;let i;if(i=o?o(t,n):L.isURLSearchParams(t)?t.toString():new K(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const $=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},X={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:K,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},Z=function(e){function t(e,n,r,o){let i=e[o++];const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&L.isArray(r)?r.length:i,a?(L.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&L.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&L.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Y={"Content-Type":void 0},ee={transitional:X,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=L.isObject(e);if(o&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r&&r?JSON.stringify(Z(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return M(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Q.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return M(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(0,JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ee.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw F.from(e,F.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};L.forEach(["delete","get","head"],(function(e){ee.headers[e]={}})),L.forEach(["post","put","patch"],(function(e){ee.headers[e]=L.merge(Y)}));const te=ee,ne=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),re=Symbol("internals");function oe(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:L.isArray(e)?e.map(ie):String(e)}function se(e,t,n,r,o){return L.isFunction(r)?r.call(this,t,n):(o&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}class ae{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=oe(t);if(!o)throw new Error("header name must be a non-empty string");const i=L.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=ie(e))}const i=(e,t)=>L.forEach(e,((e,n)=>o(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?i(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ne[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=oe(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oe(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!se(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=oe(e)){const o=L.findKey(n,e);!o||t&&!se(0,n[o],o,t)||(delete n[o],r=!0)}}return L.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!se(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,o)=>{const i=L.findKey(n,o);if(i)return t[i]=ie(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=ie(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[re]=this[re]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=oe(e);t[r]||(function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}}ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.freezeMethods(ae.prototype),L.freezeMethods(ae);const ce=ae;function ue(e,t){const n=this||te,r=t||n,o=ce.from(r.headers);let i=r.data;return L.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function le(e){return!(!e||!e.__CANCEL__)}function fe(e,t,n){F.call(this,null==e?"canceled":e,F.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(fe,F,{__CANCEL__:!0});const de=fe,pe=Q.isStandardBrowserEnv?{write:function(e,t,n,r,o,i){const s=[];s.push(e+"="+encodeURIComponent(t)),L.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),L.isString(r)&&s.push("path="+r),L.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function he(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},ge=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,c=r(a);n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const be={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=ce.from(e.headers).normalize(),i=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}L.isFormData(r)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const u=he(e.baseURL,e.url);function l(){if(!c)return;const r=ce.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:i&&"text"!==i&&"json"!==i?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),G(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new F("Request aborted",F.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new F("Network Error",F.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||X;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new F(t,r.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,c)),c=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&pe.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in c&&L.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),i&&"json"!==i&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ye(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ye(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{c&&(n(!t||t.type?new de(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===Q.protocols.indexOf(f)?n(new F("Unsupported protocol "+f+":",F.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};L.forEach(be,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const we={getAdapter:e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;oe instanceof ce?e.toJSON():e;function Se(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function o(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!L.isUndefined(t))return r(void 0,t)}function s(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>o(ve(e),ve(t),!0)};return L.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);L.isUndefined(s)&&i!==a||(n[r]=s)})),n}const Re={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Re[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ae={};Re.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new F(r(o," has been removed"+(t?" in "+t:"")),F.ERR_DEPRECATED);return t&&!Ae[o]&&(Ae[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};const Te={assertOptions:function(e,t,n){if("object"!=typeof e)throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new F("option "+i+" must be "+n,F.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new F("Unknown option "+i,F.ERR_BAD_OPTION)}},validators:Re},Ce=Te.validators;class Ne{constructor(e){this.defaults=e,this.interceptors={request:new $,response:new $}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let i;void 0!==n&&Te.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),void 0!==r&&Te.assertOptions(r,{encode:Ce.function,serialize:Ce.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),i=o&&L.merge(o.common,o[t.method]),i&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=ce.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[Oe.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new de(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new xe((function(t){e=t})),cancel:e}}}const Pe=xe,_e={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(_e).forEach((([e,t])=>{_e[t]=e}));const Le=_e,Ue=function t(n){const r=new je(n),o=e(je.prototype.request,r);return L.extend(o,je.prototype,r,{allOwnKeys:!0}),L.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Se(n,e))},o}(te);Ue.Axios=je,Ue.CanceledError=de,Ue.CancelToken=Pe,Ue.isCancel=le,Ue.VERSION="1.3.4",Ue.toFormData=M,Ue.AxiosError=F,Ue.Cancel=Ue.CanceledError,Ue.all=function(e){return Promise.all(e)},Ue.spread=function(e){return function(t){return e.apply(null,t)}},Ue.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},Ue.mergeConfig=Se,Ue.AxiosHeaders=ce,Ue.formToJSON=e=>Z(L.isHTMLForm(e)?new FormData(e):e),Ue.HttpStatusCode=Le,Ue.default=Ue;const De=Ue,Be=window.wp.i18n;var Fe=document.querySelectorAll(".license-settings form.license-settings--item");function ke(){setTimeout((function(){location.reload()}),2e3)}Fe&&Fe.forEach((function(e){e.addEventListener("submit",(function(t){t.preventDefault();var n,r,o,i,s=this.querySelector("input"),a=s.value,c=s.dataset.key,u=s.dataset.status,l=s.dataset.id,f=e.classList.contains("valid")?"deactivate":"activate";a?(e.querySelector("input[type=submit]").setAttribute("disabled","disabled"),e.querySelector(".loading").classList.add("active"),n={key:c,status:u,id:l,license:a,type:f},o=(r=instant_img_admin_localize).root+"instant-images/license/",i={headers:{"X-WP-Nonce":r.nonce,"Content-Type":"application/json"}},De.post(o,JSON.stringify(n),i).then((function(e){null!=e&&e.data?location.reload():(console.warn((0,Be.__)("Are you sure you should be doing this?","instant-images")),ke())})).catch((function(e){console.warn(e),ke()}))):s.focus()}))}));var qe=qe||{};function Ie(e){var t=document.querySelector(e);t&&(history.replaceState({},"",e),window.scrollTo({top:t.offsetTop-20,behavior:"smooth"}))}jQuery(document).ready((function(e){if(qe.setEditor=function(t){var n=wp.media.view.Router;wp.media.view.Router=n.extend({addNav:function(){var n=e(' '+instant_img_localize.instant_images+"");n.on("click",(function(e){e.preventDefault(),t.addClass("active")})),this.$el.append(n)},initialize:function(){return n.prototype.initialize.apply(this,arguments),this.addNav(),this}}),t.length&&e(".close-ii-modal").on("click",(function(e){e.preventDefault(),t.removeClass("active")}))},wp.media){var t=e("#instant_images_modal");t.length&&qe.setEditor(t)}e(document).on("click",".media-modal-backdrop",(function(e){e.preventDefault(),frame.removeClass("active")})),e(".instant-images-settings form.settings").on("submit",(function(){var t=e(this);return t.addClass("saving"),e(".save-settings .loading",t).addClass("active"),e(".save-settings #submit",t).prop("disabled",!0),e(this).ajaxSubmit({success:function(){e(".save-settings .loading",t).removeClass("active"),setTimeout((function(){e(".save-settings .saved",t).addClass("active"),setTimeout((function(){e(".save-settings .saved",t).removeClass("active"),t.removeClass("saving"),e(".save-settings #submit",t).prop("disabled",!1)}),2e3)}),250)},error:function(){t.removeClass("saving"),e(".save-settings .loading",t).removeClass("active"),e(".save-settings #submit",t).prop("disabled",!1),alert("An error occured and the settings could not be saved")}}),!1}));var n=document.querySelectorAll(".settings_page_instant-images-settings .settings-entry");if(n){var r=window.location.hash;r&&Ie(r);var o=document.querySelector(".settings_page_instant-images-settings nav.jump-nav");n.forEach((function(e){var t=e.getAttribute("id"),n=e.querySelector(".settings-entry--title .fa"),r=e.querySelector(".settings-entry--title h2").innerText,i=document.createElement("button");i.setAttribute("data-anchor",t),i.innerHTML=n.outerHTML+r,o.appendChild(i),i.addEventListener("click",(function(){Ie("#"+t)}))}))}}))})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./admin/src/js/licenses.js": +/*!**********************************!*\ + !*** ./admin/src/js/licenses.js ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + + + +// Get all license forms. +var licenseForms = document.querySelectorAll(".license-settings form.license-settings--item"); +if (licenseForms) { + // Loop each formt o add event listener. + licenseForms.forEach(function (form) { + form.addEventListener("submit", function (e) { + e.preventDefault(); + var input = this.querySelector("input"); + var license = input.value; + var key = input.dataset.key; + var status = input.dataset.status; + var id = input.dataset.id; + var type = form.classList.contains("valid") ? "deactivate" : "activate"; + if (!license) { + input.focus(); + return; + } + var button = form.querySelector("input[type=submit]"); + button.setAttribute("disabled", "disabled"); + var loading = form.querySelector(".loading"); + loading.classList.add("active"); + updateLicense({ + key: key, + status: status, + id: id, + license: license, + type: type + }); + }); + }); +} + +/** + * Update add-on license via REST API. + * + * @param {Object} params The data params for license activation/deactivation. + */ +function updateLicense(params) { + var _instant_img_admin_lo = instant_img_admin_localize, + root = _instant_img_admin_lo.root, + nonce = _instant_img_admin_lo.nonce; // eslint-disable-line no-undef + var api = root + "instant-images/license/"; + var config = { + headers: { + "X-WP-Nonce": nonce, + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_1__["default"].post(api, JSON.stringify(params), config).then(function (data) { + if (data !== null && data !== void 0 && data.data) { + location.reload(); // Success: reload window. + } else { + console.warn( + // Error handling. + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Are you sure you should be doing this?", "instant-images")); + doReload(); + } + })["catch"](function (error) { + console.warn(error); + doReload(); + }); +} + +/** + * Reload window after 2 seconds. + */ +function doReload() { + setTimeout(function () { + location.reload(); // reload window. + }, 2000); +} + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/adapters.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/adapters/adapters.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); +/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const knownAdapters = { + http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], + xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"] +} + +_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(knownAdapters, (fn, value) => { + if(fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + getAdapter: (adapters) => { + adapters = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if((adapter = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + break; + } + } + + if (!adapter) { + if (adapter === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( + `Adapter ${nameOrAdapter} is not supported by the environment`, + 'ERR_NOT_SUPPORT' + ); + } + + throw new Error( + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].hasOwnProp(knownAdapters, nameOrAdapter) ? + `Adapter '${nameOrAdapter}' is not available in the build` : + `Unknown adapter '${nameOrAdapter}'` + ); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFunction(adapter)) { + throw new TypeError('adapter is not a function'); + } + + return adapter; + }, + adapters: knownAdapters +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); +/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); + + + + + + + + + + + + + + + + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers).normalize(); + const responseType = config.responseType; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(requestData) && (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserWebWorkerEnv)) { + requestHeaders.setContentType(false); // Let the browser set it + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__["default"]; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv) { + // Add xsrf header + const xsrfValue = (config.withCredentials || (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath)) + && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__["default"].read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__["default"](null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__["default"])(fullPath); + + if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].protocols.indexOf(protocol) === -1) { + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); +/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); +/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); +/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); + + + + + + + + + + + + + + + + + + + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); + const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); + + // Copy axios.prototype to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); + + // Copy context to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); + +// Expose Axios class to allow class inheritance +axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + +// Expose Cancel & CancelToken +axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; +axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; +axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; +axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; +axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; + +// Expose AxiosError class +axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; + +// Expose isAxiosError +axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; + +// Expose mergeConfig +axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; + +axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; + +axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__["default"]; + +axios.default = axios; + +// this module should only have a default export +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); + + + + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CanceledError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { + __CANCEL__: true +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isCancel) +/* harmony export */ }); + + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); +/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); +/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + + + + + + +const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), + response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + let contextHeaders; + + // Flatten headers + contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( + headers.common, + headers[config.method] + ); + + contextHeaders && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url); + return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosError.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosError.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); + + + + + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +function isValidHeaderName(str) { + return /^[-_a-zA-Z]+$/.test(str.trim()); +} + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { + return parser.call(this, value, key); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders.prototype); +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildFullPath) +/* harmony export */ }); +/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); + + + + + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { + return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); + } + return requestedURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ dispatchRequest) +/* harmony export */ }); +/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); + + + + + + + + + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); + + // Transform request data + config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + response + ); + + response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergeConfig) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + +const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ settle) +/* harmony export */ }); +/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( + 'Request failed with status code ' + response.status, + [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ transformData) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + const context = response || config; + const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); + let data = context.data; + + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/index.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/defaults/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); + + + + + + + + + + +const DEFAULT_CONTENT_TYPE = { + 'Content-Type': undefined +}; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); + + if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) + ) { + return data; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { + return data.buffer; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); + } + + if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, + Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(DEFAULT_CONTENT_TYPE); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/transitional.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/defaults/transitional.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/env/data.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/env/data.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "VERSION": () => (/* binding */ VERSION) +/* harmony export */ }); +const VERSION = "1.3.4"; + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": +/*!****************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); + + + + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ bind) +/* harmony export */ }); + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildURL) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + + + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? + params.toString() : + new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ combineURLs) +/* harmony export */ }); + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) { + cookie.push('path=' + path); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + +// Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; + + if (isLast) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { + const obj = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAbsoluteURL) +/* harmony export */ }); + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAxiosError) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/null.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/null.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +// eslint-disable-next-line strict +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ parseProtocol) +/* harmony export */ }); + + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/speedometer.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/speedometer.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ spread) +/* harmony export */ }); + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toFormData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toFormData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); + + + + +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored + + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); +} + +const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || + ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { + const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( + formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": +/*!************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ toURLEncodedForm) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + + +function toURLEncodedForm(data, options) { + return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/validator.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/validator.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); + } + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assertOptions, + validators +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": +/*!*****************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": +/*!*********************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": +/*!****************************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/index.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); +/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); +/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); + + + + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== 'undefined' && ( + (product = navigator.product) === 'ReactNative' || + product === 'NativeScript' || + product === 'NS') + ) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; +})(); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + const isStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isBrowser: true, + classes: { + URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], + FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], + Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); + + + + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + const pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + if (reducer(descriptor, name, obj) !== false) { + reducedDescriptors[name] = descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject +}); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!*******************************!*\ + !*** ./admin/src/js/admin.js ***! + \*******************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _licenses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./licenses */ "./admin/src/js/licenses.js"); + +var instant_images = instant_images || {}; +jQuery(document).ready(function ($) { + "use strict"; + + // Media Uploader Modal + instant_images.setEditor = function (frame) { + var Parent = wp.media.view.Router; + wp.media.view.Router = Parent.extend({ + addNav: function addNav() { + // Button + var $a = $(' ' + instant_img_localize.instant_images + ""); + + // Click event + $a.on("click", function (e) { + e.preventDefault(); + // Set active state of #instant_images_modal + frame.addClass("active"); + }); + this.$el.append($a); // append + }, + initialize: function initialize() { + Parent.prototype.initialize.apply(this, arguments); + this.addNav(); // add buttons + return this; // return + } + }); + + if (frame.length) { + $(".close-ii-modal").on("click", function (e) { + e.preventDefault(); + frame.removeClass("active"); + }); + } + }; + if (wp.media) { + var _frame = $("#instant_images_modal"); + if (_frame.length) { + instant_images.setEditor(_frame); + } + } + + // Close Modal. + $(document).on("click", ".media-modal-backdrop", function (e) { + e.preventDefault(); + frame.removeClass("active"); + }); + + // Save Settings Form. + $(".instant-images-settings form.settings").on("submit", function () { + var form = $(this); + form.addClass("saving"); + $(".save-settings .loading", form).addClass("active"); + $(".save-settings #submit", form).prop("disabled", true); + $(this).ajaxSubmit({ + success: function success() { + $(".save-settings .loading", form).removeClass("active"); + setTimeout(function () { + $(".save-settings .saved", form).addClass("active"); + setTimeout(function () { + $(".save-settings .saved", form).removeClass("active"); + form.removeClass("saving"); + $(".save-settings #submit", form).prop("disabled", false); + }, 2000); + }, 250); + }, + error: function error() { + form.removeClass("saving"); + $(".save-settings .loading", form).removeClass("active"); + $(".save-settings #submit", form).prop("disabled", false); + alert("An error occured and the settings could not be saved"); // eslint-disable-line no-alert + } + }); + + return false; + }); + + // Settings anchor links. + var settings = document.querySelectorAll(".settings_page_instant-images-settings .settings-entry"); + if (settings) { + var hash = window.location.hash; + if (hash) { + scrollToSection(hash); + } + var nav = document.querySelector(".settings_page_instant-images-settings nav.jump-nav"); + settings.forEach(function (setting) { + var anchor = setting.getAttribute("id"); + var icon = setting.querySelector(".settings-entry--title .fa"); + var text = setting.querySelector(".settings-entry--title h2").innerText; + var button = document.createElement("button"); + button.setAttribute("data-anchor", anchor); + button.innerHTML = icon.outerHTML + text; + nav.appendChild(button); + + // Scroll to section. + button.addEventListener("click", function () { + scrollToSection("#" + anchor); + }); + }); + } +}); + +/** + * Scroll to section hash. + * + * @param {string} hash The section ID. + */ +function scrollToSection(hash) { + var target = document.querySelector(hash); + if (target) { + history.replaceState({}, "", hash); + window.scrollTo({ + top: target.offsetTop - 20, + behavior: "smooth" + }); + } +} +})(); + +/******/ })() +; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/block/index.asset.php b/build/block/index.asset.php index 411d1b4..2c2633b 100644 --- a/build/block/index.asset.php +++ b/build/block/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '81c099ea3fca1106f2d2'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '51dedb6fbbcc47ef39c5'); diff --git a/build/block/index.js b/build/block/index.js index 937aebb..07b822e 100644 --- a/build/block/index.js +++ b/build/block/index.js @@ -1 +1,19872 @@ -(()=>{var e={4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t>>8^255&p^99,i[n]=p,o[p]=n;var m=e[n],v=e[m],g=e[v],y=257*e[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,l[n]=y<<8|y>>>24,c[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[p]=y<<24|y>>>8,f[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,n?(n=m^e[e[e[g^m]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a6&&a%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[a/n|0]<<24),o[a]=o[a-n]^c);for(var s=this._invKeySchedule=[],l=0;l>>24]]^f[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,l,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,f,h,d,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var l=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],f=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&h]^n[d++],v=r[u>>>24]^i[f>>>16&255]^o[h>>>8&255]^a[255&c]^n[d++],g=r[f>>>24]^i[h>>>16&255]^o[c>>>8&255]^a[255&u]^n[d++],y=r[h>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&f]^n[d++];c=m,u=v,f=g,h=y}m=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^n[d++],v=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^n[d++],g=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^n[d++],y=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[d++],e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},5109:function(e,t,n){var r,i,o,a,s,l,c,u,f,h,d,p,m,v,g,y,_,b,w;e.exports=(r=n(8249),n(888),void(r.lib.Cipher||(i=r,o=i.lib,a=o.Base,s=o.WordArray,l=o.BufferedBlockAlgorithm,c=i.enc,c.Utf8,u=c.Base64,f=i.algo.EvpKDF,h=o.Cipher=l.extend({cfg:a.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){l.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:_}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),o.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=a.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=d.CBC=function(){var e=p.extend();function t(e,t,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:v}),reset:function(){var e;h.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),g=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},_=o.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(i.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=s.random(8));var i=f.create({keySize:t+n}).compute(e,r),o=s.create(i.words.slice(t),4*n);return i.sigBytes=4*t,g.create({key:i,iv:o,salt:r})}},w=o.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=_.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,_.decrypt.call(this,e,t,i.key,r)}}))))},8249:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(2480)}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},s=a.lib={},l=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=l.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},d=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*l,o);if(l){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},3786:function(e,t,n){var r,i,o;e.exports=(r=n(8249),o=(i=r).lib.WordArray,i.enc.Base64url={stringify:function(e,t=!0){var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,l=0;l<4&&a+.75*l>>6*(3-l)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e,t=!0){var n=e.length,r=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(e,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},r.enc.Base64url)},298:function(e,t,n){var r;e.exports=(r=n(8249),function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},888:function(e,t,n){var r,i,o,a,s,l,c,u;e.exports=(u=n(8249),n(2783),n(9824),o=(i=(r=u).lib).Base,a=i.WordArray,l=(s=r.algo).MD5,c=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),o=a.create(),s=o.words,l=r.keySize,c=r.iterations;s.lengthr&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,l=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},8214:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],l=e[t+1],d=e[t+2],p=e[t+3],m=e[t+4],v=e[t+5],g=e[t+6],y=e[t+7],_=e[t+8],b=e[t+9],w=e[t+10],E=e[t+11],S=e[t+12],R=e[t+13],x=e[t+14],k=e[t+15],O=o[0],C=o[1],A=o[2],B=o[3];O=c(O,C,A,B,a,7,s[0]),B=c(B,O,C,A,l,12,s[1]),A=c(A,B,O,C,d,17,s[2]),C=c(C,A,B,O,p,22,s[3]),O=c(O,C,A,B,m,7,s[4]),B=c(B,O,C,A,v,12,s[5]),A=c(A,B,O,C,g,17,s[6]),C=c(C,A,B,O,y,22,s[7]),O=c(O,C,A,B,_,7,s[8]),B=c(B,O,C,A,b,12,s[9]),A=c(A,B,O,C,w,17,s[10]),C=c(C,A,B,O,E,22,s[11]),O=c(O,C,A,B,S,7,s[12]),B=c(B,O,C,A,R,12,s[13]),A=c(A,B,O,C,x,17,s[14]),O=u(O,C=c(C,A,B,O,k,22,s[15]),A,B,l,5,s[16]),B=u(B,O,C,A,g,9,s[17]),A=u(A,B,O,C,E,14,s[18]),C=u(C,A,B,O,a,20,s[19]),O=u(O,C,A,B,v,5,s[20]),B=u(B,O,C,A,w,9,s[21]),A=u(A,B,O,C,k,14,s[22]),C=u(C,A,B,O,m,20,s[23]),O=u(O,C,A,B,b,5,s[24]),B=u(B,O,C,A,x,9,s[25]),A=u(A,B,O,C,p,14,s[26]),C=u(C,A,B,O,_,20,s[27]),O=u(O,C,A,B,R,5,s[28]),B=u(B,O,C,A,d,9,s[29]),A=u(A,B,O,C,y,14,s[30]),O=f(O,C=u(C,A,B,O,S,20,s[31]),A,B,v,4,s[32]),B=f(B,O,C,A,_,11,s[33]),A=f(A,B,O,C,E,16,s[34]),C=f(C,A,B,O,x,23,s[35]),O=f(O,C,A,B,l,4,s[36]),B=f(B,O,C,A,m,11,s[37]),A=f(A,B,O,C,y,16,s[38]),C=f(C,A,B,O,w,23,s[39]),O=f(O,C,A,B,R,4,s[40]),B=f(B,O,C,A,a,11,s[41]),A=f(A,B,O,C,p,16,s[42]),C=f(C,A,B,O,g,23,s[43]),O=f(O,C,A,B,b,4,s[44]),B=f(B,O,C,A,S,11,s[45]),A=f(A,B,O,C,k,16,s[46]),O=h(O,C=f(C,A,B,O,d,23,s[47]),A,B,a,6,s[48]),B=h(B,O,C,A,y,10,s[49]),A=h(A,B,O,C,x,15,s[50]),C=h(C,A,B,O,v,21,s[51]),O=h(O,C,A,B,S,6,s[52]),B=h(B,O,C,A,p,10,s[53]),A=h(A,B,O,C,w,15,s[54]),C=h(C,A,B,O,l,21,s[55]),O=h(O,C,A,B,_,6,s[56]),B=h(B,O,C,A,k,10,s[57]),A=h(A,B,O,C,g,15,s[58]),C=h(C,A,B,O,R,21,s[59]),O=h(O,C,A,B,m,6,s[60]),B=h(B,O,C,A,E,10,s[61]),A=h(A,B,O,C,d,15,s[62]),C=h(C,A,B,O,b,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+B|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<>>32-o)+t}function u(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<>>32-o)+t}function f(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<>>32-o)+t}function h(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),r.MD5)},8568:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var l=0;l>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},2807:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},1077:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6991:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},6475:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},2112:function(e,t,n){var r,i,o,a,s,l,c,u,f;e.exports=(f=n(8249),n(2783),n(9824),o=(i=(r=f).lib).Base,a=i.WordArray,l=(s=r.algo).SHA1,c=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=c.create(n.hasher,e),i=a.create(),o=a.create([1]),s=i.words,l=o.words,u=n.keySize,f=n.iterations;s.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,h=u<<16|65535&c;for(r[0]^=c,r[1]^=f,r[2]^=u,r[3]^=h,r[4]^=c,r[5]^=f,r[6]^=u,r[7]^=h,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,l=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=l^c}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)},4454:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,h=u<<16|65535&c;for(i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=h,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=h,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,l=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=l^c}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)},1857:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=t[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var l=r[i];r[i]=r[o],r[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)},706:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,b,w,E,S,R,x,k,O,C=this._hash.words,A=f.words,B=h.words,j=s.words,L=l.words,N=c.words,P=u.words;for(E=o=C[0],S=a=C[1],R=d=C[2],x=b=C[3],k=w=C[4],n=0;n<80;n+=1)O=o+e[t+j[n]]|0,O+=n<16?p(a,d,b)+A[0]:n<32?m(a,d,b)+A[1]:n<48?v(a,d,b)+A[2]:n<64?g(a,d,b)+A[3]:y(a,d,b)+A[4],O=(O=_(O|=0,N[n]))+w|0,o=w,w=b,b=_(d,10),d=a,a=O,O=E+e[t+L[n]]|0,O+=n<16?y(S,R,x)+B[0]:n<32?g(S,R,x)+B[1]:n<48?v(S,R,x)+B[2]:n<64?m(S,R,x)+B[3]:p(S,R,x)+B[4],O=(O=_(O|=0,P[n]))+k|0,E=k,k=x,x=_(R,10),R=S,S=O;O=C[1]+d+x|0,C[1]=C[2]+b+k|0,C[2]=C[3]+w+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+R|0,C[0]=O},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function v(e,t,n){return(e|~t)^n}function g(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function _(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(Math),r.RIPEMD160)},2783:function(e,t,n){var r,i,o,a,s,l,c,u;e.exports=(i=(r=u=n(8249)).lib,o=i.WordArray,a=i.Hasher,s=r.algo,l=[],c=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=0;c<80;c++){if(c<16)l[c]=0|e[t+c];else{var u=l[c-3]^l[c-8]^l[c-14]^l[c-16];l[c]=u<<1|u>>>31}var f=(r<<5|r>>>27)+s+l[c];f+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=a._createHelper(c),r.HmacSHA1=a._createHmacHelper(c),u.SHA1)},7792:function(e,t,n){var r,i,o,a,s,l;e.exports=(l=n(8249),n(2153),i=(r=l).lib.WordArray,o=r.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=a._createHelper(s),r.HmacSHA224=a._createHmacHelper(s),l.SHA224)},2153:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(s[i]=n(e.pow(r,.5))),l[i]=n(e.pow(r,1/3)),i++),r++}();var c=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var p=c[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[d]=m+c[d-7]+g+c[d-16]}var y=r&i^r&o^i&o,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&f)+l[d]+c[d];h=f,f=u,u=s,s=a+b|0,a=o,o=i,i=r,r=b+(_+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(u),t.HmacSHA256=o._createHmacHelper(u)}(Math),r.SHA256)},3327:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,l=[],c=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){l[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=n[i]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,m=0;m<5;m++)d^=(C=n[h+5*m]).high,p^=C.low;var v=f[h];v.high=d,v.low=p}for(h=0;h<5;h++){var g=f[(h+4)%5],y=f[(h+1)%5],_=y.high,b=y.low;for(d=g.high^(_<<1|b>>>31),p=g.low^(b<<1|_>>>31),m=0;m<5;m++)(C=n[h+5*m]).high^=d,C.low^=p}for(var w=1;w<25;w++){var E=(C=n[w]).high,S=C.low,R=l[w];R<32?(d=E<>>32-R,p=S<>>32-R):(d=S<>>64-R,p=E<>>64-R);var x=f[c[w]];x.high=d,x.low=p}var k=f[0],O=n[0];for(k.high=O.high,k.low=O.low,h=0;h<5;h++)for(m=0;m<5;m++){var C=n[w=h+5*m],A=f[w],B=f[(h+1)%5+5*m],j=f[(h+2)%5+5*m];C.high=A.high^~B.high&j.high,C.low=A.low^~B.low&j.low}C=n[0];var L=u[s];C.high^=L.high,C.low^=L.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),c.push(d),c.push(h)}return new i.init(c,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=o._createHelper(h),t.HmacSHA3=o._createHmacHelper(h)}(Math),r.SHA3)},7460:function(e,t,n){var r,i,o,a,s,l,c,u;e.exports=(u=n(8249),n(4938),n(34),i=(r=u).x64,o=i.Word,a=i.WordArray,s=r.algo,l=s.SHA512,c=s.SHA384=l.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=l._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=l._createHelper(c),r.HmacSHA384=l._createHmacHelper(c),u.SHA384)},34:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var u=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=r.high,p=r.low,m=i.high,v=i.low,g=o.high,y=o.low,_=a.high,b=a.low,w=s.high,E=s.low,S=u.high,R=u.low,x=f.high,k=f.low,O=h.high,C=h.low,A=d,B=p,j=m,L=v,N=g,P=y,z=_,I=b,T=w,D=E,M=S,H=R,F=x,W=k,U=O,q=C,V=0;V<80;V++){var G,J,Y=c[V];if(V<16)J=Y.high=0|e[t+2*V],G=Y.low=0|e[t+2*V+1];else{var K=c[V-15],$=K.high,X=K.low,Z=($>>>1|X<<31)^($>>>8|X<<24)^$>>>7,Q=(X>>>1|$<<31)^(X>>>8|$<<24)^(X>>>7|$<<25),ee=c[V-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=c[V-7],ae=oe.high,se=oe.low,le=c[V-16],ce=le.high,ue=le.low;J=(J=(J=Z+ae+((G=Q+se)>>>0>>0?1:0))+re+((G+=ie)>>>0>>0?1:0))+ce+((G+=ue)>>>0>>0?1:0),Y.high=J,Y.low=G}var fe,he=T&M^~T&F,de=D&H^~D&W,pe=A&j^A&N^j&N,me=B&L^B&P^L&P,ve=(A>>>28|B<<4)^(A<<30|B>>>2)^(A<<25|B>>>7),ge=(B>>>28|A<<4)^(B<<30|A>>>2)^(B<<25|A>>>7),ye=(T>>>14|D<<18)^(T>>>18|D<<14)^(T<<23|D>>>9),_e=(D>>>14|T<<18)^(D>>>18|T<<14)^(D<<23|T>>>9),be=l[V],we=be.high,Ee=be.low,Se=U+ye+((fe=q+_e)>>>0>>0?1:0),Re=ge+me;U=F,q=W,F=M,W=H,M=T,H=D,T=z+(Se=(Se=(Se=Se+he+((fe+=de)>>>0>>0?1:0))+we+((fe+=Ee)>>>0>>0?1:0))+J+((fe+=G)>>>0>>0?1:0))+((D=I+fe|0)>>>0>>0?1:0)|0,z=N,I=P,N=j,P=L,j=A,L=B,A=Se+(ve+pe+(Re>>>0>>0?1:0))+((B=fe+Re|0)>>>0>>0?1:0)|0}p=r.low=p+B,r.high=d+A+(p>>>0>>0?1:0),v=i.low=v+L,i.high=m+j+(v>>>0>>0?1:0),y=o.low=y+P,o.high=g+N+(y>>>0

>>0?1:0),b=a.low=b+I,a.high=_+z+(b>>>0>>0?1:0),E=s.low=E+D,s.high=w+T+(E>>>0>>0?1:0),R=u.low=R+H,u.high=S+M+(R>>>0>>0?1:0),k=f.low=k+W,f.high=x+F+(k>>>0>>0?1:0),C=h.low=C+q,h.high=O+U+(C>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},4253:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var c=i[o]=[],u=l[o];for(n=0;n<24;n++)c[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,c[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((a^i[l])&u[l])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=f.createEncryptor(n.create(t)),this._des2=f.createEncryptor(n.create(r)),this._des3=f.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),r.TripleDES)},4938:function(e,t,n){var r,i,o,a,s,l;e.exports=(r=n(8249),o=(i=r).lib,a=o.Base,s=o.WordArray,(l=i.x64={}).Word=a.extend({init:function(e,t){this.high=e,this.low=t}}),l.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{var r,i;!function(o,a){"use strict";void 0===(i="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=i)}(window,(function(){"use strict";var e=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0;n{var r,i;!function(o,a){r=[n(9741)],i=function(e){return function(e,t){"use strict";var n={extend:function(e,t){for(var n in t)e[n]=t[n];return e},modulo:function(e,t){return(e%t+t)%t}},r=Array.prototype.slice;n.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?r.call(e):[e]},n.removeFrom=function(e,t){var n=e.indexOf(t);-1!=n&&e.splice(n,1)},n.getParent=function(e,n){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,n))return e},n.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},n.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.filterFindElements=function(e,r){e=n.makeArray(e);var i=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(r){t(e,r)&&i.push(e);for(var n=e.querySelectorAll(r),o=0;o{var r,i;window,void 0===(i="function"==typeof(r=function(){"use strict";function e(e){var t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}var t="undefined"==typeof console?function(){}:function(e){console.error(e)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=n.length;function i(e){var n=getComputedStyle(e);return n||t("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var o,a=!1;function s(t){if(function(){if(!a){a=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(t);var r=i(t);o=200==Math.round(e(r.width)),s.isBoxSizeOuter=o,n.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var l=i(t);if("none"==l.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t{setTimeout((()=>{this.progress(e,t,n)}))};this.images.forEach((function(t){t.once("progress",e),t.check()}))},i.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log(`progress: ${n}`,e,t)},i.prototype.complete=function(){let e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){let e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},s.prototype=Object.create(t.prototype),s.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},s.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},s.prototype.confirm=function(e,t){this.isLoaded=e;let{parentNode:n}=this.img,r="PICTURE"===n.nodeName?n:this.img;this.emitEvent("progress",[this,r,t])},s.prototype.handleEvent=function(e){let t="on"+e.type;this[t]&&this[t](e)},s.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},s.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},s.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype=Object.create(s.prototype),l.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},l.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},i.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&(n=t,n.fn.imagesLoaded=function(e,t){return new i(this,e,t).jqDeferred.promise(n(this))})},i.makeJQueryPlugin(),i}))},8751:(e,t,n)=>{var r,i,o;window,i=[n(1794),n(6131)],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n=e.create("masonry");n.compatOptions.fitWidth="isFitWidth";var r=n.prototype;return r._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var e=0;e1&&n+e>this.cols?0:n;var r=t.size.outerWidth&&t.size.outerHeight;return this.horizontalColIndex=r?n+e:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,e)}},r._manageStamp=function(e){var n=t(e),r=this._getElementOffset(e),i=this._getOption("originLeft")?r.left:r.right,o=i+n.outerWidth,a=Math.floor(i/this.columnWidth);a=Math.max(0,a);var s=Math.floor(o/this.columnWidth);s-=o%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var l=(this._getOption("originTop")?r.top:r.bottom)+n.outerHeight,c=a;c<=s;c++)this.colYs[c]=Math.max(l,this.colYs[c])},r._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var e={height:this.maxY};return this._getOption("fitWidth")&&(e.width=this._getContainerFitWidth()),e},r._getContainerFitWidth=function(){for(var e=0,t=this.cols;--t&&0===this.colYs[t];)e++;return(this.cols-e)*this.columnWidth-this.gutter},r.needsResizeLayout=function(){var e=this.containerWidth;return this.getContainerWidth(),e!=this.containerWidth},n})?r.apply(t,i):r)||(e.exports=o)},652:(e,t,n)=>{var r,i,o;window,i=[n(1206),n(6131)],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n=document.documentElement.style,r="string"==typeof n.transition?"transition":"WebkitTransition",i="string"==typeof n.transform?"transform":"WebkitTransform",o={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],a={transform:i,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"};function s(e,t){e&&(this.element=e,this.layout=t,this.position={x:0,y:0},this._create())}var l=s.prototype=Object.create(e.prototype);l.constructor=s,l._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},l.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},l.getSize=function(){this.size=t(this.element)},l.css=function(e){var t=this.element.style;for(var n in e)t[a[n]||n]=e[n]},l.getPosition=function(){var e=getComputedStyle(this.element),t=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),r=e[t?"left":"right"],i=e[n?"top":"bottom"],o=parseFloat(r),a=parseFloat(i),s=this.layout.size;-1!=r.indexOf("%")&&(o=o/100*s.width),-1!=i.indexOf("%")&&(a=a/100*s.height),o=isNaN(o)?0:o,a=isNaN(a)?0:a,o-=t?s.paddingLeft:s.paddingRight,a-=n?s.paddingTop:s.paddingBottom,this.position.x=o,this.position.y=a},l.layoutPosition=function(){var e=this.layout.size,t={},n=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop"),i=n?"paddingLeft":"paddingRight",o=n?"left":"right",a=n?"right":"left",s=this.position.x+e[i];t[o]=this.getXValue(s),t[a]="";var l=r?"paddingTop":"paddingBottom",c=r?"top":"bottom",u=r?"bottom":"top",f=this.position.y+e[l];t[c]=this.getYValue(f),t[u]="",this.css(t),this.emitEvent("layout",[this])},l.getXValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!t?e/this.layout.size.width*100+"%":e+"px"},l.getYValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&t?e/this.layout.size.height*100+"%":e+"px"},l._transitionTo=function(e,t){this.getPosition();var n=this.position.x,r=this.position.y,i=e==this.position.x&&t==this.position.y;if(this.setPosition(e,t),!i||this.isTransitioning){var o=e-n,a=t-r,s={};s.transform=this.getTranslate(o,a),this.transition({to:s,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},l.getTranslate=function(e,t){return"translate3d("+(e=this.layout._getOption("originLeft")?e:-e)+"px, "+(t=this.layout._getOption("originTop")?t:-t)+"px, 0)"},l.goTo=function(e,t){this.setPosition(e,t),this.layoutPosition()},l.moveTo=l._transitionTo,l.setPosition=function(e,t){this.position.x=parseFloat(e),this.position.y=parseFloat(t)},l._nonTransition=function(e){for(var t in this.css(e.to),e.isCleaning&&this._removeStyles(e.to),e.onTransitionEnd)e.onTransitionEnd[t].call(this)},l.transition=function(e){if(parseFloat(this.layout.options.transitionDuration)){var t=this._transn;for(var n in e.onTransitionEnd)t.onEnd[n]=e.onTransitionEnd[n];for(n in e.to)t.ingProperties[n]=!0,e.isCleaning&&(t.clean[n]=!0);e.from&&(this.css(e.from),this.element.offsetHeight),this.enableTransition(e.to),this.css(e.to),this.isTransitioning=!0}else this._nonTransition(e)};var c="opacity,"+i.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}));l.enableTransition=function(){if(!this.isTransitioning){var e=this.layout.options.transitionDuration;e="number"==typeof e?e+"ms":e,this.css({transitionProperty:c,transitionDuration:e,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(o,this,!1)}},l.onwebkitTransitionEnd=function(e){this.ontransitionend(e)},l.onotransitionend=function(e){this.ontransitionend(e)};var u={"-webkit-transform":"transform"};l.ontransitionend=function(e){if(e.target===this.element){var t=this._transn,n=u[e.propertyName]||e.propertyName;delete t.ingProperties[n],function(e){for(var t in e)return!1;return!0}(t.ingProperties)&&this.disableTransition(),n in t.clean&&(this.element.style[e.propertyName]="",delete t.clean[n]),n in t.onEnd&&(t.onEnd[n].call(this),delete t.onEnd[n]),this.emitEvent("transitionEnd",[this])}},l.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},l._removeStyles=function(e){var t={};for(var n in e)t[n]="";this.css(t)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return l.removeTransitionStyles=function(){this.css(f)},l.stagger=function(e){e=isNaN(e)?0:e,this.staggerDelay=e+"ms"},l.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},l.remove=function(){r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},l.reveal=function(){delete this.isHidden,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:e.hiddenStyle,to:e.visibleStyle,isCleaning:!0,onTransitionEnd:t})},l.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},l.getHideRevealTransitionEndProperty=function(e){var t=this.layout.options[e];if(t.opacity)return"opacity";for(var n in t)return n},l.hide=function(){this.isHidden=!0,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:e.visibleStyle,to:e.hiddenStyle,isCleaning:!0,onTransitionEnd:t})},l.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},l.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s})?r.apply(t,i):r)||(e.exports=o)},1206:function(e,t,n){var r,i;"undefined"!=typeof window&&window,void 0===(i="function"==typeof(r=function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var r=this._onceEvents&&this._onceEvents[e],i=0;i{var r,i;!function(o,a){"use strict";r=[n(1206),n(6131),n(9047),n(652)],i=function(e,t,n,r){return function(e,t,n,r,i){var o=e.console,a=e.jQuery,s=function(){},l=0,c={};function u(e,t){var n=r.getQueryElement(e);if(n){this.element=n,a&&(this.$element=a(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(t);var i=++l;this.element.outlayerGUID=i,c[i]=this,this._create(),this._getOption("initLayout")&&this.layout()}else o&&o.error("Bad element for "+this.constructor.namespace+": "+(n||e))}u.namespace="outlayer",u.Item=i,u.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=u.prototype;function h(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}r.extend(f,t.prototype),f.option=function(e){r.extend(this.options,e)},f._getOption=function(e){var t=this.constructor.compatOptions[e];return t&&void 0!==this.options[t]?this.options[t]:this.options[e]},u.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(e){for(var t=this._filterFindItemElements(e),n=this.constructor.Item,r=[],i=0;i{}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blockEditor,t=window.wp.blocks,r=window.wp.components,i=window.wp.element,o=window.wp.i18n,a=window.wp.primitives,s=(0,i.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(a.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));function l(){return React.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("title",null,"Instant Images Icon"),React.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z",fill:"#647FE8"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",fill:"#C7D2FF"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",fill:"#C7D2FF"}))}function c(e,t){return function(){return e.apply(t,arguments)}}const{toString:u}=Object.prototype,{getPrototypeOf:f}=Object,h=(d=Object.create(null),e=>{const t=u.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const p=e=>(e=e.toLowerCase(),t=>h(t)===e),m=e=>t=>typeof t===e,{isArray:v}=Array,g=m("undefined"),y=p("ArrayBuffer"),_=m("string"),b=m("function"),w=m("number"),E=e=>null!==e&&"object"==typeof e,S=e=>{if("object"!==h(e))return!1;const t=f(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},R=p("Date"),x=p("File"),k=p("Blob"),O=p("FileList"),C=p("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),v(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!g(e)&&e!==j,N=(P="undefined"!=typeof Uint8Array&&f(Uint8Array),e=>P&&e instanceof P);var P;const z=p("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),T=p("RegExp"),D=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},M="abcdefghijklmnopqrstuvwxyz",H="0123456789",F={DIGIT:H,ALPHA:M,ALPHA_DIGIT:M+M.toUpperCase()+H},W={isArray:v,isArrayBuffer:y,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||u.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:_,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:E,isPlainObject:S,isUndefined:g,isDate:R,isFile:x,isBlob:k,isRegExp:T,isFunction:b,isStream:e=>E(e)&&b(e.pipe),isURLSearchParams:C,isTypedArray:N,isFileList:O,forEach:A,merge:function e(){const{caseless:t}=L(this)&&this||{},n={},r=(r,i)=>{const o=t&&B(n,i)||i;S(n[o])&&S(r)?n[o]=e(n[o],r):S(r)?n[o]=e({},r):v(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(A(t,((t,r)=>{n&&b(t)?e[r]=c(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&f(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:p,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!w(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:z,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:D,freezeMethods:e=>{D(e,((t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return v(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:B,global:j,isContextDefined:L,ALPHABET:F,generateString:(e=16,t=F.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(E(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=v(e)?[]:{};return A(e,((e,t)=>{const o=n(e,r+1);!g(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)}};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}W.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const q=U.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{V[e]={value:e}})),Object.defineProperties(U,V),Object.defineProperty(q,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,o)=>{const a=Object.create(q);return W.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const G=U;function J(e){return W.isPlainObject(e)||W.isArray(e)}function Y(e){return W.endsWith(e,"[]")?e.slice(0,-2):e}function K(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const $=W.toFlatObject(W,{},null,(function(e){return/^is[A-Z]/.test(e)})),X=function(e,t,n){if(!W.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!W.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&W.isSpecCompliantForm(t);if(!W.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(W.isDate(e))return e.toISOString();if(!s&&W.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(e)||W.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(W.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(W.isArray(e)&&function(e){return W.isArray(e)&&!e.some(J)}(e)||(W.isFileList(e)||W.endsWith(n,"[]"))&&(s=W.toArray(e)))return n=Y(n),s.forEach((function(e,r){!W.isUndefined(e)&&null!==e&&t.append(!0===a?K([n],r,o):null===a?n:n+"[]",l(e))})),!1;return!!J(e)||(t.append(K(i,n,o),l(e)),!1)}const u=[],f=Object.assign($,{defaultVisitor:c,convertValue:l,isVisitable:J});if(!W.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!W.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),W.forEach(n,(function(n,o){!0===(!(W.isUndefined(n)||null===n)&&i.call(t,n,W.isString(o)?o.trim():o,r,f))&&e(n,r?r.concat(o):[o])})),u.pop()}}(e),t};function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Q(e,t){this._pairs=[],e&&X(e,this,t)}const ee=Q.prototype;ee.append=function(e,t){this._pairs.push([e,t])},ee.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const te=Q;function ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function re(e,t,n){if(!t)return e;const r=n&&n.encode||ne,i=n&&n.serialize;let o;if(o=i?i(t,n):W.isURLSearchParams(t)?t.toString():new te(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ie=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},oe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},se=function(e){function t(e,n,r,i){let o=e[i++];const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&W.isArray(r)?r.length:o,s?(W.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&W.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&W.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return W.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},le={"Content-Type":void 0},ce={transitional:oe,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=W.isObject(e);if(i&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return r&&r?JSON.stringify(se(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return X(e,new ae.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ae.isNode&&W.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=W.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return X(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(W.isString(e))try{return(0,JSON.parse)(e),W.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ce.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&W.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ae.classes.FormData,Blob:ae.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};W.forEach(["delete","get","head"],(function(e){ce.headers[e]={}})),W.forEach(["post","put","patch"],(function(e){ce.headers[e]=W.merge(le)}));const ue=ce,fe=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),he=Symbol("internals");function de(e){return e&&String(e).trim().toLowerCase()}function pe(e){return!1===e||null==e?e:W.isArray(e)?e.map(pe):String(e)}function me(e,t,n,r,i){return W.isFunction(r)?r.call(this,t,n):(i&&(t=n),W.isString(t)?W.isString(r)?-1!==t.indexOf(r):W.isRegExp(r)?r.test(t):void 0:void 0)}class ve{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=de(t);if(!i)throw new Error("header name must be a non-empty string");const o=W.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=pe(e))}const o=(e,t)=>W.forEach(e,((e,n)=>i(e,n,t)));return W.isPlainObject(e)||e instanceof this.constructor?o(e,t):W.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&fe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=de(e)){const n=W.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(W.isFunction(t))return t.call(this,e,n);if(W.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=de(e)){const n=W.findKey(this,e);return!(!n||void 0===this[n]||t&&!me(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=de(e)){const i=W.findKey(n,e);!i||t&&!me(0,n[i],i,t)||(delete n[i],r=!0)}}return W.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!me(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return W.forEach(this,((r,i)=>{const o=W.findKey(n,i);if(o)return t[o]=pe(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=pe(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return W.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&W.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[he]=this[he]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=de(e);t[r]||(function(e,t){const n=W.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}}ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.freezeMethods(ve.prototype),W.freezeMethods(ve);const ge=ve;function ye(e,t){const n=this||ue,r=t||n,i=ge.from(r.headers);let o=r.data;return W.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function _e(e){return!(!e||!e.__CANCEL__)}function be(e,t,n){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,n),this.name="CanceledError"}W.inherits(be,G,{__CANCEL__:!0});const we=be,Ee=ae.isStandardBrowserEnv?{write:function(e,t,n,r,i,o){const a=[];a.push(e+"="+encodeURIComponent(t)),W.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),W.isString(r)&&a.push("path="+r),W.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Se(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Re=ae.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=W.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},xe=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,f=0;for(;u!==o;)f+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s);n=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const Oe={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=ge.from(e.headers).normalize(),o=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}W.isFormData(r)&&(ae.isStandardBrowserEnv||ae.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=Se(e.baseURL,e.url);function u(){if(!l)return;const r=ge.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),re(c,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=u:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(u)},l.onabort=function(){l&&(n(new G("Request aborted",G.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new G("Network Error",G.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||oe;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new G(t,r.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,l)),l=null},ae.isStandardBrowserEnv){const t=(e.withCredentials||Re(c))&&e.xsrfCookieName&&Ee.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in l&&W.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),W.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ke(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ke(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{l&&(n(!t||t.type?new we(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);f&&-1===ae.protocols.indexOf(f)?n(new G("Unsupported protocol "+f+":",G.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};W.forEach(Oe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ce={getAdapter:e=>{e=W.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof ge?e.toJSON():e;function Le(e,t){t=t||{};const n={};function r(e,t,n){return W.isPlainObject(e)&&W.isPlainObject(t)?W.merge.call({caseless:n},e,t):W.isPlainObject(t)?W.merge({},t):W.isArray(t)?t.slice():t}function i(e,t,n){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!W.isUndefined(t))return r(void 0,t)}function a(e,t){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(je(e),je(t),!0)};return W.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const o=l[r]||i,a=o(e[r],t[r],r);W.isUndefined(a)&&o!==s||(n[r]=a)})),n}const Ne={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Pe={};Ne.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new G(r(i," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!Pe[i]&&(Pe[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};const ze={assertOptions:function(e,t,n){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new G("option "+o+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+o,G.ERR_BAD_OPTION)}},validators:Ne},Ie=ze.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new ie,response:new ie}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let o;void 0!==n&&ze.assertOptions(n,{silentJSONParsing:Ie.transitional(Ie.boolean),forcedJSONParsing:Ie.transitional(Ie.boolean),clarifyTimeoutError:Ie.transitional(Ie.boolean)},!1),void 0!==r&&ze.assertOptions(r,{encode:Ie.function,serialize:Ie.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=i&&W.merge(i.common,i[t.method]),o&&W.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=ge.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,f=0;if(!s){const e=[Be.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new we(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}const He=Me,Fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fe).forEach((([e,t])=>{Fe[t]=e}));const We=Fe,Ue=function e(t){const n=new De(t),r=c(De.prototype.request,n);return W.extend(r,De.prototype,n,{allOwnKeys:!0}),W.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Le(t,n))},r}(ue);Ue.Axios=De,Ue.CanceledError=we,Ue.CancelToken=He,Ue.isCancel=_e,Ue.VERSION="1.3.4",Ue.toFormData=X,Ue.AxiosError=G,Ue.Cancel=Ue.CanceledError,Ue.all=function(e){return Promise.all(e)},Ue.spread=function(e){return function(t){return e.apply(null,t)}},Ue.isAxiosError=function(e){return W.isObject(e)&&!0===e.isAxiosError},Ue.mergeConfig=Le,Ue.AxiosHeaders=ge,Ue.formToJSON=e=>se(W.isHTMLForm(e)?new FormData(e):e),Ue.HttpStatusCode=We,Ue.default=Ue;const qe=Ue;var Ve=n(4184),Ge=n.n(Ve),Je=n(8751),Ye=n.n(Je);const Ke=window.React,$e=new Map,Xe=new WeakMap;let Ze=0;function Qe(e,t,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:a}=function(e){let t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Xe.has(n)||(Ze+=1,Xe.set(n,Ze.toString())),Xe.get(n)):"0"):e[t]}`;var n})).toString()}(e),n=$e.get(t);if(!n){const r=new Map;let i;const o=new IntersectionObserver((t=>{t.forEach((t=>{var n;const o=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=o),null==(n=r.get(t.target))||n.forEach((e=>{e(o,t)}))}))}),e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},$e.set(t,n)}return n}(n);let s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),o.observe(e),function(){s.splice(s.indexOf(t),1),0===s.length&&(a.delete(e),o.unobserve(e)),0===a.size&&(o.disconnect(),$e.delete(i))}}class et extends Ke.Component{constructor(e){super(e),this.node=null,this._unobserveCb=null,this.handleNode=e=>{this.node&&(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()},this.handleChange=(e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),isPlainChildren(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)},this.state={inView:!!e.initialInView,entry:void 0}}componentDidUpdate(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:o}=this.props;this._unobserveCb=Qe(this.node,this.handleChange,{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!isPlainChildren(this.props)){const{inView:e,entry:t}=this.state;return this.props.children({inView:e,entry:t,ref:this.handleNode})}const e=this.props,{children:t,as:n}=e,r=function(e,t){if(null==e)return{};for(var n,r,i={},o=Object.keys(e);r=0||(i[n]=e[n]);return i}(e);return React.createElement(n||"div",_extends({ref:this.handleNode},r),t)}}function tt({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:l,onChange:c}={}){var u;const[f,h]=Ke.useState(null),d=Ke.useRef(),[p,m]=Ke.useState({inView:!!s,entry:void 0});d.current=c,Ke.useEffect((()=>{if(a||!f)return;let s;return s=Qe(f,((e,t)=>{m({inView:e,entry:t}),d.current&&d.current(e,t),t.isIntersecting&&o&&s&&(s(),s=void 0)}),{root:i,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{s&&s()}}),[Array.isArray(e)?e.toString():e,f,i,r,o,a,n,l,t]);const v=null==(u=p.entry)?void 0:u.target,g=Ke.useRef();f||!v||o||a||g.current===v||(g.current=v,m({inView:!!s,entry:void 0}));const y=[h,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}var nt=(0,i.createContext)();function rt(e){var t=e.value,n=e.children;return React.createElement(nt.Provider,{value:t},n)}function it(){return(0,i.useContext)(nt)}function ot(e){return e&&at[e.toLowerCase()].icon?at[e.toLowerCase()].icon():null}var at={proxy:"https://proxy.getinstantimages.com/api/",testmode:!1,defaults:{provider:"unsplash",order:"latest",per_page:"20",arr_key:"results"},providers:["Unsplash","Openverse","Pixabay","Pexels"],unsplash:{name:"Unsplash",requires_key:!0,new:!1,api_var:"client_id",collections_api:"https://api.unsplash.com/collections/",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",fill:"black"}))}},pixabay:{name:"Pixabay",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{clipPath:"url(#clip0_307_143)"},React.createElement("path",{d:"M0 0V32H32V0H0Z",fill:"#48A947"}),React.createElement("path",{d:"M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",fill:"#F9FBF9"}),React.createElement("path",{d:"M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",fill:"#FAFCFA"}),React.createElement("path",{d:"M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",fill:"#4AA949"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_307_143"},React.createElement("rect",{width:"32",height:"32",fill:"white"}))))}},pexels:{name:"Pexels",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",fill:"#05A081"}),React.createElement("path",{d:"M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",fill:"#fff"}))}},openverse:{name:"Openverse",requires_key:!1,new:!1,api_var:"key",key:"",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",fill:"#000000"}))}}},st=[{label:(0,o.__)("WordPress","instant-images"),value:"wordpress"},{label:(0,o.__)("Flickr","instant-images"),value:"flickr"},{label:(0,o.__)("Nasa","instant-images"),value:"nasa"},{label:(0,o.__)("SpaceX","instant-images"),value:"spacex"},{label:(0,o.__)("Wikimedia","instant-images"),value:"wikimedia"}],lt=[{label:(0,o.__)("Square","instant-images"),value:"square"},{label:(0,o.__)("Tall","instant-images"),value:"tall"},{label:(0,o.__)("Wide","instant-images"),value:"wide"}],ct=[{label:(0,o.__)("Red","instant-images"),value:"red"},{label:(0,o.__)("Orange","instant-images"),value:"orange"},{label:(0,o.__)("Yellow","instant-images"),value:"yellow"},{label:(0,o.__)("Green","instant-images"),value:"green"},{label:(0,o.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,o.__)("Blue","instant-images"),value:"blue"},{label:(0,o.__)("Violet","instant-images"),value:"violet"},{label:(0,o.__)("Pink","instant-images"),value:"pink"},{label:(0,o.__)("Brown","instant-images"),value:"brown"},{label:(0,o.__)("Black","instant-images"),value:"black"},{label:(0,o.__)("Gray","instant-images"),value:"gray"},{label:(0,o.__)("White","instant-images"),value:"white"}],ut=[{label:(0,o.__)("Landscape","instant-images"),value:"landscape"},{label:(0,o.__)("Portrait","instant-images"),value:"portrait"},{label:(0,o.__)("Square","instant-images"),value:"squarish"}],ft=[{label:(0,o.__)("Grayscale","instant-images"),value:"grayscale"},{label:(0,o.__)("Red","instant-images"),value:"red"},{label:(0,o.__)("Orange","instant-images"),value:"orange"},{label:(0,o.__)("Yellow","instant-images"),value:"yellow"},{label:(0,o.__)("Green","instant-images"),value:"green"},{label:(0,o.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,o.__)("Blue","instant-images"),value:"blue"},{label:(0,o.__)("Lilac","instant-images"),value:"lilac"},{label:(0,o.__)("Pink","instant-images"),value:"pink"},{label:(0,o.__)("White","instant-images"),value:"white"},{label:(0,o.__)("Gray","instant-images"),value:"gray"},{label:(0,o.__)("Black","instant-images"),value:"black"},{label:(0,o.__)("Brown","instant-images"),value:"brown"},{label:(0,o.__)("Transparent","instant-images"),value:"transparent"}],ht=[{label:(0,o.__)("Backgrounds","instant-images"),value:"backgrounds"},{label:(0,o.__)("Fashion","instant-images"),value:"fashion"},{label:(0,o.__)("Nature","instant-images"),value:"nature"},{label:(0,o.__)("Science","instant-images"),value:"science"},{label:(0,o.__)("Education","instant-images"),value:"education"},{label:(0,o.__)("Feelings","instant-images"),value:"feelings"},{label:(0,o.__)("Health","instant-images"),value:"health"},{label:(0,o.__)("People","instant-images"),value:"people"},{label:(0,o.__)("Religion","instant-images"),value:"religion"},{label:(0,o.__)("Places","instant-images"),value:"places"},{label:(0,o.__)("Animals","instant-images"),value:"animals"},{label:(0,o.__)("Industry","instant-images"),value:"industry"},{label:(0,o.__)("Computer","instant-images"),value:"computer"},{label:(0,o.__)("Food","instant-images"),value:"food"},{label:(0,o.__)("Sports","instant-images"),value:"sports"},{label:(0,o.__)("Food","instant-images"),value:"food"},{label:(0,o.__)("Transportation","instant-images"),value:"transportation"},{label:(0,o.__)("Travel","instant-images"),value:"travel"},{label:(0,o.__)("Buildings","instant-images"),value:"buildings"},{label:(0,o.__)("Business","instant-images"),value:"business"},{label:(0,o.__)("Music","instant-images"),value:"music"}],dt=[{label:(0,o.__)("Horizontal","instant-images"),value:"horizontal"},{label:(0,o.__)("Vertical","instant-images"),value:"vertical"}],pt=[{label:(0,o.__)("Photo","instant-images"),value:"photo"},{label:(0,o.__)("Illustration","instant-images"),value:"illustration"},{label:(0,o.__)("Vector","instant-images"),value:"vector"}],mt=[{label:(0,o.__)("Black & White","instant-images"),value:"black_and_white"},{label:(0,o.__)("Black","instant-images"),value:"black"},{label:(0,o.__)("White","instant-images"),value:"white"},{label:(0,o.__)("Yellow","instant-images"),value:"yellow"},{label:(0,o.__)("Green","instant-images"),value:"green"},{label:(0,o.__)("Orange","instant-images"),value:"orange"},{label:(0,o.__)("Red","instant-images"),value:"red"},{label:(0,o.__)("Purple","instant-images"),value:"purple"},{label:(0,o.__)("Magenta","instant-images"),value:"magenta"},{label:(0,o.__)("Teal","instant-images"),value:"teal"},{label:(0,o.__)("Blue","instant-images"),value:"blue"}],vt=[{label:(0,o.__)("Landscape","instant-images"),value:"landscape"},{label:(0,o.__)("Portrait","instant-images"),value:"portrait"},{label:(0,o.__)("Square","instant-images"),value:"squarish"}];function gt(e){return function(e){if(Array.isArray(e))return yt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&parseInt(n)<2&&alert(instant_img_localize.api_ratelimit_msg)}}function Mt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ht="";function Ft(e){var t=e.currentTarget,n=t.getBoundingClientRect(),r=Math.round(n.left),i=Math.round(n.top),o=t.closest("#photo-listing").querySelector("#tooltip");o.classList.remove("over"),t.classList.contains("tooltip--above")?o.classList.add("above"):o.classList.remove("above"),Ht=setInterval((function(){clearInterval(Ht),o.innerHTML=t.dataset.title,r=r-o.offsetWidth+t.offsetWidth+5,o.style.left="".concat(r,"px"),o.style.top="".concat(i,"px"),setTimeout((function(){o.classList.add("over")}),25)}),750)}function Wt(e){clearInterval(Ht),e.currentTarget.closest("#photo-listing").querySelector("#tooltip").classList.remove("over")}function Ut(e){e&&window&&window.open(e,"_blank")}function qt(){var e=instant_img_localize;switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200){case 400:case 401:return e.api_invalid_msg;case 403:return e.api_invalid_403_msg;case 404:return e.api_invalid_404_msg;case 429:return e.api_ratelimit_msg;case 500:case 503:return e.api_invalid_500_msg;case 501:return e.api_invalid_501_msg}}function Vt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=instant_img_localize,r=qt(t);switch(t){case 400:case 401:case 500:case 429:console.warn("[".concat(n.instant_images," - ").concat(t," Error] ").concat(Mt(e),": ").concat(r))}}function Gt(e){return e&&e[at.defaults.arr_key]||[]}function Jt(e){return void 0===e.total||null===e.total?0:e.total}function Yt(e){if(!e||at.testmode)return!1;var t=sessionStorage.getItem(Tt(e));if(!t)return!1;var n=JSON.parse(t),r=n.expires,i=void 0===r?0:r,o=n.error;if(void 0!==o&&o)return!1;var a=Date.now()>i;return a&&$t(e),!(!n||a)&&n}function Kt(e,t){if(!e||!t||null!=t&&t.error)return!1;t.expires=Date.now()+36e5,sessionStorage.setItem(Tt(e),JSON.stringify(t))}function $t(e){if(!e)return!1;sessionStorage.removeItem(Tt(e))}function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function Zt(){Zt=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var l=u(e[r],e,o);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Xt(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function Qt(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function en(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,_x,o,a=[],_n=!0,s=!1;try{if(_x=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(a.push(r.value),a.length!==t);_n=!0);}catch(e){s=!0,i=e}finally{try{if(!_n&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1?null:React.createElement("div",{className:"instant-images-no-results"},React.createElement("div",null,React.createElement("h3",null,instant_img_localize.no_results," "),React.createElement("p",null,instant_img_localize.no_results_desc," ")))}var hn=at.providers;function dn(e){var t=e.switchProvider,n=it().provider;return React.createElement(i.Fragment,null,!(null==hn||!hn.length)&&React.createElement("nav",{className:"provider-nav"},hn.map((function(e,r){return React.createElement("div",{key:"provider-".concat(r)},React.createElement("button",{onClick:function(){return t(e.toLowerCase())},className:n===e.toLowerCase()?"provider-nav--btn active":"provider-nav--btn"},ot(e),React.createElement("span",null,e),at[e.toLowerCase()].new&&React.createElement("span",{className:"provider-nav--new"},instant_img_localize.new)))}))))}function pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=200&&t.status<400&&JSON.parse(t.response).success||o(!1)},t.onerror=function(e){console.warn(e),o(!1)}}),[]),React.createElement(i.Fragment,null,r?null:React.createElement("div",{className:"error-messaging"},React.createElement("strong",null,instant_img_localize.error_restapi),instant_img_localize.error_restapi_desc))}const vn=window.wp.data;function gn(e,n){var r=e.id,i=void 0===r?null:r,o=e.url,a=void 0===o?null:o,s=e.caption,l=void 0===s?"":s,c=e.alt,u=void 0===c?"":c;if(a&&i){var f=(0,t.createBlock)("core/image",{id:i,url:a,caption:l,alt:u});n?(0,vn.dispatch)("core/block-editor").replaceBlock(n,f):(0,vn.dispatch)("core/block-editor").insertBlocks(f)}}function yn(e){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yn(e)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&React.createElement("img",{className:"user-wrap--photo",src:j,alt:""}),B)),React.createElement("div",{className:"photo-options"},h&&!Z?React.createElement(i.Fragment,null,React.createElement("button",{type:"button",className:"set-featured fade","data-title":instant_img_localize.set_as_featured,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},onClick:function(e){return function(e){Wt(e),te.current&&(ie=!0,te.current.click())}(e)}},React.createElement("i",{className:"fa fa-picture-o","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.set_as_featured)),React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},onClick:function(e){return ae(e)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post))):null,!!l&&React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},onClick:function(e){return ae(e)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post)),Z?React.createElement("button",{onClick:function(){Z&&(window.location=Z)},className:"edit-photo-admin fade","data-title":instant_img_localize.edit_upload,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)}},React.createElement("i",{className:"fa fa-pencil","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_upload)):React.createElement("button",{onClick:function(e){return function(e){e.preventDefault(),Wt(e);var t=document.querySelectorAll(".edit-screen.editing");t&&t.forEach((function(e){e.classList.remove("editing")})),ne.current.classList.add("editing"),setTimeout((function(){ne.current.focus({preventScroll:!0})}),150)}(e)},className:"edit-photo fade","data-title":instant_img_localize.edit_details,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)}},React.createElement("i",{className:"fa fa-cog","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_details)))),React.createElement("div",{className:"photo-meta"},S?React.createElement("span",{className:"likes tooltip--above","data-title":S+" "+P,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)}},React.createElement("i",{className:"fa fa-heart heart-like","aria-hidden":"true"})," ",S):null,React.createElement("a",{className:"tooltip--above",href:v,"data-title":"".concat(instant_img_localize.open_external," ").concat(Mt(a)),onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},rel:"noopener noreferrer",target:"_blank"},React.createElement("i",{className:"fa fa-external-link","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},"".concat(instant_img_localize.open_external," ").concat(Mt(a)))))),React.createElement("div",{className:"edit-screen",tabIndex:"0",ref:ne},React.createElement("div",{className:"edit-screen--title"},React.createElement("div",null,React.createElement("p",{className:"heading"},instant_img_localize.edit_details),R&&R.length>0&&React.createElement("p",{className:"dimensions"},R)),React.createElement("div",{className:"preview",style:{backgroundImage:"url(".concat(O,")")}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_filename,":"),React.createElement("input",{type:"text",name:"filename","data-original":m,placeholder:U.filename,value:U.filename,onChange:function(e){return ce(e)}}),React.createElement("em",null,".",E)),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_title,":"),React.createElement("input",{type:"text",name:"title","data-original":g,placeholder:g,value:U.title||"",onChange:function(e){return ce(e)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_alt,":"),React.createElement("input",{type:"text",name:"alt","data-original":y,value:U.alt||"",onChange:function(e){return ce(e)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_caption,":"),React.createElement("textarea",{rows:"4",name:"caption","data-original":F,onChange:function(e){return ce(e)},value:U.caption||"",ref:re})),H?React.createElement("div",{className:"add-attribution-row"},React.createElement("button",{onClick:function(e){return function(e){e.preventDefault(),re.current.value=H,q(wn(wn({},U),{},{caption:H}))}(e)},type:"button"},instant_img_localize.attribution)):null,React.createElement("div",{className:"edit-screen--controls"},React.createElement("button",{type:"button",className:"button button-secondary",onClick:function(e){return q({filename:m,title:g,alt:y,caption:F}),ne.current.classList.remove("editing"),void te.current.focus({preventScrol:!0})}},instant_img_localize.cancel)," "," ",React.createElement("button",{type:"button",className:"button button-primary",onClick:function(){return ne.current.classList.remove("editing"),void te.current.click()}},l?instant_img_localize.insert_into_post:instant_img_localize.upload_now))),React.createElement("div",{className:"photo-status"})))}function kn(e){var t=e.result.data,n=void 0===t?null:t,r=(null==n?void 0:n.url)||"",o=(null==n?void 0:n.title)||"",a=(null==n?void 0:n.description)||"",s=(null==n?void 0:n.avatar)||"",l=n.image,c=void 0===l?null:l,u=c.src,f=void 0===u?null:u,h=c.alt,d=void 0===h?null:h,p=(0,i.useRef)(),m=(0,i.useRef)();return React.createElement(i.Fragment,null,c&&r?React.createElement("article",{className:"photo feature",title:a,ref:p,onClick:function(){return m.current.click()}},React.createElement("div",{className:"photo--wrap"},React.createElement("span",{className:"flag",title:instant_img_localize.advertisement},instant_img_localize.ad),React.createElement("div",{className:"img-wrap"},React.createElement("a",{className:"loaded",href:r,target:"_blank",ref:m,rel:"noreferrer"},React.createElement("img",{src:f,alt:d}))),React.createElement("div",{className:"feature-title"},s&&React.createElement("img",{src:s,alt:o}),React.createElement("span",null,o)))):null)}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&t.splice(n,1),t.length>=10&&(t.length=10),t.unshift(e),localStorage.setItem(In,JSON.stringify(t))}else localStorage.setItem(In,JSON.stringify([e]))}(r),g(Dn())))}(e)},autoComplete:"off"},React.createElement("label",{htmlFor:"search-input",className:"offscreen"},instant_img_localize.search_label),React.createElement("div",{ref:w},React.createElement("input",{ref:t,type:"text",id:"search-input",placeholder:instant_img_localize.search,disabled:h,onChange:function(e){return c&&p(e.target.value)},onFocus:function(){return b(!0)}}),c&&((null==v?void 0:v.length)||(null==d?void 0:d.length))?React.createElement(Vn,{show:_,history:v,setHistory:g,setSearchValue:function(e){var n=null==t?void 0:t.current;n.value=e,null==E||E.current.click(),n.focus()},container:w}):null,!s&&React.createElement(qn,{show:_})),React.createElement("button",{type:"submit",disabled:h,ref:E},React.createElement("i",{className:"fa fa-search"}),React.createElement("span",{className:"offscreen"},instant_img_localize.search)),React.createElement(Gn,{show:_})))}));function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tr(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==h[0]&&h[0],!D){e.next=3;break}return e.abrupt("return",!1);case 3:if(n||""===(null==pe||null===(t=pe.current)||void 0===t?void 0:t.value)){e.next=7;break}if(!v||!y){e.next=7;break}return Oe(pe.current.value),e.abrupt("return");case 7:if(I(!0),d=void 0,(null==pe||null===(d=pe.current)||void 0===d?void 0:d.value)&&(pe.current.value=""),X(w),ee([]),Pe(),ur=1,r=Ot(k,oe),i=Nt("photos",r),!(o=Yt(i))){e.next=18;break}Ae(Gt(o),!1,null),e.next=37;break;case 18:return e.next=20,fetch(i);case 20:return a=e.sent,l=a.status,Dt(a.headers),e.prev=23,e.next=26,a.json();case 26:c=e.sent,u=c.error,f=void 0===u?null:u,Ae(Gt(c),!1,f),Kt(i,c),e.next=37;break;case 32:e.prev=32,e.t0=e.catch(23),Vt(s,l),I(!1),$t(i);case 37:setTimeout((function(){I(!1)}),_);case 38:case"end":return e.stop()}var d}),e,null,[[23,32]])}))),Re.apply(this,arguments)}function xe(){return ke.apply(this,arguments)}function ke(){return(ke=or(Qn().mark((function e(){var t,n,r,i,o,a,l,c,u,f,h,d;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L&&!z&&!D&&!F){e.next=2;break}return e.abrupt("return");case 2:if(M(!0),ur=parseInt(ur)+1,t=null!=$&&$.active&&null!=$&&$.term?{term:$.term}:{},n=null!=$&&$.active?"search":"photos",r=null!=$&&$.active?le:oe,i=tr(tr(tr({},{page:ur}),t),r),o=Ot(k,i),a=Nt(n,o),!(l=Yt(a))){e.next=15;break}Ae(Gt(l),!0,null),e.next=34;break;case 15:return e.next=17,fetch(a);case 17:return c=e.sent,u=c.status,Dt(c.headers),e.prev=20,e.next=23,c.json();case 23:f=e.sent,h=f.error,d=void 0===h?null:h,Ae(Gt(f),!0,d),Kt(a,f),e.next=34;break;case 29:e.prev=29,e.t0=e.catch(20),Vt(s,u),M(!1),$t(a);case 34:case"end":return e.stop()}}),e,null,[[20,29]])})))).apply(this,arguments)}function Oe(e){return Ce.apply(this,arguments)}function Ce(){return(Ce=or(Qn().mark((function e(t){var n,r,i,o,a,l,c,u,f,h,d;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I(!0),Pe(),ur=1,n="id:"===t.substring(0,3)?"id":"term",r="id"===n?{id:t.replace("id:","").replace(/\s+/,"")}:{term:t},i=tr(tr(tr({},{page:ur}),r),le),o=Ot(k,i),a=Nt("search",o),!(l=Yt(a))){e.next=14;break}Ae(Gt(l),!1,null),X({active:!0,term:t,type:n,results:Jt(l)}),e.next=35;break;case 14:return e.next=16,fetch(a);case 16:return c=e.sent,u=c.status,Dt(c.headers),e.prev=19,e.next=22,c.json();case 22:f=e.sent,h=f.error,d=void 0===h?null:h,Ae(Gt(f),!1,d),X({active:!0,term:t,type:n,results:Jt(f)}),Kt(a,f),e.next=35;break;case 29:e.prev=29,e.t0=e.catch(19),W(!0),I(!1),Vt(s,u),$t(a);case 35:pe.current.classList.remove(b);case 36:case"end":return e.stop()}}),e,null,[[19,29]])})))).apply(this,arguments)}function Ae(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;e=null==t?void 0:t.length,W(0===parseInt(e)||void 0===e),R(n?function(e){return[].concat(rr(e),rr(t))}:t),V(r)}function Be(e,t){var n=tr({},oe);n[e]&&"#"===t||""===t||"all"===t?delete n[e]:n[e]=t,ae(tr({},n))}function je(e){return Le.apply(this,arguments)}function Le(){return(Le=or(Qn().mark((function e(t){var n,r;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k!==t){e.next=2;break}return e.abrupt("return");case 2:if(I(!0),V(!1),Y(!1),be.classList.remove("overflow-hidden"),!at[t].requires_key||A.includes(t)){e.next=27;break}return e.prev=7,e.next=10,fetch(Pt(t));case 10:if(n=e.sent,r=n.status,Dt(n.headers),200===r){e.next=18;break}return Y(t),V(!0),be.classList.add("overflow-hidden"),e.abrupt("return");case 18:200===r&&B((function(e){return[].concat(rr(e),[t])})),e.next=27;break;case 21:return e.prev=21,e.t0=e.catch(7),Y(t),be.classList.add("overflow-hidden"),V(!0),e.abrupt("return");case 27:setTimeout((function(){re(bt[t].filters),O(t)}),_);case 28:case"end":return e.stop()}}),e,null,[[7,21]])})))).apply(this,arguments)}function Ne(){return(Ne=or(Qn().mark((function e(t){var n;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!((null==t?void 0:t.length)<3)){e.next=2;break}return e.abrupt("return");case 2:return n=instant_img_localize.root+"instant-images-extended/suggestions/?term=".concat(t),e.next=5,qe.get(n).then((function(e){ee(e.data)})).catch((function(e){console.warn(e)}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){ve&&null!=de&&de.current&&(null==de||de.current.scroll({top:0,left:0,behavior:"smooth"}))}function ze(e){if("Escape"===e.key){var t=de.current.querySelectorAll(".edit-screen.editing");t&&rr(t).forEach((function(e){null==e||e.classList.remove("editing")}))}}return(0,i.useEffect)((function(){null!=$&&$.active||ce({})}),[$]),(0,i.useEffect)((function(){L&&null!=$&&$.active&&Oe(null==$?void 0:$.term)}),[le]),(0,i.useEffect)((function(){L&&Se()}),[oe]),(0,i.useEffect)((function(){re(bt[k].filters),ae({})}),[k]),(0,i.useEffect)((function(){xe()}),[he]),(0,i.useEffect)((function(){cr(de.current,(function(){ye||(me.current=new(Ye())(de.current,{itemSelector:".photo"}),de.current.querySelectorAll(".photo").forEach((function(e){e.classList.add("in-view")}))),setTimeout((function(){I(!1),M(!1),L||N(!0)}),_)}))}),[S]),(0,i.useEffect)((function(){return I(!1),Ee.classList.add("loaded"),ye&&Se(),document.addEventListener("keydown",ze,!1),function(){document.removeEventListener("keydown",ze,!1)}}),[]),React.createElement(i.Fragment,null,React.createElement(rt,{value:{provider:k,wpBlock:ve,mediaModal:_e,blockSidebar:ge,clientId:d,search:$,apiError:q,getPhotos:Se,searchHandler:function(e){e.preventDefault();var t=pe.current.value;t.length>2?(pe.current.classList.add(b),Oe(t)):pe.current.focus()},filterSearch:function(e,t){var n=tr({},le);n[e]&&"#"===t||""===t||"all"===t?delete n[e]:n[e]=t,ce(tr({},n))},suggestions:Q,getSuggestions:function(e){return Ne.apply(this,arguments)}}},ve?React.createElement(Et,{switchProvider:je}):React.createElement(React.Fragment,null,React.createElement(dn,{switchProvider:je}),React.createElement(Un,null)),React.createElement(mn,null),React.createElement("div",{className:"control-nav"},React.createElement("div",{className:Ge()("control-nav--filters-wrap",q||null!=$&&$.active?"inactive":null)},ne&&null!==(r=Object.entries(ne))&&void 0!==r&&r.length?React.createElement("div",{className:"control-nav--filters"},Object.entries(ne).map((function(e,t){var n=ar(e,2),r=n[0],i=n[1];return React.createElement(cn,{key:"".concat(k,"-").concat(t,"-").concat(r),data:i,filterKey:r,handler:Be})}))):null),React.createElement(Kn,{ref:pe})),React.createElement("div",{id:"photo-listing",className:z?"loading":null},React.createElement(Xn,null),ve?React.createElement(Nn,{ref:de,data:S,done:F,loadMorePhotos:xe}):React.createElement(Cn,{ref:de,data:S}),React.createElement(fn,{total:null==$?void 0:$.results,is_search:null==$?void 0:$.active}),React.createElement(un,{ref:fe,loadMorePhotos:xe,loading:D,done:F}),React.createElement(nn,{provider:J,callback:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&O(e),Y(!1),I(!1),V(!1),be.classList.remove("overflow-hidden")}}),React.createElement(rn,null),React.createElement(Pn,null))))}const hr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"connekthq/instant-images","version":"1.0.0","title":"Instant Images","category":"media","description":"One click photo uploads from Unsplash, Openverse, Pixabay and Pexels.","keywords":["image","instant images","photo","stock photos","Unsplash","Openverse","Pixabay","Pexels"],"attributes":{},"supports":{"customClassName":false,"anchor":false,"html":false},"textdomain":"instant-images","editorScript":"file:./index.js"}');function dr(){return React.createElement("div",{style:{width:"300px",padding:"0 10px"}},React.createElement("p",null,React.createElement("strong",null,(0,o.__)("Instant Images Help","instant-images"))),React.createElement("ol",null,React.createElement("li",null,(0,o.__)("Browse photos from the various stock image providers.","instant-images")),React.createElement("li",null,(0,o.__)("Select/click an image to immediately start the upload process.","instant-images")),React.createElement("li",null,(0,o.__)("Uploaded image will be inserted directly into the post using the WordPress core Image block.","instant-images"))))}function pr(e){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pr(e)}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@wordpress/icons/build-module/library/help.js": +/*!********************************************************************!*\ + !*** ./node_modules/@wordpress/icons/build-module/library/help.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); +/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); + + +/** + * WordPress dependencies + */ + +const help = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, { + d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z" +})); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (help); +//# sourceMappingURL=help.js.map + +/***/ }), + +/***/ "./src/js/common/pluginProvider.js": +/*!*****************************************!*\ + !*** ./src/js/common/pluginProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PluginProvider": () => (/* binding */ PluginProvider), +/* harmony export */ "usePluginContext": () => (/* binding */ usePluginContext) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +// Create Context object. +var PluginContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(); + +// Export Provider. +function PluginProvider(props) { + var value = props.value, + children = props.children; + return /*#__PURE__*/React.createElement(PluginContext.Provider, { + value: value + }, children); +} + +// Export useContext Hook. +function usePluginContext() { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(PluginContext); +} + +/***/ }), + +/***/ "./src/js/components/APILightbox.js": +/*!******************************************!*\ + !*** ./src/js/components/APILightbox.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ APILightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/updatePluginSetting */ "./src/js/functions/updatePluginSetting.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the APILightbox component. + * Note: Component is display when switching providers and the API is invalid. + * + * @param {Object} props The component props. + * @return {JSX.Element} The APILightbox component. + */ +function APILightbox(props) { + var provider = props.provider, + callback = props.callback; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("invalid"), + _useState2 = _slicedToArray(_useState, 2), + apiStatus = _useState2[0], + setAPIStatus = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState4 = _slicedToArray(_useState3, 2), + response = _useState4[0], + setResponse = _useState4[1]; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var submitRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var api_key = instant_img_localize["".concat(provider, "_app_id")]; + var title = apiStatus === "invalid" ? instant_img_localize.api_key_invalid : ""; + + /** + * Handler for the form submission. + * + * @param {Event} e The form event. + */ + function handleSubmit(_x2) { + return _handleSubmit.apply(this, arguments); + } + /** + * Close the lightbox + */ + function _handleSubmit() { + _handleSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) { + var _inputRef$current; + var key, data, ok, status, headers; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + e.preventDefault(); + setAPIStatus("loading"); + + // Get API key value. + key = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value; // Set API key to localized variable. + instant_img_localize["".concat(provider, "_app_id")] = key; + + // Update plugin settings via REST API. + (0,_functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__["default"])("".concat(provider, "_api"), key); + _context.prev = 5; + _context.next = 8; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_2__.buildTestURL)(provider)); + case 8: + data = _context.sent; + // Handle response. + ok = data.ok, status = data.status, headers = data.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.checkRateLimit)(headers); + + // Handle response actions. + if (ok) { + // Success. + setAPIStatus("valid"); + setResponse(instant_img_localize.api_success_msg); + setTimeout(function () { + setResponse(""); + setAPIStatus("invalid"); + callback(provider); + }, 1000); + } else { + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, status); // Render console warning. + + if (status === 400 || status === 401) { + setResponse(instant_img_localize.api_invalid_msg); // Unsplash/Pixabay incorrect API key. + } + + if (status === 429) { + setResponse(instant_img_localize.api_ratelimit_msg); // Pixabay - too many requests. + } + } + _context.next = 19; + break; + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](5); + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, 500); // Render console warning. + setResponse(instant_img_localize.api_invalid_500_msg); + case 19: + case "end": + return _context.stop(); + } + }, _callee, null, [[5, 14]]); + })); + return _handleSubmit.apply(this, arguments); + } + function closeLightbox() { + if (lightbox !== null && lightbox !== void 0 && lightbox.current) { + lightbox.current.classList.remove("active"); + setTimeout(function () { + callback(); + }, 150); + } + } + + /** + * Close the lightbox with a background click. + * + * @param {Event} e The form event. + */ + function bkgClick(e) { + var target = e.target; + // If clicked element is the background. + if (target === (lightbox === null || lightbox === void 0 ? void 0 : lightbox.current)) { + closeLightbox(); + } + } + + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + closeLightbox(); + } + } + + /** + * Reset the key to use Instant Images default. + */ + function getDefaultKey() { + inputRef.current.value = ""; + setTimeout(function () { + submitRef.current.click(); + }, 25); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + var _lightbox$current; + document.addEventListener("keydown", escFunction, false); + lightbox === null || lightbox === void 0 ? void 0 : (_lightbox$current = lightbox.current) === null || _lightbox$current === void 0 ? void 0 : _lightbox$current.classList.add("active"); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, [provider]); //eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, provider ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("div", { + className: "api-lightbox", + ref: lightbox, + onClick: function onClick(e) { + return bkgClick(e); + }, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", { + className: "api-lightbox--close", + onClick: function onClick() { + return closeLightbox(); + } + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.btnClose)), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--details" + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_6__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", null, instant_img_localize["".concat(provider, "_api_desc")]), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key), /*#__PURE__*/React.createElement("span", null, "|"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getDefaultKey(); + } + }, instant_img_localize.use_instant_images_key))), /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return handleSubmit(e); + } + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "key", + className: "offscreen" + }, instant_img_localize.enter_api_key), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--input-wrap" + }, /*#__PURE__*/React.createElement("span", { + className: apiStatus, + title: title && title + }, apiStatus === "invalid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-exclamation-triangle", + "aria-hidden": "true" + }), apiStatus === "valid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-check-circle", + "aria-hidden": "true" + }), apiStatus === "loading" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-spinner fa-spin", + "aria-hidden": "true" + })), /*#__PURE__*/React.createElement("input", { + type: "text", + id: "key", + ref: inputRef, + placeholder: "Enter API Key", + defaultValue: api_key + })), response && /*#__PURE__*/React.createElement("p", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--response", apiStatus) + }, response), /*#__PURE__*/React.createElement("button", { + type: "submit", + ref: submitRef + }, instant_img_localize.btnVerify))))) : null); +} + +/***/ }), + +/***/ "./src/js/components/ErrorLightbox.js": +/*!********************************************!*\ + !*** ./src/js/components/ErrorLightbox.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ErrorLightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/getErrorMessage */ "./src/js/functions/getErrorMessage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + + + + +/** + * Render the ErrorLightbox component. + * Note: Component is display on initial plugin load if the default provider has an invalid API key. + * + * @return {JSX.Element} The ErrorLightbox component. + */ +function ErrorLightbox() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + apiError = _usePluginContext.apiError; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var status = apiError !== null && apiError !== void 0 && apiError.status ? apiError.status : null; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, apiError && status && /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox", "error-lightbox", "active"), + ref: lightbox, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--details", "error-lightbox") + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_5__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", { + className: "callout-warning" + }, status, " ", instant_img_localize.error), /*#__PURE__*/React.createElement("p", null, (0,_functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(status)), /*#__PURE__*/React.createElement("p", { + className: "more-info" + }, instant_img_localize.api_default_provider), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key)))))); +} + +/***/ }), + +/***/ "./src/js/components/Filter.js": +/*!*************************************!*\ + !*** ./src/js/components/Filter.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Filter) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/** + * Render the Filter component. + * + * @param {Object} props The component props. + * @param {Object} props.data The filter data. + * @param {string} props.filterKey The filter key. + * @param {Function} props.handler The change/click handler function. + * @return {JSX.Element} The Filter component. + */ +function Filter(props) { + var _data$filters; + var data = props.data, + filterKey = props.filterKey, + handler = props.handler; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider; + var defaultValue = data === null || data === void 0 ? void 0 : data["default"]; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + expanded = _useState2[0], + setExpanded = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue), + _useState4 = _slicedToArray(_useState3, 2), + selected = _useState4[0], + setSelected = _useState4[1]; + var dropdown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var button = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var menu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var id = "".concat(provider, "-").concat(filterKey); + var isColor = filterKey === "colors" || filterKey === "color"; + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__.useArrowControls)(expanded, dropdown); + + /** + * Toggle menu open/closed. + * + * @param {Event} event The click event. + */ + function toggleMenu(event) { + event.preventDefault(); + + // If disabled, don't open menu. + var target = event.currentTarget; + if (target.disabled) { + return false; + } + if (expanded) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } else { + setExpanded(true); + document.addEventListener("click", closeMenuOutside); + } + } + + /** + * Close menu when clicking outside. + * + * @param {Event} event The click event. + */ + function closeMenuOutside(event) { + var _menu$current, _button$current; + if (!(menu !== null && menu !== void 0 && (_menu$current = menu.current) !== null && _menu$current !== void 0 && _menu$current.contains(event.target)) && !(button !== null && button !== void 0 && (_button$current = button.current) !== null && _button$current !== void 0 && _button$current.contains(event.target))) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } + } + + /** + * Checks for focus outside of component. + * + * @param {Event} event The click event. + */ + function focusOutside(event) { + if (!(dropdown !== null && dropdown !== void 0 && dropdown.current.contains(event.target))) { + closeMenuOutside(event); + } + } + + /** + * Detect esc key press. + * + * @param {Event} event The click event. + */ + function escClick(event) { + if (event.key === "Escape") { + setExpanded(false); + } + } + + /** + * Click handler for the filter buttons. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function click(filter, value) { + var newValue = selected !== value ? value : defaultValue; + setSelected(newValue); + handler(filter, newValue); + setTimeout(function () { + var _button$current2; + button === null || button === void 0 ? void 0 : (_button$current2 = button.current) === null || _button$current2 === void 0 ? void 0 : _button$current2.click(); + }, 100); + } + + /** + * Convert a color to a CSS value. + * + * @see https://www.w3schools.com/colors/colors_names.asp + * + * @param {string} color The current color. + * @return {string} The color. + */ + function convertColor(color) { + if (color === "lilac") { + color = "DarkViolet"; + } + if (color === "grayscale" || color === "black_and_white") { + color = "LightGray"; + } + return color; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Initiate arrow menus. + // a11yarrows.init(dropdown?.current, { + // selector: "button", + // }); + + // Check for focus outside. + document.addEventListener("keyup", focusOutside); + document.addEventListener("keydown", escClick); + return function () { + document.removeEventListener("keyup", focusOutside); + document.removeEventListener("keydown", escClick); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement("div", { + className: "filter-dropdown", + id: id, + ref: dropdown + }, /*#__PURE__*/React.createElement("button", { + onClick: toggleMenu, + className: "filter-dropdown--button", + "aria-expanded": expanded ? "true" : "false", + ref: button + }, /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-label" + }, data === null || data === void 0 ? void 0 : data.label), /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-selected" + }, selected.replace(/_/g, " "), /*#__PURE__*/React.createElement("i", { + className: "fa fa-caret-down", + "aria-hidden": "true" + }))), /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--menu", expanded ? "expanded" : null), + "data-key": filterKey, + "aria-hidden": expanded ? "false" : "true", + ref: menu + }, (data === null || data === void 0 ? void 0 : (_data$filters = data.filters) === null || _data$filters === void 0 ? void 0 : _data$filters.length) && data.filters.map(function (filter, key) { + var label = filter.label, + value = filter.value; + return /*#__PURE__*/React.createElement("button", { + key: key, + disabled: selected === value, + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--item", selected === value ? "selected" : null), + onClick: function onClick() { + return click(filterKey, value); + } + }, label, value !== "all" && value !== "transparent" && isColor ? /*#__PURE__*/React.createElement("span", { + className: "_color", + style: { + color: convertColor(value) + } + }) : null); + }))); +} + +/***/ }), + +/***/ "./src/js/components/Icon.js": +/*!***********************************!*\ + !*** ./src/js/components/Icon.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "IconLogo": () => (/* binding */ IconLogo), +/* harmony export */ "IconSVG": () => (/* binding */ IconSVG), +/* harmony export */ "default": () => (/* binding */ Icon) +/* harmony export */ }); +/** + * The Icon component. + * + * @return {JSX.Element} The Icon component. + */ +function Icon() { + return /*#__PURE__*/React.createElement("span", { + className: "instant-images-sidebar-icon" + }, /*#__PURE__*/React.createElement(IconSVG, null)); +} + +/** + * The SVG icon. + * + * @return {JSX.Element} The IconSVG component. + */ +function IconSVG() { + return /*#__PURE__*/React.createElement("svg", { + viewBox: "0 0 31 58", + width: "13px", + height: "24px" + }, /*#__PURE__*/React.createElement("polygon", { + points: "20 0 20 23 31 23 11 58 11 34 0 34 20 0", + fill: "#4a7bc5" + })); +} + +/** + * The SVG Logo. + * + * @return {JSX.Element} The IconLogo component. + */ +function IconLogo() { + return /*#__PURE__*/React.createElement("svg", { + width: "80", + height: "80", + viewBox: "0 0 80 80", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("title", null, "Instant Images Icon"), /*#__PURE__*/React.createElement("path", { + d: "M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z", + fill: "#647FE8" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + })); +} + +/***/ }), + +/***/ "./src/js/components/InstantImages.js": +/*!********************************************!*\ + !*** ./src/js/components/InstantImages.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ InstantImages) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! masonry-layout */ "./node_modules/masonry-layout/masonry.js"); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(masonry_layout__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor/block/components/Header */ "./src/js/editor/block/components/Header.js"); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../functions/getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _functions_getResults__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../functions/getResults */ "./src/js/functions/getResults.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../functions/session */ "./src/js/functions/session.js"); +/* harmony import */ var _APILightbox__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./APILightbox */ "./src/js/components/APILightbox.js"); +/* harmony import */ var _ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ErrorLightbox */ "./src/js/components/ErrorLightbox.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _LoadMore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LoadMore */ "./src/js/components/LoadMore.js"); +/* harmony import */ var _NoResults__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./NoResults */ "./src/js/components/NoResults.js"); +/* harmony import */ var _ProviderNav__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ProviderNav */ "./src/js/components/ProviderNav.js"); +/* harmony import */ var _RestAPIError__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RestAPIError */ "./src/js/components/RestAPIError.js"); +/* harmony import */ var _Results__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Results */ "./src/js/components/Results.js"); +/* harmony import */ var _ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ResultsWPBlock */ "./src/js/components/ResultsWPBlock.js"); +/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Tooltip */ "./src/js/components/Tooltip.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _search_SearchForm__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./search/SearchForm */ "./src/js/components/search/SearchForm.js"); +/* harmony import */ var _search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./search/SearchHeader */ "./src/js/components/search/SearchHeader.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var imagesLoaded = __webpack_require__(/*! imagesloaded */ "./node_modules/imagesloaded/imagesloaded.js"); +var page = 1; + +/** + * Render the main InstantImages application component. + * + * @param {Object} props The component props. + * @param {string} props.editor Editor type. + * @param {string} props.provider Image provider. + * @param {Array} props.data API results. + * @param {Element} props.container Instant Images container element. + * @param {Object} props.api_error API error object. + * @param {string} props.clientId WP block client ID. + * @return {JSX.Element} InstantImages component. + */ +function InstantImages(props) { + var _instant_img_localize4, _instant_img_localize5, _Object$entries; + var _props$editor = props.editor, + editor = _props$editor === void 0 ? "classic" : _props$editor, + provider = props.provider, + data = props.data, + container = props.container, + _props$api_error = props.api_error, + api_error = _props$api_error === void 0 ? null : _props$api_error, + _props$clientId = props.clientId, + clientId = _props$clientId === void 0 ? null : _props$clientId; + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var delay = 250; + var searchClass = "searching"; + var searchDefaults = { + active: false, + term: "", + type: "", + results: 0 + }; + + // App state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(data)), + _useState2 = _slicedToArray(_useState, 2), + results = _useState2[0], + setResults = _useState2[1]; // Image results. + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(provider), + _useState4 = _slicedToArray(_useState3, 2), + activeProvider = _useState4[0], + setActiveProvider = _useState4[1]; // Current provider. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState6 = _slicedToArray(_useState5, 2), + apiTested = _useState6[0], + setAPITested = _useState6[1]; // API key test results. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState8 = _slicedToArray(_useState7, 2), + mounted = _useState8[0], + setMounted = _useState8[1]; // App mounted state. + var _useState9 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState10 = _slicedToArray(_useState9, 2), + loading = _useState10[0], + setLoading = _useState10[1]; // Loading state + var _useState11 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState12 = _slicedToArray(_useState11, 2), + loadingMore = _useState12[0], + setLoadingMore = _useState12[1]; // Load more state. + var _useState13 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState14 = _slicedToArray(_useState13, 2), + done = _useState14[0], + setDone = _useState14[1]; // Done state. + var _useState15 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(api_error), + _useState16 = _slicedToArray(_useState15, 2), + apiError = _useState16[0], + setAPIError = _useState16[1]; // API Error. + var _useState17 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState18 = _slicedToArray(_useState17, 2), + showAPILightbox = _useState18[0], + setShowAPILightbox = _useState18[1]; // Render API key lightbox. + var _useState19 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(searchDefaults), + _useState20 = _slicedToArray(_useState19, 2), + search = _useState20[0], + setSearch = _useState20[1]; + var _useState21 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState22 = _slicedToArray(_useState21, 2), + suggestions = _useState22[0], + setSuggestions = _useState22[1]; + var _useState23 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters), + _useState24 = _slicedToArray(_useState23, 2), + filterOptions = _useState24[0], + setFilterOptions = _useState24[1]; + var _useState25 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState26 = _slicedToArray(_useState25, 2), + filters = _useState26[0], + setFilters = _useState26[1]; + var _useState27 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState28 = _slicedToArray(_useState27, 2), + searchFilters = _useState28[0], + setSearchFilters = _useState28[1]; + + // Refs. + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + var photosRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var searchInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var msnryRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // WP Editor props. + var wpBlock = editor === "block" ? true : false; + var blockSidebar = editor === "sidebar" ? true : false; + var isBlockEditor = wpBlock || blockSidebar ? true : false; + var mediaModal = editor === "media-modal" ? true : false; + var body = document.body; + var plugin = isBlockEditor ? container : container.parentNode.parentNode; + var wrapper = isBlockEditor ? container : plugin.querySelector(".instant-images-wrapper"); + + /** + * Get the initial set of photos for the current view (New/Popular/Filters/etc...). + * + * @param {boolean} reset Reset the current view. + * @since 3.0 + */ + function getPhotos() { + return _getPhotos.apply(this, arguments); + } + /** + * Load more photos in infinite scroll style. + * + * @since 3.0 + */ + function _getPhotos() { + _getPhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _searchInputRef$curre2; + var reset, + params, + url, + sessionData, + response, + status, + headers, + apiResults, + _apiResults$error, + error, + _args = arguments; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + reset = _args.length > 0 && _args[0] !== undefined ? _args[0] : false; + if (!loadingMore) { + _context.next = 3; + break; + } + return _context.abrupt("return", false); + case 3: + if (!(!reset && (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre2 = searchInputRef.current) === null || _searchInputRef$curre2 === void 0 ? void 0 : _searchInputRef$curre2.value) !== "")) { + _context.next = 7; + break; + } + if (!(extended_activated && extended_license)) { + _context.next = 7; + break; + } + doSearch(searchInputRef.current.value); + return _context.abrupt("return"); + case 7: + setLoading(true); // Set loading state. + clearSearch(); // Reset search results. + + resetScrollPosition(); + page = 1; + + // Build URL. + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, filters); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("photos", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context.next = 18; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + _context.next = 37; + break; + case 18: + _context.next = 20; + return fetch(url); + case 20: + response = _context.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context.prev = 23; + _context.next = 26; + return response.json(); + case 26: + apiResults = _context.sent; + _apiResults$error = apiResults.error, error = _apiResults$error === void 0 ? null : _apiResults$error; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context.next = 37; + break; + case 32: + _context.prev = 32; + _context.t0 = _context["catch"](23); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoading(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 37: + // Delay loading animatons for effect. + setTimeout(function () { + setLoading(false); + }, delay); + case 38: + case "end": + return _context.stop(); + } + }, _callee, null, [[23, 32]]); + })); + return _getPhotos.apply(this, arguments); + } + function loadMorePhotos() { + return _loadMorePhotos.apply(this, arguments); + } + /** + * Perform a photo search. + * + * @param {string} term Search term. + * @since 3.0 + */ + function _loadMorePhotos() { + _loadMorePhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var searchQuery, type, activeFilters, loadmoreParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error2, error; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(!mounted || loading || loadingMore || done)) { + _context2.next = 2; + break; + } + return _context2.abrupt("return"); + case 2: + setLoadingMore(true); + page = parseInt(page) + 1; + + // Get search query. + searchQuery = search !== null && search !== void 0 && search.active && search !== null && search !== void 0 && search.term ? { + term: search.term + } : {}; // Build URL. + type = search !== null && search !== void 0 && search.active ? "search" : "photos"; + activeFilters = search !== null && search !== void 0 && search.active ? searchFilters : filters; + loadmoreParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), activeFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, loadmoreParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])(type, params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context2.next = 15; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), true, null); + _context2.next = 34; + break; + case 15: + _context2.next = 17; + return fetch(url); + case 17: + response = _context2.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context2.prev = 20; + _context2.next = 23; + return response.json(); + case 23: + apiResults = _context2.sent; + _apiResults$error2 = apiResults.error, error = _apiResults$error2 === void 0 ? null : _apiResults$error2; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), true, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context2.next = 34; + break; + case 29: + _context2.prev = 29; + _context2.t0 = _context2["catch"](20); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoadingMore(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 34: + case "end": + return _context2.stop(); + } + }, _callee2, null, [[20, 29]]); + })); + return _loadMorePhotos.apply(this, arguments); + } + function doSearch(_x2) { + return _doSearch.apply(this, arguments); + } + /** + * Handle the display results. + * + * @param {Array} images Image array. + * @param {boolean} append Append images to existing results display. + * @param {string|null} error Error message. + */ + function _doSearch() { + _doSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(term) { + var searchType, searchQuery, searchParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error3, error; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + setLoading(true); + resetScrollPosition(); + page = 1; // Reset current page num. + searchType = term.substring(0, 3) === "id:" ? "id" : "term"; // Get search query. + searchQuery = searchType === "id" ? { + id: term.replace("id:", "").replace(/\s+/, "") + } : { + term: term + }; // Build URL. + searchParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), searchFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, searchParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("search", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context3.next = 14; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(sessionData) + }); + _context3.next = 35; + break; + case 14: + _context3.next = 16; + return fetch(url); + case 16: + response = _context3.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context3.prev = 19; + _context3.next = 22; + return response.json(); + case 22: + apiResults = _context3.sent; + _apiResults$error3 = apiResults.error, error = _apiResults$error3 === void 0 ? null : _apiResults$error3; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(apiResults) + }); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context3.next = 35; + break; + case 29: + _context3.prev = 29; + _context3.t0 = _context3["catch"](19); + // Reset all search parameters. + setDone(true); + setLoading(false); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 35: + searchInputRef.current.classList.remove(searchClass); + case 36: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[19, 29]]); + })); + return _doSearch.apply(this, arguments); + } + function displayResults() { + var images = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var error = arguments.length > 2 ? arguments[2] : undefined; + checkResults(images === null || images === void 0 ? void 0 : images.length); + if (append) { + setResults(function (prevState) { + return [].concat(_toConsumableArray(prevState), _toConsumableArray(images)); + }); // Load more. + } else { + setResults(images); // Standard switch. + } + + setAPIError(error); + } + + /** + * Handle the Photo Search. + * + * @param {Event} event The dispatched submit event. + * @since 3.0 + */ + function searchHandler(event) { + event.preventDefault(); + var term = searchInputRef.current.value; + if (term.length > 2) { + searchInputRef.current.classList.add(searchClass); + doSearch(term); + } else { + searchInputRef.current.focus(); + } + } + + /** + * Reset search results, settings and results view. + * + * @since 3.0 + */ + function clearSearch() { + var _searchInputRef$curre; + var term = (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.value) || ""; + if (term) { + searchInputRef.current.value = ""; + } + setSearch(searchDefaults); + setSuggestions([]); + } + + /** + * Filter the photo listing. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterPhotos(filter, value) { + var newFilters = _objectSpread({}, filters); + if (newFilters[filter] && value === "#" || value === "" || value === "all") { + delete newFilters[filter]; + } else { + newFilters[filter] = value; + } + setFilters(_objectSpread({}, newFilters)); + } + + /** + * Filter the search results. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterSearch(filter, value) { + var newSearchFilters = _objectSpread({}, searchFilters); + if (newSearchFilters[filter] && value === "#" || value === "" || value === "all") { + delete newSearchFilters[filter]; + } else { + newSearchFilters[filter] = value; + } + setSearchFilters(_objectSpread({}, newSearchFilters)); + } + + /** + * Close the API Lightbox. + * + * @param {string} target The target provider to close the lightbox for. + * @since 4.5 + */ + function closeAPILightbox() { + var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + if (target) { + setActiveProvider(target); + } + setShowAPILightbox(false); + setLoading(false); + setAPIError(false); + body.classList.remove("overflow-hidden"); + } + + /** + * Switch API providers. + * + * @param {string} newProvider The provider to switch to. + * @since 4.5 + */ + function switchProvider(_x3) { + return _switchProvider.apply(this, arguments); + } + /** + * Get autocomplete search suggestions. + * + * @param {string} term The search term. + * @return {Array} The autocomplete suggestions. + */ + function _switchProvider() { + _switchProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(newProvider) { + var response, status, headers; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!(activeProvider === newProvider)) { + _context4.next = 2; + break; + } + return _context4.abrupt("return"); + case 2: + setLoading(true); + setAPIError(false); + setShowAPILightbox(false); + body.classList.remove("overflow-hidden"); + + // API verification - check API key for provider. + if (!(_constants_API__WEBPACK_IMPORTED_MODULE_4__.API[newProvider].requires_key && !apiTested.includes(newProvider))) { + _context4.next = 27; + break; + } + _context4.prev = 7; + _context4.next = 10; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__.buildTestURL)(newProvider)); + case 10: + response = _context4.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + if (!(status !== 200)) { + _context4.next = 18; + break; + } + // Catch API errors and 401s. + setShowAPILightbox(newProvider); // Show API Lightbox. + setAPIError(true); + body.classList.add("overflow-hidden"); + return _context4.abrupt("return"); + case 18: + if (status === 200) { + // Valid API key - Add to array of tested providers. + setAPITested(function (prevState) { + return [].concat(_toConsumableArray(prevState), [newProvider]); + }); + } + _context4.next = 27; + break; + case 21: + _context4.prev = 21; + _context4.t0 = _context4["catch"](7); + // Catch all other errors. + setShowAPILightbox(newProvider); // Show API Lightbox. + body.classList.add("overflow-hidden"); + setAPIError(true); + return _context4.abrupt("return"); + case 27: + // Add slight delay for loading effect. + setTimeout(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[newProvider].filters); // Update filter options. + setActiveProvider(newProvider); // Switch the provider. + }, delay); + case 28: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[7, 21]]); + })); + return _switchProvider.apply(this, arguments); + } + function getSuggestions(_x4) { + return _getSuggestions.apply(this, arguments); + } + /** + * Renders the Masonry layout. + * + * @since 3.0 + */ + function _getSuggestions() { + _getSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(term) { + var api_url; + return _regeneratorRuntime().wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (!(!term || (term === null || term === void 0 ? void 0 : term.length) < 3)) { + _context5.next = 2; + break; + } + return _context5.abrupt("return"); + case 2: + // API endpoint URL. + api_url = instant_img_localize.root + "instant-images-extended/suggestions/?term=".concat(term); // Get suggestions. + _context5.next = 5; + return axios__WEBPACK_IMPORTED_MODULE_27__["default"].get(api_url).then(function (res) { + setSuggestions(res.data); + })["catch"](function (error) { + console.warn(error); + }); + case 5: + case "end": + return _context5.stop(); + } + }, _callee5); + })); + return _getSuggestions.apply(this, arguments); + } + function renderLayout() { + imagesLoaded(photosRef.current, function () { + if (!isBlockEditor) { + msnryRef.current = new (masonry_layout__WEBPACK_IMPORTED_MODULE_2___default())(photosRef.current, { + itemSelector: ".photo" + }); + photosRef.current.querySelectorAll(".photo").forEach(function (el) { + el.classList.add("in-view"); + }); + } + setTimeout(function () { + // Delay to allow for rendering and set up. + setLoading(false); + setLoadingMore(false); + if (!mounted) { + setMounted(true); + } + }, delay); + }); + } + + /** + * Reset the scroll position for the WP block only. + */ + function resetScrollPosition() { + if (wpBlock && photosRef !== null && photosRef !== void 0 && photosRef.current) { + photosRef === null || photosRef === void 0 ? void 0 : photosRef.current.scroll({ + top: 0, + left: 0, + behavior: "smooth" + }); + } + } + + /** + * A checker to determine if there are remaining search results. + * + * @param {number} num Total search results. + * @since 3.0 + */ + function checkResults(num) { + setDone(parseInt(num) === 0 || num === undefined); + } + + /** + * Escape handler to close edit windows on photos. + * + * @param {Event} e The key event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + var editing = photosRef.current.querySelectorAll(".edit-screen.editing"); + if (editing) { + _toConsumableArray(editing).forEach(function (element) { + element === null || element === void 0 ? void 0 : element.classList.remove("editing"); + }); + } + } + } + + /* Search callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (!(search !== null && search !== void 0 && search.active)) { + // Reset search filters when search is false. + setSearchFilters({}); + } + }, [search]); // eslint-disable-line react-hooks/exhaustive-deps + + /* Search filters change callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted && search !== null && search !== void 0 && search.active) { + doSearch(search === null || search === void 0 ? void 0 : search.term); + } + }, [searchFilters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Filters change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted) { + getPhotos(); + } + }, [filters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Provider change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters); + setFilters({}); // Trigger filter change. + }, [activeProvider]); // eslint-disable-line react-hooks/exhaustive-deps + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Infinite scrolling. + loadMorePhotos(); + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + // Results callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + renderLayout(); + }, [results]); // eslint-disable-line react-hooks/exhaustive-deps + + // Initial page load. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setLoading(false); + wrapper.classList.add("loaded"); + + // Block editor, get initial set of photos. + if (isBlockEditor) { + getPhotos(); + } + // Add global escape listener. + document.addEventListener("keydown", escFunction, false); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.PluginProvider, { + value: { + provider: activeProvider, + wpBlock: wpBlock, + mediaModal: mediaModal, + blockSidebar: blockSidebar, + clientId: clientId, + search: search, + apiError: apiError, + getPhotos: getPhotos, + searchHandler: searchHandler, + filterSearch: filterSearch, + suggestions: suggestions, + getSuggestions: getSuggestions + } + }, wpBlock ? /*#__PURE__*/React.createElement(_editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], { + switchProvider: switchProvider + }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_ProviderNav__WEBPACK_IMPORTED_MODULE_18__["default"], { + switchProvider: switchProvider + }), /*#__PURE__*/React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_23__.ExtendedCTA, null)), /*#__PURE__*/React.createElement(_RestAPIError__WEBPACK_IMPORTED_MODULE_19__["default"], null), /*#__PURE__*/React.createElement("div", { + className: "control-nav" + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--filters-wrap", apiError || search !== null && search !== void 0 && search.active ? "inactive" : null) + }, filterOptions && (_Object$entries = Object.entries(filterOptions)) !== null && _Object$entries !== void 0 && _Object$entries.length ? /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filterOptions).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_15__["default"], { + key: "".concat(activeProvider, "-").concat(index, "-").concat(key), + data: filter, + filterKey: key, + handler: filterPhotos + }); + })) : null), /*#__PURE__*/React.createElement(_search_SearchForm__WEBPACK_IMPORTED_MODULE_24__["default"], { + ref: searchInputRef + })), /*#__PURE__*/React.createElement("div", { + id: "photo-listing", + className: loading ? "loading" : null + }, /*#__PURE__*/React.createElement(_search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__["default"], null), wpBlock ? /*#__PURE__*/React.createElement(_ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__["default"], { + ref: photosRef, + data: results, + done: done, + loadMorePhotos: loadMorePhotos + }) : /*#__PURE__*/React.createElement(_Results__WEBPACK_IMPORTED_MODULE_20__["default"], { + ref: photosRef, + data: results + }), /*#__PURE__*/React.createElement(_NoResults__WEBPACK_IMPORTED_MODULE_17__["default"], { + total: search === null || search === void 0 ? void 0 : search.results, + is_search: search === null || search === void 0 ? void 0 : search.active + }), /*#__PURE__*/React.createElement(_LoadMore__WEBPACK_IMPORTED_MODULE_16__["default"], { + ref: loadMoreRef, + loadMorePhotos: loadMorePhotos, + loading: loadingMore, + done: done + }), /*#__PURE__*/React.createElement(_APILightbox__WEBPACK_IMPORTED_MODULE_13__["default"], { + provider: showAPILightbox, + callback: closeAPILightbox + }), /*#__PURE__*/React.createElement(_ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__["default"], null), /*#__PURE__*/React.createElement(_Tooltip__WEBPACK_IMPORTED_MODULE_22__["default"], null)))); +} + +/***/ }), + +/***/ "./src/js/components/LoadMore.js": +/*!***************************************!*\ + !*** ./src/js/components/LoadMore.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); + + + + +/** + * Render the LoadMore component. + * + * @return {JSX.Element} The LoadMore component. + */ +var LoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var loadMorePhotos = props.loadMorePhotos, + loading = props.loading, + done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("load-more-wrap", loading ? "loading" : null, done ? "done" : null), + ref: ref + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button", + onClick: function onClick() { + return loadMorePhotos(); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Load More Images", "instant-images"))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMore); + +/***/ }), + +/***/ "./src/js/components/NoResults.js": +/*!****************************************!*\ + !*** ./src/js/components/NoResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ NoResults) +/* harmony export */ }); +/** + * Render the NoResults component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The NoResults component. + */ +function NoResults(props) { + var _props$total = props.total, + total = _props$total === void 0 ? 0 : _props$total, + _props$is_search = props.is_search, + is_search = _props$is_search === void 0 ? false : _props$is_search; + if (!is_search || is_search && total >= 1) { + // Bail if not search or search total is greater than 1. + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-no-results" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, instant_img_localize.no_results, " "), /*#__PURE__*/React.createElement("p", null, instant_img_localize.no_results_desc, " "))); +} + +/***/ }), + +/***/ "./src/js/components/Photo.js": +/*!************************************!*\ + !*** ./src/js/components/Photo.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Photo) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/utils/insertImage */ "./src/js/editor/utils/insertImage.js"); +/* harmony import */ var _editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editor/utils/setFeaturedImage */ "./src/js/editor/utils/setFeaturedImage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../functions/providers/unsplash */ "./src/js/functions/providers/unsplash.js"); +/* harmony import */ var _functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/generateAttribution */ "./src/js/functions/generateAttribution.js"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + +/** + * Render the Photo component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Photo component. + */ +function Photo(props) { + var result = props.result, + setInactive = props.setInactive; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB, + _usePluginContext$med = _usePluginContext.mediaModal, + mediaModal = _usePluginContext$med === void 0 ? false : _usePluginContext$med, + _usePluginContext$blo = _usePluginContext.blockSidebar, + blockSidebar = _usePluginContext$blo === void 0 ? false : _usePluginContext$blo, + clientId = _usePluginContext.clientId; + var id = result.id, + filename = result.id, + permalink = result.permalink, + title = result.title, + alt = result.alt, + caption = result.caption, + attribution = result.attribution, + _result$extension = result.extension, + extension = _result$extension === void 0 ? "jpg" : _result$extension, + likes = result.likes, + dimensions = result.dimensions, + urls = result.urls, + user = result.user; + + // Deconstruct image URLs. + var thumb = urls.thumb, + full = urls.full, + download_url = urls.download_url; + + // Deconstruct user data. + var user_name = user.name, + user_photo = user.photo, + user_url = user.url; + var container = document.querySelector(".instant-img-container"); + var likeDisplay = parseInt(likes) === 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Like", "instant-images") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Likes", "instant-images"); + var _instant_img_localize = instant_img_localize, + _instant_img_localize2 = _instant_img_localize.attribution_hook, + attribution_hook = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.auto_attribution, + auto_attribution = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + + // Get the attribution text. + var imageAttribution = attribution_hook ? (0,_functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__["default"])(attribution_hook, provider, permalink, user) : attribution; + var imageCaption = auto_attribution === "1" ? imageAttribution : caption; + + // Photo state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }), + _useState2 = _slicedToArray(_useState, 2), + imageDetails = _useState2[0], + setImageDetails = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + inProgress = _useState4[0], + setInProgress = _useState4[1]; // inProgress state. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("loaded"), + _useState6 = _slicedToArray(_useState5, 2), + status = _useState6[0], + setStatus = _useState6[1]; // Status state. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState8 = _slicedToArray(_useState7, 2), + editURL = _useState8[0], + setEditURL = _useState8[1]; // Edit URL state. + + // Refs. + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var upload = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var editScreen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var captionRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // Gutenberg. + var setAsFeaturedImage = false; + var insertIntoPost = false; + + /** + * Function to trigger the image download. + * + * @since 4.3 + */ + function download() { + if (inProgress || status === "success" || status === "uploaded") { + return false; // Exit if uploading, uploaded or success. + } + + var target = upload === null || upload === void 0 ? void 0 : upload.current; + setInProgress(true); + setStatus("uploading"); + if (wpBlock) { + setInactive(true); // Make Instant Images inactive after selecting an image. + } + + // API URL + var api = instant_img_localize.root + "instant-images/download/"; + + // Data Params + var data = { + provider: provider, + id: target.getAttribute("data-id"), + image_url: target.getAttribute("data-url"), + filename: target.getAttribute("data-id"), + extension: extension, + custom_filename: target.getAttribute("data-filename"), + title: target.getAttribute("data-title"), + alt: target.getAttribute("data-alt"), + caption: target.getAttribute("data-caption"), + parent_id: instant_img_localize.parent_id, + lang: instant_img_localize.lang + }; + + // Config Params + var config = { + credentials: "same-origin", + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_9__["default"].post(api, JSON.stringify(data), config).then(function (res) { + var response = res.data; + if (response) { + // Successful response from server + var success = response.success; + var attachment = response.attachment; + var admin_url = response.admin_url; + var msg = response.msg; + if (success) { + var edit_url = "".concat(admin_url, "post.php?post=").concat(attachment.id, "&action=edit"); // Edit URL. + setEditURL(edit_url); + uploadComplete(target, msg, attachment.id); // Success/Upload Complete + + // Trigger a download at Unsplash. + if (provider === "unsplash" && download_url) { + (0,_functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__.unsplashDownload)(download_url); + } + + /** + * Gutenberg options. + */ + + // Set Featured Image via Sidebar. + if (blockSidebar && setAsFeaturedImage) { + (0,_editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__["default"])(attachment); + setAsFeaturedImage = false; + closeMediaModal(); + } + + // Insert Image via Sidebar. + if (blockSidebar && insertIntoPost) { + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment); + }, 250); + closeMediaModal(); + insertIntoPost = false; + } + + // Insert Image via WP Block. + if (wpBlock && clientId) { + setStatus("uploaded"); + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment, clientId); + }, 350); + closeMediaModal(); + insertIntoPost = false; + } + + /** + * Media Modal. + * If is media popup, redirect user to media-upload settings. + */ + if (container.dataset.mediaPopup === "true" && !blockSidebar) { + window.location = "media-upload.php?type=image&tab=library&attachment_id=" + attachment.id; + } + } else { + // Error + uploadError(target, msg); + } + } else { + // Error + uploadError(target, instant_img_localize.error_upload); + } + })["catch"](function (error) { + console.warn(error); + }); + } + + /** + * Upload complete function. + * + * @param {Element} target Clicked item. + * @param {string} msg Success Msg. + * @param {string} imageID Attachment id. + * @since 3.0 + */ + function uploadComplete(target, msg, imageID) { + if (!(photo !== null && photo !== void 0 && photo.current)) { + return; + } + setImageTitle(target, msg); + setStatus("uploaded"); + setInProgress(false); + + // Remove uploaded status after 3.5 seconds. + setTimeout(function () { + setStatus("success"); + }, 3500); + + // Refresh Media Router/Modal. + refreshMediaModal(imageID); + } + + /** + * Handler to send user to edit photo link after upload. + * + * @since 5.2.0 + */ + function editAfterUpload() { + if (editURL) { + window.location = editURL; + } + } + + /** + * Function used to trigger a download and then set as featured image + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function setFeaturedImageClick(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + setAsFeaturedImage = true; + upload.current.click(); + } + } + + /** + * Function used to insert an image directly into the block (Gutenberg) editor. + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function insertImageIntoPost(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + insertIntoPost = true; + upload.current.click(); + } + } + + /** + * Refresh Media Modal and select item after it's been uploaded. + * + * @param {string} modalID The media modal ID. + * @since 4.3 + */ + function refreshMediaModal(modalID) { + if (mediaModal && wp.media && wp.media.frame && wp.media.frame.el) { + var mediaModalEl = wp.media.frame.el; + var mediaTab = mediaModalEl.querySelector("#menu-item-browse"); + if (mediaTab) { + // Open the 'Media Library' tab. + mediaTab.click(); + } + + // Delay to allow for tab switching + setTimeout(function () { + if (wp.media.frame.content.get() !== null) { + // Force a refresh of the mdeia modal content. + wp.media.frame.content.get().collection._requery(true); + } + + // Select the attached that was just uploaded. + var selection = wp.media.frame.state().get("selection"); + var selected = parseInt(modalID); + selection.reset(selected ? [wp.media.attachment(selected)] : []); + }, 100); + } + } + + /** + * Function runs when error occurs on upload or resize. + * + * @param {Element} target Current clicked item. + * @param {string} msg Error Msg. + * @since 3.0 + */ + function uploadError(target, msg) { + setImageTitle(target, msg); + setInProgress(false); + setStatus("error"); + setInactive(false); + console.warn(msg); + } + + /** + * Set the title attribute of target. + * + * @param {Element} target Clicked element. + * @param {string} msg Title message from JSON. + * @since 3.0 + */ + function setImageTitle(target, msg) { + target.setAttribute("title", msg); // Remove 'Click to upload...', set new value + } + + /** + * Displays the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function showEditScreen(e) { + e.preventDefault(); + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + + // Get all open edit screens and close them. + var openEdits = document.querySelectorAll(".edit-screen.editing"); + if (openEdits) { + openEdits.forEach(function (edit) { + edit.classList.remove("editing"); + }); + } + + // Show edit screen + editScreen.current.classList.add("editing"); + + // Set focus on edit screen + setTimeout(function () { + editScreen.current.focus({ + preventScroll: true + }); + }, 150); + } + + /** + * Handles the change event for the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function handleEditChange(e) { + var target = e.target.name; + switch (target) { + case "filename": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + filename: e.target.value + })); + break; + case "title": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + title: e.target.value + })); + break; + case "alt": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + alt: e.target.value + })); + break; + case "caption": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: e.target.value + })); + break; + } + } + + /** + * Handles the Upload event from the edit screen. + * + * @since 3.2 + */ + function uploadNow() { + editScreen.current.classList.remove("editing"); // Hide edit screen. + upload.current.click(); // Trigger click. + } + + /** + * Cancel event for the edit screen. + * + * @since 3.2 + */ + function cancelEdit() { + // Reset image state. + setImageDetails({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }); + + // Hide edit screen + editScreen.current.classList.remove("editing"); + + // Set focus back on photo. + upload.current.focus({ + preventScrol: true + }); + } + + /** + * Close the media modal after an action. + * + * @since 4.3 + */ + function closeMediaModal() { + var mediaModalEl = document.querySelector(".media-modal"); + if (mediaModalEl) { + var closeBtn = mediaModalEl.querySelector("button.media-modal-close"); + if (!closeBtn) { + return false; + } + closeBtn.click(); + } + } + + /** + * Handles adding attribution for images. + * + * @param {Element} e The target element. + * @since 4.5 + */ + function addAttribution(e) { + e.preventDefault(); + captionRef.current.value = imageAttribution; // Set form value. + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: imageAttribution + })); // Set caption state. + } + + return /*#__PURE__*/React.createElement("article", { + className: "photo", + ref: photo + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("photo-wrap", "photo-".concat(status)) + }, /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("button", { + className: "photo-upload", + ref: upload, + "data-id": id, + "data-url": full, + "data-filename": imageDetails.filename, + "data-title": imageDetails.title, + "data-alt": imageDetails.alt, + "data-caption": imageDetails.caption, + title: wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload, + onClick: function onClick() { + return download(); + } + }, /*#__PURE__*/React.createElement("img", { + src: thumb, + alt: alt, + className: status + })), /*#__PURE__*/React.createElement("div", { + className: "photo-controls" + }, /*#__PURE__*/React.createElement("a", { + target: "_blank", + className: "user fade", + href: user_url, + rel: "noopener noreferrer", + title: "".concat(instant_img_localize.view_all, " @ ").concat(user_name) + }, /*#__PURE__*/React.createElement("div", { + className: "user-wrap" + }, (user_photo === null || user_photo === void 0 ? void 0 : user_photo.length) > 0 && /*#__PURE__*/React.createElement("img", { + className: "user-wrap--photo", + src: user_photo, + alt: "" + }), user_name)), /*#__PURE__*/React.createElement("div", { + className: "photo-options" + }, blockSidebar && !editURL ? /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "set-featured fade", + "data-title": instant_img_localize.set_as_featured, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return setFeaturedImageClick(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-picture-o", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.set_as_featured)), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post))) : null, !!wpBlock && /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post)), editURL ? /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return editAfterUpload(); + }, + className: "edit-photo-admin fade", + "data-title": instant_img_localize.edit_upload, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-pencil", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_upload)) : /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return showEditScreen(e); + }, + className: "edit-photo fade", + "data-title": instant_img_localize.edit_details, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-cog", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_details)))), /*#__PURE__*/React.createElement("div", { + className: "photo-meta" + }, likes ? /*#__PURE__*/React.createElement("span", { + className: "likes tooltip--above", + "data-title": likes + " " + likeDisplay, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-heart heart-like", + "aria-hidden": "true" + }), " ", likes) : null, /*#__PURE__*/React.createElement("a", { + className: "tooltip--above", + href: permalink, + "data-title": "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)), + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + rel: "noopener noreferrer", + target: "_blank" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-external-link", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)))))), /*#__PURE__*/React.createElement("div", { + className: "edit-screen", + tabIndex: "0", + ref: editScreen + }, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--title" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", { + className: "heading" + }, instant_img_localize.edit_details), dimensions && dimensions.length > 0 && /*#__PURE__*/React.createElement("p", { + className: "dimensions" + }, dimensions)), /*#__PURE__*/React.createElement("div", { + className: "preview", + style: { + backgroundImage: "url(".concat(thumb, ")") + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_filename, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "filename", + "data-original": filename, + placeholder: imageDetails.filename, + value: imageDetails.filename, + onChange: function onChange(e) { + return handleEditChange(e); + } + }), /*#__PURE__*/React.createElement("em", null, ".", extension)), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_title, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "title", + "data-original": title, + placeholder: title, + value: imageDetails.title || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_alt, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "alt", + "data-original": alt, + value: imageDetails.alt || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_caption, ":"), /*#__PURE__*/React.createElement("textarea", { + rows: "4", + name: "caption", + "data-original": imageCaption, + onChange: function onChange(e) { + return handleEditChange(e); + }, + value: imageDetails.caption || "", + ref: captionRef + })), imageAttribution ? /*#__PURE__*/React.createElement("div", { + className: "add-attribution-row" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return addAttribution(e); + }, + type: "button" + }, instant_img_localize.attribution)) : null, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--controls" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick(e) { + return cancelEdit(e); + } + }, instant_img_localize.cancel), " ", "\xA0", /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-primary", + onClick: function onClick() { + return uploadNow(); + } + }, wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload_now))), /*#__PURE__*/React.createElement("div", { + className: "photo-status" + }))); +} + +/***/ }), + +/***/ "./src/js/components/ProviderIcons.js": +/*!********************************************!*\ + !*** ./src/js/components/ProviderIcons.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OpenverseIcon": () => (/* binding */ OpenverseIcon), +/* harmony export */ "PexelsIcon": () => (/* binding */ PexelsIcon), +/* harmony export */ "PixabayIcon": () => (/* binding */ PixabayIcon), +/* harmony export */ "UnsplashIcon": () => (/* binding */ UnsplashIcon), +/* harmony export */ "getProviderIcon": () => (/* binding */ getProviderIcon) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Return the provider icon. + * + * @param {string} provider The provider. + * @return {JSX.Element} The provider icon. + */ +function getProviderIcon(provider) { + if (!provider) { + return null; + } + return _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon ? _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon() : null; +} + +/** + * Unsplash Icon. + */ +function UnsplashIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z", + fill: "black" + })); +} + +/** + * Pixabay Icon. + */ +function PixabayIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("g", { + clipPath: "url(#clip0_307_143)" + }, /*#__PURE__*/React.createElement("path", { + d: "M0 0V32H32V0H0Z", + fill: "#48A947" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z", + fill: "#F9FBF9" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z", + fill: "#FAFCFA" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z", + fill: "#4AA949" + })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { + id: "clip0_307_143" + }, /*#__PURE__*/React.createElement("rect", { + width: "32", + height: "32", + fill: "white" + })))); +} + +/** + * Openverse Icon. + */ +function OpenverseIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z", + fill: "#000000" + })); +} + +/** + * Pexels Icon. + */ +function PexelsIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32px", + height: "32px", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z", + fill: "#05A081" + }), /*#__PURE__*/React.createElement("path", { + d: "M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z", + fill: "#fff" + })); +} + +/***/ }), + +/***/ "./src/js/components/ProviderNav.js": +/*!******************************************!*\ + !*** ./src/js/components/ProviderNav.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ProviderNav) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the ProviderNav component. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The ProviderNav component. + */ +function ProviderNav(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !!(providers !== null && providers !== void 0 && providers.length) && /*#__PURE__*/React.createElement("nav", { + className: "provider-nav" + }, providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("div", { + key: "provider-".concat(index) + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return switchProvider(item.toLowerCase()); + }, + className: provider === item.toLowerCase() ? "provider-nav--btn active" : "provider-nav--btn" + }, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_3__.getProviderIcon)(item), /*#__PURE__*/React.createElement("span", null, item), _constants_API__WEBPACK_IMPORTED_MODULE_2__.API[item.toLowerCase()]["new"] && /*#__PURE__*/React.createElement("span", { + className: "provider-nav--new" + }, instant_img_localize["new"]))); + }))); +} + +/***/ }), + +/***/ "./src/js/components/RestAPIError.js": +/*!*******************************************!*\ + !*** ./src/js/components/RestAPIError.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ RestAPIError) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + +/** + * Render the RestAPIError component. + * + * @return {JSX.Element} The RestAPIError component. + */ +function RestAPIError() { + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState2 = _slicedToArray(_useState, 2), + access = _useState2[0], + setAccess = _useState2[1]; + + /** + * Test users access to the REST API endpoint. + * + * @since 3.2 + */ + function test() { + var testURL = instant_img_localize.root + "instant-images/test/"; + var restAPITest = new XMLHttpRequest(); + restAPITest.open("POST", testURL, true); + restAPITest.setRequestHeader("X-WP-Nonce", instant_img_localize.nonce); + restAPITest.setRequestHeader("Content-Type", "application/json"); + restAPITest.send(); + restAPITest.onload = function () { + if (restAPITest.status >= 200 && restAPITest.status < 400) { + var response = JSON.parse(restAPITest.response); + var success = response.success; + if (!success) { + setAccess(false); + } + } else { + setAccess(false); + } + }; + restAPITest.onerror = function (errorMsg) { + console.warn(errorMsg); + setAccess(false); + }; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + test(); + }, []); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !access ? /*#__PURE__*/React.createElement("div", { + className: "error-messaging" + }, /*#__PURE__*/React.createElement("strong", null, instant_img_localize.error_restapi), instant_img_localize.error_restapi_desc) : null); +} + +/***/ }), + +/***/ "./src/js/components/Results.js": +/*!**************************************!*\ + !*** ./src/js/components/Results.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var Results = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + return /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_2__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_1__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Results); + +/***/ }), + +/***/ "./src/js/components/ResultsWPBlock.js": +/*!*********************************************!*\ + !*** ./src/js/components/ResultsWPBlock.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editor/block/components/Instructions */ "./src/js/editor/block/components/Instructions.js"); +/* harmony import */ var _editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/block/components/LoadMore */ "./src/js/editor/block/components/LoadMore.js"); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var ResultsWPBlock = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data, + _props$done = props.done, + done = _props$done === void 0 ? false : _props$done, + loadMorePhotos = props.loadMorePhotos; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (wpBlock) { + loadMorePhotos(); + } + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_5__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_4__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + }), /*#__PURE__*/React.createElement(_editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__["default"], { + done: done, + ref: loadMoreRef + })), /*#__PURE__*/React.createElement(_editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__["default"], { + show: data === null || data === void 0 ? void 0 : data.length + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResultsWPBlock); + +/***/ }), + +/***/ "./src/js/components/Sponsor.js": +/*!**************************************!*\ + !*** ./src/js/components/Sponsor.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Sponsor) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render the Sponsor component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Sponsor component. + */ +function Sponsor(props) { + var result = props.result; + var _result$data = result.data, + data = _result$data === void 0 ? null : _result$data; + var url = (data === null || data === void 0 ? void 0 : data.url) || ""; + var title = (data === null || data === void 0 ? void 0 : data.title) || ""; + var desc = (data === null || data === void 0 ? void 0 : data.description) || ""; + var avatar = (data === null || data === void 0 ? void 0 : data.avatar) || ""; + var _data$image = data.image, + image = _data$image === void 0 ? null : _data$image; + var _image$src = image.src, + src = _image$src === void 0 ? null : _image$src, + _image$alt = image.alt, + alt = _image$alt === void 0 ? null : _image$alt; + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var link = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, image && url ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("article", { + className: "photo feature", + title: desc, + ref: photo, + onClick: function onClick() { + return link.current.click(); + } + }, /*#__PURE__*/React.createElement("div", { + className: "photo--wrap" + }, /*#__PURE__*/React.createElement("span", { + className: "flag", + title: instant_img_localize.advertisement + }, instant_img_localize.ad), /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("a", { + className: "loaded", + href: url, + target: "_blank", + ref: link, + rel: "noreferrer" + }, /*#__PURE__*/React.createElement("img", { + src: src, + alt: alt + }))), /*#__PURE__*/React.createElement("div", { + className: "feature-title" + }, avatar && /*#__PURE__*/React.createElement("img", { + src: avatar, + alt: title + }), /*#__PURE__*/React.createElement("span", null, title)))) : null); +} + +/***/ }), + +/***/ "./src/js/components/Tooltip.js": +/*!**************************************!*\ + !*** ./src/js/components/Tooltip.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Tooltip) +/* harmony export */ }); +/** + * Render the Tooltip component. + * + * @return {JSX.Element} The Tooltip component. + */ +function Tooltip() { + return /*#__PURE__*/React.createElement("div", { + id: "tooltip" + }); +} + +/***/ }), + +/***/ "./src/js/components/cta/Extended.js": +/*!*******************************************!*\ + !*** ./src/js/components/cta/Extended.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ExtendedCTA": () => (/* binding */ ExtendedCTA), +/* harmony export */ "ExtendedSearchCTA": () => (/* binding */ ExtendedSearchCTA) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/* eslint-disable */ + +/** + * Generic CTA for the Extended add-on. + * + * @return {JSX.Element} The ExtendedCTA component. + */ +function ExtendedCTA() { + var _instant_img_localize3, _instant_img_localize4; + var _instant_img_localize = (_instant_img_localize3 = instant_img_localize) === null || _instant_img_localize3 === void 0 ? void 0 : (_instant_img_localize4 = _instant_img_localize3.addons) === null || _instant_img_localize4 === void 0 ? void 0 : _instant_img_localize4.extended, + _instant_img_localize2 = _instant_img_localize.activated, + activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2; + var name = "extended-cta-2024"; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) === "hide"), + _useState2 = _slicedToArray(_useState, 2), + dissmissed = _useState2[0], + setDismissed = _useState2[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setDismissed(true); + } + return /*#__PURE__*/React.createElement(React.Fragment, null, !activated && !dissmissed ? /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--standard" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-bullhorn", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, "Introducing the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), " ", "\u2192 An extension pack of premium features and functionality to enhance the Instant Images plugin."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")))) : null); +} + +/** + * CTA for the Extended add-on in the search dropdown. + * + * @param {Object} props The component props. + * @param {boolean} props.show Display the component. + * @return {JSX.Element} The ExtendedSearchCTA component. + */ +function ExtendedSearchCTA(_ref) { + var _ref$show = _ref.show, + show = _ref$show === void 0 ? false : _ref$show; + var name = "extended-cta-search-2024"; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) !== "hide"), + _useState4 = _slicedToArray(_useState3, 2), + active = _useState4[0], + setActive = _useState4[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setActive(false); + } + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history extended-cta", show && active ? "active" : null) + }, /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--search" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "closeBtn", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", { + className: "fa fa-magic", + "aria-hidden": "true" + }), "Enable search suggestions, history, and maintain current search term while switching providers with the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")))))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchForm.js": +/*!************************************************!*\ + !*** ./src/js/components/search/SearchForm.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useClickOutside */ "./src/js/hooks/useClickOutside.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _SearchHistory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SearchHistory */ "./src/js/components/search/SearchHistory.js"); +/* harmony import */ var _SearchToolTip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SearchToolTip */ "./src/js/components/search/SearchToolTip.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } + + + + + + + + + +/** + * Render the search form as a component. + * + * @return {JSX.Element} The SearchForm component. + */ +var SearchForm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) { + var _instant_img_localize4, _instant_img_localize5; + _objectDestructuringEmpty(_ref); + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + searchHandler = _usePluginContext.searchHandler, + apiError = _usePluginContext.apiError, + suggestions = _usePluginContext.suggestions, + getSuggestions = _usePluginContext.getSuggestions; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState2 = _slicedToArray(_useState, 2), + history = _useState2[0], + setHistory = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + show = _useState4[0], + setShow = _useState4[1]; + var historyRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + var submitBtnRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Handle clickoutside hook. + (0,_hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__.useClickOutside)(historyRef, function () { + setShow(false); + }); + + /** + * Set the search value in the form. + * + * @param {string} value The value to set. + */ + function setSearchValue(value) { + var input = ref === null || ref === void 0 ? void 0 : ref.current; + input.value = value; + submitBtnRef === null || submitBtnRef === void 0 ? void 0 : submitBtnRef.current.click(); + + // Set focus on input. + input.focus(); + } + + /** + * Search submit handler. + * + * @param {Event} e The event object. + */ + function formSubmit(e) { + var _ref$current; + e.preventDefault(); + var term = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.value; + if (term) { + searchHandler(e); + if (extended_license) { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSearchHistory)(term); + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + } + } + } + + /** + * Should the history div be shown? + * + * @return {boolean} Show history. + */ + function showHistory() { + return (history === null || history === void 0 ? void 0 : history.length) || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + }, []); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--search", apiError ? "inactive" : null) + }, /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return formSubmit(e); + }, + autoComplete: "off" + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "search-input", + className: "offscreen" + }, instant_img_localize.search_label), /*#__PURE__*/React.createElement("div", { + ref: historyRef + }, /*#__PURE__*/React.createElement("input", { + ref: ref, + type: "text", + id: "search-input", + placeholder: instant_img_localize.search, + disabled: apiError, + onChange: function onChange(e) { + return extended_license && getSuggestions(e.target.value); + }, + onFocus: function onFocus() { + return setShow(true); + } + }), extended_license && showHistory() ? + /*#__PURE__*/ + /* Extended: Show only with valid add-on license */ + React.createElement(_SearchHistory__WEBPACK_IMPORTED_MODULE_6__["default"], { + show: show, + history: history, + setHistory: setHistory, + setSearchValue: setSearchValue, + container: historyRef + }) : null, !extended_activated && + /*#__PURE__*/ + /* Extended: Show only when add-on not installed. */ + React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_5__.ExtendedSearchCTA, { + show: show + })), /*#__PURE__*/React.createElement("button", { + type: "submit", + disabled: apiError, + ref: submitBtnRef + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-search" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.search)), /*#__PURE__*/React.createElement(_SearchToolTip__WEBPACK_IMPORTED_MODULE_7__["default"], { + show: show + }))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchForm); + +/***/ }), + +/***/ "./src/js/components/search/SearchHeader.js": +/*!**************************************************!*\ + !*** ./src/js/components/search/SearchHeader.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHeader) +/* harmony export */ }); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the SearchHeader component. + * + * @return {JSX.Element} The SearchHeader component. + */ +function SearchHeader() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + search = _usePluginContext.search, + getPhotos = _usePluginContext.getPhotos, + filterSearch = _usePluginContext.filterSearch; + var _search$active = search.active, + active = _search$active === void 0 ? false : _search$active, + _search$term = search.term, + term = _search$term === void 0 ? "" : _search$term, + _search$results = search.results, + total = _search$results === void 0 ? 0 : _search$results; + var filters = _constants_filters__WEBPACK_IMPORTED_MODULE_0__.FILTERS[provider].search; + if (!active) { + // Exit if search is not active. + return null; + } + return /*#__PURE__*/React.createElement("header", { + className: "search-header" + }, /*#__PURE__*/React.createElement("h2", null, term.replace("id:", "ID: ")), /*#__PURE__*/React.createElement("div", { + className: "search-header--text" + }, "".concat(total, " ").concat(instant_img_localize.search_results), " ", /*#__PURE__*/React.createElement("strong", null, "".concat(term)), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getPhotos(); + } + }, instant_img_localize.clear_search)), filters && Object.entries(filters).length && /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters-wrap" + }, /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filters).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_1__["default"], { + key: "".concat(provider, "-search-").concat(key, "-").concat(index), + filterKey: key, + provider: provider, + data: filter, + handler: filterSearch + }); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchHistory.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchHistory.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHistory) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); + + + + + + + +/** + * The History list component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The SearchHistory component. + */ +function SearchHistory(props) { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.usePluginContext)(), + suggestions = _usePluginContext.suggestions; + var show = props.show, + history = props.history, + setHistory = props.setHistory, + setSearchValue = props.setSearchValue, + container = props.container; + var dropRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__.useArrowControls)(show, container); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history", show ? "active" : null), + role: "listbox", + ref: dropRef + }, !!suggestions.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Suggestions", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-suggestions" + }, suggestions.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + }))), !!history.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Recent Searches", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_4__.clearSearchHistory)(); + setHistory([]); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Clear", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-history" + }, history.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "history", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchToolTip.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchToolTip.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchToolTip) +/* harmony export */ }); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); + + + +/** + * Render the search results tooltip component. + * + * @return {JSX.Element} The SearchToolTip component. + */ +function SearchToolTip() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + getPhotos = _usePluginContext.getPhotos, + search = _usePluginContext.search; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_0___default()("control-nav--search-tooltip", search !== null && search !== void 0 && search.active ? null : "hide") + }, /*#__PURE__*/React.createElement("span", { + title: "".concat(search === null || search === void 0 ? void 0 : search.results, " ").concat(instant_img_localize.search_results, " ").concat(search === null || search === void 0 ? void 0 : search.term) + }, search === null || search === void 0 ? void 0 : search.results), /*#__PURE__*/React.createElement("button", { + type: "button", + title: instant_img_localize.clear_search, + onClick: function onClick() { + return getPhotos(true); + } + }, "x", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.clear_search))); +} + +/***/ }), + +/***/ "./src/js/constants/API.js": +/*!*********************************!*\ + !*** ./src/js/constants/API.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "API": () => (/* binding */ API) +/* harmony export */ }); +/* harmony import */ var _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ProviderIcons */ "./src/js/components/ProviderIcons.js"); + +var API = { + proxy: "https://proxy.getinstantimages.com/api/" || 0, + // eslint-disable-line + testmode: false, + defaults: { + provider: "unsplash", + order: "latest", + per_page: "20", + arr_key: "results" + }, + providers: ["Unsplash", "Openverse", "Pixabay", "Pexels"], + unsplash: { + name: "Unsplash", + requires_key: true, + "new": false, + api_var: "client_id", + collections_api: "https://api.unsplash.com/collections/", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.UnsplashIcon + }, + pixabay: { + name: "Pixabay", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PixabayIcon + }, + pexels: { + name: "Pexels", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PexelsIcon + }, + openverse: { + name: "Openverse", + requires_key: false, + "new": false, + api_var: "key", + key: "", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.OpenverseIcon + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters.js": +/*!*************************************!*\ + !*** ./src/js/constants/filters.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "FILTERS": () => (/* binding */ FILTERS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _filters_openverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters/openverse */ "./src/js/constants/filters/openverse.js"); +/* harmony import */ var _filters_pexels__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/pexels */ "./src/js/constants/filters/pexels.js"); +/* harmony import */ var _filters_pixabay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filters/pixabay */ "./src/js/constants/filters/pixabay.js"); +/* harmony import */ var _filters_unsplash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filters/unsplash */ "./src/js/constants/filters/unsplash.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + + + + +var ALL = { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("All", "instant-images"), + value: "all" +}; +var FILTERS = { + openverse: { + filters: { + source: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Source", "instant-images"), + "default": "wordpress", + filters: _toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_SOURCES) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + } + }, + search: { + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photograph", "instant-images"), + value: "photograph" + }] + }, + extension: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Extension", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_EXTENSIONS)) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + }, + license: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("License", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_LICENSES)) + }, + license_type: { + label: "license_type", + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Commercial", "instant-images"), + value: "commercial" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Modification", "instant-images"), + value: "modification" + }] + } + } + }, + pexels: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "curated", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Curated", "instant-images"), + value: "curated" + }] + } + }, + search: { + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_COLORS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + } + } + }, + unsplash: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "latest", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Oldest", "instant-images"), + value: "oldest" + }] + } + }, + search: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "relevance", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Relevance", "instant-images"), + value: "relevance" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_COLORS)) + } + } + }, + pixabay: { + filters: { + order: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "popular", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Category", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_CATS)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + }, + search: { + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + } + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters/openverse.js": +/*!***********************************************!*\ + !*** ./src/js/constants/filters/openverse.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OPENVERSE_EXTENSIONS": () => (/* binding */ OPENVERSE_EXTENSIONS), +/* harmony export */ "OPENVERSE_LICENSES": () => (/* binding */ OPENVERSE_LICENSES), +/* harmony export */ "OPENVERSE_ORIENTATIONS": () => (/* binding */ OPENVERSE_ORIENTATIONS), +/* harmony export */ "OPENVERSE_SOURCES": () => (/* binding */ OPENVERSE_SOURCES) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var OPENVERSE_SOURCES = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("WordPress", "instant-images"), + value: "wordpress" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Flickr", "instant-images"), + value: "flickr" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nasa", "instant-images"), + value: "nasa" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("SpaceX", "instant-images"), + value: "spacex" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wikimedia", "instant-images"), + value: "wikimedia" +}]; +var OPENVERSE_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "square" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Tall", "instant-images"), + value: "tall" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wide", "instant-images"), + value: "wide" +}]; +var OPENVERSE_EXTENSIONS = [{ + label: "JPG", + value: "JPG" +}, { + label: "GIF", + value: "GIF" +}, { + label: "PNG", + value: "PNG" +}, { + label: "SVG", + value: "SVG" +}]; +var OPENVERSE_LICENSES = [{ + label: "BY", + value: "BY" +}, { + label: "BY-NC", + value: "BY-NC" +}, { + label: "BY-NC-ND", + value: "BY-NC-ND" +}, { + label: "BY-NC-SA", + value: "BY-NC-SA" +}, { + label: "BY-ND", + value: "BY-ND" +}, { + label: "BY-SA", + value: "BY-SA" +}, { + label: "CC0", + value: "CC0" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pexels.js": +/*!********************************************!*\ + !*** ./src/js/constants/filters/pexels.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PEXELS_COLORS": () => (/* binding */ PEXELS_COLORS), +/* harmony export */ "PEXELS_ORIENTATIONS": () => (/* binding */ PEXELS_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PEXELS_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Violet", "instant-images"), + value: "violet" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}]; +var PEXELS_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pixabay.js": +/*!*********************************************!*\ + !*** ./src/js/constants/filters/pixabay.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PIXABAY_CATS": () => (/* binding */ PIXABAY_CATS), +/* harmony export */ "PIXABAY_COLORS": () => (/* binding */ PIXABAY_COLORS), +/* harmony export */ "PIXABAY_IMAGE_TYPE": () => (/* binding */ PIXABAY_IMAGE_TYPE), +/* harmony export */ "PIXABAY_ORIENTATIONS": () => (/* binding */ PIXABAY_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PIXABAY_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grayscale", "instant-images"), + value: "grayscale" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Lilac", "instant-images"), + value: "lilac" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transparent", "instant-images"), + value: "transparent" +}]; +var PIXABAY_CATS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Backgrounds", "instant-images"), + value: "backgrounds" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Fashion", "instant-images"), + value: "fashion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nature", "instant-images"), + value: "nature" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Science", "instant-images"), + value: "science" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Education", "instant-images"), + value: "education" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Feelings", "instant-images"), + value: "feelings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Health", "instant-images"), + value: "health" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("People", "instant-images"), + value: "people" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Religion", "instant-images"), + value: "religion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Places", "instant-images"), + value: "places" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Animals", "instant-images"), + value: "animals" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Industry", "instant-images"), + value: "industry" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Computer", "instant-images"), + value: "computer" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sports", "instant-images"), + value: "sports" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transportation", "instant-images"), + value: "transportation" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Travel", "instant-images"), + value: "travel" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Buildings", "instant-images"), + value: "buildings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Business", "instant-images"), + value: "business" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Music", "instant-images"), + value: "music" +}]; +var PIXABAY_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Horizontal", "instant-images"), + value: "horizontal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vertical", "instant-images"), + value: "vertical" +}]; +var PIXABAY_IMAGE_TYPE = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photo", "instant-images"), + value: "photo" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vector", "instant-images"), + value: "vector" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/unsplash.js": +/*!**********************************************!*\ + !*** ./src/js/constants/filters/unsplash.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "UNSPLASH_COLORS": () => (/* binding */ UNSPLASH_COLORS), +/* harmony export */ "UNSPLASH_ORIENTATIONS": () => (/* binding */ UNSPLASH_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var UNSPLASH_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black & White", "instant-images"), + value: "black_and_white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Purple", "instant-images"), + value: "purple" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Magenta", "instant-images"), + value: "magenta" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Teal", "instant-images"), + value: "teal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}]; +var UNSPLASH_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/editor/block/components/Header.js": +/*!**************************************************!*\ + !*** ./src/js/editor/block/components/Header.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockHeader) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the block header. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The BlockHeader component. + */ +function BlockHeader(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + + /** + * Switch the provider via select. + * + * @param {string} value The provider value. + */ + function providerChange(value) { + if (value) { + switchProvider(value); + } + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header" + }, /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-logo" + }, /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_3__.IconLogo, null), /*#__PURE__*/React.createElement("span", null, "Instant Images")), /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-nav" + }, /*#__PURE__*/React.createElement("label", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images")), /*#__PURE__*/React.createElement("select", { + defaultValue: provider, + onChange: function onChange(e) { + return providerChange(e.target.value); + } + }, /*#__PURE__*/React.createElement("option", { + value: "" + }, "-- ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images"), " --"), providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("option", { + key: index, + value: item.toLowerCase() + }, item); + })))); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/Help.js": +/*!************************************************!*\ + !*** ./src/js/editor/block/components/Help.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockHelp) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render help instructions for the WP Block. + * + * @return {JSX.Element} The BlockHelp component. + */ +function BlockHelp() { + return /*#__PURE__*/React.createElement("div", { + style: { + width: "300px", + padding: "0 10px" + } + }, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("strong", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Instant Images Help", "instant-images"))), /*#__PURE__*/React.createElement("ol", null, /*#__PURE__*/React.createElement("li", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Browse photos from the various stock image providers.", "instant-images")), /*#__PURE__*/React.createElement("li", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select/click an image to immediately start the upload process.", "instant-images")), /*#__PURE__*/React.createElement("li", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Uploaded image will be inserted directly into the post using the WordPress core Image block.", "instant-images")))); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/Instructions.js": +/*!********************************************************!*\ + !*** ./src/js/editor/block/components/Instructions.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockInstructions) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render instructional text for the WP Block. + * + * @param {Object} props The component props. + * @return {JSX.Element} The BlockInstructions component. + */ +function BlockInstructions(props) { + var _props$show = props.show, + show = _props$show === void 0 ? false : _props$show; + if (!show) { + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--instructions" + }, /*#__PURE__*/React.createElement("span", null, "\u2190"), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Scroll to Load Images", "instant-images"), /*#__PURE__*/React.createElement("span", null, "\u2192")); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/LoadMore.js": +/*!****************************************************!*\ + !*** ./src/js/editor/block/components/LoadMore.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Render the BlockLoadMore component. + * + * @return {JSX.Element} The BlockLoadMore component. + */ +var BlockLoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("instant-images-block--loader", done ? "done" : null), + ref: ref + }); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockLoadMore); + +/***/ }), + +/***/ "./src/js/editor/utils/insertImage.js": +/*!********************************************!*\ + !*** ./src/js/editor/utils/insertImage.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ insertImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Insert an image block into the block editor. + * + * @param {Object} attachment The attachment object. + * @param {string} clientId The block ID. + */ +function insertImage(attachment, clientId) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id, + _attachment$url = attachment.url, + url = _attachment$url === void 0 ? null : _attachment$url, + _attachment$caption = attachment.caption, + caption = _attachment$caption === void 0 ? "" : _attachment$caption, + _attachment$alt = attachment.alt, + alt = _attachment$alt === void 0 ? "" : _attachment$alt; + if (!url || !id) { + return; + } + + // Create block. + var block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)("core/image", { + id: id, + url: url, + caption: caption, + alt: alt + }); + if (clientId) { + // Replace the Instant Images block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").replaceBlock(clientId, block); + } else { + // Insert Image block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").insertBlocks(block); + } +} + +/***/ }), + +/***/ "./src/js/editor/utils/setFeaturedImage.js": +/*!*************************************************!*\ + !*** ./src/js/editor/utils/setFeaturedImage.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ setFeaturedImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Set image as featured image in Gutenberg. + * + * @param {Object} attachment The attachment object. + */ +function setFeaturedImage(attachment) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id; + if (!id) { + return; + } + + // Set the featured image. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/editor").editPost({ + featured_media: id + }); + + // Open the document sidebar. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/edit-post").openGeneralSidebar("edit-post/document"); +} + +/***/ }), + +/***/ "./src/js/functions/buildURL.js": +/*!**************************************!*\ + !*** ./src/js/functions/buildURL.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "buildTestURL": () => (/* binding */ buildTestURL), +/* harmony export */ "default": () => (/* binding */ buildURL), +/* harmony export */ "getProxyURL": () => (/* binding */ getProxyURL) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _providers_openverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers/openverse */ "./src/js/functions/providers/openverse.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + + + +/** + * Build the API query parameters. + * + * @param {string} type The query type (search, photos, id). + * @param {Object} params The current params object. + * @return {string} The new API URL with querystring params. + */ +function buildURL(type, params) { + if (!type) { + // Bail early if API query type is missing. + return ""; + } + // Get the current provider. + var _params = params, + _params$provider = _params.provider, + provider = _params$provider === void 0 ? "unsplash" : _params$provider; + + // Provider doesn't need to be sent. + delete params.provider; + + // Set Openverse params. + params = provider === "openverse" ? (0,_providers_openverse__WEBPACK_IMPORTED_MODULE_2__.openverseParams)(type, params) : params; + + // Build the API URL. + var url = new URL(getProxyURL(provider)); + + // Add `type` to params. + url.searchParams.append("type", type); + + // Append query params. + Object.keys(params).forEach(function (key) { + url.searchParams.append(key, params[key]); + }); + + // Add `version` to params. + url.searchParams.append("version", instant_img_localize.version); + return url === null || url === void 0 ? void 0 : url.href; +} + +/** + * Get the proxy URL from ENV vars. + * + * @param {string} provider The image provider. + * @return {string} The proxy URL. + */ +function getProxyURL(provider) { + var _API$proxy = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.proxy, + proxy = _API$proxy === void 0 ? "https://proxy.getinstantimages.com/api/" : _API$proxy; + return "".concat(proxy).concat(provider); +} + +/** + * Build a API testing URL. + * + * @param {string} provider The current service provider. + * @return {string} The API URL. + */ +function buildTestURL(provider) { + var options = { + per_page: 5, + page: 1 + }; + + // Build URL. + var params = _objectSpread(_objectSpread({ + test: true + }, (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__["default"])(provider)), options); + return buildURL("photos", params); +} + +/***/ }), + +/***/ "./src/js/functions/consoleStatus.js": +/*!*******************************************!*\ + !*** ./src/js/functions/consoleStatus.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ consoleStatus) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _getErrorMessage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getErrorMessage */ "./src/js/functions/getErrorMessage.js"); + + + +/** + * Display a console.warn message about API status. + * + * @param {string} provider The API service provider. + * @param {string} status The API status. + */ +function consoleStatus(provider) { + var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; + var local = instant_img_localize; + var message = (0,_getErrorMessage__WEBPACK_IMPORTED_MODULE_1__["default"])(status); + switch (status) { + case 400: + case 401: + case 500: + // Unsplash/Pixabay/Pexels incorrect API key + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/generateAttribution.js": +/*!*************************************************!*\ + !*** ./src/js/functions/generateAttribution.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ generateAttribution) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + +/** + * Get the API URL for searches by ID. + * + * @param {string} text Attribution hook content. + * @param {string} provider Image provider. + * @param {string} permalink Image url. + * @param {Object} user The user data. + * @return {string} The raw attribution HTML. + */ +function generateAttribution(text, provider, permalink, user) { + if (!text || !provider || !permalink || !user) { + return text; + } + + // Get user data. + var username = user.name, + user_url = user.url; + + // Format provider data. + var provider_url = instant_img_localize["".concat(provider, "_url")]; + var provider_name = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider); + + // Generate attribution template. + var attribution = text; + attribution = attribution.replace("{username}", username); + attribution = attribution.replace("{user_url}", user_url); + attribution = attribution.replace("{image_url}", permalink); + attribution = attribution.replace("{provider_url}", provider_url); + attribution = attribution.replace("{provider}", provider_name); + return attribution; +} + +/***/ }), + +/***/ "./src/js/functions/getErrorMessage.js": +/*!*********************************************!*\ + !*** ./src/js/functions/getErrorMessage.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getErrorMessage) +/* harmony export */ }); +/** + * Get the correct error message by status code. + * + * @param {string} status The API status. + */ +function getErrorMessage() { + var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200; + var local = instant_img_localize; + switch (status) { + case 400: + case 401: + // Unsplash/Pixabay/Pexels incorrect API key. + return local.api_invalid_msg; + case 403: + return local.api_invalid_403_msg; + case 404: + return local.api_invalid_404_msg; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + return local.api_ratelimit_msg; + case 500: + case 503: + // Internal server error. + return local.api_invalid_500_msg; + case 501: + // Missing params. + return local.api_invalid_501_msg; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/getProvider.js": +/*!*****************************************!*\ + !*** ./src/js/functions/getProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getProvider) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Get the default provider on page load. + * + * @return {string} The default service provider. + */ +function getProvider() { + return instant_img_localize && instant_img_localize.default_provider ? instant_img_localize.default_provider : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.provider; +} + +/***/ }), + +/***/ "./src/js/functions/getQueryParams.js": +/*!********************************************!*\ + !*** ./src/js/functions/getQueryParams.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getQueryParams), +/* harmony export */ "getAuth": () => (/* binding */ getAuth), +/* harmony export */ "getContentSafety": () => (/* binding */ getContentSafety) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + +// eslint-disable + +/** + * Build the API query parameters + * + * @param {string} provider The current service provider. + * @param {Object} queryParams Optional query parameters to append to base params. + * @return {Object} Parameters used for the fetch request. + */ +function getQueryParams(provider, queryParams) { + if (!provider) { + return {}; + } + + // Construct per page amount. + var per_page = queryParams && queryParams.id ? 1 : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.per_page; + + // Set default params. + var params = { + provider: provider, + per_page: per_page + }; + + // Append additional params. + params = getContentSafety(params, provider); + params = _objectSpread(_objectSpread({}, params), queryParams); + params = getAuth(params, provider); + + /** + * Display query params in the browser console. + * + * Global plugin hook. + */ + if (instant_img_localize.query_debug) { + console.table(params); + } + return params; +} + +/** + * Get auth keys and append to API query request. + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The auth parameter object. + */ +function getAuth(params, provider) { + var has_auth = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].requires_key; + if (!has_auth || !provider) { + return params; + } + var app_id = instant_img_localize["".concat(provider, "_app_id")]; + if (app_id) { + // Pass API keys if not using defaults. + params[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].api_var] = app_id; + } + return params; +} + +/** + * Set the photo safety for indicating that only images suitable for all ages should be returned. + * + * @see https://unsplash.com/documentation#content-safety + * @see https://pixabay.com/api/docs/ + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The fetch parameters object. + */ +function getContentSafety(params, provider) { + switch (provider) { + case "unsplash": + if (instant_img_localize.unsplash_content_filter) { + params.content_filter = instant_img_localize.unsplash_content_filter; + } + break; + case "pixabay": + if (instant_img_localize.pixabay_safesearch) { + params.safesearch = "true"; + } + break; + case "openverse": + if (instant_img_localize.openverse_mature) { + params.mature = "true"; + } + break; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/getResults.js": +/*!****************************************!*\ + !*** ./src/js/functions/getResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getResults), +/* harmony export */ "getResultById": () => (/* binding */ getResultById), +/* harmony export */ "getSearchTotal": () => (/* binding */ getSearchTotal) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Pluck `results` from the API response. + * + * @param {Object} data The API results object. + * @return {Array} The results as an array. + */ +function getResults(data) { + if (!data) { + return []; + } + var results = data[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.arr_key] || []; + return results; +} + +/** + * Get the total search results. + * + * @param {Object} data The search data object. + * @return {string} The total results. + */ +function getSearchTotal(data) { + // Return 0 if undefined or null. + return data.total === undefined || data.total === null ? 0 : data.total; +} + +/** + * Get results by photo ID. + * + * @param {string} provider The current service provider. + * @param {string} key The match key to access. + * @param {Object} data The API results object. + * @return {Array} The results as an array. + * @deprecated 5.0 + */ +function getResultById(provider, key, data) { + if (!data) { + return []; + } + var result = []; + switch (provider) { + case "unsplash": + case "pexels": + result = data || []; + break; + case "pixabay": + result = data[key] && data[key][0] ? data[key][0] : []; + break; + } + return result; +} + +/***/ }), + +/***/ "./src/js/functions/helpers.js": +/*!*************************************!*\ + !*** ./src/js/functions/helpers.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "capitalizeFirstLetter": () => (/* binding */ capitalizeFirstLetter), +/* harmony export */ "checkRateLimit": () => (/* binding */ checkRateLimit), +/* harmony export */ "gotoURL": () => (/* binding */ gotoURL), +/* harmony export */ "hideTooltip": () => (/* binding */ hideTooltip), +/* harmony export */ "isObjectEmpty": () => (/* binding */ isObjectEmpty), +/* harmony export */ "md5Hash": () => (/* binding */ md5Hash), +/* harmony export */ "showTooltip": () => (/* binding */ showTooltip) +/* harmony export */ }); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js"); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Get the MD5 hash value of a URL. + * + * @param {string} url The API URL to hash. + * @return {string} The MD5 hash. + */ +function md5Hash(url) { + return crypto_js__WEBPACK_IMPORTED_MODULE_0___default().MD5(url).toString(); +} + +/** + * Check if an object is empty. + * + * @param {Object} obj The object to test against. + * @return {boolean} Is this an object. + */ +function isObjectEmpty(obj) { + if (obj === null || obj === undefined) { + return true; + } + return Object.keys(obj).length === 0; +} + +/** + * Check the `x-ratelimit-remaining` headers to confirm the API is available. + * + * @param {Object} headers The request headers object. + */ +function checkRateLimit(headers) { + if (!headers) { + return; + } + var limit = headers.get("X-RateLimit-Limit") || -1; + var remaining = headers.get("X-RateLimit-Remaining") || -1; + if (limit > -1 && parseInt(remaining) < 2) { + alert(instant_img_localize.api_ratelimit_msg); // eslint-disable-line + } +} + +/** + * Capitalize the first letter of a string. + * + * @param {string} str The string to format. + * @return {string} The formatted string. + */ +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +var tooltipInterval = ""; + +/** + * Show the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function showTooltip(e) { + var target = e.currentTarget; + var rect = target.getBoundingClientRect(); + var left = Math.round(rect.left); + var top = Math.round(rect.top); + var container = target.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); + if (target.classList.contains("tooltip--above")) { + tooltip.classList.add("above"); + } else { + tooltip.classList.remove("above"); + } + + // Delay Tooltip Reveal. + tooltipInterval = setInterval(function () { + clearInterval(tooltipInterval); + tooltip.innerHTML = target.dataset.title; // Tooltip content. + + // Position Tooltip. + left = left - tooltip.offsetWidth + target.offsetWidth + 5; + tooltip.style.left = "".concat(left, "px"); + tooltip.style.top = "".concat(top, "px"); + setTimeout(function () { + tooltip.classList.add("over"); + }, 25); + }, 750); +} + +/** + * Hide the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function hideTooltip(e) { + clearInterval(tooltipInterval); + var container = e.currentTarget.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); +} + +/** + * Open the URL in new window. + * + * @param {string} url The destination URL. + */ +function gotoURL(url) { + if (url && window) { + window.open(url, "_blank"); + } +} + +/***/ }), + +/***/ "./src/js/functions/localStorage.js": +/*!******************************************!*\ + !*** ./src/js/functions/localStorage.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clearSearchHistory": () => (/* binding */ clearSearchHistory), +/* harmony export */ "getSearchHistory": () => (/* binding */ getSearchHistory), +/* harmony export */ "getSetting": () => (/* binding */ getSetting), +/* harmony export */ "saveSearchHistory": () => (/* binding */ saveSearchHistory), +/* harmony export */ "saveSettings": () => (/* binding */ saveSettings) +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var searchName = "instant-images-recent-searches"; +var settingsName = "instant-images-settings"; +var most = 10; + +/** + * Save search value to localstorage. + * + * @param {string} term The search term. + */ +function saveSearchHistory(term) { + var recent = getSearchHistory(); + if (!recent) { + localStorage.setItem(searchName, JSON.stringify([term])); + return; + } + + // Find duplicates. + var duplicate = recent.indexOf(term); + if (duplicate > -1) { + recent.splice(duplicate, 1); + } + + // Limit to 6 items. + if (recent.length >= most) { + recent.length = most; + } + + // Add new term to the beginning of the array. + recent.unshift(term); + localStorage.setItem(searchName, JSON.stringify(recent)); +} + +/** + * Get the search history from localstorage. + * + * @return {Array} The search history. + */ +function getSearchHistory() { + var history = localStorage.getItem(searchName); + if (!history) { + return []; + } + return JSON.parse(localStorage.getItem(searchName)); +} + +/** + * Clear search history. + */ +function clearSearchHistory() { + localStorage.removeItem(searchName); +} + +/** + * Save generic setting to localstorage as an key/value object pair. + * + * @param {string} key The object key. + * @param {value} value The object value. + */ +function saveSettings(key, value) { + var settings = localStorage.getItem(settingsName); + var setting = _defineProperty({}, key, value); + if (!settings) { + localStorage.setItem(settingsName, JSON.stringify(setting)); + } else { + var parsed = JSON.parse(settings); + parsed[key] = value; + localStorage.setItem(settingsName, JSON.stringify(parsed)); + } +} + +/** + * Get an individual setting from local storage. + * + * @param {string} key The stoarge key. + * @return {string|boolean} The storage value. + */ +function getSetting(key) { + var settings = localStorage.getItem(settingsName); + if (!settings) { + return false; + } + var parsed = JSON.parse(settings); + return parsed[key] ? parsed[key] : false; +} + +/***/ }), + +/***/ "./src/js/functions/providers/openverse.js": +/*!*************************************************!*\ + !*** ./src/js/functions/providers/openverse.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "openverseParams": () => (/* binding */ openverseParams) +/* harmony export */ }); +/* harmony import */ var _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters/openverse */ "./src/js/constants/filters/openverse.js"); + + +/** + * Format the params for Openverse. + * + * @param {string} type Query type (search, photos, id). + * @param {Object} params Query params object. + * @return {Object} Updated params. + */ +function openverseParams(type, params) { + if (type === "photos" && !params.source) { + params.source = "wordpress"; // Add `wordpress` as the default openverse `source`. + } + + if (type === "search") { + // Include these sources only. + var sources = _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__.OPENVERSE_SOURCES.map(function (source) { + return source.value; + }).toString(); // e.g. `wordpress,flickr,nasa,spacex,wikimedia` + params.source = sources; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/providers/unsplash.js": +/*!************************************************!*\ + !*** ./src/js/functions/providers/unsplash.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "unsplashDownload": () => (/* binding */ unsplashDownload) +/* harmony export */ }); +/* harmony import */ var _buildURL__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getQueryParams */ "./src/js/functions/getQueryParams.js"); + + + +/** + * Function to trigger an image download at unsplash.com. + * Note: This is used to give authors download credits and nothing more. + * + * @see https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download + * + * @param {string} download_url The URL to trigger a download. + * @since 3.1 + */ +function unsplashDownload(download_url) { + var params = (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__.getAuth)({}, "unsplash"); + params.download_url = download_url; // Append download URL to query params. + var url = (0,_buildURL__WEBPACK_IMPORTED_MODULE_0__["default"])("photos", params); + fetch(url).then(function (data) { + return data.json(); + }).then(function () { + // Success, nothing else happens here + console.log("Image download successsfully triggered at Unsplash."); // eslint-disable-line no-console + })["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/functions/session.js": +/*!*************************************!*\ + !*** ./src/js/functions/session.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "deleteSession": () => (/* binding */ deleteSession), +/* harmony export */ "getSession": () => (/* binding */ getSession), +/* harmony export */ "saveSession": () => (/* binding */ saveSession) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + + +/** + * Get results from session storage by URL. + * + * @param {string} url The API URL. + * @return {Array|boolean} Session results. + */ +function getSession(url) { + if (!url || _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.testmode) { + return false; // Exit if no URL or test mode is enabled. + } + + var session = sessionStorage.getItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); + if (!session) { + return false; // Exit if no session data. + } + + var data = JSON.parse(session); + var _data$expires = data.expires, + expires = _data$expires === void 0 ? 0 : _data$expires, + _data$error = data.error, + error = _data$error === void 0 ? null : _data$error; + if (error) { + return false; // Exit if session data has error entry. + } + + // Check if expiration time has passed. + var expired = Date.now() > expires; + + // Delete session data when expired. + if (expired) { + deleteSession(url); + } + return data && !expired ? data : false; +} + +/** + * Save API data to session storage by URL. + * + * @param {string} url Save results to session by URL. + * @param {Array} results The API results. + */ +function saveSession(url, results) { + if (!url || !results || results !== null && results !== void 0 && results.error) { + return false; + } + // Set expiration to 1 hour. + results.expires = Date.now() + 3600000; + + // Save session data. + sessionStorage.setItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url), JSON.stringify(results)); +} + +/** + * Remove/delete session storage by URL. + * + * @param {string} url The API URL. + */ +function deleteSession(url) { + if (!url) { + return false; + } + sessionStorage.removeItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); +} + +/***/ }), + +/***/ "./src/js/functions/updatePluginSetting.js": +/*!*************************************************!*\ + !*** ./src/js/functions/updatePluginSetting.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ updatePluginSetting) +/* harmony export */ }); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); + + +/** + * Update plugin settings by specific key/value pair. + * + * @param {string} setting The previous provider. + * @param {string} value The value to save. + */ +function updatePluginSetting(setting, value) { + var _instant_img_localize; + var api = ((_instant_img_localize = instant_img_localize) === null || _instant_img_localize === void 0 ? void 0 : _instant_img_localize.root) + "instant-images/settings/"; // eslint-disable-line no-undef + + var params = { + setting: setting, + value: value + }; + var config = { + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + // eslint-disable-line no-undef + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_0__["default"].post(api, JSON.stringify(params), config).then(function () {})["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/hooks/useArrowControls.js": +/*!******************************************!*\ + !*** ./src/js/hooks/useArrowControls.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useArrowControls": () => (/* binding */ useArrowControls) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + +/** + * Detect up and down arrow presses. + * + * @param {boolean} active Is the element currently active. + * @param {Object} ref The container ref to select the focusable elements. + */ +function useArrowControls(active, ref) { + var focusedRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(active); + + /** + * Add event listener for arrow keys. + * + * @param {KeyboardEvent} e The event. + */ + function arrowHandler(e) { + var key = e.key; + if (focusedRef !== null && focusedRef !== void 0 && focusedRef.current && ref !== null && ref !== void 0 && ref.current) { + var focusable = ref === null || ref === void 0 ? void 0 : ref.current.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input"); + if (!(focusable !== null && focusable !== void 0 && focusable.length)) { + // Exit if no focusable elements. + return; + } + var first = focusable[0]; + var last = focusable[focusable.length - 1]; + var _active = document.activeElement; // eslint-disable-line + var activeIndex = _toConsumableArray(focusable).indexOf(_active); + + // Up arrow. + if (key === "ArrowUp") { + e.preventDefault(); + if (activeIndex === 0) { + last.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex - 1].focus({ + preventScroll: true + }); + } + } + // Down Arrow + if (key === "ArrowDown") { + e.preventDefault(); + if (activeIndex === focusable.length - 1 || activeIndex === -1) { + first.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex + 1].focus({ + preventScroll: true + }); + } + } + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + focusedRef.current = active; + }, [active]); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + document.addEventListener("keydown", arrowHandler, false); + return function () { + // Dispose of events. + document.removeEventListener("keydown", arrowHandler, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./src/js/hooks/useClickOutside.js": +/*!*****************************************!*\ + !*** ./src/js/hooks/useClickOutside.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useClickOutside": () => (/* binding */ useClickOutside) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Detect clicks outside of ref. + * + * @param {Object} ref React ref. + * @param {Function} onClickOutside Function to invoke when clicked outside. + */ +function useClickOutside(ref, onClickOutside) { + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escapeClick(e) { + var key = e.key; + if (key === "Escape") { + onClickOutside(); + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + /** + * Invoke Function onClick outside of element + * + * @param {Event} event The event object. + */ + function handleClickOutside(event) { + if (ref.current && !ref.current.contains(event.target)) { + onClickOutside(); + } + } + + // Bind events. + document.addEventListener("mousedown", handleClickOutside); + document.addEventListener("keyup", handleClickOutside); + document.addEventListener("keydown", escapeClick, false); + return function () { + // Dispose of events. + document.removeEventListener("mousedown", handleClickOutside); + document.removeEventListener("keyup", handleClickOutside); + document.removeEventListener("keydown", escapeClick, false); + }; + }, [ref, onClickOutside]); //eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./node_modules/classnames/index.js": +/*!******************************************!*\ + !*** ./node_modules/classnames/index.js ***! + \******************************************/ +/***/ ((module, exports) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + var nativeCodeString = '[native code]'; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { + classes.push(arg.toString()); + continue; + } + + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + + +/***/ }), + +/***/ "./node_modules/crypto-js/aes.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/aes.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; + } + } + + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; + + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; + + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); + + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + var t; + + // Skip reset of nRounds has been set before and key did not change + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + // Shortcuts + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6; + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; + + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + + // Key schedule row counter + var ksRow = 4; + + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + + keySize: 256/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); + }()); + + + return CryptoJS.AES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/cipher-core.js": +/*!***********************************************!*\ + !*** ./node_modules/crypto-js/cipher-core.js ***! + \***********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher core components. + */ + CryptoJS.lib.Cipher || (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; + + // Set initial values + this.reset(); + }, + + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-cipher logic + this._doReset(); + }, + + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); + + // Process available blocks + return this._process(); + }, + + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } + + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + + keySize: 128/32, + + ivSize: 128/32, + + _ENC_XFORM_MODE: 1, + + _DEC_XFORM_MODE: 2, + + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); + + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); + + return finalProcessedBlocks; + }, + + blockSize: 1 + }); + + /** + * Mode namespace. + */ + var C_mode = C.mode = {}; + + /** + * Abstract base block cipher mode template. + */ + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); + + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + var block; + + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }()); + + /** + * Padding namespace. + */ + var C_pad = C.pad = {}; + + /** + * PKCS #5/7 padding strategy. + */ + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + + // Add padding + data.concat(padding); + }, + + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + /** + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) + */ + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + + reset: function () { + var modeCreator; + + // Reset cipher + Cipher.reset.call(this); + + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + modeCreator = mode.createDecryptor; + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } + + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, + + _doFinalize: function () { + var finalProcessedBlocks; + + // Shortcut + var padding = this.cfg.padding; + + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); + + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + + // Unpad data + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + + blockSize: 128/32 + }); + + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); + }, + + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + + /** + * Format namespace. + */ + var C_format = C.format = {}; + + /** + * OpenSSL formatting strategy. + */ + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + var wordArray; + + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + // Format + if (salt) { + wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + var salt; + + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); + + // Shortcut + var ciphertextWords = ciphertext.words; + + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + salt = WordArray.create(ciphertextWords.slice(2, 4)); + + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; + + /** + * A cipher wrapper that returns ciphertext as a serializable cipher params object. + */ + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + + // Shortcut + var cipherCfg = encryptor.cfg; + + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + + return plaintext; + }, + + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; + + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); + } + + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); + } + }; + + /** + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. + */ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + + // Mix in derived params + ciphertext.mixIn(derivedParams); + + return ciphertext; + }, + + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + + return plaintext; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/core.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/core.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(); + } + else {} +}(this, function () { + + /*globals window, global, require*/ + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + + var crypto; + + // Native crypto from window (Browser) + if (typeof window !== 'undefined' && window.crypto) { + crypto = window.crypto; + } + + // Native crypto in web worker (Browser) + if (typeof self !== 'undefined' && self.crypto) { + crypto = self.crypto; + } + + // Native crypto from worker + if (typeof globalThis !== 'undefined' && globalThis.crypto) { + crypto = globalThis.crypto; + } + + // Native (experimental IE 11) crypto from window (Browser) + if (!crypto && typeof window !== 'undefined' && window.msCrypto) { + crypto = window.msCrypto; + } + + // Native crypto from global (NodeJS) + if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { + crypto = __webpack_require__.g.crypto; + } + + // Native crypto import via require (NodeJS) + if (!crypto && "function" === 'function') { + try { + crypto = __webpack_require__(/*! crypto */ "?9157"); + } catch (err) {} + } + + /* + * Cryptographically secure pseudorandom number generator + * + * As Math.random() is cryptographically not safe to use + */ + var cryptoSecureRandomInt = function () { + if (crypto) { + // Use getRandomValues method (Browser) + if (typeof crypto.getRandomValues === 'function') { + try { + return crypto.getRandomValues(new Uint32Array(1))[0]; + } catch (err) {} + } + + // Use randomBytes method (NodeJS) + if (typeof crypto.randomBytes === 'function') { + try { + return crypto.randomBytes(4).readInt32LE(); + } catch (err) {} + } + } + + throw new Error('Native crypto module could not be used to get secure random number.'); + }; + + /* + * Local polyfill of Object.create + + */ + var create = Object.create || (function () { + function F() {} + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()); + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var j = 0; j < thatSigBytes; j += 4) { + thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + var processedWords; + + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/enc-base64.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + + return CryptoJS.enc.Base64; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64url.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/enc-base64url.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64url encoding strategy. + */ + var Base64url = C_enc.Base64url = { + /** + * Converts a word array to a Base64url string. + * + * @param {WordArray} wordArray The word array. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {string} The Base64url string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); + */ + stringify: function (wordArray, urlSafe=true) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = urlSafe ? this._safe_map : this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64url string to a word array. + * + * @param {string} base64Str The Base64url string. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64url.parse(base64String); + */ + parse: function (base64Str, urlSafe=true) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = urlSafe ? this._safe_map : this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + return CryptoJS.enc.Base64url; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-utf16.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/enc-utf16.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * UTF-16 BE encoding strategy. + */ + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + /** + * UTF-16 LE encoding strategy. + */ + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + function swapEndian(word) { + return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); + } + }()); + + + return CryptoJS.enc.Utf16; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/evpkdf.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/evpkdf.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + + /** + * This key derivation function is meant to conform with EVP_BytesToKey. + * www.openssl.org/docs/crypto/EVP_BytesToKey.html + */ + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: MD5, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + var block; + + // Shortcut + var cfg = this.cfg; + + // Init hasher + var hasher = cfg.hasher.create(); + + // Initial values + var derivedKey = WordArray.create(); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + block = hasher.update(password).finalize(salt); + hasher.reset(); + + // Iterations + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.EvpKDF(password, salt); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.EvpKDF; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/format-hex.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/format-hex.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + + var HexFormatter = C_format.Hex = { + /** + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The hexadecimally encoded string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); + */ + stringify: function (cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + + /** + * Converts a hexadecimally encoded ciphertext string to a cipher params object. + * + * @param {string} input The hexadecimally encoded string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.Hex.parse(hexString); + */ + parse: function (input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext: ciphertext }); + } + }; + }()); + + + return CryptoJS.format.Hex; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/hmac.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/hmac.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/crypto-js/index.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./lib-typedarrays */ "./node_modules/crypto-js/lib-typedarrays.js"), __webpack_require__(/*! ./enc-utf16 */ "./node_modules/crypto-js/enc-utf16.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./enc-base64url */ "./node_modules/crypto-js/enc-base64url.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./sha224 */ "./node_modules/crypto-js/sha224.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"), __webpack_require__(/*! ./sha384 */ "./node_modules/crypto-js/sha384.js"), __webpack_require__(/*! ./sha3 */ "./node_modules/crypto-js/sha3.js"), __webpack_require__(/*! ./ripemd160 */ "./node_modules/crypto-js/ripemd160.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"), __webpack_require__(/*! ./pbkdf2 */ "./node_modules/crypto-js/pbkdf2.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"), __webpack_require__(/*! ./mode-cfb */ "./node_modules/crypto-js/mode-cfb.js"), __webpack_require__(/*! ./mode-ctr */ "./node_modules/crypto-js/mode-ctr.js"), __webpack_require__(/*! ./mode-ctr-gladman */ "./node_modules/crypto-js/mode-ctr-gladman.js"), __webpack_require__(/*! ./mode-ofb */ "./node_modules/crypto-js/mode-ofb.js"), __webpack_require__(/*! ./mode-ecb */ "./node_modules/crypto-js/mode-ecb.js"), __webpack_require__(/*! ./pad-ansix923 */ "./node_modules/crypto-js/pad-ansix923.js"), __webpack_require__(/*! ./pad-iso10126 */ "./node_modules/crypto-js/pad-iso10126.js"), __webpack_require__(/*! ./pad-iso97971 */ "./node_modules/crypto-js/pad-iso97971.js"), __webpack_require__(/*! ./pad-zeropadding */ "./node_modules/crypto-js/pad-zeropadding.js"), __webpack_require__(/*! ./pad-nopadding */ "./node_modules/crypto-js/pad-nopadding.js"), __webpack_require__(/*! ./format-hex */ "./node_modules/crypto-js/format-hex.js"), __webpack_require__(/*! ./aes */ "./node_modules/crypto-js/aes.js"), __webpack_require__(/*! ./tripledes */ "./node_modules/crypto-js/tripledes.js"), __webpack_require__(/*! ./rc4 */ "./node_modules/crypto-js/rc4.js"), __webpack_require__(/*! ./rabbit */ "./node_modules/crypto-js/rabbit.js"), __webpack_require__(/*! ./rabbit-legacy */ "./node_modules/crypto-js/rabbit-legacy.js")); + } + else {} +}(this, function (CryptoJS) { + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/lib-typedarrays.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/lib-typedarrays.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Check if typed arrays are supported + if (typeof ArrayBuffer != 'function') { + return; + } + + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + + // Reference original init + var superInit = WordArray.init; + + // Augment WordArray.init to handle typed arrays + var subInit = WordArray.init = function (typedArray) { + // Convert buffers to uint8 + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + + // Convert other array views to uint8 + if ( + typedArray instanceof Int8Array || + (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || + typedArray instanceof Int16Array || + typedArray instanceof Uint16Array || + typedArray instanceof Int32Array || + typedArray instanceof Uint32Array || + typedArray instanceof Float32Array || + typedArray instanceof Float64Array + ) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + + // Handle Uint8Array + if (typedArray instanceof Uint8Array) { + // Shortcut + var typedArrayByteLength = typedArray.byteLength; + + // Extract bytes + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + } + + // Initialize this word array + superInit.call(this, words, typedArrayByteLength); + } else { + // Else call normal init + superInit.apply(this, arguments); + } + }; + + subInit.prototype = WordArray; + }()); + + + return CryptoJS.lib.WordArray; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/md5.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/md5.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcuts + var H = this._hash.words; + + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + + // Working varialbes + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); + + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); + + + return CryptoJS.MD5; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-cfb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-cfb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher Feedback block mode. + */ + CryptoJS.mode.CFB = (function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + + CFB.Encryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + CFB.Decryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var keystream; + + // Shortcut + var iv = this._iv; + + // Generate keystream + if (iv) { + keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + + return CFB; + }()); + + + return CryptoJS.mode.CFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr-gladman.js": +/*!****************************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr-gladman.js ***! + \****************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = (function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + + function incWord(word) + { + if (((word >> 24) & 0xff) === 0xff) { //overflow + var b1 = (word >> 16)&0xff; + var b2 = (word >> 8)&0xff; + var b3 = word & 0xff; + + if (b1 === 0xff) // overflow b1 + { + b1 = 0; + if (b2 === 0xff) + { + b2 = 0; + if (b3 === 0xff) + { + b3 = 0; + } + else + { + ++b3; + } + } + else + { + ++b2; + } + } + else + { + ++b1; + } + + word = 0; + word += (b1 << 16); + word += (b2 << 8); + word += b3; + } + else + { + word += (0x01 << 24); + } + return word; + } + + function incCounter(counter) + { + if ((counter[0] = incWord(counter[0])) === 0) + { + // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 + counter[1] = incWord(counter[1]); + } + return counter; + } + + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + + incCounter(counter); + + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTRGladman.Decryptor = Encryptor; + + return CTRGladman; + }()); + + + + + return CryptoJS.mode.CTRGladman; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Counter block mode. + */ + CryptoJS.mode.CTR = (function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Increment counter + counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTR.Decryptor = Encryptor; + + return CTR; + }()); + + + return CryptoJS.mode.CTR; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ecb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ecb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + + return ECB; + }()); + + + return CryptoJS.mode.ECB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ofb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ofb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Output Feedback block mode. + */ + CryptoJS.mode.OFB = (function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + + // Generate keystream + if (iv) { + keystream = this._keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + OFB.Decryptor = Encryptor; + + return OFB; + }()); + + + return CryptoJS.mode.OFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-ansix923.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-ansix923.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ANSI X.923 padding strategy. + */ + CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Ansix923; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso10126.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso10126.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO 10126 padding strategy. + */ + CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Iso10126; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso97971.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso97971.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO/IEC 9797-1 Padding Method 2. + */ + CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); + + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } + }; + + + return CryptoJS.pad.Iso97971; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-nopadding.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/pad-nopadding.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * A noop padding strategy. + */ + CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } + }; + + + return CryptoJS.pad.NoPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-zeropadding.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/pad-zeropadding.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Zero padding strategy. + */ + CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + + unpad: function (data) { + // Shortcut + var dataWords = data.words; + + // Unpad + var i = data.sigBytes - 1; + for (var i = data.sigBytes - 1; i >= 0; i--) { + if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + data.sigBytes = i + 1; + break; + } + } + } + }; + + + return CryptoJS.pad.ZeroPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pbkdf2.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/pbkdf2.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; + + /** + * Password-Based Key Derivation Function 2 algorithm. + */ + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA1 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: SHA1, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + // Shortcut + var cfg = this.cfg; + + // Init HMAC + var hmac = HMAC.create(cfg.hasher, password); + + // Initial values + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + + // Shortcuts + var blockWords = block.words; + var blockWordsLength = blockWords.length; + + // Iterations + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + + // Shortcut + var intermediateWords = intermediate.words; + + // XOR intermediate with block + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + + derivedKey.concat(block); + blockIndexWords[0]++; + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.PBKDF2(password, salt); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.PBKDF2; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit-legacy.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/rabbit-legacy.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm. + * + * This is a legacy version that neglected to convert the key to little-endian. + * This error doesn't affect the cipher's security, + * but it does affect its compatibility with other implementations. + */ + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); + */ + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + }()); + + + return CryptoJS.RabbitLegacy; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/rabbit.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Swap endian + for (var i = 0; i < 4; i++) { + K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | + (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); + } + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); + }()); + + + return CryptoJS.Rabbit; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rc4.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/rc4.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + /** + * RC4 stream cipher algorithm. + */ + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + + // Init sbox + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; + } + + // Key setup + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + // Counters + this._i = this._j = 0; + }, + + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + + keySize: 256/32, + + ivSize: 0 + }); + + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; + + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } + + // Update counters + this._i = i; + this._j = j; + + return keystreamWord; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); + + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + + _doReset: function () { + RC4._doReset.call(this); + + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + }()); + + + return CryptoJS.RC4; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/ripemd160.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/ripemd160.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var _zl = WordArray.create([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); + var _zr = WordArray.create([ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); + var _sl = WordArray.create([ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); + var _sr = WordArray.create([ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); + + var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); + + /** + * RIPEMD160 hash algorithm. + */ + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, + + _doProcessBlock: function (M, offset) { + + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + // Shortcut + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 5; i++) { + // Shortcut + var H_i = H[i]; + + // Swap + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + + function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); + + } + + function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); + } + + function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); + } + + function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); + } + + function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); + + } + + function rotl(x,n) { + return (x<>>(32-n)); + } + + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.RIPEMD160('message'); + * var hash = CryptoJS.RIPEMD160(wordArray); + */ + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacRIPEMD160(message, key); + */ + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + }(Math)); + + + return CryptoJS.RIPEMD160; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha1.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha1.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + return CryptoJS.SHA1; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha224.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha224.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); + }, + + _doFinalize: function () { + var hash = SHA256._doFinalize.call(this); + + hash.sigBytes -= 4; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); + */ + C.SHA224 = SHA256._createHelper(SHA224); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); + */ + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + }()); + + + return CryptoJS.SHA224; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha256.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha256.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); + + + return CryptoJS.SHA256; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha3.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha3.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + + // Constants tables + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + + // Compute Constants + (function () { + // Compute rho offset constants + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; + + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + + // Compute pi index constants + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + } + } + + // Compute round constants + var LFSR = 0x01; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else /* if (bitPosition >= 32) */ { + roundConstantMsw ^= 1 << (bitPosition - 32); + } + } + + // Compute next LFSR + if (LFSR & 0x80) { + // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 + LFSR = (LFSR << 1) ^ 0x71; + } else { + LFSR <<= 1; + } + } + + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + }()); + + // Reusable objects for temporary values + var T = []; + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + }()); + + /** + * SHA-3 hash algorithm. + */ + var SHA3 = C_algo.SHA3 = Hasher.extend({ + /** + * Configuration options. + * + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 + */ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + + _doReset: function () { + var state = this._state = [] + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + + // Absorb + for (var i = 0; i < nBlockSizeLanes; i++) { + // Shortcuts + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + + // Swap endian + M2i = ( + (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | + (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) + ); + M2i1 = ( + (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | + (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) + ); + + // Absorb message into state + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + + // Rounds + for (var round = 0; round < 24; round++) { + // Theta + for (var x = 0; x < 5; x++) { + // Mix column lanes + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + + // Temporary values + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + // Shortcuts + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + + // Mix surrounding columns + var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); + var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + + // Rho Pi + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var tMsw; + var tLsw; + + // Shortcuts + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + + // Rotate lanes + if (rhoOffset < 32) { + tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); + tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); + } else /* if (rhoOffset >= 32) */ { + tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); + tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); + } + + // Transpose lanes + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + + // Rho pi at x = y = 0 + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + + // Chi + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + // Shortcuts + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[((x + 1) % 5) + 5 * y]; + var Tx2Lane = T[((x + 2) % 5) + 5 * y]; + + // Mix rows + lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); + lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); + } + } + + // Iota + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + } + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); + dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + + // Squeeze + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + // Shortcuts + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + + // Swap endian + laneMsw = ( + (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | + (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) + ); + laneLsw = ( + (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | + (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) + ); + + // Squeeze state to retrieve hash + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + // Return final computed hash + return new WordArray.init(hashWords, outputLengthBytes); + }, + + clone: function () { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA3('message'); + * var hash = CryptoJS.SHA3(wordArray); + */ + C.SHA3 = Hasher._createHelper(SHA3); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA3(message, key); + */ + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + }(Math)); + + + return CryptoJS.SHA3; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha384.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha384.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + + /** + * SHA-384 hash algorithm. + */ + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), + new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), + new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), + new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); + */ + C.SHA384 = SHA512._createHelper(SHA384); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + }()); + + + return CryptoJS.SHA384; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha512.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha512.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; + + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); + + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), + new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), + new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), + new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; + + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + // Rounds + for (var i = 0; i < 80; i++) { + var Wil; + var Wih; + + // Shortcut + var Wi = W[i]; + + // Extend message + if (i < 16) { + Wih = Wi.high = M[offset + i * 2] | 0; + Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + + Wil = gamma0l + Wi7l; + Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + Wil = Wil + gamma1l; + Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + Wil = Wil + Wi16l; + Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + var hash = this._hash.toX32(); + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + }()); + + + return CryptoJS.SHA512; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/tripledes.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/tripledes.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Permuted Choice 1 constants + var PC1 = [ + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, 27, 19, 11, 3, + 60, 52, 44, 36, 63, 55, 47, 39, + 31, 23, 15, 7, 62, 54, 46, 38, + 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 + ]; + + // Permuted Choice 2 constants + var PC2 = [ + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 + ]; + + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; + + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; + + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } + + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; + + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; + + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } + + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } + + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + + keySize: 64/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); + + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + // Make sure the key length is valid (64, 128 or >= 192 bit) + if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { + throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); + } + + // Extend the key according to the keying options defined in 3DES standard + var key1 = keyWords.slice(0, 2); + var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); + var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); + + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(key1)); + this._des2 = DES.createEncryptor(WordArray.create(key2)); + this._des3 = DES.createEncryptor(WordArray.create(key3)); + }, + + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + + keySize: 192/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); + }()); + + + return CryptoJS.TripleDES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/x64-core.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/x64-core.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + + /** + * x64 namespace. + */ + var C_x64 = C.x64 = {}; + + /** + * A 64-bit word. + */ + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function (high, low) { + this.high = high; + this.low = low; + } + + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + + // return X64Word.create(high, low); + // } + }); + + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; + + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + + // Clone "words" array + var words = clone.words = this.words.slice(0); + + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); + }()); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/desandro-matches-selector/matches-selector.js": +/*!********************************************************************!*\ + !*** ./node_modules/desandro-matches-selector/matches-selector.js ***! + \********************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * matchesSelector v2.0.2 + * matchesSelector( element, '.selector' ) + * MIT license + */ + +/*jshint browser: true, strict: true, undef: true, unused: true */ + +( function( window, factory ) { + /*global define: false, module: false */ + 'use strict'; + // universal module definition + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory() { + 'use strict'; + + var matchesMethod = ( function() { + var ElemProto = window.Element.prototype; + // check for the standard method name first + if ( ElemProto.matches ) { + return 'matches'; + } + // check un-prefixed + if ( ElemProto.matchesSelector ) { + return 'matchesSelector'; + } + // check vendor prefixes + var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; + + for ( var i=0; i < prefixes.length; i++ ) { + var prefix = prefixes[i]; + var method = prefix + 'MatchesSelector'; + if ( ElemProto[ method ] ) { + return method; + } + } + })(); + + return function matchesSelector( elem, selector ) { + return elem[ matchesMethod ]( selector ); + }; + +})); + + +/***/ }), + +/***/ "./node_modules/ev-emitter/ev-emitter.js": +/*!***********************************************!*\ + !*** ./node_modules/ev-emitter/ev-emitter.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * EvEmitter v2.1.1 + * Lil' event emitter + * MIT License + */ + +( function( global, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS - Browserify, Webpack + module.exports = factory(); + } else { + // Browser globals + global.EvEmitter = factory(); + } + +}( typeof window != 'undefined' ? window : this, function() { + +function EvEmitter() {} + +let proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // set events hash + let events = this._events = this._events || {}; + // set listeners array + let listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( !listeners.includes( listener ) ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + let onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + let index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + // copy over to avoid interference if .off() in listener + listeners = listeners.slice( 0 ); + args = args || []; + // once stuff + let onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( let listener of listeners ) { + let isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; + return this; +}; + +return EvEmitter; + +} ) ); + + +/***/ }), + +/***/ "./node_modules/fizzy-ui-utils/utils.js": +/*!**********************************************!*\ + !*** ./node_modules/fizzy-ui-utils/utils.js ***! + \**********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Fizzy UI utils v2.0.7 + * MIT license + */ + +/*jshint browser: true, undef: true, unused: true, strict: true */ + +( function( window, factory ) { + // universal module definition + /*jshint strict: false */ /*globals define, module, require */ + + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! desandro-matches-selector/matches-selector */ "./node_modules/desandro-matches-selector/matches-selector.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) { + return factory( window, matchesSelector ); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, matchesSelector ) { + +'use strict'; + +var utils = {}; + +// ----- extend ----- // + +// extends objects +utils.extend = function( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +}; + +// ----- modulo ----- // + +utils.modulo = function( num, div ) { + return ( ( num % div ) + div ) % div; +}; + +// ----- makeArray ----- // + +var arraySlice = Array.prototype.slice; + +// turn element or nodeList into an array +utils.makeArray = function( obj ) { + if ( Array.isArray( obj ) ) { + // use object if already an array + return obj; + } + // return empty array if undefined or null. #6 + if ( obj === null || obj === undefined ) { + return []; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { + // convert nodeList to array + return arraySlice.call( obj ); + } + + // array of single index + return [ obj ]; +}; + +// ----- removeFrom ----- // + +utils.removeFrom = function( ary, obj ) { + var index = ary.indexOf( obj ); + if ( index != -1 ) { + ary.splice( index, 1 ); + } +}; + +// ----- getParent ----- // + +utils.getParent = function( elem, selector ) { + while ( elem.parentNode && elem != document.body ) { + elem = elem.parentNode; + if ( matchesSelector( elem, selector ) ) { + return elem; + } + } +}; + +// ----- getQueryElement ----- // + +// use element as selector string +utils.getQueryElement = function( elem ) { + if ( typeof elem == 'string' ) { + return document.querySelector( elem ); + } + return elem; +}; + +// ----- handleEvent ----- // + +// enable .ontype to trigger from .addEventListener( elem, 'type' ) +utils.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +// ----- filterFindElements ----- // + +utils.filterFindElements = function( elems, selector ) { + // make array of elems + elems = utils.makeArray( elems ); + var ffElems = []; + + elems.forEach( function( elem ) { + // check that elem is an actual element + if ( !( elem instanceof HTMLElement ) ) { + return; + } + // add elem if no selector + if ( !selector ) { + ffElems.push( elem ); + return; + } + // filter & find items if we have a selector + // filter + if ( matchesSelector( elem, selector ) ) { + ffElems.push( elem ); + } + // find children + var childElems = elem.querySelectorAll( selector ); + // concat childElems to filterFound array + for ( var i=0; i < childElems.length; i++ ) { + ffElems.push( childElems[i] ); + } + }); + + return ffElems; +}; + +// ----- debounceMethod ----- // + +utils.debounceMethod = function( _class, methodName, threshold ) { + threshold = threshold || 100; + // original method + var method = _class.prototype[ methodName ]; + var timeoutName = methodName + 'Timeout'; + + _class.prototype[ methodName ] = function() { + var timeout = this[ timeoutName ]; + clearTimeout( timeout ); + + var args = arguments; + var _this = this; + this[ timeoutName ] = setTimeout( function() { + method.apply( _this, args ); + delete _this[ timeoutName ]; + }, threshold ); + }; +}; + +// ----- docReady ----- // + +utils.docReady = function( callback ) { + var readyState = document.readyState; + if ( readyState == 'complete' || readyState == 'interactive' ) { + // do async to allow for other scripts to run. metafizzy/flickity#441 + setTimeout( callback ); + } else { + document.addEventListener( 'DOMContentLoaded', callback ); + } +}; + +// ----- htmlInit ----- // + +// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ +utils.toDashed = function( str ) { + return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { + return $1 + '-' + $2; + }).toLowerCase(); +}; + +var console = window.console; +/** + * allow user to initialize classes via [data-namespace] or .js-namespace class + * htmlInit( Widget, 'widgetName' ) + * options are parsed from data-namespace-options + */ +utils.htmlInit = function( WidgetClass, namespace ) { + utils.docReady( function() { + var dashedNamespace = utils.toDashed( namespace ); + var dataAttr = 'data-' + dashedNamespace; + var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); + var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); + var elems = utils.makeArray( dataAttrElems ) + .concat( utils.makeArray( jsDashElems ) ); + var dataOptionsAttr = dataAttr + '-options'; + var jQuery = window.jQuery; + + elems.forEach( function( elem ) { + var attr = elem.getAttribute( dataAttr ) || + elem.getAttribute( dataOptionsAttr ); + var options; + try { + options = attr && JSON.parse( attr ); + } catch ( error ) { + // log error, do not initialize + if ( console ) { + console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + + ': ' + error ); + } + return; + } + // initialize + var instance = new WidgetClass( elem, options ); + // make available via $().data('namespace') + if ( jQuery ) { + jQuery.data( elem, namespace, instance ); + } + }); + + }); +}; + +// ----- ----- // + +return utils; + +})); + + +/***/ }), + +/***/ "./node_modules/get-size/get-size.js": +/*!*******************************************!*\ + !*** ./node_modules/get-size/get-size.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * getSize v2.0.3 + * measure size of elements + * MIT license + */ + +/* jshint browser: true, strict: true, undef: true, unused: true */ +/* globals console: false */ + +( function( window, factory ) { + /* jshint strict: false */ /* globals define, module */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +})( window, function factory() { +'use strict'; + +// -------------------------- helpers -------------------------- // + +// get a number from a string, not a percentage +function getStyleSize( value ) { + var num = parseFloat( value ); + // not a percent like '100%', and a number + var isValid = value.indexOf('%') == -1 && !isNaN( num ); + return isValid && num; +} + +function noop() {} + +var logError = typeof console == 'undefined' ? noop : + function( message ) { + console.error( message ); + }; + +// -------------------------- measurements -------------------------- // + +var measurements = [ + 'paddingLeft', + 'paddingRight', + 'paddingTop', + 'paddingBottom', + 'marginLeft', + 'marginRight', + 'marginTop', + 'marginBottom', + 'borderLeftWidth', + 'borderRightWidth', + 'borderTopWidth', + 'borderBottomWidth' +]; + +var measurementsLength = measurements.length; + +function getZeroSize() { + var size = { + width: 0, + height: 0, + innerWidth: 0, + innerHeight: 0, + outerWidth: 0, + outerHeight: 0 + }; + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + size[ measurement ] = 0; + } + return size; +} + +// -------------------------- getStyle -------------------------- // + +/** + * getStyle, get style of element, check for Firefox bug + * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + */ +function getStyle( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + logError( 'Style returned ' + style + + '. Are you running this code in a hidden iframe on Firefox? ' + + 'See https://bit.ly/getsizebug1' ); + } + return style; +} + +// -------------------------- setup -------------------------- // + +var isSetup = false; + +var isBoxSizeOuter; + +/** + * setup + * check isBoxSizerOuter + * do on first getSize() rather than on page load for Firefox bug + */ +function setup() { + // setup once + if ( isSetup ) { + return; + } + isSetup = true; + + // -------------------------- box sizing -------------------------- // + + /** + * Chrome & Safari measure the outer-width on style.width on border-box elems + * IE11 & Firefox<29 measures the inner-width + */ + var div = document.createElement('div'); + div.style.width = '200px'; + div.style.padding = '1px 2px 3px 4px'; + div.style.borderStyle = 'solid'; + div.style.borderWidth = '1px 2px 3px 4px'; + div.style.boxSizing = 'border-box'; + + var body = document.body || document.documentElement; + body.appendChild( div ); + var style = getStyle( div ); + // round value for browser zoom. desandro/masonry#928 + isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; + getSize.isBoxSizeOuter = isBoxSizeOuter; + + body.removeChild( div ); +} + +// -------------------------- getSize -------------------------- // + +function getSize( elem ) { + setup(); + + // use querySeletor if elem is string + if ( typeof elem == 'string' ) { + elem = document.querySelector( elem ); + } + + // do not proceed on non-objects + if ( !elem || typeof elem != 'object' || !elem.nodeType ) { + return; + } + + var style = getStyle( elem ); + + // if hidden, everything is 0 + if ( style.display == 'none' ) { + return getZeroSize(); + } + + var size = {}; + size.width = elem.offsetWidth; + size.height = elem.offsetHeight; + + var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; + + // get all measurements + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + var value = style[ measurement ]; + var num = parseFloat( value ); + // any 'auto', 'medium' value will be 0 + size[ measurement ] = !isNaN( num ) ? num : 0; + } + + var paddingWidth = size.paddingLeft + size.paddingRight; + var paddingHeight = size.paddingTop + size.paddingBottom; + var marginWidth = size.marginLeft + size.marginRight; + var marginHeight = size.marginTop + size.marginBottom; + var borderWidth = size.borderLeftWidth + size.borderRightWidth; + var borderHeight = size.borderTopWidth + size.borderBottomWidth; + + var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; + + // overwrite width and height if we can get it from style + var styleWidth = getStyleSize( style.width ); + if ( styleWidth !== false ) { + size.width = styleWidth + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); + } + + var styleHeight = getStyleSize( style.height ); + if ( styleHeight !== false ) { + size.height = styleHeight + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); + } + + size.innerWidth = size.width - ( paddingWidth + borderWidth ); + size.innerHeight = size.height - ( paddingHeight + borderHeight ); + + size.outerWidth = size.width + marginWidth; + size.outerHeight = size.height + marginHeight; + + return size; +} + +return getSize; + +}); + + +/***/ }), + +/***/ "./node_modules/imagesloaded/imagesloaded.js": +/*!***************************************************!*\ + !*** ./node_modules/imagesloaded/imagesloaded.js ***! + \***************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/*! + * imagesLoaded v5.0.0 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS + module.exports = factory( window, __webpack_require__(/*! ev-emitter */ "./node_modules/ev-emitter/ev-emitter.js") ); + } else { + // browser global + window.imagesLoaded = factory( window, window.EvEmitter ); + } + +} )( typeof window !== 'undefined' ? window : this, + function factory( window, EvEmitter ) { + +let $ = window.jQuery; +let console = window.console; + +// -------------------------- helpers -------------------------- // + +// turn element or nodeList into an array +function makeArray( obj ) { + // use object if already an array + if ( Array.isArray( obj ) ) return obj; + + let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + // convert nodeList to array + if ( isArrayLike ) return [ ...obj ]; + + // array of single index + return [ obj ]; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {[Array, Element, NodeList, String]} elem + * @param {[Object, Function]} options - if function, use as callback + * @param {Function} onAlways - callback function + * @returns {ImagesLoaded} + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + let queryElem = elem; + if ( typeof elem == 'string' ) { + queryElem = document.querySelectorAll( elem ); + } + // bail if bad element + if ( !queryElem ) { + console.error(`Bad element for imagesLoaded ${queryElem || elem}`); + return; + } + + this.elements = makeArray( queryElem ); + this.options = {}; + // shift arguments if no options set + if ( typeof options == 'function' ) { + onAlways = options; + } else { + Object.assign( this.options, options ); + } + + if ( onAlways ) this.on( 'always', onAlways ); + + this.getImages(); + // add jQuery Deferred object + if ( $ ) this.jqDeferred = new $.Deferred(); + + // HACK check async to allow time to bind listeners + setTimeout( this.check.bind( this ) ); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +const elementNodeTypes = [ 1, 9, 11 ]; + +/** + * @param {Node} elem + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName === 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + let { nodeType } = elem; + if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return; + + let childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( let img of childImgs ) { + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + let children = elem.querySelectorAll( this.options.background ); + for ( let child of children ) { + this.addElementBackgroundImages( child ); + } + } +}; + +const reURL = /url\((['"])?(.*?)\1\)/gi; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + let style = getComputedStyle( elem ); + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + if ( !style ) return; + + // get url inside url("...") + let matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + let url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + let loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + let background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + /* eslint-disable-next-line func-style */ + let onProgress = ( image, elem, message ) => { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( () => { + this.progress( image, elem, message ); + } ); + }; + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + } ); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount === this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( `progress: ${message}`, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + let eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + // add crossOrigin attribute. #204 + if ( this.img.crossOrigin ) { + this.proxyImage.crossOrigin = this.img.crossOrigin; + } + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.currentSrc || this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + // check for non-zero, non-undefined naturalWidth + // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 + return this.img.complete && this.img.naturalWidth; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + let { parentNode } = this.img; + // emit progress with parent or self + let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img; + this.emitEvent( 'progress', [ this, elem, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + let method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) return; + + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, onAlways ) { + let instance = new ImagesLoaded( this, options, onAlways ); + return instance.jqDeferred.promise( $( this ) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +} ); + + +/***/ }), + +/***/ "./node_modules/masonry-layout/masonry.js": +/*!************************************************!*\ + !*** ./node_modules/masonry-layout/masonry.js ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Masonry v4.2.2 + * Cascading grid layout library + * https://masonry.desandro.com + * MIT License + * by David DeSandro + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /*globals define, module, require */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! outlayer/outlayer */ "./node_modules/outlayer/outlayer.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( Outlayer, getSize ) { + +'use strict'; + +// -------------------------- masonryDefinition -------------------------- // + + // create an Outlayer layout class + var Masonry = Outlayer.create('masonry'); + // isFitWidth -> fitWidth + Masonry.compatOptions.fitWidth = 'isFitWidth'; + + var proto = Masonry.prototype; + + proto._resetLayout = function() { + this.getSize(); + this._getMeasurement( 'columnWidth', 'outerWidth' ); + this._getMeasurement( 'gutter', 'outerWidth' ); + this.measureColumns(); + + // reset column Y + this.colYs = []; + for ( var i=0; i < this.cols; i++ ) { + this.colYs.push( 0 ); + } + + this.maxY = 0; + this.horizontalColIndex = 0; + }; + + proto.measureColumns = function() { + this.getContainerWidth(); + // if columnWidth is 0, default to outerWidth of first item + if ( !this.columnWidth ) { + var firstItem = this.items[0]; + var firstItemElem = firstItem && firstItem.element; + // columnWidth fall back to item of first element + this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth || + // if first elem has no width, default to size of container + this.containerWidth; + } + + var columnWidth = this.columnWidth += this.gutter; + + // calculate columns + var containerWidth = this.containerWidth + this.gutter; + var cols = containerWidth / columnWidth; + // fix rounding errors, typically with gutters + var excess = columnWidth - containerWidth % columnWidth; + // if overshoot is less than a pixel, round up, otherwise floor it + var mathMethod = excess && excess < 1 ? 'round' : 'floor'; + cols = Math[ mathMethod ]( cols ); + this.cols = Math.max( cols, 1 ); + }; + + proto.getContainerWidth = function() { + // container is parent if fit width + var isFitWidth = this._getOption('fitWidth'); + var container = isFitWidth ? this.element.parentNode : this.element; + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var size = getSize( container ); + this.containerWidth = size && size.innerWidth; + }; + + proto._getItemLayoutPosition = function( item ) { + item.getSize(); + // how many columns does this brick span + var remainder = item.size.outerWidth % this.columnWidth; + var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; + // round if off by 1 pixel, otherwise use ceil + var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth ); + colSpan = Math.min( colSpan, this.cols ); + // use horizontal or top column position + var colPosMethod = this.options.horizontalOrder ? + '_getHorizontalColPosition' : '_getTopColPosition'; + var colPosition = this[ colPosMethod ]( colSpan, item ); + // position the brick + var position = { + x: this.columnWidth * colPosition.col, + y: colPosition.y + }; + // apply setHeight to necessary columns + var setHeight = colPosition.y + item.size.outerHeight; + var setMax = colSpan + colPosition.col; + for ( var i = colPosition.col; i < setMax; i++ ) { + this.colYs[i] = setHeight; + } + + return position; + }; + + proto._getTopColPosition = function( colSpan ) { + var colGroup = this._getTopColGroup( colSpan ); + // get the minimum Y value from the columns + var minimumY = Math.min.apply( Math, colGroup ); + + return { + col: colGroup.indexOf( minimumY ), + y: minimumY, + }; + }; + + /** + * @param {Number} colSpan - number of columns the element spans + * @returns {Array} colGroup + */ + proto._getTopColGroup = function( colSpan ) { + if ( colSpan < 2 ) { + // if brick spans only one column, use all the column Ys + return this.colYs; + } + + var colGroup = []; + // how many different places could this brick fit horizontally + var groupCount = this.cols + 1 - colSpan; + // for each group potential horizontal position + for ( var i = 0; i < groupCount; i++ ) { + colGroup[i] = this._getColGroupY( i, colSpan ); + } + return colGroup; + }; + + proto._getColGroupY = function( col, colSpan ) { + if ( colSpan < 2 ) { + return this.colYs[ col ]; + } + // make an array of colY values for that one group + var groupColYs = this.colYs.slice( col, col + colSpan ); + // and get the max value of the array + return Math.max.apply( Math, groupColYs ); + }; + + // get column position based on horizontal index. #873 + proto._getHorizontalColPosition = function( colSpan, item ) { + var col = this.horizontalColIndex % this.cols; + var isOver = colSpan > 1 && col + colSpan > this.cols; + // shift to next row if item can't fit on current row + col = isOver ? 0 : col; + // don't let zero-size items take up space + var hasSize = item.size.outerWidth && item.size.outerHeight; + this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; + + return { + col: col, + y: this._getColGroupY( col, colSpan ), + }; + }; + + proto._manageStamp = function( stamp ) { + var stampSize = getSize( stamp ); + var offset = this._getElementOffset( stamp ); + // get the columns that this stamp affects + var isOriginLeft = this._getOption('originLeft'); + var firstX = isOriginLeft ? offset.left : offset.right; + var lastX = firstX + stampSize.outerWidth; + var firstCol = Math.floor( firstX / this.columnWidth ); + firstCol = Math.max( 0, firstCol ); + var lastCol = Math.floor( lastX / this.columnWidth ); + // lastCol should not go over if multiple of columnWidth #425 + lastCol -= lastX % this.columnWidth ? 0 : 1; + lastCol = Math.min( this.cols - 1, lastCol ); + // set colYs to bottom of the stamp + + var isOriginTop = this._getOption('originTop'); + var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) + + stampSize.outerHeight; + for ( var i = firstCol; i <= lastCol; i++ ) { + this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); + } + }; + + proto._getContainerSize = function() { + this.maxY = Math.max.apply( Math, this.colYs ); + var size = { + height: this.maxY + }; + + if ( this._getOption('fitWidth') ) { + size.width = this._getContainerFitWidth(); + } + + return size; + }; + + proto._getContainerFitWidth = function() { + var unusedCols = 0; + // count unused columns + var i = this.cols; + while ( --i ) { + if ( this.colYs[i] !== 0 ) { + break; + } + unusedCols++; + } + // fit container to columns that have been used + return ( this.cols - unusedCols ) * this.columnWidth - this.gutter; + }; + + proto.needsResizeLayout = function() { + var previousWidth = this.containerWidth; + this.getContainerWidth(); + return previousWidth != this.containerWidth; + }; + + return Masonry; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/item.js": +/*!***************************************!*\ + !*** ./node_modules/outlayer/item.js ***! + \***************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Outlayer Item + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( EvEmitter, getSize ) { +'use strict'; + +// ----- helpers ----- // + +function isEmptyObj( obj ) { + for ( var prop in obj ) { + return false; + } + prop = null; + return true; +} + +// -------------------------- CSS3 support -------------------------- // + + +var docElemStyle = document.documentElement.style; + +var transitionProperty = typeof docElemStyle.transition == 'string' ? + 'transition' : 'WebkitTransition'; +var transformProperty = typeof docElemStyle.transform == 'string' ? + 'transform' : 'WebkitTransform'; + +var transitionEndEvent = { + WebkitTransition: 'webkitTransitionEnd', + transition: 'transitionend' +}[ transitionProperty ]; + +// cache all vendor properties that could have vendor prefix +var vendorProperties = { + transform: transformProperty, + transition: transitionProperty, + transitionDuration: transitionProperty + 'Duration', + transitionProperty: transitionProperty + 'Property', + transitionDelay: transitionProperty + 'Delay' +}; + +// -------------------------- Item -------------------------- // + +function Item( element, layout ) { + if ( !element ) { + return; + } + + this.element = element; + // parent layout class, i.e. Masonry, Isotope, or Packery + this.layout = layout; + this.position = { + x: 0, + y: 0 + }; + + this._create(); +} + +// inherit EvEmitter +var proto = Item.prototype = Object.create( EvEmitter.prototype ); +proto.constructor = Item; + +proto._create = function() { + // transition objects + this._transn = { + ingProperties: {}, + clean: {}, + onEnd: {} + }; + + this.css({ + position: 'absolute' + }); +}; + +// trigger specified handler for event type +proto.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * apply CSS styles to element + * @param {Object} style + */ +proto.css = function( style ) { + var elemStyle = this.element.style; + + for ( var prop in style ) { + // use vendor property if available + var supportedProp = vendorProperties[ prop ] || prop; + elemStyle[ supportedProp ] = style[ prop ]; + } +}; + + // measure position, and sets it +proto.getPosition = function() { + var style = getComputedStyle( this.element ); + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + var xValue = style[ isOriginLeft ? 'left' : 'right' ]; + var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; + var x = parseFloat( xValue ); + var y = parseFloat( yValue ); + // convert percent to pixels + var layoutSize = this.layout.size; + if ( xValue.indexOf('%') != -1 ) { + x = ( x / 100 ) * layoutSize.width; + } + if ( yValue.indexOf('%') != -1 ) { + y = ( y / 100 ) * layoutSize.height; + } + // clean up 'auto' or other non-integer values + x = isNaN( x ) ? 0 : x; + y = isNaN( y ) ? 0 : y; + // remove padding from measurement + x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; + y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; + + this.position.x = x; + this.position.y = y; +}; + +// set settled position, apply padding +proto.layoutPosition = function() { + var layoutSize = this.layout.size; + var style = {}; + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + + // x + var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; + var xProperty = isOriginLeft ? 'left' : 'right'; + var xResetProperty = isOriginLeft ? 'right' : 'left'; + + var x = this.position.x + layoutSize[ xPadding ]; + // set in percentage or pixels + style[ xProperty ] = this.getXValue( x ); + // reset other property + style[ xResetProperty ] = ''; + + // y + var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; + var yProperty = isOriginTop ? 'top' : 'bottom'; + var yResetProperty = isOriginTop ? 'bottom' : 'top'; + + var y = this.position.y + layoutSize[ yPadding ]; + // set in percentage or pixels + style[ yProperty ] = this.getYValue( y ); + // reset other property + style[ yResetProperty ] = ''; + + this.css( style ); + this.emitEvent( 'layout', [ this ] ); +}; + +proto.getXValue = function( x ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && !isHorizontal ? + ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px'; +}; + +proto.getYValue = function( y ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && isHorizontal ? + ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px'; +}; + +proto._transitionTo = function( x, y ) { + this.getPosition(); + // get current x & y from top/left + var curX = this.position.x; + var curY = this.position.y; + + var didNotMove = x == this.position.x && y == this.position.y; + + // save end position + this.setPosition( x, y ); + + // if did not move and not transitioning, just go to layout + if ( didNotMove && !this.isTransitioning ) { + this.layoutPosition(); + return; + } + + var transX = x - curX; + var transY = y - curY; + var transitionStyle = {}; + transitionStyle.transform = this.getTranslate( transX, transY ); + + this.transition({ + to: transitionStyle, + onTransitionEnd: { + transform: this.layoutPosition + }, + isCleaning: true + }); +}; + +proto.getTranslate = function( x, y ) { + // flip cooridinates if origin on right or bottom + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + x = isOriginLeft ? x : -x; + y = isOriginTop ? y : -y; + return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; +}; + +// non transition + transform support +proto.goTo = function( x, y ) { + this.setPosition( x, y ); + this.layoutPosition(); +}; + +proto.moveTo = proto._transitionTo; + +proto.setPosition = function( x, y ) { + this.position.x = parseFloat( x ); + this.position.y = parseFloat( y ); +}; + +// ----- transition ----- // + +/** + * @param {Object} style - CSS + * @param {Function} onTransitionEnd + */ + +// non transition, just trigger callback +proto._nonTransition = function( args ) { + this.css( args.to ); + if ( args.isCleaning ) { + this._removeStyles( args.to ); + } + for ( var prop in args.onTransitionEnd ) { + args.onTransitionEnd[ prop ].call( this ); + } +}; + +/** + * proper transition + * @param {Object} args - arguments + * @param {Object} to - style to transition to + * @param {Object} from - style to start transition from + * @param {Boolean} isCleaning - removes transition styles after transition + * @param {Function} onTransitionEnd - callback + */ +proto.transition = function( args ) { + // redirect to nonTransition if no transition duration + if ( !parseFloat( this.layout.options.transitionDuration ) ) { + this._nonTransition( args ); + return; + } + + var _transition = this._transn; + // keep track of onTransitionEnd callback by css property + for ( var prop in args.onTransitionEnd ) { + _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ]; + } + // keep track of properties that are transitioning + for ( prop in args.to ) { + _transition.ingProperties[ prop ] = true; + // keep track of properties to clean up when transition is done + if ( args.isCleaning ) { + _transition.clean[ prop ] = true; + } + } + + // set from styles + if ( args.from ) { + this.css( args.from ); + // force redraw. http://blog.alexmaccaw.com/css-transitions + var h = this.element.offsetHeight; + // hack for JSHint to hush about unused var + h = null; + } + // enable transition + this.enableTransition( args.to ); + // set styles that are transitioning + this.css( args.to ); + + this.isTransitioning = true; + +}; + +// dash before all cap letters, including first for +// WebkitTransform => -webkit-transform +function toDashedAll( str ) { + return str.replace( /([A-Z])/g, function( $1 ) { + return '-' + $1.toLowerCase(); + }); +} + +var transitionProps = 'opacity,' + toDashedAll( transformProperty ); + +proto.enableTransition = function(/* style */) { + // HACK changing transitionProperty during a transition + // will cause transition to jump + if ( this.isTransitioning ) { + return; + } + + // make `transition: foo, bar, baz` from style object + // HACK un-comment this when enableTransition can work + // while a transition is happening + // var transitionValues = []; + // for ( var prop in style ) { + // // dash-ify camelCased properties like WebkitTransition + // prop = vendorProperties[ prop ] || prop; + // transitionValues.push( toDashedAll( prop ) ); + // } + // munge number to millisecond, to match stagger + var duration = this.layout.options.transitionDuration; + duration = typeof duration == 'number' ? duration + 'ms' : duration; + // enable transition styles + this.css({ + transitionProperty: transitionProps, + transitionDuration: duration, + transitionDelay: this.staggerDelay || 0 + }); + // listen for transition end event + this.element.addEventListener( transitionEndEvent, this, false ); +}; + +// ----- events ----- // + +proto.onwebkitTransitionEnd = function( event ) { + this.ontransitionend( event ); +}; + +proto.onotransitionend = function( event ) { + this.ontransitionend( event ); +}; + +// properties that I munge to make my life easier +var dashedVendorProperties = { + '-webkit-transform': 'transform' +}; + +proto.ontransitionend = function( event ) { + // disregard bubbled events from children + if ( event.target !== this.element ) { + return; + } + var _transition = this._transn; + // get property name of transitioned property, convert to prefix-free + var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName; + + // remove property that has completed transitioning + delete _transition.ingProperties[ propertyName ]; + // check if any properties are still transitioning + if ( isEmptyObj( _transition.ingProperties ) ) { + // all properties have completed transitioning + this.disableTransition(); + } + // clean style + if ( propertyName in _transition.clean ) { + // clean up style + this.element.style[ event.propertyName ] = ''; + delete _transition.clean[ propertyName ]; + } + // trigger onTransitionEnd callback + if ( propertyName in _transition.onEnd ) { + var onTransitionEnd = _transition.onEnd[ propertyName ]; + onTransitionEnd.call( this ); + delete _transition.onEnd[ propertyName ]; + } + + this.emitEvent( 'transitionEnd', [ this ] ); +}; + +proto.disableTransition = function() { + this.removeTransitionStyles(); + this.element.removeEventListener( transitionEndEvent, this, false ); + this.isTransitioning = false; +}; + +/** + * removes style property from element + * @param {Object} style +**/ +proto._removeStyles = function( style ) { + // clean up transition styles + var cleanStyle = {}; + for ( var prop in style ) { + cleanStyle[ prop ] = ''; + } + this.css( cleanStyle ); +}; + +var cleanTransitionStyle = { + transitionProperty: '', + transitionDuration: '', + transitionDelay: '' +}; + +proto.removeTransitionStyles = function() { + // remove transition + this.css( cleanTransitionStyle ); +}; + +// ----- stagger ----- // + +proto.stagger = function( delay ) { + delay = isNaN( delay ) ? 0 : delay; + this.staggerDelay = delay + 'ms'; +}; + +// ----- show/hide/remove ----- // + +// remove element from DOM +proto.removeElem = function() { + this.element.parentNode.removeChild( this.element ); + // remove display: none + this.css({ display: '' }); + this.emitEvent( 'remove', [ this ] ); +}; + +proto.remove = function() { + // just remove element if no transition support or no transition + if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) { + this.removeElem(); + return; + } + + // start transition + this.once( 'transitionEnd', function() { + this.removeElem(); + }); + this.hide(); +}; + +proto.reveal = function() { + delete this.isHidden; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd; + + this.transition({ + from: options.hiddenStyle, + to: options.visibleStyle, + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onRevealTransitionEnd = function() { + // check if still visible + // during transition, item may have been hidden + if ( !this.isHidden ) { + this.emitEvent('reveal'); + } +}; + +/** + * get style property use for hide/reveal transition end + * @param {String} styleProperty - hiddenStyle/visibleStyle + * @returns {String} + */ +proto.getHideRevealTransitionEndProperty = function( styleProperty ) { + var optionStyle = this.layout.options[ styleProperty ]; + // use opacity + if ( optionStyle.opacity ) { + return 'opacity'; + } + // get first property + for ( var prop in optionStyle ) { + return prop; + } +}; + +proto.hide = function() { + // set flag + this.isHidden = true; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd; + + this.transition({ + from: options.visibleStyle, + to: options.hiddenStyle, + // keep hidden stuff hidden + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onHideTransitionEnd = function() { + // check if still hidden + // during transition, item may have been un-hidden + if ( this.isHidden ) { + this.css({ display: 'none' }); + this.emitEvent('hide'); + } +}; + +proto.destroy = function() { + this.css({ + position: '', + left: '', + right: '', + top: '', + bottom: '', + transition: '', + transform: '' + }); +}; + +return Item; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js": +/*!*********************************************************************!*\ + !*** ./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js ***! + \*********************************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * EvEmitter v1.1.0 + * Lil' event emitter + * MIT License + */ + +/* jshint unused: true, undef: true, strict: true */ + +( function( global, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, window */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( typeof window != 'undefined' ? window : this, function() { + +"use strict"; + +function EvEmitter() {} + +var proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // set events hash + var events = this._events = this._events || {}; + // set listeners array + var listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( listeners.indexOf( listener ) == -1 ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + var onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + // copy over to avoid interference if .off() in listener + listeners = listeners.slice(0); + args = args || []; + // once stuff + var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( var i=0; i < listeners.length; i++ ) { + var listener = listeners[i] + var isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; +}; + +return EvEmitter; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/outlayer.js": +/*!*******************************************!*\ + !*** ./node_modules/outlayer/outlayer.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Outlayer v2.1.1 + * the brains and guts of a layout library + * MIT license + */ + +( function( window, factory ) { + 'use strict'; + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js"), + __webpack_require__(/*! fizzy-ui-utils/utils */ "./node_modules/fizzy-ui-utils/utils.js"), + __webpack_require__(/*! ./item */ "./node_modules/outlayer/item.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter, getSize, utils, Item ) { + return factory( window, EvEmitter, getSize, utils, Item); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, EvEmitter, getSize, utils, Item ) { +'use strict'; + +// ----- vars ----- // + +var console = window.console; +var jQuery = window.jQuery; +var noop = function() {}; + +// -------------------------- Outlayer -------------------------- // + +// globally unique identifiers +var GUID = 0; +// internal store of all Outlayer intances +var instances = {}; + + +/** + * @param {Element, String} element + * @param {Object} options + * @constructor + */ +function Outlayer( element, options ) { + var queryElement = utils.getQueryElement( element ); + if ( !queryElement ) { + if ( console ) { + console.error( 'Bad element for ' + this.constructor.namespace + + ': ' + ( queryElement || element ) ); + } + return; + } + this.element = queryElement; + // add jQuery + if ( jQuery ) { + this.$element = jQuery( this.element ); + } + + // options + this.options = utils.extend( {}, this.constructor.defaults ); + this.option( options ); + + // add id for Outlayer.getFromElement + var id = ++GUID; + this.element.outlayerGUID = id; // expando + instances[ id ] = this; // associate via id + + // kick it off + this._create(); + + var isInitLayout = this._getOption('initLayout'); + if ( isInitLayout ) { + this.layout(); + } +} + +// settings are for internal use only +Outlayer.namespace = 'outlayer'; +Outlayer.Item = Item; + +// default options +Outlayer.defaults = { + containerStyle: { + position: 'relative' + }, + initLayout: true, + originLeft: true, + originTop: true, + resize: true, + resizeContainer: true, + // item options + transitionDuration: '0.4s', + hiddenStyle: { + opacity: 0, + transform: 'scale(0.001)' + }, + visibleStyle: { + opacity: 1, + transform: 'scale(1)' + } +}; + +var proto = Outlayer.prototype; +// inherit EvEmitter +utils.extend( proto, EvEmitter.prototype ); + +/** + * set options + * @param {Object} opts + */ +proto.option = function( opts ) { + utils.extend( this.options, opts ); +}; + +/** + * get backwards compatible option value, check old name + */ +proto._getOption = function( option ) { + var oldOption = this.constructor.compatOptions[ option ]; + return oldOption && this.options[ oldOption ] !== undefined ? + this.options[ oldOption ] : this.options[ option ]; +}; + +Outlayer.compatOptions = { + // currentName: oldName + initLayout: 'isInitLayout', + horizontal: 'isHorizontal', + layoutInstant: 'isLayoutInstant', + originLeft: 'isOriginLeft', + originTop: 'isOriginTop', + resize: 'isResizeBound', + resizeContainer: 'isResizingContainer' +}; + +proto._create = function() { + // get items from children + this.reloadItems(); + // elements that affect layout, but are not laid out + this.stamps = []; + this.stamp( this.options.stamp ); + // set container style + utils.extend( this.element.style, this.options.containerStyle ); + + // bind resize method + var canBindResize = this._getOption('resize'); + if ( canBindResize ) { + this.bindResize(); + } +}; + +// goes through all children again and gets bricks in proper order +proto.reloadItems = function() { + // collection of item elements + this.items = this._itemize( this.element.children ); +}; + + +/** + * turn elements into Outlayer.Items to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - collection of new Outlayer Items + */ +proto._itemize = function( elems ) { + + var itemElems = this._filterFindItemElements( elems ); + var Item = this.constructor.Item; + + // create new Outlayer Items for collection + var items = []; + for ( var i=0; i < itemElems.length; i++ ) { + var elem = itemElems[i]; + var item = new Item( elem, this ); + items.push( item ); + } + + return items; +}; + +/** + * get item elements to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - item elements + */ +proto._filterFindItemElements = function( elems ) { + return utils.filterFindElements( elems, this.options.itemSelector ); +}; + +/** + * getter method for getting item elements + * @returns {Array} elems - collection of item elements + */ +proto.getItemElements = function() { + return this.items.map( function( item ) { + return item.element; + }); +}; + +// ----- init & layout ----- // + +/** + * lays out all items + */ +proto.layout = function() { + this._resetLayout(); + this._manageStamps(); + + // don't animate first layout + var layoutInstant = this._getOption('layoutInstant'); + var isInstant = layoutInstant !== undefined ? + layoutInstant : !this._isLayoutInited; + this.layoutItems( this.items, isInstant ); + + // flag for initalized + this._isLayoutInited = true; +}; + +// _init is alias for layout +proto._init = proto.layout; + +/** + * logic before any new layout + */ +proto._resetLayout = function() { + this.getSize(); +}; + + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * get measurement from option, for columnWidth, rowHeight, gutter + * if option is String -> get element from selector string, & get size of element + * if option is Element -> get size of element + * else use option as a number + * + * @param {String} measurement + * @param {String} size - width or height + * @private + */ +proto._getMeasurement = function( measurement, size ) { + var option = this.options[ measurement ]; + var elem; + if ( !option ) { + // default to 0 + this[ measurement ] = 0; + } else { + // use option as an element + if ( typeof option == 'string' ) { + elem = this.element.querySelector( option ); + } else if ( option instanceof HTMLElement ) { + elem = option; + } + // use size of element, if element + this[ measurement ] = elem ? getSize( elem )[ size ] : option; + } +}; + +/** + * layout a collection of item elements + * @api public + */ +proto.layoutItems = function( items, isInstant ) { + items = this._getItemsForLayout( items ); + + this._layoutItems( items, isInstant ); + + this._postLayout(); +}; + +/** + * get the items to be laid out + * you may want to skip over some items + * @param {Array} items + * @returns {Array} items + */ +proto._getItemsForLayout = function( items ) { + return items.filter( function( item ) { + return !item.isIgnored; + }); +}; + +/** + * layout items + * @param {Array} items + * @param {Boolean} isInstant + */ +proto._layoutItems = function( items, isInstant ) { + this._emitCompleteOnItems( 'layout', items ); + + if ( !items || !items.length ) { + // no items, emit event with empty array + return; + } + + var queue = []; + + items.forEach( function( item ) { + // get x/y object from method + var position = this._getItemLayoutPosition( item ); + // enqueue + position.item = item; + position.isInstant = isInstant || item.isLayoutInstant; + queue.push( position ); + }, this ); + + this._processLayoutQueue( queue ); +}; + +/** + * get item layout position + * @param {Outlayer.Item} item + * @returns {Object} x and y position + */ +proto._getItemLayoutPosition = function( /* item */ ) { + return { + x: 0, + y: 0 + }; +}; + +/** + * iterate over array and position each item + * Reason being - separating this logic prevents 'layout invalidation' + * thx @paul_irish + * @param {Array} queue + */ +proto._processLayoutQueue = function( queue ) { + this.updateStagger(); + queue.forEach( function( obj, i ) { + this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i ); + }, this ); +}; + +// set stagger from option in milliseconds number +proto.updateStagger = function() { + var stagger = this.options.stagger; + if ( stagger === null || stagger === undefined ) { + this.stagger = 0; + return; + } + this.stagger = getMilliseconds( stagger ); + return this.stagger; +}; + +/** + * Sets position of item in DOM + * @param {Outlayer.Item} item + * @param {Number} x - horizontal position + * @param {Number} y - vertical position + * @param {Boolean} isInstant - disables transitions + */ +proto._positionItem = function( item, x, y, isInstant, i ) { + if ( isInstant ) { + // if not transition, just set CSS + item.goTo( x, y ); + } else { + item.stagger( i * this.stagger ); + item.moveTo( x, y ); + } +}; + +/** + * Any logic you want to do after each layout, + * i.e. size the container + */ +proto._postLayout = function() { + this.resizeContainer(); +}; + +proto.resizeContainer = function() { + var isResizingContainer = this._getOption('resizeContainer'); + if ( !isResizingContainer ) { + return; + } + var size = this._getContainerSize(); + if ( size ) { + this._setContainerMeasure( size.width, true ); + this._setContainerMeasure( size.height, false ); + } +}; + +/** + * Sets width or height of container if returned + * @returns {Object} size + * @param {Number} width + * @param {Number} height + */ +proto._getContainerSize = noop; + +/** + * @param {Number} measure - size of width or height + * @param {Boolean} isWidth + */ +proto._setContainerMeasure = function( measure, isWidth ) { + if ( measure === undefined ) { + return; + } + + var elemSize = this.size; + // add padding and border width if border box + if ( elemSize.isBorderBox ) { + measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + + elemSize.borderLeftWidth + elemSize.borderRightWidth : + elemSize.paddingBottom + elemSize.paddingTop + + elemSize.borderTopWidth + elemSize.borderBottomWidth; + } + + measure = Math.max( measure, 0 ); + this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; +}; + +/** + * emit eventComplete on a collection of items events + * @param {String} eventName + * @param {Array} items - Outlayer.Items + */ +proto._emitCompleteOnItems = function( eventName, items ) { + var _this = this; + function onComplete() { + _this.dispatchEvent( eventName + 'Complete', null, [ items ] ); + } + + var count = items.length; + if ( !items || !count ) { + onComplete(); + return; + } + + var doneCount = 0; + function tick() { + doneCount++; + if ( doneCount == count ) { + onComplete(); + } + } + + // bind callback + items.forEach( function( item ) { + item.once( eventName, tick ); + }); +}; + +/** + * emits events via EvEmitter and jQuery events + * @param {String} type - name of event + * @param {Event} event - original event + * @param {Array} args - extra arguments + */ +proto.dispatchEvent = function( type, event, args ) { + // add original event to arguments + var emitArgs = event ? [ event ].concat( args ) : args; + this.emitEvent( type, emitArgs ); + + if ( jQuery ) { + // set this.$element + this.$element = this.$element || jQuery( this.element ); + if ( event ) { + // create jQuery event + var $event = jQuery.Event( event ); + $event.type = type; + this.$element.trigger( $event, args ); + } else { + // just trigger with type if no event available + this.$element.trigger( type, args ); + } + } +}; + +// -------------------------- ignore & stamps -------------------------- // + + +/** + * keep item in collection, but do not lay it out + * ignored items do not get skipped in layout + * @param {Element} elem + */ +proto.ignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + item.isIgnored = true; + } +}; + +/** + * return item to layout collection + * @param {Element} elem + */ +proto.unignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + delete item.isIgnored; + } +}; + +/** + * adds elements to stamps + * @param {NodeList, Array, Element, or String} elems + */ +proto.stamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ) { + return; + } + + this.stamps = this.stamps.concat( elems ); + // ignore + elems.forEach( this.ignore, this ); +}; + +/** + * removes elements to stamps + * @param {NodeList, Array, or Element} elems + */ +proto.unstamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ){ + return; + } + + elems.forEach( function( elem ) { + // filter out removed stamp elements + utils.removeFrom( this.stamps, elem ); + this.unignore( elem ); + }, this ); +}; + +/** + * finds child elements + * @param {NodeList, Array, Element, or String} elems + * @returns {Array} elems + */ +proto._find = function( elems ) { + if ( !elems ) { + return; + } + // if string, use argument as selector string + if ( typeof elems == 'string' ) { + elems = this.element.querySelectorAll( elems ); + } + elems = utils.makeArray( elems ); + return elems; +}; + +proto._manageStamps = function() { + if ( !this.stamps || !this.stamps.length ) { + return; + } + + this._getBoundingRect(); + + this.stamps.forEach( this._manageStamp, this ); +}; + +// update boundingLeft / Top +proto._getBoundingRect = function() { + // get bounding rect for container element + var boundingRect = this.element.getBoundingClientRect(); + var size = this.size; + this._boundingRect = { + left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, + top: boundingRect.top + size.paddingTop + size.borderTopWidth, + right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), + bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) + }; +}; + +/** + * @param {Element} stamp +**/ +proto._manageStamp = noop; + +/** + * get x/y position of element relative to container element + * @param {Element} elem + * @returns {Object} offset - has left, top, right, bottom + */ +proto._getElementOffset = function( elem ) { + var boundingRect = elem.getBoundingClientRect(); + var thisRect = this._boundingRect; + var size = getSize( elem ); + var offset = { + left: boundingRect.left - thisRect.left - size.marginLeft, + top: boundingRect.top - thisRect.top - size.marginTop, + right: thisRect.right - boundingRect.right - size.marginRight, + bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom + }; + return offset; +}; + +// -------------------------- resize -------------------------- // + +// enable event handlers for listeners +// i.e. resize -> onresize +proto.handleEvent = utils.handleEvent; + +/** + * Bind layout to window resizing + */ +proto.bindResize = function() { + window.addEventListener( 'resize', this ); + this.isResizeBound = true; +}; + +/** + * Unbind layout to window resizing + */ +proto.unbindResize = function() { + window.removeEventListener( 'resize', this ); + this.isResizeBound = false; +}; + +proto.onresize = function() { + this.resize(); +}; + +utils.debounceMethod( Outlayer, 'onresize', 100 ); + +proto.resize = function() { + // don't trigger if size did not change + // or if resize was unbound. See #9 + if ( !this.isResizeBound || !this.needsResizeLayout() ) { + return; + } + + this.layout(); +}; + +/** + * check if layout is needed post layout + * @returns Boolean + */ +proto.needsResizeLayout = function() { + var size = getSize( this.element ); + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var hasSizes = this.size && size; + return hasSizes && size.innerWidth !== this.size.innerWidth; +}; + +// -------------------------- methods -------------------------- // + +/** + * add items to Outlayer instance + * @param {Array or NodeList or Element} elems + * @returns {Array} items - Outlayer.Items +**/ +proto.addItems = function( elems ) { + var items = this._itemize( elems ); + // add items to collection + if ( items.length ) { + this.items = this.items.concat( items ); + } + return items; +}; + +/** + * Layout newly-appended item elements + * @param {Array or NodeList or Element} elems + */ +proto.appended = function( elems ) { + var items = this.addItems( elems ); + if ( !items.length ) { + return; + } + // layout and reveal just the new items + this.layoutItems( items, true ); + this.reveal( items ); +}; + +/** + * Layout prepended elements + * @param {Array or NodeList or Element} elems + */ +proto.prepended = function( elems ) { + var items = this._itemize( elems ); + if ( !items.length ) { + return; + } + // add items to beginning of collection + var previousItems = this.items.slice(0); + this.items = items.concat( previousItems ); + // start new layout + this._resetLayout(); + this._manageStamps(); + // layout new stuff without transition + this.layoutItems( items, true ); + this.reveal( items ); + // layout previous items + this.layoutItems( previousItems ); +}; + +/** + * reveal a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.reveal = function( items ) { + this._emitCompleteOnItems( 'reveal', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.reveal(); + }); +}; + +/** + * hide a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.hide = function( items ) { + this._emitCompleteOnItems( 'hide', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.hide(); + }); +}; + +/** + * reveal item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.revealItemElements = function( elems ) { + var items = this.getItems( elems ); + this.reveal( items ); +}; + +/** + * hide item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.hideItemElements = function( elems ) { + var items = this.getItems( elems ); + this.hide( items ); +}; + +/** + * get Outlayer.Item, given an Element + * @param {Element} elem + * @param {Function} callback + * @returns {Outlayer.Item} item + */ +proto.getItem = function( elem ) { + // loop through items to get the one that matches + for ( var i=0; i < this.items.length; i++ ) { + var item = this.items[i]; + if ( item.element == elem ) { + // return item + return item; + } + } +}; + +/** + * get collection of Outlayer.Items, given Elements + * @param {Array} elems + * @returns {Array} items - Outlayer.Items + */ +proto.getItems = function( elems ) { + elems = utils.makeArray( elems ); + var items = []; + elems.forEach( function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + items.push( item ); + } + }, this ); + + return items; +}; + +/** + * remove element(s) from instance and DOM + * @param {Array or NodeList or Element} elems + */ +proto.remove = function( elems ) { + var removeItems = this.getItems( elems ); + + this._emitCompleteOnItems( 'remove', removeItems ); + + // bail if no items to remove + if ( !removeItems || !removeItems.length ) { + return; + } + + removeItems.forEach( function( item ) { + item.remove(); + // remove item from collection + utils.removeFrom( this.items, item ); + }, this ); +}; + +// ----- destroy ----- // + +// remove and disable Outlayer instance +proto.destroy = function() { + // clean up dynamic styles + var style = this.element.style; + style.height = ''; + style.position = ''; + style.width = ''; + // destroy items + this.items.forEach( function( item ) { + item.destroy(); + }); + + this.unbindResize(); + + var id = this.element.outlayerGUID; + delete instances[ id ]; // remove reference to instance by id + delete this.element.outlayerGUID; + // remove data for jQuery + if ( jQuery ) { + jQuery.removeData( this.element, this.constructor.namespace ); + } + +}; + +// -------------------------- data -------------------------- // + +/** + * get Outlayer instance from element + * @param {Element} elem + * @returns {Outlayer} + */ +Outlayer.data = function( elem ) { + elem = utils.getQueryElement( elem ); + var id = elem && elem.outlayerGUID; + return id && instances[ id ]; +}; + + +// -------------------------- create Outlayer class -------------------------- // + +/** + * create a layout class + * @param {String} namespace + */ +Outlayer.create = function( namespace, options ) { + // sub-class Outlayer + var Layout = subclass( Outlayer ); + // apply new options and compatOptions + Layout.defaults = utils.extend( {}, Outlayer.defaults ); + utils.extend( Layout.defaults, options ); + Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions ); + + Layout.namespace = namespace; + + Layout.data = Outlayer.data; + + // sub-class Item + Layout.Item = subclass( Item ); + + // -------------------------- declarative -------------------------- // + + utils.htmlInit( Layout, namespace ); + + // -------------------------- jQuery bridge -------------------------- // + + // make into jQuery plugin + if ( jQuery && jQuery.bridget ) { + jQuery.bridget( namespace, Layout ); + } + + return Layout; +}; + +function subclass( Parent ) { + function SubClass() { + Parent.apply( this, arguments ); + } + + SubClass.prototype = Object.create( Parent.prototype ); + SubClass.prototype.constructor = SubClass; + + return SubClass; +} + +// ----- helpers ----- // + +// how many milliseconds are in each unit +var msUnits = { + ms: 1, + s: 1000 +}; + +// munge time-like parameter into millisecond number +// '0.4s' -> 40 +function getMilliseconds( time ) { + if ( typeof time == 'number' ) { + return time; + } + var matches = time.match( /(^\d*\.?\d*)(\w*)/ ); + var num = matches && matches[1]; + var unit = matches && matches[2]; + if ( !num.length ) { + return 0; + } + num = parseFloat( num ); + var mult = msUnits[ unit ] || 1; + return num * mult; +} + +// ----- fin ----- // + +// back in global +Outlayer.Item = Item; + +return Outlayer; + +})); + + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["React"]; + +/***/ }), + +/***/ "@wordpress/block-editor": +/*!*************************************!*\ + !*** external ["wp","blockEditor"] ***! + \*************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["blockEditor"]; + +/***/ }), + +/***/ "@wordpress/blocks": +/*!********************************!*\ + !*** external ["wp","blocks"] ***! + \********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["blocks"]; + +/***/ }), + +/***/ "@wordpress/components": +/*!************************************!*\ + !*** external ["wp","components"] ***! + \************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["components"]; + +/***/ }), + +/***/ "@wordpress/data": +/*!******************************!*\ + !*** external ["wp","data"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["data"]; + +/***/ }), + +/***/ "@wordpress/element": +/*!*********************************!*\ + !*** external ["wp","element"] ***! + \*********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["element"]; + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "@wordpress/primitives": +/*!************************************!*\ + !*** external ["wp","primitives"] ***! + \************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["primitives"]; + +/***/ }), + +/***/ "?9157": +/*!************************!*\ + !*** crypto (ignored) ***! + \************************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/adapters.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/adapters/adapters.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); +/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const knownAdapters = { + http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], + xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"] +} + +_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(knownAdapters, (fn, value) => { + if(fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + getAdapter: (adapters) => { + adapters = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if((adapter = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + break; + } + } + + if (!adapter) { + if (adapter === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( + `Adapter ${nameOrAdapter} is not supported by the environment`, + 'ERR_NOT_SUPPORT' + ); + } + + throw new Error( + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].hasOwnProp(knownAdapters, nameOrAdapter) ? + `Adapter '${nameOrAdapter}' is not available in the build` : + `Unknown adapter '${nameOrAdapter}'` + ); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFunction(adapter)) { + throw new TypeError('adapter is not a function'); + } + + return adapter; + }, + adapters: knownAdapters +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); +/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); + + + + + + + + + + + + + + + + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers).normalize(); + const responseType = config.responseType; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(requestData) && (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserWebWorkerEnv)) { + requestHeaders.setContentType(false); // Let the browser set it + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__["default"]; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv) { + // Add xsrf header + const xsrfValue = (config.withCredentials || (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath)) + && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__["default"].read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__["default"](null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__["default"])(fullPath); + + if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].protocols.indexOf(protocol) === -1) { + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); +/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); +/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); +/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); + + + + + + + + + + + + + + + + + + + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); + const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); + + // Copy axios.prototype to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); + + // Copy context to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); + +// Expose Axios class to allow class inheritance +axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + +// Expose Cancel & CancelToken +axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; +axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; +axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; +axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; +axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; + +// Expose AxiosError class +axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; + +// Expose isAxiosError +axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; + +// Expose mergeConfig +axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; + +axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; + +axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__["default"]; + +axios.default = axios; + +// this module should only have a default export +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); + + + + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CanceledError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { + __CANCEL__: true +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isCancel) +/* harmony export */ }); + + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); +/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); +/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + + + + + + +const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), + response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + let contextHeaders; + + // Flatten headers + contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( + headers.common, + headers[config.method] + ); + + contextHeaders && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url); + return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosError.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosError.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); + + + + + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +function isValidHeaderName(str) { + return /^[-_a-zA-Z]+$/.test(str.trim()); +} + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { + return parser.call(this, value, key); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders.prototype); +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildFullPath) +/* harmony export */ }); +/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); + + + + + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { + return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); + } + return requestedURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ dispatchRequest) +/* harmony export */ }); +/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); + + + + + + + + + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); + + // Transform request data + config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + response + ); + + response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergeConfig) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + +const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ settle) +/* harmony export */ }); +/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( + 'Request failed with status code ' + response.status, + [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ transformData) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + const context = response || config; + const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); + let data = context.data; + + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/index.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/defaults/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); + + + + + + + + + + +const DEFAULT_CONTENT_TYPE = { + 'Content-Type': undefined +}; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); + + if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) + ) { + return data; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { + return data.buffer; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); + } + + if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, + Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(DEFAULT_CONTENT_TYPE); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/transitional.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/defaults/transitional.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/env/data.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/env/data.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "VERSION": () => (/* binding */ VERSION) +/* harmony export */ }); +const VERSION = "1.3.4"; + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": +/*!****************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); + + + + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ bind) +/* harmony export */ }); + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildURL) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + + + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? + params.toString() : + new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ combineURLs) +/* harmony export */ }); + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) { + cookie.push('path=' + path); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + +// Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; + + if (isLast) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { + const obj = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAbsoluteURL) +/* harmony export */ }); + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAxiosError) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/null.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/null.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +// eslint-disable-next-line strict +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ parseProtocol) +/* harmony export */ }); + + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/speedometer.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/speedometer.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ spread) +/* harmony export */ }); + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toFormData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toFormData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); + + + + +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored + + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); +} + +const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || + ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { + const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( + formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": +/*!************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ toURLEncodedForm) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + + +function toURLEncodedForm(data, options) { + return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/validator.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/validator.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); + } + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assertOptions, + validators +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": +/*!*****************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": +/*!*********************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": +/*!****************************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/index.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); +/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); +/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); + + + + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== 'undefined' && ( + (product = navigator.product) === 'ReactNative' || + product === 'NativeScript' || + product === 'NS') + ) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; +})(); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + const isStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isBrowser: true, + classes: { + URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], + FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], + Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); + + + + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + const pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + if (reducer(descriptor, name, obj) !== false) { + reducedDescriptors[name] = descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject +}); + + +/***/ }), + +/***/ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs": +/*!*****************************************************************************************!*\ + !*** ./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "InView": () => (/* binding */ InView), +/* harmony export */ "defaultFallbackInView": () => (/* binding */ defaultFallbackInView), +/* harmony export */ "observe": () => (/* binding */ observe), +/* harmony export */ "useInView": () => (/* binding */ useInView) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); + + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const observerMap = new Map(); +const RootIds = new WeakMap(); +let rootId = 0; +let unsupportedValue = undefined; +/** + * What should be the default behavior if the IntersectionObserver is unsupported? + * Ideally the polyfill has been loaded, you can have the following happen: + * - `undefined`: Throw an error + * - `true` or `false`: Set the `inView` value to this regardless of intersection state + * **/ + +function defaultFallbackInView(inView) { + unsupportedValue = inView; +} +/** + * Generate a unique ID for the root element + * @param root + */ + +function getRootId(root) { + if (!root) return '0'; + if (RootIds.has(root)) return RootIds.get(root); + rootId += 1; + RootIds.set(root, rootId.toString()); + return RootIds.get(root); +} +/** + * Convert the options to a string Id, based on the values. + * Ensures we can reuse the same observer when observing elements with the same options. + * @param options + */ + + +function optionsToId(options) { + return Object.keys(options).sort().filter(key => options[key] !== undefined).map(key => { + return `${key}_${key === 'root' ? getRootId(options.root) : options[key]}`; + }).toString(); +} + +function createObserver(options) { + // Create a unique ID for this observer instance, based on the root, root margin and threshold. + let id = optionsToId(options); + let instance = observerMap.get(id); + + if (!instance) { + // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view. + const elements = new Map(); + let thresholds; + const observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + var _elements$get; + + // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it. + // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0 + const inView = entry.isIntersecting && thresholds.some(threshold => entry.intersectionRatio >= threshold); // @ts-ignore support IntersectionObserver v2 + + if (options.trackVisibility && typeof entry.isVisible === 'undefined') { + // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. + // @ts-ignore + entry.isVisible = inView; + } + + (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(callback => { + callback(inView, entry); + }); + }); + }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options + + thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]); + instance = { + id, + observer, + elements + }; + observerMap.set(id, instance); + } + + return instance; +} +/** + * @param element - DOM Element to observe + * @param callback - Callback function to trigger when intersection status changes + * @param options - Intersection Observer options + * @param fallbackInView - Fallback inView value. + * @return Function - Cleanup function that should be triggered to unregister the observer + */ + + +function observe(element, callback, options = {}, fallbackInView = unsupportedValue) { + if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) { + const bounds = element.getBoundingClientRect(); + callback(fallbackInView, { + isIntersecting: fallbackInView, + target: element, + intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0, + time: 0, + boundingClientRect: bounds, + intersectionRect: bounds, + rootBounds: bounds + }); + return () => {// Nothing to cleanup + }; + } // An observer with the same options can be reused, so lets use this fact + + + const { + id, + observer, + elements + } = createObserver(options); // Register the callback listener for this element + + let callbacks = elements.get(element) || []; + + if (!elements.has(element)) { + elements.set(element, callbacks); + } + + callbacks.push(callback); + observer.observe(element); + return function unobserve() { + // Remove the callback from the callback list + callbacks.splice(callbacks.indexOf(callback), 1); + + if (callbacks.length === 0) { + // No more callback exists for element, so destroy it + elements.delete(element); + observer.unobserve(element); + } + + if (elements.size === 0) { + // No more elements are being observer by this instance, so destroy it + observer.disconnect(); + observerMap.delete(id); + } + }; +} + +const _excluded = ["children", "as", "triggerOnce", "threshold", "root", "rootMargin", "onChange", "skip", "trackVisibility", "delay", "initialInView", "fallbackInView"]; + +function isPlainChildren(props) { + return typeof props.children !== 'function'; +} +/** + ## Render props + + To use the `` component, you pass it a function. It will be called + whenever the state changes, with the new value of `inView`. In addition to the + `inView` prop, children also receive a `ref` that should be set on the + containing DOM element. This is the element that the IntersectionObserver will + monitor. + + If you need it, you can also access the + [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) + on `entry`, giving you access to all the details about the current intersection + state. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + + {({ inView, ref, entry }) => ( +

+

{`Header inside viewport ${inView}.`}

+
+ )} + + ); + + export default Component; + ``` + + ## Plain children + + You can pass any element to the ``, and it will handle creating the + wrapping DOM element. Add a handler to the `onChange` method, and control the + state in your own component. Any extra props you add to `` will be + passed to the HTML element, allowing you set the `className`, `style`, etc. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + console.log('Inview:', inView)}> +

Plain children are always rendered. Use onChange to monitor state.

+
+ ); + + export default Component; + ``` + */ + + +class InView extends react__WEBPACK_IMPORTED_MODULE_0__.Component { + constructor(props) { + super(props); + this.node = null; + this._unobserveCb = null; + + this.handleNode = node => { + if (this.node) { + // Clear the old observer, before we start observing a new element + this.unobserve(); + + if (!node && !this.props.triggerOnce && !this.props.skip) { + // Reset the state if we get a new node, and we aren't ignoring updates + this.setState({ + inView: !!this.props.initialInView, + entry: undefined + }); + } + } + + this.node = node ? node : null; + this.observeNode(); + }; + + this.handleChange = (inView, entry) => { + if (inView && this.props.triggerOnce) { + // If `triggerOnce` is true, we should stop observing the element. + this.unobserve(); + } + + if (!isPlainChildren(this.props)) { + // Store the current State, so we can pass it to the children in the next render update + // There's no reason to update the state for plain children, since it's not used in the rendering. + this.setState({ + inView, + entry + }); + } + + if (this.props.onChange) { + // If the user is actively listening for onChange, always trigger it + this.props.onChange(inView, entry); + } + }; + + this.state = { + inView: !!props.initialInView, + entry: undefined + }; + } + + componentDidUpdate(prevProps) { + // If a IntersectionObserver option changed, reinit the observer + if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) { + this.unobserve(); + this.observeNode(); + } + } + + componentWillUnmount() { + this.unobserve(); + this.node = null; + } + + observeNode() { + if (!this.node || this.props.skip) return; + const { + threshold, + root, + rootMargin, + trackVisibility, + delay, + fallbackInView + } = this.props; + this._unobserveCb = observe(this.node, this.handleChange, { + threshold, + root, + rootMargin, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + } + + unobserve() { + if (this._unobserveCb) { + this._unobserveCb(); + + this._unobserveCb = null; + } + } + + render() { + if (!isPlainChildren(this.props)) { + const { + inView, + entry + } = this.state; + return this.props.children({ + inView, + entry, + ref: this.handleNode + }); + } + + const _this$props = this.props, + { + children, + as + } = _this$props, + props = _objectWithoutPropertiesLoose(_this$props, _excluded); + + return react__WEBPACK_IMPORTED_MODULE_0__.createElement(as || 'div', _extends({ + ref: this.handleNode + }, props), children); + } + +} + +/** + * React Hooks make it easy to monitor the `inView` state of your components. Call + * the `useInView` hook with the (optional) [options](#options) you need. It will + * return an array containing a `ref`, the `inView` status and the current + * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry). + * Assign the `ref` to the DOM element you want to monitor, and the hook will + * report the status. + * + * @example + * ```jsx + * import React from 'react'; + * import { useInView } from 'react-intersection-observer'; + * + * const Component = () => { + * const { ref, inView, entry } = useInView({ + * threshold: 0, + * }); + * + * return ( + *
+ *

{`Header inside viewport ${inView}.`}

+ *
+ * ); + * }; + * ``` + */ + +function useInView({ + threshold, + delay, + trackVisibility, + rootMargin, + root, + triggerOnce, + skip, + initialInView, + fallbackInView, + onChange +} = {}) { + var _state$entry; + + const [ref, setRef] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null); + const callback = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + const [state, setState] = react__WEBPACK_IMPORTED_MODULE_0__.useState({ + inView: !!initialInView, + entry: undefined + }); // Store the onChange callback in a `ref`, so we can access the latest instance + // inside the `useEffect`, but without triggering a rerender. + + callback.current = onChange; + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { + // Ensure we have node ref, and that we shouldn't skip observing + if (skip || !ref) return; + let unobserve; + unobserve = observe(ref, (inView, entry) => { + setState({ + inView, + entry + }); + if (callback.current) callback.current(inView, entry); + + if (entry.isIntersecting && triggerOnce && unobserve) { + // If it should only trigger once, unobserve the element after it's inView + unobserve(); + unobserve = undefined; + } + }, { + root, + rootMargin, + threshold, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + return () => { + if (unobserve) { + unobserve(); + } + }; + }, // We break the rule here, because we aren't including the actual `threshold` variable + // eslint-disable-next-line react-hooks/exhaustive-deps + [// If the threshold is an array, convert it to a string, so it won't change between renders. + // eslint-disable-next-line react-hooks/exhaustive-deps + Array.isArray(threshold) ? threshold.toString() : threshold, ref, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]); + const entryTarget = (_state$entry = state.entry) == null ? void 0 : _state$entry.target; + const previousEntryTarget = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + + if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) { + // If we don't have a node ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`) + // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView + previousEntryTarget.current = entryTarget; + setState({ + inView: !!initialInView, + entry: undefined + }); + } + + const result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values. + + result.ref = result[0]; + result.inView = result[1]; + result.entry = result[2]; + return result; +} + + +//# sourceMappingURL=react-intersection-observer.modern.mjs.map + + +/***/ }), + +/***/ "./src/js/editor/block/block.json": +/*!****************************************!*\ + !*** ./src/js/editor/block/block.json ***! + \****************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"connekthq/instant-images","version":"1.0.0","title":"Instant Images","category":"media","description":"One click photo uploads from Unsplash, Openverse, Pixabay and Pexels.","keywords":["image","instant images","photo","stock photos","Unsplash","Openverse","Pixabay","Pexels"],"attributes":{},"supports":{"customClassName":false,"anchor":false,"html":false},"textdomain":"instant-images","editorScript":"file:./index.js"}'); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!**************************************!*\ + !*** ./src/js/editor/block/index.js ***! + \**************************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/help.js"); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/Icon */ "./src/js/components/Icon.js"); +/* harmony import */ var _components_InstantImages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/InstantImages */ "./src/js/components/InstantImages.js"); +/* harmony import */ var _functions_getProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../functions/getProvider */ "./src/js/functions/getProvider.js"); +/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./block.json */ "./src/js/editor/block/block.json"); +/* harmony import */ var _components_Help__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/Help */ "./src/js/editor/block/components/Help.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + + + + + + + + + + + +// Register the block +(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)("connekthq/instant-images", _objectSpread(_objectSpread({}, _block_json__WEBPACK_IMPORTED_MODULE_8__), {}, { + icon: _components_Icon__WEBPACK_IMPORTED_MODULE_5__.IconLogo, + edit: function edit(_ref) { + var clientId = _ref.clientId; + return /*#__PURE__*/React.createElement(InstantImagesBlock, { + clientId: clientId + }); + }, + save: function save() { + return /*#__PURE__*/React.createElement(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, null); + } +})); + +/** + * Render the InstantImages component. + * + * @param {Object} props The component props. + * @param {string} props.clientId WP block client ID. + * @return {JSX.Element} The InstantImagesBlock component. + */ +function InstantImagesBlock(_ref2) { + var clientId = _ref2.clientId; + var provider = (0,_functions_getProvider__WEBPACK_IMPORTED_MODULE_7__["default"])(); + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + mounted = _useState2[0], + setMounted = _useState2[1]; + var containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(); + var blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)({ + className: "instant-images-block" + }); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () { + if (!mounted) { + setMounted(true); + } + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement("div", blockProps, /*#__PURE__*/React.createElement("div", { + className: "instant-img-container", + "data-editor": "block", + ref: containerRef + }, /*#__PURE__*/React.createElement(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.BlockControls, null, /*#__PURE__*/React.createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToolbarGroup, null, /*#__PURE__*/React.createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToolbarDropdownMenu, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Help", "instant-images"), + icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__["default"] + }, function () { + return /*#__PURE__*/React.createElement(_components_Help__WEBPACK_IMPORTED_MODULE_9__["default"], null); + }))), !!mounted && /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_6__["default"], { + editor: "block", + provider: provider, + clientId: clientId, + data: [], + container: containerRef === null || containerRef === void 0 ? void 0 : containerRef.current + }))); +} +})(); + +/******/ })() +; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/instant-images.asset.php b/build/instant-images.asset.php index 685be83..36c155e 100644 --- a/build/instant-images.asset.php +++ b/build/instant-images.asset.php @@ -1 +1 @@ - array('react', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fc10c92482e3e4e883e3'); + array('react', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '29c211701dd89dee583f'); diff --git a/build/instant-images.js b/build/instant-images.js index 53c3fc1..4974362 100644 --- a/build/instant-images.js +++ b/build/instant-images.js @@ -1 +1,19928 @@ -(()=>{var t,e={7131:(t,e,n)=>{"use strict";const r=window.wp.element;function i(t,e){return function(){return t.apply(e,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,s=(c=Object.create(null),t=>{const e=o.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const l=t=>(t=t.toLowerCase(),e=>s(e)===t),u=t=>e=>typeof e===t,{isArray:f}=Array,h=u("undefined"),d=l("ArrayBuffer"),p=u("string"),m=u("function"),v=u("number"),g=t=>null!==t&&"object"==typeof t,y=t=>{if("object"!==s(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},_=l("Date"),b=l("File"),w=l("Blob"),E=l("FileList"),S=l("URLSearchParams");function R(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),f(t))for(r=0,i=t.length;r0;)if(r=n[i],e===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,O=t=>!h(t)&&t!==k,C=(A="undefined"!=typeof Uint8Array&&a(Uint8Array),t=>A&&t instanceof A);var A;const L=l("HTMLFormElement"),B=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),j=l("RegExp"),N=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};R(n,((n,i)=>{!1!==e(n,i,t)&&(r[i]=n)})),Object.defineProperties(t,r)},P="abcdefghijklmnopqrstuvwxyz",z="0123456789",T={DIGIT:z,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+z},I={isArray:f,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!h(t)&&null!==t.constructor&&!h(t.constructor)&&m(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||o.call(t)===e||m(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&d(t.buffer),e},isString:p,isNumber:v,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:y,isUndefined:h,isDate:_,isFile:b,isBlob:w,isRegExp:j,isFunction:m,isStream:t=>g(t)&&m(t.pipe),isURLSearchParams:S,isTypedArray:C,isFileList:E,forEach:R,merge:function t(){const{caseless:e}=O(this)&&this||{},n={},r=(r,i)=>{const o=e&&x(n,i)||i;y(n[o])&&y(r)?n[o]=t(n[o],r):y(r)?n[o]=t({},r):f(r)?n[o]=r.slice():n[o]=r};for(let t=0,e=arguments.length;t(R(e,((e,r)=>{n&&m(e)?t[r]=i(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,o,s;const c={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],r&&!r(s,t,e)||c[s]||(e[s]=t[s],c[s]=!0);t=!1!==n&&a(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:l,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(f(t))return t;let e=t.length;if(!v(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:N,freezeMethods:t=>{N(t,((e,n)=>{if(m(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];m(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return f(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:x,global:k,isContextDefined:O,ALPHABET:T,generateString:(t=16,e=T.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&m(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=f(t)?[]:{};return R(t,((t,e)=>{const o=n(t,r+1);!h(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)}};function D(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}I.inherits(D,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=D.prototype,F={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{F[t]={value:t}})),Object.defineProperties(D,F),Object.defineProperty(M,"isAxiosError",{value:!0}),D.from=(t,e,n,r,i,o)=>{const a=Object.create(M);return I.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),D.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};const H=D;function W(t){return I.isPlainObject(t)||I.isArray(t)}function U(t){return I.endsWith(t,"[]")?t.slice(0,-2):t}function q(t,e,n){return t?t.concat(e).map((function(t,e){return t=U(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const V=I.toFlatObject(I,{},null,(function(t){return/^is[A-Z]/.test(t)})),G=function(t,e,n){if(!I.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!I.isUndefined(e[t])}))).metaTokens,i=n.visitor||l,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(e);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(I.isDate(t))return t.toISOString();if(!s&&I.isBlob(t))throw new H("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(t)||I.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function l(t,n,i){let s=t;if(t&&!i&&"object"==typeof t)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(I.isArray(t)&&function(t){return I.isArray(t)&&!t.some(W)}(t)||(I.isFileList(t)||I.endsWith(n,"[]"))&&(s=I.toArray(t)))return n=U(n),s.forEach((function(t,r){!I.isUndefined(t)&&null!==t&&e.append(!0===a?q([n],r,o):null===a?n:n+"[]",c(t))})),!1;return!!W(t)||(e.append(q(i,n,o),c(t)),!1)}const u=[],f=Object.assign(V,{defaultVisitor:l,convertValue:c,isVisitable:W});if(!I.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!I.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),I.forEach(n,(function(n,o){!0===(!(I.isUndefined(n)||null===n)&&i.call(e,n,I.isString(o)?o.trim():o,r,f))&&t(n,r?r.concat(o):[o])})),u.pop()}}(t),e};function Y(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function J(t,e){this._pairs=[],t&&G(t,this,e)}const K=J.prototype;K.append=function(t,e){this._pairs.push([t,e])},K.toString=function(t){const e=t?function(e){return t.call(this,e,Y)}:Y;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const X=J;function $(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(t,e,n){if(!e)return t;const r=n&&n.encode||$,i=n&&n.serialize;let o;if(o=i?i(e,n):I.isURLSearchParams(e)?e.toString():new X(e,n).toString(r),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}const Q=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},et={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},nt=function(t){function e(t,n,r,i){let o=t[i++];const a=Number.isFinite(+o),s=i>=t.length;return o=!o&&I.isArray(r)?r.length:o,s?(I.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&I.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&I.isArray(r[o])&&(r[o]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r{e(function(t){return I.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},rt={"Content-Type":void 0},it={transitional:tt,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=I.isObject(t);if(i&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return r&&r?JSON.stringify(nt(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return G(t,new et.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return et.isNode&&I.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((o=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return G(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(I.isString(t))try{return(0,JSON.parse)(t),I.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||it.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&I.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw H.from(t,H.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:et.classes.FormData,Blob:et.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};I.forEach(["delete","get","head"],(function(t){it.headers[t]={}})),I.forEach(["post","put","patch"],(function(t){it.headers[t]=I.merge(rt)}));const ot=it,at=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),st=Symbol("internals");function ct(t){return t&&String(t).trim().toLowerCase()}function lt(t){return!1===t||null==t?t:I.isArray(t)?t.map(lt):String(t)}function ut(t,e,n,r,i){return I.isFunction(r)?r.call(this,e,n):(i&&(e=n),I.isString(e)?I.isString(r)?-1!==e.indexOf(r):I.isRegExp(r)?r.test(e):void 0:void 0)}class ft{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=ct(e);if(!i)throw new Error("header name must be a non-empty string");const o=I.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=lt(t))}const o=(t,e)=>I.forEach(t,((t,n)=>i(t,n,e)));return I.isPlainObject(t)||t instanceof this.constructor?o(t,e):I.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?o((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&at[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&i(e,t,n),this}get(t,e){if(t=ct(t)){const n=I.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(I.isFunction(e))return e.call(this,t,n);if(I.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ct(t)){const n=I.findKey(this,t);return!(!n||void 0===this[n]||e&&!ut(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=ct(t)){const i=I.findKey(n,t);!i||e&&!ut(0,n[i],i,e)||(delete n[i],r=!0)}}return I.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!ut(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return I.forEach(this,((r,i)=>{const o=I.findKey(n,i);if(o)return e[o]=lt(r),void delete e[i];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete e[i],e[a]=lt(r),n[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&I.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[st]=this[st]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=ct(t);e[r]||(function(t,e){const n=I.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return I.isArray(t)?t.forEach(r):r(t),this}}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.freezeMethods(ft.prototype),I.freezeMethods(ft);const ht=ft;function dt(t,e){const n=this||ot,r=e||n,i=ht.from(r.headers);let o=r.data;return I.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function pt(t){return!(!t||!t.__CANCEL__)}function mt(t,e,n){H.call(this,null==t?"canceled":t,H.ERR_CANCELED,e,n),this.name="CanceledError"}I.inherits(mt,H,{__CANCEL__:!0});const vt=mt,gt=et.isStandardBrowserEnv?{write:function(t,e,n,r,i,o){const a=[];a.push(t+"="+encodeURIComponent(e)),I.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),I.isString(r)&&a.push("path="+r),I.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function yt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const _t=et.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=I.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0},bt=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,o=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),l=r[a];i||(i=c),n[o]=s,r[o]=c;let u=a,f=0;for(;u!==o;)f+=n[u++],u%=t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),c-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,c=r(s);n=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&o<=a?(a-o)/c:void 0,event:i};l[e?"download":"upload"]=!0,t(l)}}const Et={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const i=ht.from(t.headers).normalize(),o=t.responseType;let a;function s(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}I.isFormData(r)&&(et.isStandardBrowserEnv||et.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(e+":"+n))}const l=yt(t.baseURL,t.url);function u(){if(!c)return;const r=ht.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),s()}),(function(t){n(t),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),Z(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(n(new H("Request aborted",H.ECONNABORTED,t,c)),c=null)},c.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||tt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new H(e,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,t,c)),c=null},et.isStandardBrowserEnv){const e=(t.withCredentials||_t(l))&&t.xsrfCookieName&>.read(t.xsrfCookieName);e&&i.set(t.xsrfHeaderName,e)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&I.forEach(i.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),I.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&"json"!==o&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",wt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",wt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{c&&(n(!e||e.type?new vt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(l);f&&-1===et.protocols.indexOf(f)?n(new H("Unsupported protocol "+f+":",H.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};I.forEach(Et,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const St={getAdapter:t=>{t=I.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let i=0;it instanceof ht?t.toJSON():t;function Ot(t,e){e=e||{};const n={};function r(t,e,n){return I.isPlainObject(t)&&I.isPlainObject(e)?I.merge.call({caseless:n},t,e):I.isPlainObject(e)?I.merge({},e):I.isArray(e)?e.slice():e}function i(t,e,n){return I.isUndefined(e)?I.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function o(t,e){if(!I.isUndefined(e))return r(void 0,e)}function a(t,e){return I.isUndefined(e)?I.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>i(kt(t),kt(e),!0)};return I.forEach(Object.keys(t).concat(Object.keys(e)),(function(r){const o=c[r]||i,a=o(t[r],e[r],r);I.isUndefined(a)&&o!==s||(n[r]=a)})),n}const Ct={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ct[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const At={};Ct.transitional=function(t,e,n){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,o)=>{if(!1===t)throw new H(r(i," has been removed"+(e?" in "+e:"")),H.ERR_DEPRECATED);return e&&!At[i]&&(At[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}};const Lt={assertOptions:function(t,e,n){if("object"!=typeof t)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],a=e[o];if(a){const e=t[o],n=void 0===e||a(e,o,t);if(!0!==n)throw new H("option "+o+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+o,H.ERR_BAD_OPTION)}},validators:Ct},Bt=Lt.validators;class jt{constructor(t){this.defaults=t,this.interceptors={request:new Q,response:new Q}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ot(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;let o;void 0!==n&&Lt.assertOptions(n,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean)},!1),void 0!==r&&Lt.assertOptions(r,{encode:Bt.function,serialize:Bt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),o=i&&I.merge(i.common,i[e.method]),o&&I.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=ht.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let u,f=0;if(!s){const t=[xt.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),u=t.length,l=Promise.resolve(e);f{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new vt(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Pt((function(e){t=e})),cancel:t}}}const zt=Pt,Tt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tt).forEach((([t,e])=>{Tt[e]=t}));const It=Tt,Dt=function t(e){const n=new Nt(e),r=i(Nt.prototype.request,n);return I.extend(r,Nt.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Ot(e,n))},r}(ot);Dt.Axios=Nt,Dt.CanceledError=vt,Dt.CancelToken=zt,Dt.isCancel=pt,Dt.VERSION="1.3.4",Dt.toFormData=G,Dt.AxiosError=H,Dt.Cancel=Dt.CanceledError,Dt.all=function(t){return Promise.all(t)},Dt.spread=function(t){return function(e){return t.apply(null,e)}},Dt.isAxiosError=function(t){return I.isObject(t)&&!0===t.isAxiosError},Dt.mergeConfig=Ot,Dt.AxiosHeaders=ht,Dt.formToJSON=t=>nt(I.isHTMLForm(t)?new FormData(t):t),Dt.HttpStatusCode=It,Dt.default=Dt;const Mt=Dt;var Ft=n(4184),Ht=n.n(Ft),Wt=n(8751),Ut=n.n(Wt);const qt=window.React,Vt=new Map,Gt=new WeakMap;let Yt=0;function Jt(t,e,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:a}=function(t){let e=function(t){return Object.keys(t).sort().filter((e=>void 0!==t[e])).map((e=>{return`${e}_${"root"===e?(n=t.root,n?(Gt.has(n)||(Yt+=1,Gt.set(n,Yt.toString())),Gt.get(n)):"0"):t[e]}`;var n})).toString()}(t),n=Vt.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver((e=>{e.forEach((e=>{var n;const o=e.isIntersecting&&i.some((t=>e.intersectionRatio>=t));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach((t=>{t(o,e)}))}))}),t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},Vt.set(e,n)}return n}(n);let s=a.get(t)||[];return a.has(t)||a.set(t,s),s.push(e),o.observe(t),function(){s.splice(s.indexOf(e),1),0===s.length&&(a.delete(t),o.unobserve(t)),0===a.size&&(o.disconnect(),Vt.delete(i))}}class Kt extends qt.Component{constructor(t){super(t),this.node=null,this._unobserveCb=null,this.handleNode=t=>{this.node&&(this.unobserve(),t||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()},this.handleChange=(t,e)=>{t&&this.props.triggerOnce&&this.unobserve(),isPlainChildren(this.props)||this.setState({inView:t,entry:e}),this.props.onChange&&this.props.onChange(t,e)},this.state={inView:!!t.initialInView,entry:void 0}}componentDidUpdate(t){t.rootMargin===this.props.rootMargin&&t.root===this.props.root&&t.threshold===this.props.threshold&&t.skip===this.props.skip&&t.trackVisibility===this.props.trackVisibility&&t.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:o}=this.props;this._unobserveCb=Jt(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!isPlainChildren(this.props)){const{inView:t,entry:e}=this.state;return this.props.children({inView:t,entry:e,ref:this.handleNode})}const t=this.props,{children:e,as:n}=t,r=function(t,e){if(null==t)return{};for(var n,r,i={},o=Object.keys(t);r=0||(i[n]=t[n]);return i}(t);return React.createElement(n||"div",_extends({ref:this.handleNode},r),e)}}function Xt({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:c,onChange:l}={}){var u;const[f,h]=qt.useState(null),d=qt.useRef(),[p,m]=qt.useState({inView:!!s,entry:void 0});d.current=l,qt.useEffect((()=>{if(a||!f)return;let s;return s=Jt(f,((t,e)=>{m({inView:t,entry:e}),d.current&&d.current(t,e),e.isIntersecting&&o&&s&&(s(),s=void 0)}),{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},c),()=>{s&&s()}}),[Array.isArray(t)?t.toString():t,f,i,r,o,a,n,c,e]);const v=null==(u=p.entry)?void 0:u.target,g=qt.useRef();f||!v||o||a||g.current===v||(g.current=v,m({inView:!!s,entry:void 0}));const y=[h,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}var $t=(0,r.createContext)();function Zt(t){var e=t.value,n=t.children;return React.createElement($t.Provider,{value:e},n)}function Qt(){return(0,r.useContext)($t)}function te(t){return t&&ee[t.toLowerCase()].icon?ee[t.toLowerCase()].icon():null}var ee={proxy:"https://proxy.getinstantimages.com/api/",testmode:!1,defaults:{provider:"unsplash",order:"latest",per_page:"20",arr_key:"results"},providers:["Unsplash","Openverse","Pixabay","Pexels"],unsplash:{name:"Unsplash",requires_key:!0,new:!1,api_var:"client_id",collections_api:"https://api.unsplash.com/collections/",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",fill:"black"}))}},pixabay:{name:"Pixabay",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{clipPath:"url(#clip0_307_143)"},React.createElement("path",{d:"M0 0V32H32V0H0Z",fill:"#48A947"}),React.createElement("path",{d:"M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",fill:"#F9FBF9"}),React.createElement("path",{d:"M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",fill:"#FAFCFA"}),React.createElement("path",{d:"M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",fill:"#4AA949"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_307_143"},React.createElement("rect",{width:"32",height:"32",fill:"white"}))))}},pexels:{name:"Pexels",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",fill:"#05A081"}),React.createElement("path",{d:"M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",fill:"#fff"}))}},openverse:{name:"Openverse",requires_key:!1,new:!1,api_var:"key",key:"",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",fill:"#000000"}))}}};const ne=window.wp.i18n;var re=[{label:(0,ne.__)("WordPress","instant-images"),value:"wordpress"},{label:(0,ne.__)("Flickr","instant-images"),value:"flickr"},{label:(0,ne.__)("Nasa","instant-images"),value:"nasa"},{label:(0,ne.__)("SpaceX","instant-images"),value:"spacex"},{label:(0,ne.__)("Wikimedia","instant-images"),value:"wikimedia"}],ie=[{label:(0,ne.__)("Square","instant-images"),value:"square"},{label:(0,ne.__)("Tall","instant-images"),value:"tall"},{label:(0,ne.__)("Wide","instant-images"),value:"wide"}],oe=[{label:(0,ne.__)("Red","instant-images"),value:"red"},{label:(0,ne.__)("Orange","instant-images"),value:"orange"},{label:(0,ne.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ne.__)("Green","instant-images"),value:"green"},{label:(0,ne.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,ne.__)("Blue","instant-images"),value:"blue"},{label:(0,ne.__)("Violet","instant-images"),value:"violet"},{label:(0,ne.__)("Pink","instant-images"),value:"pink"},{label:(0,ne.__)("Brown","instant-images"),value:"brown"},{label:(0,ne.__)("Black","instant-images"),value:"black"},{label:(0,ne.__)("Gray","instant-images"),value:"gray"},{label:(0,ne.__)("White","instant-images"),value:"white"}],ae=[{label:(0,ne.__)("Landscape","instant-images"),value:"landscape"},{label:(0,ne.__)("Portrait","instant-images"),value:"portrait"},{label:(0,ne.__)("Square","instant-images"),value:"squarish"}],se=[{label:(0,ne.__)("Grayscale","instant-images"),value:"grayscale"},{label:(0,ne.__)("Red","instant-images"),value:"red"},{label:(0,ne.__)("Orange","instant-images"),value:"orange"},{label:(0,ne.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ne.__)("Green","instant-images"),value:"green"},{label:(0,ne.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,ne.__)("Blue","instant-images"),value:"blue"},{label:(0,ne.__)("Lilac","instant-images"),value:"lilac"},{label:(0,ne.__)("Pink","instant-images"),value:"pink"},{label:(0,ne.__)("White","instant-images"),value:"white"},{label:(0,ne.__)("Gray","instant-images"),value:"gray"},{label:(0,ne.__)("Black","instant-images"),value:"black"},{label:(0,ne.__)("Brown","instant-images"),value:"brown"},{label:(0,ne.__)("Transparent","instant-images"),value:"transparent"}],ce=[{label:(0,ne.__)("Backgrounds","instant-images"),value:"backgrounds"},{label:(0,ne.__)("Fashion","instant-images"),value:"fashion"},{label:(0,ne.__)("Nature","instant-images"),value:"nature"},{label:(0,ne.__)("Science","instant-images"),value:"science"},{label:(0,ne.__)("Education","instant-images"),value:"education"},{label:(0,ne.__)("Feelings","instant-images"),value:"feelings"},{label:(0,ne.__)("Health","instant-images"),value:"health"},{label:(0,ne.__)("People","instant-images"),value:"people"},{label:(0,ne.__)("Religion","instant-images"),value:"religion"},{label:(0,ne.__)("Places","instant-images"),value:"places"},{label:(0,ne.__)("Animals","instant-images"),value:"animals"},{label:(0,ne.__)("Industry","instant-images"),value:"industry"},{label:(0,ne.__)("Computer","instant-images"),value:"computer"},{label:(0,ne.__)("Food","instant-images"),value:"food"},{label:(0,ne.__)("Sports","instant-images"),value:"sports"},{label:(0,ne.__)("Food","instant-images"),value:"food"},{label:(0,ne.__)("Transportation","instant-images"),value:"transportation"},{label:(0,ne.__)("Travel","instant-images"),value:"travel"},{label:(0,ne.__)("Buildings","instant-images"),value:"buildings"},{label:(0,ne.__)("Business","instant-images"),value:"business"},{label:(0,ne.__)("Music","instant-images"),value:"music"}],le=[{label:(0,ne.__)("Horizontal","instant-images"),value:"horizontal"},{label:(0,ne.__)("Vertical","instant-images"),value:"vertical"}],ue=[{label:(0,ne.__)("Photo","instant-images"),value:"photo"},{label:(0,ne.__)("Illustration","instant-images"),value:"illustration"},{label:(0,ne.__)("Vector","instant-images"),value:"vector"}],fe=[{label:(0,ne.__)("Black & White","instant-images"),value:"black_and_white"},{label:(0,ne.__)("Black","instant-images"),value:"black"},{label:(0,ne.__)("White","instant-images"),value:"white"},{label:(0,ne.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ne.__)("Green","instant-images"),value:"green"},{label:(0,ne.__)("Orange","instant-images"),value:"orange"},{label:(0,ne.__)("Red","instant-images"),value:"red"},{label:(0,ne.__)("Purple","instant-images"),value:"purple"},{label:(0,ne.__)("Magenta","instant-images"),value:"magenta"},{label:(0,ne.__)("Teal","instant-images"),value:"teal"},{label:(0,ne.__)("Blue","instant-images"),value:"blue"}],he=[{label:(0,ne.__)("Landscape","instant-images"),value:"landscape"},{label:(0,ne.__)("Portrait","instant-images"),value:"portrait"},{label:(0,ne.__)("Square","instant-images"),value:"squarish"}];function de(t){return function(t){if(Array.isArray(t))return pe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return pe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&parseInt(n)<2&&alert(instant_img_localize.api_ratelimit_msg)}}function Te(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Ie="";function De(t){var e=t.currentTarget,n=e.getBoundingClientRect(),r=Math.round(n.left),i=Math.round(n.top),o=e.closest("#photo-listing").querySelector("#tooltip");o.classList.remove("over"),e.classList.contains("tooltip--above")?o.classList.add("above"):o.classList.remove("above"),Ie=setInterval((function(){clearInterval(Ie),o.innerHTML=e.dataset.title,r=r-o.offsetWidth+e.offsetWidth+5,o.style.left="".concat(r,"px"),o.style.top="".concat(i,"px"),setTimeout((function(){o.classList.add("over")}),25)}),750)}function Me(t){clearInterval(Ie),t.currentTarget.closest("#photo-listing").querySelector("#tooltip").classList.remove("over")}function Fe(t){t&&window&&window.open(t,"_blank")}function He(){var t=instant_img_localize;switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200){case 400:case 401:return t.api_invalid_msg;case 403:return t.api_invalid_403_msg;case 404:return t.api_invalid_404_msg;case 429:return t.api_ratelimit_msg;case 500:case 503:return t.api_invalid_500_msg;case 501:return t.api_invalid_501_msg}}function We(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=instant_img_localize,r=He(e);switch(e){case 400:case 401:case 500:case 429:console.warn("[".concat(n.instant_images," - ").concat(e," Error] ").concat(Te(t),": ").concat(r))}}function Ue(t){return t&&t[ee.defaults.arr_key]||[]}function qe(t){return void 0===t.total||null===t.total?0:t.total}function Ve(t){if(!t||ee.testmode)return!1;var e=sessionStorage.getItem(Pe(t));if(!e)return!1;var n=JSON.parse(e),r=n.expires,i=void 0===r?0:r,o=n.error;if(void 0!==o&&o)return!1;var a=Date.now()>i;return a&&Ye(t),!(!n||a)&&n}function Ge(t,e){if(!t||!e||null!=e&&e.error)return!1;e.expires=Date.now()+36e5,sessionStorage.setItem(Pe(t),JSON.stringify(e))}function Ye(t){if(!t)return!1;sessionStorage.removeItem(Pe(t))}function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function Ke(){Ke=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==Je(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Xe(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function $e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,_x,o,a=[],_n=!0,s=!1;try{if(_x=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(a.push(r.value),a.length!==e);_n=!0);}catch(t){s=!0,i=t}finally{try{if(!_n&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=1?null:React.createElement("div",{className:"instant-images-no-results"},React.createElement("div",null,React.createElement("h3",null,instant_img_localize.no_results," "),React.createElement("p",null,instant_img_localize.no_results_desc," ")))}var ln=ee.providers;function un(t){var e=t.switchProvider,n=Qt().provider;return React.createElement(r.Fragment,null,!(null==ln||!ln.length)&&React.createElement("nav",{className:"provider-nav"},ln.map((function(t,r){return React.createElement("div",{key:"provider-".concat(r)},React.createElement("button",{onClick:function(){return e(t.toLowerCase())},className:n===t.toLowerCase()?"provider-nav--btn active":"provider-nav--btn"},te(t),React.createElement("span",null,t),ee[t.toLowerCase()].new&&React.createElement("span",{className:"provider-nav--new"},instant_img_localize.new)))}))))}function fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=200&&e.status<400&&JSON.parse(e.response).success||o(!1)},e.onerror=function(t){console.warn(t),o(!1)}}),[]),React.createElement(r.Fragment,null,i?null:React.createElement("div",{className:"error-messaging"},React.createElement("strong",null,instant_img_localize.error_restapi),instant_img_localize.error_restapi_desc))}const dn=window.wp.blocks,pn=window.wp.data;function mn(t,e){var n=t.id,r=void 0===n?null:n,i=t.url,o=void 0===i?null:i,a=t.caption,s=void 0===a?"":a,c=t.alt,l=void 0===c?"":c;if(o&&r){var u=(0,dn.createBlock)("core/image",{id:r,url:o,caption:s,alt:l});e?(0,pn.dispatch)("core/block-editor").replaceBlock(e,u):(0,pn.dispatch)("core/block-editor").insertBlocks(u)}}function vn(t){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(t)}function gn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yn(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&React.createElement("img",{className:"user-wrap--photo",src:L,alt:""}),A)),React.createElement("div",{className:"photo-options"},f&&!$?React.createElement(r.Fragment,null,React.createElement("button",{type:"button",className:"set-featured fade","data-title":instant_img_localize.set_as_featured,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},onClick:function(t){return function(t){Me(t),tt.current&&(rt=!0,tt.current.click())}(t)}},React.createElement("i",{className:"fa fa-picture-o","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.set_as_featured)),React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},onClick:function(t){return ot(t)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post))):null,!!s&&React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},onClick:function(t){return ot(t)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post)),$?React.createElement("button",{onClick:function(){$&&(window.location=$)},className:"edit-photo-admin fade","data-title":instant_img_localize.edit_upload,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)}},React.createElement("i",{className:"fa fa-pencil","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_upload)):React.createElement("button",{onClick:function(t){return function(t){t.preventDefault(),Me(t);var e=document.querySelectorAll(".edit-screen.editing");e&&e.forEach((function(t){t.classList.remove("editing")})),et.current.classList.add("editing"),setTimeout((function(){et.current.focus({preventScroll:!0})}),150)}(t)},className:"edit-photo fade","data-title":instant_img_localize.edit_details,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)}},React.createElement("i",{className:"fa fa-cog","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_details)))),React.createElement("div",{className:"photo-meta"},E?React.createElement("span",{className:"likes tooltip--above","data-title":E+" "+N,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)}},React.createElement("i",{className:"fa fa-heart heart-like","aria-hidden":"true"})," ",E):null,React.createElement("a",{className:"tooltip--above",href:m,"data-title":"".concat(instant_img_localize.open_external," ").concat(Te(o)),onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},rel:"noopener noreferrer",target:"_blank"},React.createElement("i",{className:"fa fa-external-link","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},"".concat(instant_img_localize.open_external," ").concat(Te(o)))))),React.createElement("div",{className:"edit-screen",tabIndex:"0",ref:et},React.createElement("div",{className:"edit-screen--title"},React.createElement("div",null,React.createElement("p",{className:"heading"},instant_img_localize.edit_details),S&&S.length>0&&React.createElement("p",{className:"dimensions"},S)),React.createElement("div",{className:"preview",style:{backgroundImage:"url(".concat(k,")")}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_filename,":"),React.createElement("input",{type:"text",name:"filename","data-original":p,placeholder:W.filename,value:W.filename,onChange:function(t){return ct(t)}}),React.createElement("em",null,".",w)),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_title,":"),React.createElement("input",{type:"text",name:"title","data-original":v,placeholder:v,value:W.title||"",onChange:function(t){return ct(t)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_alt,":"),React.createElement("input",{type:"text",name:"alt","data-original":g,value:W.alt||"",onChange:function(t){return ct(t)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_caption,":"),React.createElement("textarea",{rows:"4",name:"caption","data-original":F,onChange:function(t){return ct(t)},value:W.caption||"",ref:nt})),M?React.createElement("div",{className:"add-attribution-row"},React.createElement("button",{onClick:function(t){return function(t){t.preventDefault(),nt.current.value=M,U(yn(yn({},W),{},{caption:M}))}(t)},type:"button"},instant_img_localize.attribution)):null,React.createElement("div",{className:"edit-screen--controls"},React.createElement("button",{type:"button",className:"button button-secondary",onClick:function(t){return U({filename:p,title:v,alt:g,caption:F}),et.current.classList.remove("editing"),void tt.current.focus({preventScrol:!0})}},instant_img_localize.cancel)," "," ",React.createElement("button",{type:"button",className:"button button-primary",onClick:function(){return et.current.classList.remove("editing"),void tt.current.click()}},s?instant_img_localize.insert_into_post:instant_img_localize.upload_now))),React.createElement("div",{className:"photo-status"})))}function Rn(t){var e=t.result.data,n=void 0===e?null:e,i=(null==n?void 0:n.url)||"",o=(null==n?void 0:n.title)||"",a=(null==n?void 0:n.description)||"",s=(null==n?void 0:n.avatar)||"",c=n.image,l=void 0===c?null:c,u=l.src,f=void 0===u?null:u,h=l.alt,d=void 0===h?null:h,p=(0,r.useRef)(),m=(0,r.useRef)();return React.createElement(r.Fragment,null,l&&i?React.createElement("article",{className:"photo feature",title:a,ref:p,onClick:function(){return m.current.click()}},React.createElement("div",{className:"photo--wrap"},React.createElement("span",{className:"flag",title:instant_img_localize.advertisement},instant_img_localize.ad),React.createElement("div",{className:"img-wrap"},React.createElement("a",{className:"loaded",href:i,target:"_blank",ref:m,rel:"noreferrer"},React.createElement("img",{src:f,alt:d}))),React.createElement("div",{className:"feature-title"},s&&React.createElement("img",{src:s,alt:o}),React.createElement("span",null,o)))):null)}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&e.splice(n,1),e.length>=10&&(e.length=10),e.unshift(t),localStorage.setItem(Pn,JSON.stringify(e))}else localStorage.setItem(Pn,JSON.stringify([t]))}(r),g(Tn())))}(t)},autoComplete:"off"},React.createElement("label",{htmlFor:"search-input",className:"offscreen"},instant_img_localize.search_label),React.createElement("div",{ref:w},React.createElement("input",{ref:e,type:"text",id:"search-input",placeholder:instant_img_localize.search,disabled:h,onChange:function(t){return l&&p(t.target.value)},onFocus:function(){return b(!0)}}),l&&((null==v?void 0:v.length)||(null==d?void 0:d.length))?React.createElement(Un,{show:_,history:v,setHistory:g,setSearchValue:function(t){var n=null==e?void 0:e.current;n.value=t,null==E||E.current.click(),n.focus()},container:w}):null,!s&&React.createElement(Wn,{show:_})),React.createElement("button",{type:"submit",disabled:h,ref:E},React.createElement("i",{className:"fa fa-search"}),React.createElement("span",{className:"offscreen"},instant_img_localize.search)),React.createElement(qn,{show:_})))}));function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Zn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qn(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==h[0]&&h[0],!D){t.next=3;break}return t.abrupt("return",!1);case 3:if(n||""===(null==pt||null===(e=pt.current)||void 0===e?void 0:e.value)){t.next=7;break}if(!v||!y){t.next=7;break}return Ot(pt.current.value),t.abrupt("return");case 7:if(T(!0),d=void 0,(null==pt||null===(d=pt.current)||void 0===d?void 0:d.value)&&(pt.current.value=""),$(w),tt([]),Pt(),cr=1,r=Re(k,ot),i=Le("photos",r),!(o=Ve(i))){t.next=18;break}At(Ue(o),!1,null),t.next=37;break;case 18:return t.next=20,fetch(i);case 20:return a=t.sent,c=a.status,ze(a.headers),t.prev=23,t.next=26,a.json();case 26:l=t.sent,u=l.error,f=void 0===u?null:u,At(Ue(l),!1,f),Ge(i,l),t.next=37;break;case 32:t.prev=32,t.t0=t.catch(23),We(s,c),T(!1),Ye(i);case 37:setTimeout((function(){T(!1)}),_);case 38:case"end":return t.stop()}var d}),t,null,[[23,32]])}))),Rt.apply(this,arguments)}function xt(){return kt.apply(this,arguments)}function kt(){return(kt=rr($n().mark((function t(){var e,n,r,i,o,a,c,l,u,f,h,d;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j&&!z&&!D&&!H){t.next=2;break}return t.abrupt("return");case 2:if(M(!0),cr=parseInt(cr)+1,e=null!=X&&X.active&&null!=X&&X.term?{term:X.term}:{},n=null!=X&&X.active?"search":"photos",r=null!=X&&X.active?ct:ot,i=Qn(Qn(Qn({},{page:cr}),e),r),o=Re(k,i),a=Le(n,o),!(c=Ve(a))){t.next=15;break}At(Ue(c),!0,null),t.next=34;break;case 15:return t.next=17,fetch(a);case 17:return l=t.sent,u=l.status,ze(l.headers),t.prev=20,t.next=23,l.json();case 23:f=t.sent,h=f.error,d=void 0===h?null:h,At(Ue(f),!0,d),Ge(a,f),t.next=34;break;case 29:t.prev=29,t.t0=t.catch(20),We(s,u),M(!1),Ye(a);case 34:case"end":return t.stop()}}),t,null,[[20,29]])})))).apply(this,arguments)}function Ot(t){return Ct.apply(this,arguments)}function Ct(){return(Ct=rr($n().mark((function t(e){var n,r,i,o,a,c,l,u,f,h,d;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T(!0),Pt(),cr=1,n="id:"===e.substring(0,3)?"id":"term",r="id"===n?{id:e.replace("id:","").replace(/\s+/,"")}:{term:e},i=Qn(Qn(Qn({},{page:cr}),r),ct),o=Re(k,i),a=Le("search",o),!(c=Ve(a))){t.next=14;break}At(Ue(c),!1,null),$({active:!0,term:e,type:n,results:qe(c)}),t.next=35;break;case 14:return t.next=16,fetch(a);case 16:return l=t.sent,u=l.status,ze(l.headers),t.prev=19,t.next=22,l.json();case 22:f=t.sent,h=f.error,d=void 0===h?null:h,At(Ue(f),!1,d),$({active:!0,term:e,type:n,results:qe(f)}),Ge(a,f),t.next=35;break;case 29:t.prev=29,t.t0=t.catch(19),W(!0),T(!1),We(s,u),Ye(a);case 35:pt.current.classList.remove(b);case 36:case"end":return t.stop()}}),t,null,[[19,29]])})))).apply(this,arguments)}function At(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;t=null==e?void 0:e.length,W(0===parseInt(t)||void 0===t),R(n?function(t){return[].concat(er(t),er(e))}:e),V(r)}function Lt(t,e){var n=Qn({},ot);n[t]&&"#"===e||""===e||"all"===e?delete n[t]:n[t]=e,at(Qn({},n))}function Bt(t){return jt.apply(this,arguments)}function jt(){return(jt=rr($n().mark((function t(e){var n,r;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(k!==e){t.next=2;break}return t.abrupt("return");case 2:if(T(!0),V(!1),J(!1),bt.classList.remove("overflow-hidden"),!ee[e].requires_key||A.includes(e)){t.next=27;break}return t.prev=7,t.next=10,fetch(Be(e));case 10:if(n=t.sent,r=n.status,ze(n.headers),200===r){t.next=18;break}return J(e),V(!0),bt.classList.add("overflow-hidden"),t.abrupt("return");case 18:200===r&&L((function(t){return[].concat(er(t),[e])})),t.next=27;break;case 21:return t.prev=21,t.t0=t.catch(7),J(e),bt.classList.add("overflow-hidden"),V(!0),t.abrupt("return");case 27:setTimeout((function(){rt(ve[e].filters),O(e)}),_);case 28:case"end":return t.stop()}}),t,null,[[7,21]])})))).apply(this,arguments)}function Nt(){return(Nt=rr($n().mark((function t(e){var n;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&!((null==e?void 0:e.length)<3)){t.next=2;break}return t.abrupt("return");case 2:return n=instant_img_localize.root+"instant-images-extended/suggestions/?term=".concat(e),t.next=5,Mt.get(n).then((function(t){tt(t.data)})).catch((function(t){console.warn(t)}));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Pt(){vt&&null!=dt&&dt.current&&(null==dt||dt.current.scroll({top:0,left:0,behavior:"smooth"}))}function zt(t){if("Escape"===t.key){var e=dt.current.querySelectorAll(".edit-screen.editing");e&&er(e).forEach((function(t){null==t||t.classList.remove("editing")}))}}return(0,r.useEffect)((function(){null!=X&&X.active||lt({})}),[X]),(0,r.useEffect)((function(){j&&null!=X&&X.active&&Ot(null==X?void 0:X.term)}),[ct]),(0,r.useEffect)((function(){j&&St()}),[ot]),(0,r.useEffect)((function(){rt(ve[k].filters),at({})}),[k]),(0,r.useEffect)((function(){xt()}),[ht]),(0,r.useEffect)((function(){sr(dt.current,(function(){yt||(mt.current=new(Ut())(dt.current,{itemSelector:".photo"}),dt.current.querySelectorAll(".photo").forEach((function(t){t.classList.add("in-view")}))),setTimeout((function(){T(!1),M(!1),j||N(!0)}),_)}))}),[S]),(0,r.useEffect)((function(){return T(!1),Et.classList.add("loaded"),yt&&St(),document.addEventListener("keydown",zt,!1),function(){document.removeEventListener("keydown",zt,!1)}}),[]),React.createElement(r.Fragment,null,React.createElement(Zt,{value:{provider:k,wpBlock:vt,mediaModal:_t,blockSidebar:gt,clientId:d,search:X,apiError:q,getPhotos:St,searchHandler:function(t){t.preventDefault();var e=pt.current.value;e.length>2?(pt.current.classList.add(b),Ot(e)):pt.current.focus()},filterSearch:function(t,e){var n=Qn({},ct);n[t]&&"#"===e||""===e||"all"===e?delete n[t]:n[t]=e,lt(Qn({},n))},suggestions:Q,getSuggestions:function(t){return Nt.apply(this,arguments)}}},vt?React.createElement(_e,{switchProvider:Bt}):React.createElement(React.Fragment,null,React.createElement(un,{switchProvider:Bt}),React.createElement(Hn,null)),React.createElement(hn,null),React.createElement("div",{className:"control-nav"},React.createElement("div",{className:Ht()("control-nav--filters-wrap",q||null!=X&&X.active?"inactive":null)},nt&&null!==(i=Object.entries(nt))&&void 0!==i&&i.length?React.createElement("div",{className:"control-nav--filters"},Object.entries(nt).map((function(t,e){var n=ir(t,2),r=n[0],i=n[1];return React.createElement(an,{key:"".concat(k,"-").concat(e,"-").concat(r),data:i,filterKey:r,handler:Lt})}))):null),React.createElement(Yn,{ref:pt})),React.createElement("div",{id:"photo-listing",className:z?"loading":null},React.createElement(Kn,null),vt?React.createElement(Bn,{ref:dt,data:S,done:H,loadMorePhotos:xt}):React.createElement(kn,{ref:dt,data:S}),React.createElement(cn,{total:null==X?void 0:X.results,is_search:null==X?void 0:X.active}),React.createElement(sn,{ref:ft,loadMorePhotos:xt,loading:D,done:H}),React.createElement(Qe,{provider:Y,callback:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t&&O(t),J(!1),T(!1),V(!1),bt.classList.remove("overflow-hidden")}}),React.createElement(tn,null),React.createElement(jn,null))))}function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function fr(){fr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==ur(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function hr(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function dr(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){hr(o,r,i,a,s,"next",t)}function s(t){hr(o,r,i,a,s,"throw",t)}a(void 0)}))}}var pr=instant_img_localize&&instant_img_localize.default_provider?instant_img_localize.default_provider:ee.defaults.provider;function mr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee.defaults.provider,e=Le("photos",Re(t));function n(){return(n=dr(fr().mark((function n(){var i,o,a,s,c,l,u;return fr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=document.getElementById("app"))){n.next=25;break}if(!(o=Ve(e))){n.next=7;break}r.createRoot?(0,r.createRoot)(i).render(React.createElement(lr,{editor:"classic",data:o,container:i,provider:t,api_error:null})):(0,r.render)(React.createElement(lr,{editor:"classic",data:o,container:i,provider:t,api_error:null}),i),n.next=25;break;case 7:return n.next=9,fetch(e);case 9:return a=n.sent,s=a.status,ze(a.headers),n.prev=12,n.next=15,a.json();case 15:c=n.sent,l=c.error,u=void 0===l?null:l,r.createRoot?(0,r.createRoot)(i).render(React.createElement(lr,{editor:"classic",data:c,container:i,provider:t,api_error:u})):(0,r.render)(React.createElement(lr,{editor:"classic",data:c,container:i,provider:t,api_error:u}),i),Ge(e,c),n.next=25;break;case 21:n.prev=21,n.t0=n.catch(12),We(t,s),Ye(e);case 25:case"end":return n.stop()}}),n,null,[[12,21]])})))).apply(this,arguments)}!function(){n.apply(this,arguments)}()}dr(fr().mark((function t(){return fr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:mr(pr);case 1:case"end":return t.stop()}}),t)})))()},4184:(t,e)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e>>8^255&p^99,i[n]=p,o[p]=n;var m=t[n],v=t[m],g=t[v],y=257*t[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[p]=y<<24|y>>>8,f[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,n?(n=m^t[t[t[g^m]]],r^=t[t[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a6&&a%n==4&&(l=i[l>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l]):(l=i[(l=l<<8|l>>>24)>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l],l^=p[a/n|0]<<24),o[a]=o[a-n]^l);for(var s=this._invKeySchedule=[],c=0;c>>24]]^f[i[l>>>16&255]]^h[i[l>>>8&255]]^d[i[255&l]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,c,l,i)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,u,f,h,d,o),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,o,a,s){for(var c=this._nRounds,l=t[e]^n[0],u=t[e+1]^n[1],f=t[e+2]^n[2],h=t[e+3]^n[3],d=4,p=1;p>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&h]^n[d++],v=r[u>>>24]^i[f>>>16&255]^o[h>>>8&255]^a[255&l]^n[d++],g=r[f>>>24]^i[h>>>16&255]^o[l>>>8&255]^a[255&u]^n[d++],y=r[h>>>24]^i[l>>>16&255]^o[u>>>8&255]^a[255&f]^n[d++];l=m,u=v,f=g,h=y}m=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^n[d++],v=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^n[d++],g=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^n[d++],y=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[d++],t[e]=m,t[e+1]=v,t[e+2]=g,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),r.AES)},5109:function(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,m,v,g,y,_,b,w;t.exports=(r=n(8249),n(888),void(r.lib.Cipher||(i=r,o=i.lib,a=o.Base,s=o.WordArray,c=o.BufferedBlockAlgorithm,l=i.enc,l.Utf8,u=l.Base64,f=i.algo.EvpKDF,h=o.Cipher=c.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?w:_}return function(e){return{encrypt:function(n,r,i){return t(r).encrypt(e,n,r,i)},decrypt:function(n,r,i){return t(r).decrypt(e,n,r,i)}}}}()}),o.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),m=d.CBC=function(){var t=p.extend();function e(t,e,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,n=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,n&&n.words):(this._mode=t.call(r,this,n&&n.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),g=o.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(e):e).toString(u)},parse:function(t){var e,n=u.parse(t),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:e})}},_=o.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r),o=i.finalize(e),a=i.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),b=(i.kdf={}).OpenSSL={execute:function(t,e,n,r){r||(r=s.random(8));var i=f.create({keySize:e+n}).compute(t,r),o=s.create(i.words.slice(e),4*n);return i.sigBytes=4*e,g.create({key:i,iv:o,salt:r})}},w=o.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:b}),encrypt:function(t,e,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize);r.iv=i.iv;var o=_.encrypt.call(this,t,e,i.key,r);return o.mixIn(i),o},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var i=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);return r.iv=i.iv,_.decrypt.call(this,t,e,i.key,r)}}))))},8249:function(t,e,n){var r;t.exports=(r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(2480)}catch(t){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),a={},s=a.lib={},c=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},l=s.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=u.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new l.init(n,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},p=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,u=t.min(4*c,o);if(c){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},3786:function(t,e,n){var r,i,o;t.exports=(r=n(8249),o=(i=r).lib.WordArray,i.enc.Base64url={stringify:function(t,e=!0){var n=t.words,r=t.sigBytes,i=e?this._safe_map:this._map;t.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c>>6*(3-c)&63));var l=i.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(t,e=!0){var n=t.length,r=e?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(t,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},r.enc.Base64url)},298:function(t,e,n){var r;t.exports=(r=n(8249),function(){var t=r,e=t.lib.WordArray,n=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var n=t.length,r=[],i=0;i>>1]|=t.charCodeAt(i)<<16-i%2*16;return e.create(r,2*n)}},n.Utf16LE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(t){for(var n=t.length,r=[],o=0;o>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(r,2*n)}}}(),r.enc.Utf16)},888:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(u=n(8249),n(2783),n(9824),o=(i=(r=u).lib).Base,a=i.WordArray,c=(s=r.algo).MD5,l=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n,r=this.cfg,i=r.hasher.create(),o=a.create(),s=o.words,c=r.keySize,l=r.iterations;s.lengthr&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),a=this._iKey=e.clone(),s=i.words,c=a.words,l=0;l>>2]|=t[i]<<24-i%4*8;e.call(this,r,n)}else e.apply(this,arguments)};n.prototype=t}}(),r.lib.WordArray)},8214:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=t[e+0],c=t[e+1],d=t[e+2],p=t[e+3],m=t[e+4],v=t[e+5],g=t[e+6],y=t[e+7],_=t[e+8],b=t[e+9],w=t[e+10],E=t[e+11],S=t[e+12],R=t[e+13],x=t[e+14],k=t[e+15],O=o[0],C=o[1],A=o[2],L=o[3];O=l(O,C,A,L,a,7,s[0]),L=l(L,O,C,A,c,12,s[1]),A=l(A,L,O,C,d,17,s[2]),C=l(C,A,L,O,p,22,s[3]),O=l(O,C,A,L,m,7,s[4]),L=l(L,O,C,A,v,12,s[5]),A=l(A,L,O,C,g,17,s[6]),C=l(C,A,L,O,y,22,s[7]),O=l(O,C,A,L,_,7,s[8]),L=l(L,O,C,A,b,12,s[9]),A=l(A,L,O,C,w,17,s[10]),C=l(C,A,L,O,E,22,s[11]),O=l(O,C,A,L,S,7,s[12]),L=l(L,O,C,A,R,12,s[13]),A=l(A,L,O,C,x,17,s[14]),O=u(O,C=l(C,A,L,O,k,22,s[15]),A,L,c,5,s[16]),L=u(L,O,C,A,g,9,s[17]),A=u(A,L,O,C,E,14,s[18]),C=u(C,A,L,O,a,20,s[19]),O=u(O,C,A,L,v,5,s[20]),L=u(L,O,C,A,w,9,s[21]),A=u(A,L,O,C,k,14,s[22]),C=u(C,A,L,O,m,20,s[23]),O=u(O,C,A,L,b,5,s[24]),L=u(L,O,C,A,x,9,s[25]),A=u(A,L,O,C,p,14,s[26]),C=u(C,A,L,O,_,20,s[27]),O=u(O,C,A,L,R,5,s[28]),L=u(L,O,C,A,d,9,s[29]),A=u(A,L,O,C,y,14,s[30]),O=f(O,C=u(C,A,L,O,S,20,s[31]),A,L,v,4,s[32]),L=f(L,O,C,A,_,11,s[33]),A=f(A,L,O,C,E,16,s[34]),C=f(C,A,L,O,x,23,s[35]),O=f(O,C,A,L,c,4,s[36]),L=f(L,O,C,A,m,11,s[37]),A=f(A,L,O,C,y,16,s[38]),C=f(C,A,L,O,w,23,s[39]),O=f(O,C,A,L,R,4,s[40]),L=f(L,O,C,A,a,11,s[41]),A=f(A,L,O,C,p,16,s[42]),C=f(C,A,L,O,g,23,s[43]),O=f(O,C,A,L,b,4,s[44]),L=f(L,O,C,A,S,11,s[45]),A=f(A,L,O,C,k,16,s[46]),O=h(O,C=f(C,A,L,O,d,23,s[47]),A,L,a,6,s[48]),L=h(L,O,C,A,y,10,s[49]),A=h(A,L,O,C,x,15,s[50]),C=h(C,A,L,O,v,21,s[51]),O=h(O,C,A,L,S,6,s[52]),L=h(L,O,C,A,p,10,s[53]),A=h(A,L,O,C,w,15,s[54]),C=h(C,A,L,O,c,21,s[55]),O=h(O,C,A,L,_,6,s[56]),L=h(L,O,C,A,k,10,s[57]),A=h(A,L,O,C,g,15,s[58]),C=h(C,A,L,O,R,21,s[59]),O=h(O,C,A,L,m,6,s[60]),L=h(L,O,C,A,E,10,s[61]),A=h(A,L,O,C,d,15,s[62]),C=h(C,A,L,O,b,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+L|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function l(t,e,n,r,i,o,a){var s=t+(e&n|~e&r)+i+a;return(s<>>32-o)+e}function u(t,e,n,r,i,o,a){var s=t+(e&r|n&~r)+i+a;return(s<>>32-o)+e}function f(t,e,n,r,i,o,a){var s=t+(e^n^r)+i+a;return(s<>>32-o)+e}function h(t,e,n,r,i,o,a){var s=t+(n^(e|~r))+i+a;return(s<>>32-o)+e}e.MD5=o._createHelper(c),e.HmacMD5=o._createHmacHelper(c)}(Math),r.MD5)},8568:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.mode.CFB=function(){var t=r.lib.BlockCipherMode.extend();function e(t,e,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a>24&255)){var e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}var n=t.Encryptor=t.extend({processBlock:function(t,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Ansix923)},2807:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.Iso10126={pad:function(t,e){var n=4*e,i=n-t.sigBytes%n;t.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Iso10126)},1077:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.Iso97971={pad:function(t,e){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,e)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)},6991:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},6475:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){var e=t.words,n=t.sigBytes-1;for(n=t.sigBytes-1;n>=0;n--)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},r.pad.ZeroPadding)},2112:function(t,e,n){var r,i,o,a,s,c,l,u,f;t.exports=(f=n(8249),n(2783),n(9824),o=(i=(r=f).lib).Base,a=i.WordArray,c=(s=r.algo).SHA1,l=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=l.create(n.hasher,t),i=a.create(),o=a.create([1]),s=i.words,c=o.words,u=n.keySize,f=n.iterations;s.length>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(e){var o=e.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,h=u<<16|65535&l;for(r[0]^=l,r[1]^=f,r[2]^=u,r[3]^=h,r[4]^=l,r[5]^=f,r[6]^=u,r[7]^=h,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(t,e){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),t[e+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var r=t[n]+e[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(s)}(),r.RabbitLegacy)},4454:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=[],o=[],a=[],s=n.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,n=0;n<4;n++)t[n]=16711935&(t[n]<<8|t[n]>>>24)|4278255360&(t[n]<<24|t[n]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,h=u<<16|65535&l;for(i[0]^=l,i[1]^=f,i[2]^=u,i[3]^=h,i[4]^=l,i[5]^=f,i[6]^=u,i[7]^=h,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),t[e+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var r=t[n]+e[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(s)}(),r.Rabbit)},1857:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=n.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=e[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[n],t[n]=o,r|=t[(t[e]+t[n])%256]<<24-8*i}return this._i=e,this._j=n,r}t.RC4=e._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(a)}(),r.RC4)},706:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,b,w,E,S,R,x,k,O,C=this._hash.words,A=f.words,L=h.words,B=s.words,j=c.words,N=l.words,P=u.words;for(E=o=C[0],S=a=C[1],R=d=C[2],x=b=C[3],k=w=C[4],n=0;n<80;n+=1)O=o+t[e+B[n]]|0,O+=n<16?p(a,d,b)+A[0]:n<32?m(a,d,b)+A[1]:n<48?v(a,d,b)+A[2]:n<64?g(a,d,b)+A[3]:y(a,d,b)+A[4],O=(O=_(O|=0,N[n]))+w|0,o=w,w=b,b=_(d,10),d=a,a=O,O=E+t[e+j[n]]|0,O+=n<16?y(S,R,x)+L[0]:n<32?g(S,R,x)+L[1]:n<48?v(S,R,x)+L[2]:n<64?m(S,R,x)+L[3]:p(S,R,x)+L[4],O=(O=_(O|=0,P[n]))+k|0,E=k,k=x,x=_(R,10),R=S,S=O;O=C[1]+d+x|0,C[1]=C[2]+b+k|0,C[2]=C[3]+w+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+R|0,C[0]=O},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,n){return t^e^n}function m(t,e,n){return t&e|~t&n}function v(t,e,n){return(t|~e)^n}function g(t,e,n){return t&n|e&~n}function y(t,e,n){return t^(e|~n)}function _(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(Math),r.RIPEMD160)},2783:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(i=(r=u=n(8249)).lib,o=i.WordArray,a=i.Hasher,s=r.algo,c=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=0;l<80;l++){if(l<16)c[l]=0|t[e+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var f=(r<<5|r>>>27)+s+c[l];f+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),r.SHA1=a._createHelper(l),r.HmacSHA1=a._createHmacHelper(l),u.SHA1)},7792:function(t,e,n){var r,i,o,a,s,c;t.exports=(c=n(8249),n(2153),i=(r=c).lib.WordArray,o=r.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),r.SHA224=a._createHelper(s),r.HmacSHA224=a._createHmacHelper(s),c.SHA224)},2153:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var l=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=0;d<64;d++){if(d<16)l[d]=0|t[e+d];else{var p=l[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=l[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;l[d]=m+l[d-7]+g+l[d-16]}var y=r&i^r&o^i&o,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&f)+c[d]+l[d];h=f,f=u,u=s,s=a+b|0,a=o,o=i,i=r,r=b+(_+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(u),e.HmacSHA256=o._createHmacHelper(u)}(Math),r.SHA256)},3327:function(t,e,n){var r;t.exports=(r=n(8249),n(4938),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.x64.Word,s=e.algo,c=[],l=[],u=[];!function(){for(var t=1,e=0,n=0;n<24;n++){c[t+5*e]=(n+1)*(n+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r}for(t=0;t<5;t++)for(e=0;e<5;e++)l[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=n[i]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,m=0;m<5;m++)d^=(C=n[h+5*m]).high,p^=C.low;var v=f[h];v.high=d,v.low=p}for(h=0;h<5;h++){var g=f[(h+4)%5],y=f[(h+1)%5],_=y.high,b=y.low;for(d=g.high^(_<<1|b>>>31),p=g.low^(b<<1|_>>>31),m=0;m<5;m++)(C=n[h+5*m]).high^=d,C.low^=p}for(var w=1;w<25;w++){var E=(C=n[w]).high,S=C.low,R=c[w];R<32?(d=E<>>32-R,p=S<>>32-R):(d=S<>>64-R,p=E<>>64-R);var x=f[l[w]];x.high=d,x.low=p}var k=f[0],O=n[0];for(k.high=O.high,k.low=O.low,h=0;h<5;h++)for(m=0;m<5;m++){var C=n[w=h+5*m],A=f[w],L=f[(h+1)%5+5*m],B=f[(h+2)%5+5*m];C.high=A.high^~L.high&B.high,C.low=A.low^~L.low&B.low}C=n[0];var j=u[s];C.high^=j.high,C.low^=j.low}},_doFinalize:function(){var e=this._data,n=e.words,r=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(h)}return new i.init(l,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});e.SHA3=o._createHelper(h),e.HmacSHA3=o._createHmacHelper(h)}(Math),r.SHA3)},7460:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(u=n(8249),n(4938),n(34),i=(r=u).x64,o=i.Word,a=i.WordArray,s=r.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},34:function(t,e,n){var r;t.exports=(r=n(8249),n(4938),function(){var t=r,e=t.lib.Hasher,n=t.x64,i=n.Word,o=n.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var t=0;t<80;t++)l[t]=s()}();var u=a.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=r.high,p=r.low,m=i.high,v=i.low,g=o.high,y=o.low,_=a.high,b=a.low,w=s.high,E=s.low,S=u.high,R=u.low,x=f.high,k=f.low,O=h.high,C=h.low,A=d,L=p,B=m,j=v,N=g,P=y,z=_,T=b,I=w,D=E,M=S,F=R,H=x,W=k,U=O,q=C,V=0;V<80;V++){var G,Y,J=l[V];if(V<16)Y=J.high=0|t[e+2*V],G=J.low=0|t[e+2*V+1];else{var K=l[V-15],X=K.high,$=K.low,Z=(X>>>1|$<<31)^(X>>>8|$<<24)^X>>>7,Q=($>>>1|X<<31)^($>>>8|X<<24)^($>>>7|X<<25),tt=l[V-2],et=tt.high,nt=tt.low,rt=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,it=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=l[V-7],at=ot.high,st=ot.low,ct=l[V-16],lt=ct.high,ut=ct.low;Y=(Y=(Y=Z+at+((G=Q+st)>>>0>>0?1:0))+rt+((G+=it)>>>0>>0?1:0))+lt+((G+=ut)>>>0>>0?1:0),J.high=Y,J.low=G}var ft,ht=I&M^~I&H,dt=D&F^~D&W,pt=A&B^A&N^B&N,mt=L&j^L&P^j&P,vt=(A>>>28|L<<4)^(A<<30|L>>>2)^(A<<25|L>>>7),gt=(L>>>28|A<<4)^(L<<30|A>>>2)^(L<<25|A>>>7),yt=(I>>>14|D<<18)^(I>>>18|D<<14)^(I<<23|D>>>9),_t=(D>>>14|I<<18)^(D>>>18|I<<14)^(D<<23|I>>>9),bt=c[V],wt=bt.high,Et=bt.low,St=U+yt+((ft=q+_t)>>>0>>0?1:0),Rt=gt+mt;U=H,q=W,H=M,W=F,M=I,F=D,I=z+(St=(St=(St=St+ht+((ft+=dt)>>>0
>>0?1:0))+wt+((ft+=Et)>>>0>>0?1:0))+Y+((ft+=G)>>>0>>0?1:0))+((D=T+ft|0)>>>0>>0?1:0)|0,z=N,T=P,N=B,P=j,B=A,j=L,A=St+(vt+pt+(Rt>>>0>>0?1:0))+((L=ft+Rt|0)>>>0>>0?1:0)|0}p=r.low=p+L,r.high=d+A+(p>>>0>>0?1:0),v=i.low=v+j,i.high=m+B+(v>>>0>>0?1:0),y=o.low=y+P,o.high=g+N+(y>>>0

>>0?1:0),b=a.low=b+T,a.high=_+z+(b>>>0>>0?1:0),E=s.low=E+D,s.high=w+I+(E>>>0>>0?1:0),R=u.low=R+F,u.high=S+M+(R>>>0>>0?1:0),k=f.low=k+W,f.high=x+H+(k>>>0>>0?1:0),C=h.low=C+q,h.high=O+U+(C>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(u),t.HmacSHA512=e._createHmacHelper(u)}(),r.SHA512)},4253:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib,n=e.WordArray,i=e.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;n<56;n++){var r=a[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],u=c[o];for(n=0;n<24;n++)l[n/6|0]|=e[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=e[28+(s[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,n){this._lBlock=t[e],this._rBlock=t[e+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((a^i[c])&u[c])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<192.");var e=t.slice(0,2),r=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=f.createEncryptor(n.create(e)),this._des2=f.createEncryptor(n.create(r)),this._des3=f.createEncryptor(n.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),r.TripleDES)},4938:function(t,e,n){var r,i,o,a,s,c;t.exports=(r=n(8249),o=(i=r).lib,a=o.Base,s=o.WordArray,(c=i.x64={}).Word=a.extend({init:function(t,e){this.high=t,this.low=e}}),c.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r{var r,i;!function(o,a){"use strict";void 0===(i="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],n=0;n{var r,i;!function(o,a){r=[n(9741)],i=function(t){return function(t,e){"use strict";var n={extend:function(t,e){for(var n in e)t[n]=e[n];return t},modulo:function(t,e){return(t%e+e)%e}},r=Array.prototype.slice;n.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?r.call(t):[t]},n.removeFrom=function(t,e){var n=t.indexOf(e);-1!=n&&t.splice(n,1)},n.getParent=function(t,n){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,n))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.filterFindElements=function(t,r){t=n.makeArray(t);var i=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(r){e(t,r)&&i.push(t);for(var n=t.querySelectorAll(r),o=0;o{var r,i;window,void 0===(i="function"==typeof(r=function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var e="undefined"==typeof console?function(){}:function(t){console.error(t)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=n.length;function i(t){var n=getComputedStyle(t);return n||e("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var o,a=!1;function s(e){if(function(){if(!a){a=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(e);var r=i(e);o=200==Math.round(t(r.width)),s.isBoxSizeOuter=o,n.removeChild(e)}}(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var c=i(e);if("none"==c.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e{setTimeout((()=>{this.progress(t,e,n)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},i.prototype.progress=function(t,e,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log(`progress: ${n}`,t,e)},i.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},s.prototype=Object.create(e.prototype),s.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},s.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},s.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:n}=this.img,r="PICTURE"===n.nodeName?n:this.img;this.emitEvent("progress",[this,r,e])},s.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},s.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},s.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},s.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype=Object.create(s.prototype),c.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},c.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},i.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(n=e,n.fn.imagesLoaded=function(t,e){return new i(this,t,e).jqDeferred.promise(n(this))})},i.makeJQueryPlugin(),i}))},8751:(t,e,n)=>{var r,i,o;window,i=[n(1794),n(6131)],void 0===(o="function"==typeof(r=function(t,e){"use strict";var n=t.create("masonry");n.compatOptions.fitWidth="isFitWidth";var r=n.prototype;return r._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t1&&n+t>this.cols?0:n;var r=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=r?n+t:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,t)}},r._manageStamp=function(t){var n=e(t),r=this._getElementOffset(t),i=this._getOption("originLeft")?r.left:r.right,o=i+n.outerWidth,a=Math.floor(i/this.columnWidth);a=Math.max(0,a);var s=Math.floor(o/this.columnWidth);s-=o%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var c=(this._getOption("originTop")?r.top:r.bottom)+n.outerHeight,l=a;l<=s;l++)this.colYs[l]=Math.max(c,this.colYs[l])},r._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},r._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},r.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},n})?r.apply(e,i):r)||(t.exports=o)},652:(t,e,n)=>{var r,i,o;window,i=[n(1206),n(6131)],void 0===(o="function"==typeof(r=function(t,e){"use strict";var n=document.documentElement.style,r="string"==typeof n.transition?"transition":"WebkitTransition",i="string"==typeof n.transform?"transform":"WebkitTransform",o={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],a={transform:i,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"};function s(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var c=s.prototype=Object.create(t.prototype);c.constructor=s,c._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},c.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},c.getSize=function(){this.size=e(this.element)},c.css=function(t){var e=this.element.style;for(var n in t)e[a[n]||n]=t[n]},c.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),r=t[e?"left":"right"],i=t[n?"top":"bottom"],o=parseFloat(r),a=parseFloat(i),s=this.layout.size;-1!=r.indexOf("%")&&(o=o/100*s.width),-1!=i.indexOf("%")&&(a=a/100*s.height),o=isNaN(o)?0:o,a=isNaN(a)?0:a,o-=e?s.paddingLeft:s.paddingRight,a-=n?s.paddingTop:s.paddingBottom,this.position.x=o,this.position.y=a},c.layoutPosition=function(){var t=this.layout.size,e={},n=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop"),i=n?"paddingLeft":"paddingRight",o=n?"left":"right",a=n?"right":"left",s=this.position.x+t[i];e[o]=this.getXValue(s),e[a]="";var c=r?"paddingTop":"paddingBottom",l=r?"top":"bottom",u=r?"bottom":"top",f=this.position.y+t[c];e[l]=this.getYValue(f),e[u]="",this.css(e),this.emitEvent("layout",[this])},c.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},c.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},c._transitionTo=function(t,e){this.getPosition();var n=this.position.x,r=this.position.y,i=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),!i||this.isTransitioning){var o=t-n,a=e-r,s={};s.transform=this.getTranslate(o,a),this.transition({to:s,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},c.getTranslate=function(t,e){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(e=this.layout._getOption("originTop")?e:-e)+"px, 0)"},c.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},c.moveTo=c._transitionTo,c.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},c._nonTransition=function(t){for(var e in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[e].call(this)},c.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var e=this._transn;for(var n in t.onTransitionEnd)e.onEnd[n]=t.onTransitionEnd[n];for(n in t.to)e.ingProperties[n]=!0,t.isCleaning&&(e.clean[n]=!0);t.from&&(this.css(t.from),this.element.offsetHeight),this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var l="opacity,"+i.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}));c.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(o,this,!1)}},c.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},c.onotransitionend=function(t){this.ontransitionend(t)};var u={"-webkit-transform":"transform"};c.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=u[t.propertyName]||t.propertyName;delete e.ingProperties[n],function(t){for(var e in t)return!1;return!0}(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd&&(e.onEnd[n].call(this),delete e.onEnd[n]),this.emitEvent("transitionEnd",[this])}},c.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},c._removeStyles=function(t){var e={};for(var n in t)e[n]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return c.removeTransitionStyles=function(){this.css(f)},c.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},c.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},c.remove=function(){r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},c.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},c.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},c.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var n in e)return n},c.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},c.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},c.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s})?r.apply(e,i):r)||(t.exports=o)},1206:function(t,e,n){var r,i;"undefined"!=typeof window&&window,void 0===(i="function"==typeof(r=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},r=n[t]=n[t]||[];return-1==r.indexOf(e)&&r.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var r=n.indexOf(e);return-1!=r&&n.splice(r,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var r=this._onceEvents&&this._onceEvents[t],i=0;i{var r,i;!function(o,a){"use strict";r=[n(1206),n(6131),n(9047),n(652)],i=function(t,e,n,r){return function(t,e,n,r,i){var o=t.console,a=t.jQuery,s=function(){},c=0,l={};function u(t,e){var n=r.getQueryElement(t);if(n){this.element=n,a&&(this.$element=a(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(e);var i=++c;this.element.outlayerGUID=i,l[i]=this,this._create(),this._getOption("initLayout")&&this.layout()}else o&&o.error("Bad element for "+this.constructor.namespace+": "+(n||t))}u.namespace="outlayer",u.Item=i,u.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=u.prototype;function h(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}r.extend(f,e.prototype),f.option=function(t){r.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},u.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),n=this.constructor.Item,r=[],i=0;i{}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t].call(o.exports,o,o.exports,r),o.exports}r.m=e,t=[],r.O=(e,n,i,o)=>{if(!n){var a=1/0;for(u=0;u=o)&&Object.keys(r.O).every((t=>r.O[t](n[c])))?n.splice(c--,1):(s=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,i,o]},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={245:0,228:0};r.O.j=e=>0===t[e];var e=(e,n)=>{var i,o,a=n[0],s=n[1],c=n[2],l=0;if(a.some((e=>0!==t[e]))){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(c)var u=c(r)}for(e&&e(n);lr(7131)));i=r.O(i)})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/js/common/pluginProvider.js": +/*!*****************************************!*\ + !*** ./src/js/common/pluginProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PluginProvider": () => (/* binding */ PluginProvider), +/* harmony export */ "usePluginContext": () => (/* binding */ usePluginContext) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +// Create Context object. +var PluginContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(); + +// Export Provider. +function PluginProvider(props) { + var value = props.value, + children = props.children; + return /*#__PURE__*/React.createElement(PluginContext.Provider, { + value: value + }, children); +} + +// Export useContext Hook. +function usePluginContext() { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(PluginContext); +} + +/***/ }), + +/***/ "./src/js/components/APILightbox.js": +/*!******************************************!*\ + !*** ./src/js/components/APILightbox.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ APILightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/updatePluginSetting */ "./src/js/functions/updatePluginSetting.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the APILightbox component. + * Note: Component is display when switching providers and the API is invalid. + * + * @param {Object} props The component props. + * @return {JSX.Element} The APILightbox component. + */ +function APILightbox(props) { + var provider = props.provider, + callback = props.callback; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("invalid"), + _useState2 = _slicedToArray(_useState, 2), + apiStatus = _useState2[0], + setAPIStatus = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState4 = _slicedToArray(_useState3, 2), + response = _useState4[0], + setResponse = _useState4[1]; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var submitRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var api_key = instant_img_localize["".concat(provider, "_app_id")]; + var title = apiStatus === "invalid" ? instant_img_localize.api_key_invalid : ""; + + /** + * Handler for the form submission. + * + * @param {Event} e The form event. + */ + function handleSubmit(_x2) { + return _handleSubmit.apply(this, arguments); + } + /** + * Close the lightbox + */ + function _handleSubmit() { + _handleSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) { + var _inputRef$current; + var key, data, ok, status, headers; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + e.preventDefault(); + setAPIStatus("loading"); + + // Get API key value. + key = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value; // Set API key to localized variable. + instant_img_localize["".concat(provider, "_app_id")] = key; + + // Update plugin settings via REST API. + (0,_functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__["default"])("".concat(provider, "_api"), key); + _context.prev = 5; + _context.next = 8; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_2__.buildTestURL)(provider)); + case 8: + data = _context.sent; + // Handle response. + ok = data.ok, status = data.status, headers = data.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.checkRateLimit)(headers); + + // Handle response actions. + if (ok) { + // Success. + setAPIStatus("valid"); + setResponse(instant_img_localize.api_success_msg); + setTimeout(function () { + setResponse(""); + setAPIStatus("invalid"); + callback(provider); + }, 1000); + } else { + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, status); // Render console warning. + + if (status === 400 || status === 401) { + setResponse(instant_img_localize.api_invalid_msg); // Unsplash/Pixabay incorrect API key. + } + + if (status === 429) { + setResponse(instant_img_localize.api_ratelimit_msg); // Pixabay - too many requests. + } + } + _context.next = 19; + break; + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](5); + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, 500); // Render console warning. + setResponse(instant_img_localize.api_invalid_500_msg); + case 19: + case "end": + return _context.stop(); + } + }, _callee, null, [[5, 14]]); + })); + return _handleSubmit.apply(this, arguments); + } + function closeLightbox() { + if (lightbox !== null && lightbox !== void 0 && lightbox.current) { + lightbox.current.classList.remove("active"); + setTimeout(function () { + callback(); + }, 150); + } + } + + /** + * Close the lightbox with a background click. + * + * @param {Event} e The form event. + */ + function bkgClick(e) { + var target = e.target; + // If clicked element is the background. + if (target === (lightbox === null || lightbox === void 0 ? void 0 : lightbox.current)) { + closeLightbox(); + } + } + + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + closeLightbox(); + } + } + + /** + * Reset the key to use Instant Images default. + */ + function getDefaultKey() { + inputRef.current.value = ""; + setTimeout(function () { + submitRef.current.click(); + }, 25); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + var _lightbox$current; + document.addEventListener("keydown", escFunction, false); + lightbox === null || lightbox === void 0 ? void 0 : (_lightbox$current = lightbox.current) === null || _lightbox$current === void 0 ? void 0 : _lightbox$current.classList.add("active"); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, [provider]); //eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, provider ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("div", { + className: "api-lightbox", + ref: lightbox, + onClick: function onClick(e) { + return bkgClick(e); + }, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", { + className: "api-lightbox--close", + onClick: function onClick() { + return closeLightbox(); + } + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.btnClose)), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--details" + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_6__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", null, instant_img_localize["".concat(provider, "_api_desc")]), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key), /*#__PURE__*/React.createElement("span", null, "|"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getDefaultKey(); + } + }, instant_img_localize.use_instant_images_key))), /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return handleSubmit(e); + } + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "key", + className: "offscreen" + }, instant_img_localize.enter_api_key), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--input-wrap" + }, /*#__PURE__*/React.createElement("span", { + className: apiStatus, + title: title && title + }, apiStatus === "invalid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-exclamation-triangle", + "aria-hidden": "true" + }), apiStatus === "valid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-check-circle", + "aria-hidden": "true" + }), apiStatus === "loading" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-spinner fa-spin", + "aria-hidden": "true" + })), /*#__PURE__*/React.createElement("input", { + type: "text", + id: "key", + ref: inputRef, + placeholder: "Enter API Key", + defaultValue: api_key + })), response && /*#__PURE__*/React.createElement("p", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--response", apiStatus) + }, response), /*#__PURE__*/React.createElement("button", { + type: "submit", + ref: submitRef + }, instant_img_localize.btnVerify))))) : null); +} + +/***/ }), + +/***/ "./src/js/components/ErrorLightbox.js": +/*!********************************************!*\ + !*** ./src/js/components/ErrorLightbox.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ErrorLightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/getErrorMessage */ "./src/js/functions/getErrorMessage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + + + + +/** + * Render the ErrorLightbox component. + * Note: Component is display on initial plugin load if the default provider has an invalid API key. + * + * @return {JSX.Element} The ErrorLightbox component. + */ +function ErrorLightbox() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + apiError = _usePluginContext.apiError; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var status = apiError !== null && apiError !== void 0 && apiError.status ? apiError.status : null; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, apiError && status && /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox", "error-lightbox", "active"), + ref: lightbox, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--details", "error-lightbox") + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_5__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", { + className: "callout-warning" + }, status, " ", instant_img_localize.error), /*#__PURE__*/React.createElement("p", null, (0,_functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(status)), /*#__PURE__*/React.createElement("p", { + className: "more-info" + }, instant_img_localize.api_default_provider), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key)))))); +} + +/***/ }), + +/***/ "./src/js/components/Filter.js": +/*!*************************************!*\ + !*** ./src/js/components/Filter.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Filter) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/** + * Render the Filter component. + * + * @param {Object} props The component props. + * @param {Object} props.data The filter data. + * @param {string} props.filterKey The filter key. + * @param {Function} props.handler The change/click handler function. + * @return {JSX.Element} The Filter component. + */ +function Filter(props) { + var _data$filters; + var data = props.data, + filterKey = props.filterKey, + handler = props.handler; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider; + var defaultValue = data === null || data === void 0 ? void 0 : data["default"]; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + expanded = _useState2[0], + setExpanded = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue), + _useState4 = _slicedToArray(_useState3, 2), + selected = _useState4[0], + setSelected = _useState4[1]; + var dropdown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var button = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var menu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var id = "".concat(provider, "-").concat(filterKey); + var isColor = filterKey === "colors" || filterKey === "color"; + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__.useArrowControls)(expanded, dropdown); + + /** + * Toggle menu open/closed. + * + * @param {Event} event The click event. + */ + function toggleMenu(event) { + event.preventDefault(); + + // If disabled, don't open menu. + var target = event.currentTarget; + if (target.disabled) { + return false; + } + if (expanded) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } else { + setExpanded(true); + document.addEventListener("click", closeMenuOutside); + } + } + + /** + * Close menu when clicking outside. + * + * @param {Event} event The click event. + */ + function closeMenuOutside(event) { + var _menu$current, _button$current; + if (!(menu !== null && menu !== void 0 && (_menu$current = menu.current) !== null && _menu$current !== void 0 && _menu$current.contains(event.target)) && !(button !== null && button !== void 0 && (_button$current = button.current) !== null && _button$current !== void 0 && _button$current.contains(event.target))) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } + } + + /** + * Checks for focus outside of component. + * + * @param {Event} event The click event. + */ + function focusOutside(event) { + if (!(dropdown !== null && dropdown !== void 0 && dropdown.current.contains(event.target))) { + closeMenuOutside(event); + } + } + + /** + * Detect esc key press. + * + * @param {Event} event The click event. + */ + function escClick(event) { + if (event.key === "Escape") { + setExpanded(false); + } + } + + /** + * Click handler for the filter buttons. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function click(filter, value) { + var newValue = selected !== value ? value : defaultValue; + setSelected(newValue); + handler(filter, newValue); + setTimeout(function () { + var _button$current2; + button === null || button === void 0 ? void 0 : (_button$current2 = button.current) === null || _button$current2 === void 0 ? void 0 : _button$current2.click(); + }, 100); + } + + /** + * Convert a color to a CSS value. + * + * @see https://www.w3schools.com/colors/colors_names.asp + * + * @param {string} color The current color. + * @return {string} The color. + */ + function convertColor(color) { + if (color === "lilac") { + color = "DarkViolet"; + } + if (color === "grayscale" || color === "black_and_white") { + color = "LightGray"; + } + return color; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Initiate arrow menus. + // a11yarrows.init(dropdown?.current, { + // selector: "button", + // }); + + // Check for focus outside. + document.addEventListener("keyup", focusOutside); + document.addEventListener("keydown", escClick); + return function () { + document.removeEventListener("keyup", focusOutside); + document.removeEventListener("keydown", escClick); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement("div", { + className: "filter-dropdown", + id: id, + ref: dropdown + }, /*#__PURE__*/React.createElement("button", { + onClick: toggleMenu, + className: "filter-dropdown--button", + "aria-expanded": expanded ? "true" : "false", + ref: button + }, /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-label" + }, data === null || data === void 0 ? void 0 : data.label), /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-selected" + }, selected.replace(/_/g, " "), /*#__PURE__*/React.createElement("i", { + className: "fa fa-caret-down", + "aria-hidden": "true" + }))), /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--menu", expanded ? "expanded" : null), + "data-key": filterKey, + "aria-hidden": expanded ? "false" : "true", + ref: menu + }, (data === null || data === void 0 ? void 0 : (_data$filters = data.filters) === null || _data$filters === void 0 ? void 0 : _data$filters.length) && data.filters.map(function (filter, key) { + var label = filter.label, + value = filter.value; + return /*#__PURE__*/React.createElement("button", { + key: key, + disabled: selected === value, + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--item", selected === value ? "selected" : null), + onClick: function onClick() { + return click(filterKey, value); + } + }, label, value !== "all" && value !== "transparent" && isColor ? /*#__PURE__*/React.createElement("span", { + className: "_color", + style: { + color: convertColor(value) + } + }) : null); + }))); +} + +/***/ }), + +/***/ "./src/js/components/Icon.js": +/*!***********************************!*\ + !*** ./src/js/components/Icon.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "IconLogo": () => (/* binding */ IconLogo), +/* harmony export */ "IconSVG": () => (/* binding */ IconSVG), +/* harmony export */ "default": () => (/* binding */ Icon) +/* harmony export */ }); +/** + * The Icon component. + * + * @return {JSX.Element} The Icon component. + */ +function Icon() { + return /*#__PURE__*/React.createElement("span", { + className: "instant-images-sidebar-icon" + }, /*#__PURE__*/React.createElement(IconSVG, null)); +} + +/** + * The SVG icon. + * + * @return {JSX.Element} The IconSVG component. + */ +function IconSVG() { + return /*#__PURE__*/React.createElement("svg", { + viewBox: "0 0 31 58", + width: "13px", + height: "24px" + }, /*#__PURE__*/React.createElement("polygon", { + points: "20 0 20 23 31 23 11 58 11 34 0 34 20 0", + fill: "#4a7bc5" + })); +} + +/** + * The SVG Logo. + * + * @return {JSX.Element} The IconLogo component. + */ +function IconLogo() { + return /*#__PURE__*/React.createElement("svg", { + width: "80", + height: "80", + viewBox: "0 0 80 80", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("title", null, "Instant Images Icon"), /*#__PURE__*/React.createElement("path", { + d: "M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z", + fill: "#647FE8" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + })); +} + +/***/ }), + +/***/ "./src/js/components/InstantImages.js": +/*!********************************************!*\ + !*** ./src/js/components/InstantImages.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ InstantImages) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! masonry-layout */ "./node_modules/masonry-layout/masonry.js"); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(masonry_layout__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor/block/components/Header */ "./src/js/editor/block/components/Header.js"); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../functions/getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _functions_getResults__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../functions/getResults */ "./src/js/functions/getResults.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../functions/session */ "./src/js/functions/session.js"); +/* harmony import */ var _APILightbox__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./APILightbox */ "./src/js/components/APILightbox.js"); +/* harmony import */ var _ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ErrorLightbox */ "./src/js/components/ErrorLightbox.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _LoadMore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LoadMore */ "./src/js/components/LoadMore.js"); +/* harmony import */ var _NoResults__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./NoResults */ "./src/js/components/NoResults.js"); +/* harmony import */ var _ProviderNav__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ProviderNav */ "./src/js/components/ProviderNav.js"); +/* harmony import */ var _RestAPIError__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RestAPIError */ "./src/js/components/RestAPIError.js"); +/* harmony import */ var _Results__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Results */ "./src/js/components/Results.js"); +/* harmony import */ var _ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ResultsWPBlock */ "./src/js/components/ResultsWPBlock.js"); +/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Tooltip */ "./src/js/components/Tooltip.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _search_SearchForm__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./search/SearchForm */ "./src/js/components/search/SearchForm.js"); +/* harmony import */ var _search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./search/SearchHeader */ "./src/js/components/search/SearchHeader.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var imagesLoaded = __webpack_require__(/*! imagesloaded */ "./node_modules/imagesloaded/imagesloaded.js"); +var page = 1; + +/** + * Render the main InstantImages application component. + * + * @param {Object} props The component props. + * @param {string} props.editor Editor type. + * @param {string} props.provider Image provider. + * @param {Array} props.data API results. + * @param {Element} props.container Instant Images container element. + * @param {Object} props.api_error API error object. + * @param {string} props.clientId WP block client ID. + * @return {JSX.Element} InstantImages component. + */ +function InstantImages(props) { + var _instant_img_localize4, _instant_img_localize5, _Object$entries; + var _props$editor = props.editor, + editor = _props$editor === void 0 ? "classic" : _props$editor, + provider = props.provider, + data = props.data, + container = props.container, + _props$api_error = props.api_error, + api_error = _props$api_error === void 0 ? null : _props$api_error, + _props$clientId = props.clientId, + clientId = _props$clientId === void 0 ? null : _props$clientId; + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var delay = 250; + var searchClass = "searching"; + var searchDefaults = { + active: false, + term: "", + type: "", + results: 0 + }; + + // App state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(data)), + _useState2 = _slicedToArray(_useState, 2), + results = _useState2[0], + setResults = _useState2[1]; // Image results. + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(provider), + _useState4 = _slicedToArray(_useState3, 2), + activeProvider = _useState4[0], + setActiveProvider = _useState4[1]; // Current provider. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState6 = _slicedToArray(_useState5, 2), + apiTested = _useState6[0], + setAPITested = _useState6[1]; // API key test results. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState8 = _slicedToArray(_useState7, 2), + mounted = _useState8[0], + setMounted = _useState8[1]; // App mounted state. + var _useState9 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState10 = _slicedToArray(_useState9, 2), + loading = _useState10[0], + setLoading = _useState10[1]; // Loading state + var _useState11 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState12 = _slicedToArray(_useState11, 2), + loadingMore = _useState12[0], + setLoadingMore = _useState12[1]; // Load more state. + var _useState13 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState14 = _slicedToArray(_useState13, 2), + done = _useState14[0], + setDone = _useState14[1]; // Done state. + var _useState15 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(api_error), + _useState16 = _slicedToArray(_useState15, 2), + apiError = _useState16[0], + setAPIError = _useState16[1]; // API Error. + var _useState17 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState18 = _slicedToArray(_useState17, 2), + showAPILightbox = _useState18[0], + setShowAPILightbox = _useState18[1]; // Render API key lightbox. + var _useState19 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(searchDefaults), + _useState20 = _slicedToArray(_useState19, 2), + search = _useState20[0], + setSearch = _useState20[1]; + var _useState21 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState22 = _slicedToArray(_useState21, 2), + suggestions = _useState22[0], + setSuggestions = _useState22[1]; + var _useState23 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters), + _useState24 = _slicedToArray(_useState23, 2), + filterOptions = _useState24[0], + setFilterOptions = _useState24[1]; + var _useState25 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState26 = _slicedToArray(_useState25, 2), + filters = _useState26[0], + setFilters = _useState26[1]; + var _useState27 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState28 = _slicedToArray(_useState27, 2), + searchFilters = _useState28[0], + setSearchFilters = _useState28[1]; + + // Refs. + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + var photosRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var searchInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var msnryRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // WP Editor props. + var wpBlock = editor === "block" ? true : false; + var blockSidebar = editor === "sidebar" ? true : false; + var isBlockEditor = wpBlock || blockSidebar ? true : false; + var mediaModal = editor === "media-modal" ? true : false; + var body = document.body; + var plugin = isBlockEditor ? container : container.parentNode.parentNode; + var wrapper = isBlockEditor ? container : plugin.querySelector(".instant-images-wrapper"); + + /** + * Get the initial set of photos for the current view (New/Popular/Filters/etc...). + * + * @param {boolean} reset Reset the current view. + * @since 3.0 + */ + function getPhotos() { + return _getPhotos.apply(this, arguments); + } + /** + * Load more photos in infinite scroll style. + * + * @since 3.0 + */ + function _getPhotos() { + _getPhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _searchInputRef$curre2; + var reset, + params, + url, + sessionData, + response, + status, + headers, + apiResults, + _apiResults$error, + error, + _args = arguments; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + reset = _args.length > 0 && _args[0] !== undefined ? _args[0] : false; + if (!loadingMore) { + _context.next = 3; + break; + } + return _context.abrupt("return", false); + case 3: + if (!(!reset && (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre2 = searchInputRef.current) === null || _searchInputRef$curre2 === void 0 ? void 0 : _searchInputRef$curre2.value) !== "")) { + _context.next = 7; + break; + } + if (!(extended_activated && extended_license)) { + _context.next = 7; + break; + } + doSearch(searchInputRef.current.value); + return _context.abrupt("return"); + case 7: + setLoading(true); // Set loading state. + clearSearch(); // Reset search results. + + resetScrollPosition(); + page = 1; + + // Build URL. + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, filters); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("photos", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context.next = 18; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + _context.next = 37; + break; + case 18: + _context.next = 20; + return fetch(url); + case 20: + response = _context.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context.prev = 23; + _context.next = 26; + return response.json(); + case 26: + apiResults = _context.sent; + _apiResults$error = apiResults.error, error = _apiResults$error === void 0 ? null : _apiResults$error; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context.next = 37; + break; + case 32: + _context.prev = 32; + _context.t0 = _context["catch"](23); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoading(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 37: + // Delay loading animatons for effect. + setTimeout(function () { + setLoading(false); + }, delay); + case 38: + case "end": + return _context.stop(); + } + }, _callee, null, [[23, 32]]); + })); + return _getPhotos.apply(this, arguments); + } + function loadMorePhotos() { + return _loadMorePhotos.apply(this, arguments); + } + /** + * Perform a photo search. + * + * @param {string} term Search term. + * @since 3.0 + */ + function _loadMorePhotos() { + _loadMorePhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var searchQuery, type, activeFilters, loadmoreParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error2, error; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(!mounted || loading || loadingMore || done)) { + _context2.next = 2; + break; + } + return _context2.abrupt("return"); + case 2: + setLoadingMore(true); + page = parseInt(page) + 1; + + // Get search query. + searchQuery = search !== null && search !== void 0 && search.active && search !== null && search !== void 0 && search.term ? { + term: search.term + } : {}; // Build URL. + type = search !== null && search !== void 0 && search.active ? "search" : "photos"; + activeFilters = search !== null && search !== void 0 && search.active ? searchFilters : filters; + loadmoreParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), activeFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, loadmoreParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])(type, params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context2.next = 15; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), true, null); + _context2.next = 34; + break; + case 15: + _context2.next = 17; + return fetch(url); + case 17: + response = _context2.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context2.prev = 20; + _context2.next = 23; + return response.json(); + case 23: + apiResults = _context2.sent; + _apiResults$error2 = apiResults.error, error = _apiResults$error2 === void 0 ? null : _apiResults$error2; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), true, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context2.next = 34; + break; + case 29: + _context2.prev = 29; + _context2.t0 = _context2["catch"](20); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoadingMore(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 34: + case "end": + return _context2.stop(); + } + }, _callee2, null, [[20, 29]]); + })); + return _loadMorePhotos.apply(this, arguments); + } + function doSearch(_x2) { + return _doSearch.apply(this, arguments); + } + /** + * Handle the display results. + * + * @param {Array} images Image array. + * @param {boolean} append Append images to existing results display. + * @param {string|null} error Error message. + */ + function _doSearch() { + _doSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(term) { + var searchType, searchQuery, searchParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error3, error; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + setLoading(true); + resetScrollPosition(); + page = 1; // Reset current page num. + searchType = term.substring(0, 3) === "id:" ? "id" : "term"; // Get search query. + searchQuery = searchType === "id" ? { + id: term.replace("id:", "").replace(/\s+/, "") + } : { + term: term + }; // Build URL. + searchParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), searchFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, searchParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("search", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context3.next = 14; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(sessionData) + }); + _context3.next = 35; + break; + case 14: + _context3.next = 16; + return fetch(url); + case 16: + response = _context3.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context3.prev = 19; + _context3.next = 22; + return response.json(); + case 22: + apiResults = _context3.sent; + _apiResults$error3 = apiResults.error, error = _apiResults$error3 === void 0 ? null : _apiResults$error3; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(apiResults) + }); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context3.next = 35; + break; + case 29: + _context3.prev = 29; + _context3.t0 = _context3["catch"](19); + // Reset all search parameters. + setDone(true); + setLoading(false); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 35: + searchInputRef.current.classList.remove(searchClass); + case 36: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[19, 29]]); + })); + return _doSearch.apply(this, arguments); + } + function displayResults() { + var images = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var error = arguments.length > 2 ? arguments[2] : undefined; + checkResults(images === null || images === void 0 ? void 0 : images.length); + if (append) { + setResults(function (prevState) { + return [].concat(_toConsumableArray(prevState), _toConsumableArray(images)); + }); // Load more. + } else { + setResults(images); // Standard switch. + } + + setAPIError(error); + } + + /** + * Handle the Photo Search. + * + * @param {Event} event The dispatched submit event. + * @since 3.0 + */ + function searchHandler(event) { + event.preventDefault(); + var term = searchInputRef.current.value; + if (term.length > 2) { + searchInputRef.current.classList.add(searchClass); + doSearch(term); + } else { + searchInputRef.current.focus(); + } + } + + /** + * Reset search results, settings and results view. + * + * @since 3.0 + */ + function clearSearch() { + var _searchInputRef$curre; + var term = (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.value) || ""; + if (term) { + searchInputRef.current.value = ""; + } + setSearch(searchDefaults); + setSuggestions([]); + } + + /** + * Filter the photo listing. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterPhotos(filter, value) { + var newFilters = _objectSpread({}, filters); + if (newFilters[filter] && value === "#" || value === "" || value === "all") { + delete newFilters[filter]; + } else { + newFilters[filter] = value; + } + setFilters(_objectSpread({}, newFilters)); + } + + /** + * Filter the search results. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterSearch(filter, value) { + var newSearchFilters = _objectSpread({}, searchFilters); + if (newSearchFilters[filter] && value === "#" || value === "" || value === "all") { + delete newSearchFilters[filter]; + } else { + newSearchFilters[filter] = value; + } + setSearchFilters(_objectSpread({}, newSearchFilters)); + } + + /** + * Close the API Lightbox. + * + * @param {string} target The target provider to close the lightbox for. + * @since 4.5 + */ + function closeAPILightbox() { + var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + if (target) { + setActiveProvider(target); + } + setShowAPILightbox(false); + setLoading(false); + setAPIError(false); + body.classList.remove("overflow-hidden"); + } + + /** + * Switch API providers. + * + * @param {string} newProvider The provider to switch to. + * @since 4.5 + */ + function switchProvider(_x3) { + return _switchProvider.apply(this, arguments); + } + /** + * Get autocomplete search suggestions. + * + * @param {string} term The search term. + * @return {Array} The autocomplete suggestions. + */ + function _switchProvider() { + _switchProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(newProvider) { + var response, status, headers; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!(activeProvider === newProvider)) { + _context4.next = 2; + break; + } + return _context4.abrupt("return"); + case 2: + setLoading(true); + setAPIError(false); + setShowAPILightbox(false); + body.classList.remove("overflow-hidden"); + + // API verification - check API key for provider. + if (!(_constants_API__WEBPACK_IMPORTED_MODULE_4__.API[newProvider].requires_key && !apiTested.includes(newProvider))) { + _context4.next = 27; + break; + } + _context4.prev = 7; + _context4.next = 10; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__.buildTestURL)(newProvider)); + case 10: + response = _context4.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + if (!(status !== 200)) { + _context4.next = 18; + break; + } + // Catch API errors and 401s. + setShowAPILightbox(newProvider); // Show API Lightbox. + setAPIError(true); + body.classList.add("overflow-hidden"); + return _context4.abrupt("return"); + case 18: + if (status === 200) { + // Valid API key - Add to array of tested providers. + setAPITested(function (prevState) { + return [].concat(_toConsumableArray(prevState), [newProvider]); + }); + } + _context4.next = 27; + break; + case 21: + _context4.prev = 21; + _context4.t0 = _context4["catch"](7); + // Catch all other errors. + setShowAPILightbox(newProvider); // Show API Lightbox. + body.classList.add("overflow-hidden"); + setAPIError(true); + return _context4.abrupt("return"); + case 27: + // Add slight delay for loading effect. + setTimeout(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[newProvider].filters); // Update filter options. + setActiveProvider(newProvider); // Switch the provider. + }, delay); + case 28: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[7, 21]]); + })); + return _switchProvider.apply(this, arguments); + } + function getSuggestions(_x4) { + return _getSuggestions.apply(this, arguments); + } + /** + * Renders the Masonry layout. + * + * @since 3.0 + */ + function _getSuggestions() { + _getSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(term) { + var api_url; + return _regeneratorRuntime().wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (!(!term || (term === null || term === void 0 ? void 0 : term.length) < 3)) { + _context5.next = 2; + break; + } + return _context5.abrupt("return"); + case 2: + // API endpoint URL. + api_url = instant_img_localize.root + "instant-images-extended/suggestions/?term=".concat(term); // Get suggestions. + _context5.next = 5; + return axios__WEBPACK_IMPORTED_MODULE_27__["default"].get(api_url).then(function (res) { + setSuggestions(res.data); + })["catch"](function (error) { + console.warn(error); + }); + case 5: + case "end": + return _context5.stop(); + } + }, _callee5); + })); + return _getSuggestions.apply(this, arguments); + } + function renderLayout() { + imagesLoaded(photosRef.current, function () { + if (!isBlockEditor) { + msnryRef.current = new (masonry_layout__WEBPACK_IMPORTED_MODULE_2___default())(photosRef.current, { + itemSelector: ".photo" + }); + photosRef.current.querySelectorAll(".photo").forEach(function (el) { + el.classList.add("in-view"); + }); + } + setTimeout(function () { + // Delay to allow for rendering and set up. + setLoading(false); + setLoadingMore(false); + if (!mounted) { + setMounted(true); + } + }, delay); + }); + } + + /** + * Reset the scroll position for the WP block only. + */ + function resetScrollPosition() { + if (wpBlock && photosRef !== null && photosRef !== void 0 && photosRef.current) { + photosRef === null || photosRef === void 0 ? void 0 : photosRef.current.scroll({ + top: 0, + left: 0, + behavior: "smooth" + }); + } + } + + /** + * A checker to determine if there are remaining search results. + * + * @param {number} num Total search results. + * @since 3.0 + */ + function checkResults(num) { + setDone(parseInt(num) === 0 || num === undefined); + } + + /** + * Escape handler to close edit windows on photos. + * + * @param {Event} e The key event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + var editing = photosRef.current.querySelectorAll(".edit-screen.editing"); + if (editing) { + _toConsumableArray(editing).forEach(function (element) { + element === null || element === void 0 ? void 0 : element.classList.remove("editing"); + }); + } + } + } + + /* Search callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (!(search !== null && search !== void 0 && search.active)) { + // Reset search filters when search is false. + setSearchFilters({}); + } + }, [search]); // eslint-disable-line react-hooks/exhaustive-deps + + /* Search filters change callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted && search !== null && search !== void 0 && search.active) { + doSearch(search === null || search === void 0 ? void 0 : search.term); + } + }, [searchFilters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Filters change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted) { + getPhotos(); + } + }, [filters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Provider change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters); + setFilters({}); // Trigger filter change. + }, [activeProvider]); // eslint-disable-line react-hooks/exhaustive-deps + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Infinite scrolling. + loadMorePhotos(); + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + // Results callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + renderLayout(); + }, [results]); // eslint-disable-line react-hooks/exhaustive-deps + + // Initial page load. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setLoading(false); + wrapper.classList.add("loaded"); + + // Block editor, get initial set of photos. + if (isBlockEditor) { + getPhotos(); + } + // Add global escape listener. + document.addEventListener("keydown", escFunction, false); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.PluginProvider, { + value: { + provider: activeProvider, + wpBlock: wpBlock, + mediaModal: mediaModal, + blockSidebar: blockSidebar, + clientId: clientId, + search: search, + apiError: apiError, + getPhotos: getPhotos, + searchHandler: searchHandler, + filterSearch: filterSearch, + suggestions: suggestions, + getSuggestions: getSuggestions + } + }, wpBlock ? /*#__PURE__*/React.createElement(_editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], { + switchProvider: switchProvider + }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_ProviderNav__WEBPACK_IMPORTED_MODULE_18__["default"], { + switchProvider: switchProvider + }), /*#__PURE__*/React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_23__.ExtendedCTA, null)), /*#__PURE__*/React.createElement(_RestAPIError__WEBPACK_IMPORTED_MODULE_19__["default"], null), /*#__PURE__*/React.createElement("div", { + className: "control-nav" + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--filters-wrap", apiError || search !== null && search !== void 0 && search.active ? "inactive" : null) + }, filterOptions && (_Object$entries = Object.entries(filterOptions)) !== null && _Object$entries !== void 0 && _Object$entries.length ? /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filterOptions).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_15__["default"], { + key: "".concat(activeProvider, "-").concat(index, "-").concat(key), + data: filter, + filterKey: key, + handler: filterPhotos + }); + })) : null), /*#__PURE__*/React.createElement(_search_SearchForm__WEBPACK_IMPORTED_MODULE_24__["default"], { + ref: searchInputRef + })), /*#__PURE__*/React.createElement("div", { + id: "photo-listing", + className: loading ? "loading" : null + }, /*#__PURE__*/React.createElement(_search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__["default"], null), wpBlock ? /*#__PURE__*/React.createElement(_ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__["default"], { + ref: photosRef, + data: results, + done: done, + loadMorePhotos: loadMorePhotos + }) : /*#__PURE__*/React.createElement(_Results__WEBPACK_IMPORTED_MODULE_20__["default"], { + ref: photosRef, + data: results + }), /*#__PURE__*/React.createElement(_NoResults__WEBPACK_IMPORTED_MODULE_17__["default"], { + total: search === null || search === void 0 ? void 0 : search.results, + is_search: search === null || search === void 0 ? void 0 : search.active + }), /*#__PURE__*/React.createElement(_LoadMore__WEBPACK_IMPORTED_MODULE_16__["default"], { + ref: loadMoreRef, + loadMorePhotos: loadMorePhotos, + loading: loadingMore, + done: done + }), /*#__PURE__*/React.createElement(_APILightbox__WEBPACK_IMPORTED_MODULE_13__["default"], { + provider: showAPILightbox, + callback: closeAPILightbox + }), /*#__PURE__*/React.createElement(_ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__["default"], null), /*#__PURE__*/React.createElement(_Tooltip__WEBPACK_IMPORTED_MODULE_22__["default"], null)))); +} + +/***/ }), + +/***/ "./src/js/components/LoadMore.js": +/*!***************************************!*\ + !*** ./src/js/components/LoadMore.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); + + + + +/** + * Render the LoadMore component. + * + * @return {JSX.Element} The LoadMore component. + */ +var LoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var loadMorePhotos = props.loadMorePhotos, + loading = props.loading, + done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("load-more-wrap", loading ? "loading" : null, done ? "done" : null), + ref: ref + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button", + onClick: function onClick() { + return loadMorePhotos(); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Load More Images", "instant-images"))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMore); + +/***/ }), + +/***/ "./src/js/components/NoResults.js": +/*!****************************************!*\ + !*** ./src/js/components/NoResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ NoResults) +/* harmony export */ }); +/** + * Render the NoResults component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The NoResults component. + */ +function NoResults(props) { + var _props$total = props.total, + total = _props$total === void 0 ? 0 : _props$total, + _props$is_search = props.is_search, + is_search = _props$is_search === void 0 ? false : _props$is_search; + if (!is_search || is_search && total >= 1) { + // Bail if not search or search total is greater than 1. + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-no-results" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, instant_img_localize.no_results, " "), /*#__PURE__*/React.createElement("p", null, instant_img_localize.no_results_desc, " "))); +} + +/***/ }), + +/***/ "./src/js/components/Photo.js": +/*!************************************!*\ + !*** ./src/js/components/Photo.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Photo) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/utils/insertImage */ "./src/js/editor/utils/insertImage.js"); +/* harmony import */ var _editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editor/utils/setFeaturedImage */ "./src/js/editor/utils/setFeaturedImage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../functions/providers/unsplash */ "./src/js/functions/providers/unsplash.js"); +/* harmony import */ var _functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/generateAttribution */ "./src/js/functions/generateAttribution.js"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + +/** + * Render the Photo component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Photo component. + */ +function Photo(props) { + var result = props.result, + setInactive = props.setInactive; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB, + _usePluginContext$med = _usePluginContext.mediaModal, + mediaModal = _usePluginContext$med === void 0 ? false : _usePluginContext$med, + _usePluginContext$blo = _usePluginContext.blockSidebar, + blockSidebar = _usePluginContext$blo === void 0 ? false : _usePluginContext$blo, + clientId = _usePluginContext.clientId; + var id = result.id, + filename = result.id, + permalink = result.permalink, + title = result.title, + alt = result.alt, + caption = result.caption, + attribution = result.attribution, + _result$extension = result.extension, + extension = _result$extension === void 0 ? "jpg" : _result$extension, + likes = result.likes, + dimensions = result.dimensions, + urls = result.urls, + user = result.user; + + // Deconstruct image URLs. + var thumb = urls.thumb, + full = urls.full, + download_url = urls.download_url; + + // Deconstruct user data. + var user_name = user.name, + user_photo = user.photo, + user_url = user.url; + var container = document.querySelector(".instant-img-container"); + var likeDisplay = parseInt(likes) === 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Like", "instant-images") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Likes", "instant-images"); + var _instant_img_localize = instant_img_localize, + _instant_img_localize2 = _instant_img_localize.attribution_hook, + attribution_hook = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.auto_attribution, + auto_attribution = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + + // Get the attribution text. + var imageAttribution = attribution_hook ? (0,_functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__["default"])(attribution_hook, provider, permalink, user) : attribution; + var imageCaption = auto_attribution === "1" ? imageAttribution : caption; + + // Photo state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }), + _useState2 = _slicedToArray(_useState, 2), + imageDetails = _useState2[0], + setImageDetails = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + inProgress = _useState4[0], + setInProgress = _useState4[1]; // inProgress state. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("loaded"), + _useState6 = _slicedToArray(_useState5, 2), + status = _useState6[0], + setStatus = _useState6[1]; // Status state. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState8 = _slicedToArray(_useState7, 2), + editURL = _useState8[0], + setEditURL = _useState8[1]; // Edit URL state. + + // Refs. + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var upload = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var editScreen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var captionRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // Gutenberg. + var setAsFeaturedImage = false; + var insertIntoPost = false; + + /** + * Function to trigger the image download. + * + * @since 4.3 + */ + function download() { + if (inProgress || status === "success" || status === "uploaded") { + return false; // Exit if uploading, uploaded or success. + } + + var target = upload === null || upload === void 0 ? void 0 : upload.current; + setInProgress(true); + setStatus("uploading"); + if (wpBlock) { + setInactive(true); // Make Instant Images inactive after selecting an image. + } + + // API URL + var api = instant_img_localize.root + "instant-images/download/"; + + // Data Params + var data = { + provider: provider, + id: target.getAttribute("data-id"), + image_url: target.getAttribute("data-url"), + filename: target.getAttribute("data-id"), + extension: extension, + custom_filename: target.getAttribute("data-filename"), + title: target.getAttribute("data-title"), + alt: target.getAttribute("data-alt"), + caption: target.getAttribute("data-caption"), + parent_id: instant_img_localize.parent_id, + lang: instant_img_localize.lang + }; + + // Config Params + var config = { + credentials: "same-origin", + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_9__["default"].post(api, JSON.stringify(data), config).then(function (res) { + var response = res.data; + if (response) { + // Successful response from server + var success = response.success; + var attachment = response.attachment; + var admin_url = response.admin_url; + var msg = response.msg; + if (success) { + var edit_url = "".concat(admin_url, "post.php?post=").concat(attachment.id, "&action=edit"); // Edit URL. + setEditURL(edit_url); + uploadComplete(target, msg, attachment.id); // Success/Upload Complete + + // Trigger a download at Unsplash. + if (provider === "unsplash" && download_url) { + (0,_functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__.unsplashDownload)(download_url); + } + + /** + * Gutenberg options. + */ + + // Set Featured Image via Sidebar. + if (blockSidebar && setAsFeaturedImage) { + (0,_editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__["default"])(attachment); + setAsFeaturedImage = false; + closeMediaModal(); + } + + // Insert Image via Sidebar. + if (blockSidebar && insertIntoPost) { + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment); + }, 250); + closeMediaModal(); + insertIntoPost = false; + } + + // Insert Image via WP Block. + if (wpBlock && clientId) { + setStatus("uploaded"); + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment, clientId); + }, 350); + closeMediaModal(); + insertIntoPost = false; + } + + /** + * Media Modal. + * If is media popup, redirect user to media-upload settings. + */ + if (container.dataset.mediaPopup === "true" && !blockSidebar) { + window.location = "media-upload.php?type=image&tab=library&attachment_id=" + attachment.id; + } + } else { + // Error + uploadError(target, msg); + } + } else { + // Error + uploadError(target, instant_img_localize.error_upload); + } + })["catch"](function (error) { + console.warn(error); + }); + } + + /** + * Upload complete function. + * + * @param {Element} target Clicked item. + * @param {string} msg Success Msg. + * @param {string} imageID Attachment id. + * @since 3.0 + */ + function uploadComplete(target, msg, imageID) { + if (!(photo !== null && photo !== void 0 && photo.current)) { + return; + } + setImageTitle(target, msg); + setStatus("uploaded"); + setInProgress(false); + + // Remove uploaded status after 3.5 seconds. + setTimeout(function () { + setStatus("success"); + }, 3500); + + // Refresh Media Router/Modal. + refreshMediaModal(imageID); + } + + /** + * Handler to send user to edit photo link after upload. + * + * @since 5.2.0 + */ + function editAfterUpload() { + if (editURL) { + window.location = editURL; + } + } + + /** + * Function used to trigger a download and then set as featured image + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function setFeaturedImageClick(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + setAsFeaturedImage = true; + upload.current.click(); + } + } + + /** + * Function used to insert an image directly into the block (Gutenberg) editor. + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function insertImageIntoPost(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + insertIntoPost = true; + upload.current.click(); + } + } + + /** + * Refresh Media Modal and select item after it's been uploaded. + * + * @param {string} modalID The media modal ID. + * @since 4.3 + */ + function refreshMediaModal(modalID) { + if (mediaModal && wp.media && wp.media.frame && wp.media.frame.el) { + var mediaModalEl = wp.media.frame.el; + var mediaTab = mediaModalEl.querySelector("#menu-item-browse"); + if (mediaTab) { + // Open the 'Media Library' tab. + mediaTab.click(); + } + + // Delay to allow for tab switching + setTimeout(function () { + if (wp.media.frame.content.get() !== null) { + // Force a refresh of the mdeia modal content. + wp.media.frame.content.get().collection._requery(true); + } + + // Select the attached that was just uploaded. + var selection = wp.media.frame.state().get("selection"); + var selected = parseInt(modalID); + selection.reset(selected ? [wp.media.attachment(selected)] : []); + }, 100); + } + } + + /** + * Function runs when error occurs on upload or resize. + * + * @param {Element} target Current clicked item. + * @param {string} msg Error Msg. + * @since 3.0 + */ + function uploadError(target, msg) { + setImageTitle(target, msg); + setInProgress(false); + setStatus("error"); + setInactive(false); + console.warn(msg); + } + + /** + * Set the title attribute of target. + * + * @param {Element} target Clicked element. + * @param {string} msg Title message from JSON. + * @since 3.0 + */ + function setImageTitle(target, msg) { + target.setAttribute("title", msg); // Remove 'Click to upload...', set new value + } + + /** + * Displays the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function showEditScreen(e) { + e.preventDefault(); + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + + // Get all open edit screens and close them. + var openEdits = document.querySelectorAll(".edit-screen.editing"); + if (openEdits) { + openEdits.forEach(function (edit) { + edit.classList.remove("editing"); + }); + } + + // Show edit screen + editScreen.current.classList.add("editing"); + + // Set focus on edit screen + setTimeout(function () { + editScreen.current.focus({ + preventScroll: true + }); + }, 150); + } + + /** + * Handles the change event for the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function handleEditChange(e) { + var target = e.target.name; + switch (target) { + case "filename": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + filename: e.target.value + })); + break; + case "title": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + title: e.target.value + })); + break; + case "alt": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + alt: e.target.value + })); + break; + case "caption": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: e.target.value + })); + break; + } + } + + /** + * Handles the Upload event from the edit screen. + * + * @since 3.2 + */ + function uploadNow() { + editScreen.current.classList.remove("editing"); // Hide edit screen. + upload.current.click(); // Trigger click. + } + + /** + * Cancel event for the edit screen. + * + * @since 3.2 + */ + function cancelEdit() { + // Reset image state. + setImageDetails({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }); + + // Hide edit screen + editScreen.current.classList.remove("editing"); + + // Set focus back on photo. + upload.current.focus({ + preventScrol: true + }); + } + + /** + * Close the media modal after an action. + * + * @since 4.3 + */ + function closeMediaModal() { + var mediaModalEl = document.querySelector(".media-modal"); + if (mediaModalEl) { + var closeBtn = mediaModalEl.querySelector("button.media-modal-close"); + if (!closeBtn) { + return false; + } + closeBtn.click(); + } + } + + /** + * Handles adding attribution for images. + * + * @param {Element} e The target element. + * @since 4.5 + */ + function addAttribution(e) { + e.preventDefault(); + captionRef.current.value = imageAttribution; // Set form value. + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: imageAttribution + })); // Set caption state. + } + + return /*#__PURE__*/React.createElement("article", { + className: "photo", + ref: photo + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("photo-wrap", "photo-".concat(status)) + }, /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("button", { + className: "photo-upload", + ref: upload, + "data-id": id, + "data-url": full, + "data-filename": imageDetails.filename, + "data-title": imageDetails.title, + "data-alt": imageDetails.alt, + "data-caption": imageDetails.caption, + title: wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload, + onClick: function onClick() { + return download(); + } + }, /*#__PURE__*/React.createElement("img", { + src: thumb, + alt: alt, + className: status + })), /*#__PURE__*/React.createElement("div", { + className: "photo-controls" + }, /*#__PURE__*/React.createElement("a", { + target: "_blank", + className: "user fade", + href: user_url, + rel: "noopener noreferrer", + title: "".concat(instant_img_localize.view_all, " @ ").concat(user_name) + }, /*#__PURE__*/React.createElement("div", { + className: "user-wrap" + }, (user_photo === null || user_photo === void 0 ? void 0 : user_photo.length) > 0 && /*#__PURE__*/React.createElement("img", { + className: "user-wrap--photo", + src: user_photo, + alt: "" + }), user_name)), /*#__PURE__*/React.createElement("div", { + className: "photo-options" + }, blockSidebar && !editURL ? /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "set-featured fade", + "data-title": instant_img_localize.set_as_featured, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return setFeaturedImageClick(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-picture-o", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.set_as_featured)), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post))) : null, !!wpBlock && /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post)), editURL ? /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return editAfterUpload(); + }, + className: "edit-photo-admin fade", + "data-title": instant_img_localize.edit_upload, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-pencil", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_upload)) : /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return showEditScreen(e); + }, + className: "edit-photo fade", + "data-title": instant_img_localize.edit_details, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-cog", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_details)))), /*#__PURE__*/React.createElement("div", { + className: "photo-meta" + }, likes ? /*#__PURE__*/React.createElement("span", { + className: "likes tooltip--above", + "data-title": likes + " " + likeDisplay, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-heart heart-like", + "aria-hidden": "true" + }), " ", likes) : null, /*#__PURE__*/React.createElement("a", { + className: "tooltip--above", + href: permalink, + "data-title": "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)), + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + rel: "noopener noreferrer", + target: "_blank" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-external-link", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)))))), /*#__PURE__*/React.createElement("div", { + className: "edit-screen", + tabIndex: "0", + ref: editScreen + }, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--title" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", { + className: "heading" + }, instant_img_localize.edit_details), dimensions && dimensions.length > 0 && /*#__PURE__*/React.createElement("p", { + className: "dimensions" + }, dimensions)), /*#__PURE__*/React.createElement("div", { + className: "preview", + style: { + backgroundImage: "url(".concat(thumb, ")") + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_filename, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "filename", + "data-original": filename, + placeholder: imageDetails.filename, + value: imageDetails.filename, + onChange: function onChange(e) { + return handleEditChange(e); + } + }), /*#__PURE__*/React.createElement("em", null, ".", extension)), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_title, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "title", + "data-original": title, + placeholder: title, + value: imageDetails.title || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_alt, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "alt", + "data-original": alt, + value: imageDetails.alt || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_caption, ":"), /*#__PURE__*/React.createElement("textarea", { + rows: "4", + name: "caption", + "data-original": imageCaption, + onChange: function onChange(e) { + return handleEditChange(e); + }, + value: imageDetails.caption || "", + ref: captionRef + })), imageAttribution ? /*#__PURE__*/React.createElement("div", { + className: "add-attribution-row" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return addAttribution(e); + }, + type: "button" + }, instant_img_localize.attribution)) : null, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--controls" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick(e) { + return cancelEdit(e); + } + }, instant_img_localize.cancel), " ", "\xA0", /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-primary", + onClick: function onClick() { + return uploadNow(); + } + }, wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload_now))), /*#__PURE__*/React.createElement("div", { + className: "photo-status" + }))); +} + +/***/ }), + +/***/ "./src/js/components/ProviderIcons.js": +/*!********************************************!*\ + !*** ./src/js/components/ProviderIcons.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OpenverseIcon": () => (/* binding */ OpenverseIcon), +/* harmony export */ "PexelsIcon": () => (/* binding */ PexelsIcon), +/* harmony export */ "PixabayIcon": () => (/* binding */ PixabayIcon), +/* harmony export */ "UnsplashIcon": () => (/* binding */ UnsplashIcon), +/* harmony export */ "getProviderIcon": () => (/* binding */ getProviderIcon) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Return the provider icon. + * + * @param {string} provider The provider. + * @return {JSX.Element} The provider icon. + */ +function getProviderIcon(provider) { + if (!provider) { + return null; + } + return _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon ? _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon() : null; +} + +/** + * Unsplash Icon. + */ +function UnsplashIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z", + fill: "black" + })); +} + +/** + * Pixabay Icon. + */ +function PixabayIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("g", { + clipPath: "url(#clip0_307_143)" + }, /*#__PURE__*/React.createElement("path", { + d: "M0 0V32H32V0H0Z", + fill: "#48A947" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z", + fill: "#F9FBF9" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z", + fill: "#FAFCFA" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z", + fill: "#4AA949" + })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { + id: "clip0_307_143" + }, /*#__PURE__*/React.createElement("rect", { + width: "32", + height: "32", + fill: "white" + })))); +} + +/** + * Openverse Icon. + */ +function OpenverseIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z", + fill: "#000000" + })); +} + +/** + * Pexels Icon. + */ +function PexelsIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32px", + height: "32px", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z", + fill: "#05A081" + }), /*#__PURE__*/React.createElement("path", { + d: "M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z", + fill: "#fff" + })); +} + +/***/ }), + +/***/ "./src/js/components/ProviderNav.js": +/*!******************************************!*\ + !*** ./src/js/components/ProviderNav.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ProviderNav) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the ProviderNav component. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The ProviderNav component. + */ +function ProviderNav(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !!(providers !== null && providers !== void 0 && providers.length) && /*#__PURE__*/React.createElement("nav", { + className: "provider-nav" + }, providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("div", { + key: "provider-".concat(index) + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return switchProvider(item.toLowerCase()); + }, + className: provider === item.toLowerCase() ? "provider-nav--btn active" : "provider-nav--btn" + }, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_3__.getProviderIcon)(item), /*#__PURE__*/React.createElement("span", null, item), _constants_API__WEBPACK_IMPORTED_MODULE_2__.API[item.toLowerCase()]["new"] && /*#__PURE__*/React.createElement("span", { + className: "provider-nav--new" + }, instant_img_localize["new"]))); + }))); +} + +/***/ }), + +/***/ "./src/js/components/RestAPIError.js": +/*!*******************************************!*\ + !*** ./src/js/components/RestAPIError.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ RestAPIError) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + +/** + * Render the RestAPIError component. + * + * @return {JSX.Element} The RestAPIError component. + */ +function RestAPIError() { + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState2 = _slicedToArray(_useState, 2), + access = _useState2[0], + setAccess = _useState2[1]; + + /** + * Test users access to the REST API endpoint. + * + * @since 3.2 + */ + function test() { + var testURL = instant_img_localize.root + "instant-images/test/"; + var restAPITest = new XMLHttpRequest(); + restAPITest.open("POST", testURL, true); + restAPITest.setRequestHeader("X-WP-Nonce", instant_img_localize.nonce); + restAPITest.setRequestHeader("Content-Type", "application/json"); + restAPITest.send(); + restAPITest.onload = function () { + if (restAPITest.status >= 200 && restAPITest.status < 400) { + var response = JSON.parse(restAPITest.response); + var success = response.success; + if (!success) { + setAccess(false); + } + } else { + setAccess(false); + } + }; + restAPITest.onerror = function (errorMsg) { + console.warn(errorMsg); + setAccess(false); + }; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + test(); + }, []); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !access ? /*#__PURE__*/React.createElement("div", { + className: "error-messaging" + }, /*#__PURE__*/React.createElement("strong", null, instant_img_localize.error_restapi), instant_img_localize.error_restapi_desc) : null); +} + +/***/ }), + +/***/ "./src/js/components/Results.js": +/*!**************************************!*\ + !*** ./src/js/components/Results.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var Results = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + return /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_2__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_1__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Results); + +/***/ }), + +/***/ "./src/js/components/ResultsWPBlock.js": +/*!*********************************************!*\ + !*** ./src/js/components/ResultsWPBlock.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editor/block/components/Instructions */ "./src/js/editor/block/components/Instructions.js"); +/* harmony import */ var _editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/block/components/LoadMore */ "./src/js/editor/block/components/LoadMore.js"); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var ResultsWPBlock = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data, + _props$done = props.done, + done = _props$done === void 0 ? false : _props$done, + loadMorePhotos = props.loadMorePhotos; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (wpBlock) { + loadMorePhotos(); + } + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_5__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_4__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + }), /*#__PURE__*/React.createElement(_editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__["default"], { + done: done, + ref: loadMoreRef + })), /*#__PURE__*/React.createElement(_editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__["default"], { + show: data === null || data === void 0 ? void 0 : data.length + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResultsWPBlock); + +/***/ }), + +/***/ "./src/js/components/Sponsor.js": +/*!**************************************!*\ + !*** ./src/js/components/Sponsor.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Sponsor) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render the Sponsor component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Sponsor component. + */ +function Sponsor(props) { + var result = props.result; + var _result$data = result.data, + data = _result$data === void 0 ? null : _result$data; + var url = (data === null || data === void 0 ? void 0 : data.url) || ""; + var title = (data === null || data === void 0 ? void 0 : data.title) || ""; + var desc = (data === null || data === void 0 ? void 0 : data.description) || ""; + var avatar = (data === null || data === void 0 ? void 0 : data.avatar) || ""; + var _data$image = data.image, + image = _data$image === void 0 ? null : _data$image; + var _image$src = image.src, + src = _image$src === void 0 ? null : _image$src, + _image$alt = image.alt, + alt = _image$alt === void 0 ? null : _image$alt; + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var link = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, image && url ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("article", { + className: "photo feature", + title: desc, + ref: photo, + onClick: function onClick() { + return link.current.click(); + } + }, /*#__PURE__*/React.createElement("div", { + className: "photo--wrap" + }, /*#__PURE__*/React.createElement("span", { + className: "flag", + title: instant_img_localize.advertisement + }, instant_img_localize.ad), /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("a", { + className: "loaded", + href: url, + target: "_blank", + ref: link, + rel: "noreferrer" + }, /*#__PURE__*/React.createElement("img", { + src: src, + alt: alt + }))), /*#__PURE__*/React.createElement("div", { + className: "feature-title" + }, avatar && /*#__PURE__*/React.createElement("img", { + src: avatar, + alt: title + }), /*#__PURE__*/React.createElement("span", null, title)))) : null); +} + +/***/ }), + +/***/ "./src/js/components/Tooltip.js": +/*!**************************************!*\ + !*** ./src/js/components/Tooltip.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Tooltip) +/* harmony export */ }); +/** + * Render the Tooltip component. + * + * @return {JSX.Element} The Tooltip component. + */ +function Tooltip() { + return /*#__PURE__*/React.createElement("div", { + id: "tooltip" + }); +} + +/***/ }), + +/***/ "./src/js/components/cta/Extended.js": +/*!*******************************************!*\ + !*** ./src/js/components/cta/Extended.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ExtendedCTA": () => (/* binding */ ExtendedCTA), +/* harmony export */ "ExtendedSearchCTA": () => (/* binding */ ExtendedSearchCTA) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/* eslint-disable */ + +/** + * Generic CTA for the Extended add-on. + * + * @return {JSX.Element} The ExtendedCTA component. + */ +function ExtendedCTA() { + var _instant_img_localize3, _instant_img_localize4; + var _instant_img_localize = (_instant_img_localize3 = instant_img_localize) === null || _instant_img_localize3 === void 0 ? void 0 : (_instant_img_localize4 = _instant_img_localize3.addons) === null || _instant_img_localize4 === void 0 ? void 0 : _instant_img_localize4.extended, + _instant_img_localize2 = _instant_img_localize.activated, + activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2; + var name = "extended-cta-2024"; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) === "hide"), + _useState2 = _slicedToArray(_useState, 2), + dissmissed = _useState2[0], + setDismissed = _useState2[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setDismissed(true); + } + return /*#__PURE__*/React.createElement(React.Fragment, null, !activated && !dissmissed ? /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--standard" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-bullhorn", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, "Introducing the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), " ", "\u2192 An extension pack of premium features and functionality to enhance the Instant Images plugin."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")))) : null); +} + +/** + * CTA for the Extended add-on in the search dropdown. + * + * @param {Object} props The component props. + * @param {boolean} props.show Display the component. + * @return {JSX.Element} The ExtendedSearchCTA component. + */ +function ExtendedSearchCTA(_ref) { + var _ref$show = _ref.show, + show = _ref$show === void 0 ? false : _ref$show; + var name = "extended-cta-search-2024"; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) !== "hide"), + _useState4 = _slicedToArray(_useState3, 2), + active = _useState4[0], + setActive = _useState4[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setActive(false); + } + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history extended-cta", show && active ? "active" : null) + }, /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--search" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "closeBtn", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", { + className: "fa fa-magic", + "aria-hidden": "true" + }), "Enable search suggestions, history, and maintain current search term while switching providers with the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")))))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchForm.js": +/*!************************************************!*\ + !*** ./src/js/components/search/SearchForm.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useClickOutside */ "./src/js/hooks/useClickOutside.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _SearchHistory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SearchHistory */ "./src/js/components/search/SearchHistory.js"); +/* harmony import */ var _SearchToolTip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SearchToolTip */ "./src/js/components/search/SearchToolTip.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } + + + + + + + + + +/** + * Render the search form as a component. + * + * @return {JSX.Element} The SearchForm component. + */ +var SearchForm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) { + var _instant_img_localize4, _instant_img_localize5; + _objectDestructuringEmpty(_ref); + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + searchHandler = _usePluginContext.searchHandler, + apiError = _usePluginContext.apiError, + suggestions = _usePluginContext.suggestions, + getSuggestions = _usePluginContext.getSuggestions; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState2 = _slicedToArray(_useState, 2), + history = _useState2[0], + setHistory = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + show = _useState4[0], + setShow = _useState4[1]; + var historyRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + var submitBtnRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Handle clickoutside hook. + (0,_hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__.useClickOutside)(historyRef, function () { + setShow(false); + }); + + /** + * Set the search value in the form. + * + * @param {string} value The value to set. + */ + function setSearchValue(value) { + var input = ref === null || ref === void 0 ? void 0 : ref.current; + input.value = value; + submitBtnRef === null || submitBtnRef === void 0 ? void 0 : submitBtnRef.current.click(); + + // Set focus on input. + input.focus(); + } + + /** + * Search submit handler. + * + * @param {Event} e The event object. + */ + function formSubmit(e) { + var _ref$current; + e.preventDefault(); + var term = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.value; + if (term) { + searchHandler(e); + if (extended_license) { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSearchHistory)(term); + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + } + } + } + + /** + * Should the history div be shown? + * + * @return {boolean} Show history. + */ + function showHistory() { + return (history === null || history === void 0 ? void 0 : history.length) || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + }, []); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--search", apiError ? "inactive" : null) + }, /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return formSubmit(e); + }, + autoComplete: "off" + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "search-input", + className: "offscreen" + }, instant_img_localize.search_label), /*#__PURE__*/React.createElement("div", { + ref: historyRef + }, /*#__PURE__*/React.createElement("input", { + ref: ref, + type: "text", + id: "search-input", + placeholder: instant_img_localize.search, + disabled: apiError, + onChange: function onChange(e) { + return extended_license && getSuggestions(e.target.value); + }, + onFocus: function onFocus() { + return setShow(true); + } + }), extended_license && showHistory() ? + /*#__PURE__*/ + /* Extended: Show only with valid add-on license */ + React.createElement(_SearchHistory__WEBPACK_IMPORTED_MODULE_6__["default"], { + show: show, + history: history, + setHistory: setHistory, + setSearchValue: setSearchValue, + container: historyRef + }) : null, !extended_activated && + /*#__PURE__*/ + /* Extended: Show only when add-on not installed. */ + React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_5__.ExtendedSearchCTA, { + show: show + })), /*#__PURE__*/React.createElement("button", { + type: "submit", + disabled: apiError, + ref: submitBtnRef + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-search" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.search)), /*#__PURE__*/React.createElement(_SearchToolTip__WEBPACK_IMPORTED_MODULE_7__["default"], { + show: show + }))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchForm); + +/***/ }), + +/***/ "./src/js/components/search/SearchHeader.js": +/*!**************************************************!*\ + !*** ./src/js/components/search/SearchHeader.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHeader) +/* harmony export */ }); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the SearchHeader component. + * + * @return {JSX.Element} The SearchHeader component. + */ +function SearchHeader() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + search = _usePluginContext.search, + getPhotos = _usePluginContext.getPhotos, + filterSearch = _usePluginContext.filterSearch; + var _search$active = search.active, + active = _search$active === void 0 ? false : _search$active, + _search$term = search.term, + term = _search$term === void 0 ? "" : _search$term, + _search$results = search.results, + total = _search$results === void 0 ? 0 : _search$results; + var filters = _constants_filters__WEBPACK_IMPORTED_MODULE_0__.FILTERS[provider].search; + if (!active) { + // Exit if search is not active. + return null; + } + return /*#__PURE__*/React.createElement("header", { + className: "search-header" + }, /*#__PURE__*/React.createElement("h2", null, term.replace("id:", "ID: ")), /*#__PURE__*/React.createElement("div", { + className: "search-header--text" + }, "".concat(total, " ").concat(instant_img_localize.search_results), " ", /*#__PURE__*/React.createElement("strong", null, "".concat(term)), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getPhotos(); + } + }, instant_img_localize.clear_search)), filters && Object.entries(filters).length && /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters-wrap" + }, /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filters).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_1__["default"], { + key: "".concat(provider, "-search-").concat(key, "-").concat(index), + filterKey: key, + provider: provider, + data: filter, + handler: filterSearch + }); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchHistory.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchHistory.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHistory) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); + + + + + + + +/** + * The History list component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The SearchHistory component. + */ +function SearchHistory(props) { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.usePluginContext)(), + suggestions = _usePluginContext.suggestions; + var show = props.show, + history = props.history, + setHistory = props.setHistory, + setSearchValue = props.setSearchValue, + container = props.container; + var dropRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__.useArrowControls)(show, container); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history", show ? "active" : null), + role: "listbox", + ref: dropRef + }, !!suggestions.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Suggestions", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-suggestions" + }, suggestions.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + }))), !!history.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Recent Searches", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_4__.clearSearchHistory)(); + setHistory([]); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Clear", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-history" + }, history.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "history", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchToolTip.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchToolTip.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchToolTip) +/* harmony export */ }); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); + + + +/** + * Render the search results tooltip component. + * + * @return {JSX.Element} The SearchToolTip component. + */ +function SearchToolTip() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + getPhotos = _usePluginContext.getPhotos, + search = _usePluginContext.search; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_0___default()("control-nav--search-tooltip", search !== null && search !== void 0 && search.active ? null : "hide") + }, /*#__PURE__*/React.createElement("span", { + title: "".concat(search === null || search === void 0 ? void 0 : search.results, " ").concat(instant_img_localize.search_results, " ").concat(search === null || search === void 0 ? void 0 : search.term) + }, search === null || search === void 0 ? void 0 : search.results), /*#__PURE__*/React.createElement("button", { + type: "button", + title: instant_img_localize.clear_search, + onClick: function onClick() { + return getPhotos(true); + } + }, "x", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.clear_search))); +} + +/***/ }), + +/***/ "./src/js/constants/API.js": +/*!*********************************!*\ + !*** ./src/js/constants/API.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "API": () => (/* binding */ API) +/* harmony export */ }); +/* harmony import */ var _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ProviderIcons */ "./src/js/components/ProviderIcons.js"); + +var API = { + proxy: "https://proxy.getinstantimages.com/api/" || 0, + // eslint-disable-line + testmode: false, + defaults: { + provider: "unsplash", + order: "latest", + per_page: "20", + arr_key: "results" + }, + providers: ["Unsplash", "Openverse", "Pixabay", "Pexels"], + unsplash: { + name: "Unsplash", + requires_key: true, + "new": false, + api_var: "client_id", + collections_api: "https://api.unsplash.com/collections/", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.UnsplashIcon + }, + pixabay: { + name: "Pixabay", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PixabayIcon + }, + pexels: { + name: "Pexels", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PexelsIcon + }, + openverse: { + name: "Openverse", + requires_key: false, + "new": false, + api_var: "key", + key: "", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.OpenverseIcon + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters.js": +/*!*************************************!*\ + !*** ./src/js/constants/filters.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "FILTERS": () => (/* binding */ FILTERS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _filters_openverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters/openverse */ "./src/js/constants/filters/openverse.js"); +/* harmony import */ var _filters_pexels__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/pexels */ "./src/js/constants/filters/pexels.js"); +/* harmony import */ var _filters_pixabay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filters/pixabay */ "./src/js/constants/filters/pixabay.js"); +/* harmony import */ var _filters_unsplash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filters/unsplash */ "./src/js/constants/filters/unsplash.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + + + + +var ALL = { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("All", "instant-images"), + value: "all" +}; +var FILTERS = { + openverse: { + filters: { + source: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Source", "instant-images"), + "default": "wordpress", + filters: _toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_SOURCES) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + } + }, + search: { + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photograph", "instant-images"), + value: "photograph" + }] + }, + extension: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Extension", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_EXTENSIONS)) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + }, + license: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("License", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_LICENSES)) + }, + license_type: { + label: "license_type", + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Commercial", "instant-images"), + value: "commercial" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Modification", "instant-images"), + value: "modification" + }] + } + } + }, + pexels: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "curated", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Curated", "instant-images"), + value: "curated" + }] + } + }, + search: { + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_COLORS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + } + } + }, + unsplash: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "latest", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Oldest", "instant-images"), + value: "oldest" + }] + } + }, + search: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "relevance", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Relevance", "instant-images"), + value: "relevance" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_COLORS)) + } + } + }, + pixabay: { + filters: { + order: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "popular", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Category", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_CATS)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + }, + search: { + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + } + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters/openverse.js": +/*!***********************************************!*\ + !*** ./src/js/constants/filters/openverse.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OPENVERSE_EXTENSIONS": () => (/* binding */ OPENVERSE_EXTENSIONS), +/* harmony export */ "OPENVERSE_LICENSES": () => (/* binding */ OPENVERSE_LICENSES), +/* harmony export */ "OPENVERSE_ORIENTATIONS": () => (/* binding */ OPENVERSE_ORIENTATIONS), +/* harmony export */ "OPENVERSE_SOURCES": () => (/* binding */ OPENVERSE_SOURCES) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var OPENVERSE_SOURCES = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("WordPress", "instant-images"), + value: "wordpress" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Flickr", "instant-images"), + value: "flickr" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nasa", "instant-images"), + value: "nasa" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("SpaceX", "instant-images"), + value: "spacex" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wikimedia", "instant-images"), + value: "wikimedia" +}]; +var OPENVERSE_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "square" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Tall", "instant-images"), + value: "tall" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wide", "instant-images"), + value: "wide" +}]; +var OPENVERSE_EXTENSIONS = [{ + label: "JPG", + value: "JPG" +}, { + label: "GIF", + value: "GIF" +}, { + label: "PNG", + value: "PNG" +}, { + label: "SVG", + value: "SVG" +}]; +var OPENVERSE_LICENSES = [{ + label: "BY", + value: "BY" +}, { + label: "BY-NC", + value: "BY-NC" +}, { + label: "BY-NC-ND", + value: "BY-NC-ND" +}, { + label: "BY-NC-SA", + value: "BY-NC-SA" +}, { + label: "BY-ND", + value: "BY-ND" +}, { + label: "BY-SA", + value: "BY-SA" +}, { + label: "CC0", + value: "CC0" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pexels.js": +/*!********************************************!*\ + !*** ./src/js/constants/filters/pexels.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PEXELS_COLORS": () => (/* binding */ PEXELS_COLORS), +/* harmony export */ "PEXELS_ORIENTATIONS": () => (/* binding */ PEXELS_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PEXELS_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Violet", "instant-images"), + value: "violet" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}]; +var PEXELS_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pixabay.js": +/*!*********************************************!*\ + !*** ./src/js/constants/filters/pixabay.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PIXABAY_CATS": () => (/* binding */ PIXABAY_CATS), +/* harmony export */ "PIXABAY_COLORS": () => (/* binding */ PIXABAY_COLORS), +/* harmony export */ "PIXABAY_IMAGE_TYPE": () => (/* binding */ PIXABAY_IMAGE_TYPE), +/* harmony export */ "PIXABAY_ORIENTATIONS": () => (/* binding */ PIXABAY_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PIXABAY_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grayscale", "instant-images"), + value: "grayscale" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Lilac", "instant-images"), + value: "lilac" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transparent", "instant-images"), + value: "transparent" +}]; +var PIXABAY_CATS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Backgrounds", "instant-images"), + value: "backgrounds" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Fashion", "instant-images"), + value: "fashion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nature", "instant-images"), + value: "nature" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Science", "instant-images"), + value: "science" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Education", "instant-images"), + value: "education" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Feelings", "instant-images"), + value: "feelings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Health", "instant-images"), + value: "health" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("People", "instant-images"), + value: "people" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Religion", "instant-images"), + value: "religion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Places", "instant-images"), + value: "places" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Animals", "instant-images"), + value: "animals" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Industry", "instant-images"), + value: "industry" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Computer", "instant-images"), + value: "computer" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sports", "instant-images"), + value: "sports" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transportation", "instant-images"), + value: "transportation" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Travel", "instant-images"), + value: "travel" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Buildings", "instant-images"), + value: "buildings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Business", "instant-images"), + value: "business" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Music", "instant-images"), + value: "music" +}]; +var PIXABAY_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Horizontal", "instant-images"), + value: "horizontal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vertical", "instant-images"), + value: "vertical" +}]; +var PIXABAY_IMAGE_TYPE = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photo", "instant-images"), + value: "photo" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vector", "instant-images"), + value: "vector" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/unsplash.js": +/*!**********************************************!*\ + !*** ./src/js/constants/filters/unsplash.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "UNSPLASH_COLORS": () => (/* binding */ UNSPLASH_COLORS), +/* harmony export */ "UNSPLASH_ORIENTATIONS": () => (/* binding */ UNSPLASH_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var UNSPLASH_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black & White", "instant-images"), + value: "black_and_white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Purple", "instant-images"), + value: "purple" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Magenta", "instant-images"), + value: "magenta" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Teal", "instant-images"), + value: "teal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}]; +var UNSPLASH_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/editor/block/components/Header.js": +/*!**************************************************!*\ + !*** ./src/js/editor/block/components/Header.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockHeader) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the block header. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The BlockHeader component. + */ +function BlockHeader(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + + /** + * Switch the provider via select. + * + * @param {string} value The provider value. + */ + function providerChange(value) { + if (value) { + switchProvider(value); + } + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header" + }, /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-logo" + }, /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_3__.IconLogo, null), /*#__PURE__*/React.createElement("span", null, "Instant Images")), /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-nav" + }, /*#__PURE__*/React.createElement("label", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images")), /*#__PURE__*/React.createElement("select", { + defaultValue: provider, + onChange: function onChange(e) { + return providerChange(e.target.value); + } + }, /*#__PURE__*/React.createElement("option", { + value: "" + }, "-- ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images"), " --"), providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("option", { + key: index, + value: item.toLowerCase() + }, item); + })))); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/Instructions.js": +/*!********************************************************!*\ + !*** ./src/js/editor/block/components/Instructions.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockInstructions) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render instructional text for the WP Block. + * + * @param {Object} props The component props. + * @return {JSX.Element} The BlockInstructions component. + */ +function BlockInstructions(props) { + var _props$show = props.show, + show = _props$show === void 0 ? false : _props$show; + if (!show) { + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--instructions" + }, /*#__PURE__*/React.createElement("span", null, "\u2190"), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Scroll to Load Images", "instant-images"), /*#__PURE__*/React.createElement("span", null, "\u2192")); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/LoadMore.js": +/*!****************************************************!*\ + !*** ./src/js/editor/block/components/LoadMore.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Render the BlockLoadMore component. + * + * @return {JSX.Element} The BlockLoadMore component. + */ +var BlockLoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("instant-images-block--loader", done ? "done" : null), + ref: ref + }); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockLoadMore); + +/***/ }), + +/***/ "./src/js/editor/utils/insertImage.js": +/*!********************************************!*\ + !*** ./src/js/editor/utils/insertImage.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ insertImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Insert an image block into the block editor. + * + * @param {Object} attachment The attachment object. + * @param {string} clientId The block ID. + */ +function insertImage(attachment, clientId) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id, + _attachment$url = attachment.url, + url = _attachment$url === void 0 ? null : _attachment$url, + _attachment$caption = attachment.caption, + caption = _attachment$caption === void 0 ? "" : _attachment$caption, + _attachment$alt = attachment.alt, + alt = _attachment$alt === void 0 ? "" : _attachment$alt; + if (!url || !id) { + return; + } + + // Create block. + var block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)("core/image", { + id: id, + url: url, + caption: caption, + alt: alt + }); + if (clientId) { + // Replace the Instant Images block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").replaceBlock(clientId, block); + } else { + // Insert Image block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").insertBlocks(block); + } +} + +/***/ }), + +/***/ "./src/js/editor/utils/setFeaturedImage.js": +/*!*************************************************!*\ + !*** ./src/js/editor/utils/setFeaturedImage.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ setFeaturedImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Set image as featured image in Gutenberg. + * + * @param {Object} attachment The attachment object. + */ +function setFeaturedImage(attachment) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id; + if (!id) { + return; + } + + // Set the featured image. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/editor").editPost({ + featured_media: id + }); + + // Open the document sidebar. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/edit-post").openGeneralSidebar("edit-post/document"); +} + +/***/ }), + +/***/ "./src/js/functions/buildURL.js": +/*!**************************************!*\ + !*** ./src/js/functions/buildURL.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "buildTestURL": () => (/* binding */ buildTestURL), +/* harmony export */ "default": () => (/* binding */ buildURL), +/* harmony export */ "getProxyURL": () => (/* binding */ getProxyURL) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _providers_openverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers/openverse */ "./src/js/functions/providers/openverse.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + + + +/** + * Build the API query parameters. + * + * @param {string} type The query type (search, photos, id). + * @param {Object} params The current params object. + * @return {string} The new API URL with querystring params. + */ +function buildURL(type, params) { + if (!type) { + // Bail early if API query type is missing. + return ""; + } + // Get the current provider. + var _params = params, + _params$provider = _params.provider, + provider = _params$provider === void 0 ? "unsplash" : _params$provider; + + // Provider doesn't need to be sent. + delete params.provider; + + // Set Openverse params. + params = provider === "openverse" ? (0,_providers_openverse__WEBPACK_IMPORTED_MODULE_2__.openverseParams)(type, params) : params; + + // Build the API URL. + var url = new URL(getProxyURL(provider)); + + // Add `type` to params. + url.searchParams.append("type", type); + + // Append query params. + Object.keys(params).forEach(function (key) { + url.searchParams.append(key, params[key]); + }); + + // Add `version` to params. + url.searchParams.append("version", instant_img_localize.version); + return url === null || url === void 0 ? void 0 : url.href; +} + +/** + * Get the proxy URL from ENV vars. + * + * @param {string} provider The image provider. + * @return {string} The proxy URL. + */ +function getProxyURL(provider) { + var _API$proxy = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.proxy, + proxy = _API$proxy === void 0 ? "https://proxy.getinstantimages.com/api/" : _API$proxy; + return "".concat(proxy).concat(provider); +} + +/** + * Build a API testing URL. + * + * @param {string} provider The current service provider. + * @return {string} The API URL. + */ +function buildTestURL(provider) { + var options = { + per_page: 5, + page: 1 + }; + + // Build URL. + var params = _objectSpread(_objectSpread({ + test: true + }, (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__["default"])(provider)), options); + return buildURL("photos", params); +} + +/***/ }), + +/***/ "./src/js/functions/consoleStatus.js": +/*!*******************************************!*\ + !*** ./src/js/functions/consoleStatus.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ consoleStatus) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _getErrorMessage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getErrorMessage */ "./src/js/functions/getErrorMessage.js"); + + + +/** + * Display a console.warn message about API status. + * + * @param {string} provider The API service provider. + * @param {string} status The API status. + */ +function consoleStatus(provider) { + var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; + var local = instant_img_localize; + var message = (0,_getErrorMessage__WEBPACK_IMPORTED_MODULE_1__["default"])(status); + switch (status) { + case 400: + case 401: + case 500: + // Unsplash/Pixabay/Pexels incorrect API key + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/generateAttribution.js": +/*!*************************************************!*\ + !*** ./src/js/functions/generateAttribution.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ generateAttribution) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + +/** + * Get the API URL for searches by ID. + * + * @param {string} text Attribution hook content. + * @param {string} provider Image provider. + * @param {string} permalink Image url. + * @param {Object} user The user data. + * @return {string} The raw attribution HTML. + */ +function generateAttribution(text, provider, permalink, user) { + if (!text || !provider || !permalink || !user) { + return text; + } + + // Get user data. + var username = user.name, + user_url = user.url; + + // Format provider data. + var provider_url = instant_img_localize["".concat(provider, "_url")]; + var provider_name = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider); + + // Generate attribution template. + var attribution = text; + attribution = attribution.replace("{username}", username); + attribution = attribution.replace("{user_url}", user_url); + attribution = attribution.replace("{image_url}", permalink); + attribution = attribution.replace("{provider_url}", provider_url); + attribution = attribution.replace("{provider}", provider_name); + return attribution; +} + +/***/ }), + +/***/ "./src/js/functions/getErrorMessage.js": +/*!*********************************************!*\ + !*** ./src/js/functions/getErrorMessage.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getErrorMessage) +/* harmony export */ }); +/** + * Get the correct error message by status code. + * + * @param {string} status The API status. + */ +function getErrorMessage() { + var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200; + var local = instant_img_localize; + switch (status) { + case 400: + case 401: + // Unsplash/Pixabay/Pexels incorrect API key. + return local.api_invalid_msg; + case 403: + return local.api_invalid_403_msg; + case 404: + return local.api_invalid_404_msg; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + return local.api_ratelimit_msg; + case 500: + case 503: + // Internal server error. + return local.api_invalid_500_msg; + case 501: + // Missing params. + return local.api_invalid_501_msg; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/getProvider.js": +/*!*****************************************!*\ + !*** ./src/js/functions/getProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getProvider) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Get the default provider on page load. + * + * @return {string} The default service provider. + */ +function getProvider() { + return instant_img_localize && instant_img_localize.default_provider ? instant_img_localize.default_provider : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.provider; +} + +/***/ }), + +/***/ "./src/js/functions/getQueryParams.js": +/*!********************************************!*\ + !*** ./src/js/functions/getQueryParams.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getQueryParams), +/* harmony export */ "getAuth": () => (/* binding */ getAuth), +/* harmony export */ "getContentSafety": () => (/* binding */ getContentSafety) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + +// eslint-disable + +/** + * Build the API query parameters + * + * @param {string} provider The current service provider. + * @param {Object} queryParams Optional query parameters to append to base params. + * @return {Object} Parameters used for the fetch request. + */ +function getQueryParams(provider, queryParams) { + if (!provider) { + return {}; + } + + // Construct per page amount. + var per_page = queryParams && queryParams.id ? 1 : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.per_page; + + // Set default params. + var params = { + provider: provider, + per_page: per_page + }; + + // Append additional params. + params = getContentSafety(params, provider); + params = _objectSpread(_objectSpread({}, params), queryParams); + params = getAuth(params, provider); + + /** + * Display query params in the browser console. + * + * Global plugin hook. + */ + if (instant_img_localize.query_debug) { + console.table(params); + } + return params; +} + +/** + * Get auth keys and append to API query request. + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The auth parameter object. + */ +function getAuth(params, provider) { + var has_auth = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].requires_key; + if (!has_auth || !provider) { + return params; + } + var app_id = instant_img_localize["".concat(provider, "_app_id")]; + if (app_id) { + // Pass API keys if not using defaults. + params[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].api_var] = app_id; + } + return params; +} + +/** + * Set the photo safety for indicating that only images suitable for all ages should be returned. + * + * @see https://unsplash.com/documentation#content-safety + * @see https://pixabay.com/api/docs/ + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The fetch parameters object. + */ +function getContentSafety(params, provider) { + switch (provider) { + case "unsplash": + if (instant_img_localize.unsplash_content_filter) { + params.content_filter = instant_img_localize.unsplash_content_filter; + } + break; + case "pixabay": + if (instant_img_localize.pixabay_safesearch) { + params.safesearch = "true"; + } + break; + case "openverse": + if (instant_img_localize.openverse_mature) { + params.mature = "true"; + } + break; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/getResults.js": +/*!****************************************!*\ + !*** ./src/js/functions/getResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getResults), +/* harmony export */ "getResultById": () => (/* binding */ getResultById), +/* harmony export */ "getSearchTotal": () => (/* binding */ getSearchTotal) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Pluck `results` from the API response. + * + * @param {Object} data The API results object. + * @return {Array} The results as an array. + */ +function getResults(data) { + if (!data) { + return []; + } + var results = data[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.arr_key] || []; + return results; +} + +/** + * Get the total search results. + * + * @param {Object} data The search data object. + * @return {string} The total results. + */ +function getSearchTotal(data) { + // Return 0 if undefined or null. + return data.total === undefined || data.total === null ? 0 : data.total; +} + +/** + * Get results by photo ID. + * + * @param {string} provider The current service provider. + * @param {string} key The match key to access. + * @param {Object} data The API results object. + * @return {Array} The results as an array. + * @deprecated 5.0 + */ +function getResultById(provider, key, data) { + if (!data) { + return []; + } + var result = []; + switch (provider) { + case "unsplash": + case "pexels": + result = data || []; + break; + case "pixabay": + result = data[key] && data[key][0] ? data[key][0] : []; + break; + } + return result; +} + +/***/ }), + +/***/ "./src/js/functions/helpers.js": +/*!*************************************!*\ + !*** ./src/js/functions/helpers.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "capitalizeFirstLetter": () => (/* binding */ capitalizeFirstLetter), +/* harmony export */ "checkRateLimit": () => (/* binding */ checkRateLimit), +/* harmony export */ "gotoURL": () => (/* binding */ gotoURL), +/* harmony export */ "hideTooltip": () => (/* binding */ hideTooltip), +/* harmony export */ "isObjectEmpty": () => (/* binding */ isObjectEmpty), +/* harmony export */ "md5Hash": () => (/* binding */ md5Hash), +/* harmony export */ "showTooltip": () => (/* binding */ showTooltip) +/* harmony export */ }); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js"); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Get the MD5 hash value of a URL. + * + * @param {string} url The API URL to hash. + * @return {string} The MD5 hash. + */ +function md5Hash(url) { + return crypto_js__WEBPACK_IMPORTED_MODULE_0___default().MD5(url).toString(); +} + +/** + * Check if an object is empty. + * + * @param {Object} obj The object to test against. + * @return {boolean} Is this an object. + */ +function isObjectEmpty(obj) { + if (obj === null || obj === undefined) { + return true; + } + return Object.keys(obj).length === 0; +} + +/** + * Check the `x-ratelimit-remaining` headers to confirm the API is available. + * + * @param {Object} headers The request headers object. + */ +function checkRateLimit(headers) { + if (!headers) { + return; + } + var limit = headers.get("X-RateLimit-Limit") || -1; + var remaining = headers.get("X-RateLimit-Remaining") || -1; + if (limit > -1 && parseInt(remaining) < 2) { + alert(instant_img_localize.api_ratelimit_msg); // eslint-disable-line + } +} + +/** + * Capitalize the first letter of a string. + * + * @param {string} str The string to format. + * @return {string} The formatted string. + */ +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +var tooltipInterval = ""; + +/** + * Show the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function showTooltip(e) { + var target = e.currentTarget; + var rect = target.getBoundingClientRect(); + var left = Math.round(rect.left); + var top = Math.round(rect.top); + var container = target.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); + if (target.classList.contains("tooltip--above")) { + tooltip.classList.add("above"); + } else { + tooltip.classList.remove("above"); + } + + // Delay Tooltip Reveal. + tooltipInterval = setInterval(function () { + clearInterval(tooltipInterval); + tooltip.innerHTML = target.dataset.title; // Tooltip content. + + // Position Tooltip. + left = left - tooltip.offsetWidth + target.offsetWidth + 5; + tooltip.style.left = "".concat(left, "px"); + tooltip.style.top = "".concat(top, "px"); + setTimeout(function () { + tooltip.classList.add("over"); + }, 25); + }, 750); +} + +/** + * Hide the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function hideTooltip(e) { + clearInterval(tooltipInterval); + var container = e.currentTarget.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); +} + +/** + * Open the URL in new window. + * + * @param {string} url The destination URL. + */ +function gotoURL(url) { + if (url && window) { + window.open(url, "_blank"); + } +} + +/***/ }), + +/***/ "./src/js/functions/localStorage.js": +/*!******************************************!*\ + !*** ./src/js/functions/localStorage.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clearSearchHistory": () => (/* binding */ clearSearchHistory), +/* harmony export */ "getSearchHistory": () => (/* binding */ getSearchHistory), +/* harmony export */ "getSetting": () => (/* binding */ getSetting), +/* harmony export */ "saveSearchHistory": () => (/* binding */ saveSearchHistory), +/* harmony export */ "saveSettings": () => (/* binding */ saveSettings) +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var searchName = "instant-images-recent-searches"; +var settingsName = "instant-images-settings"; +var most = 10; + +/** + * Save search value to localstorage. + * + * @param {string} term The search term. + */ +function saveSearchHistory(term) { + var recent = getSearchHistory(); + if (!recent) { + localStorage.setItem(searchName, JSON.stringify([term])); + return; + } + + // Find duplicates. + var duplicate = recent.indexOf(term); + if (duplicate > -1) { + recent.splice(duplicate, 1); + } + + // Limit to 6 items. + if (recent.length >= most) { + recent.length = most; + } + + // Add new term to the beginning of the array. + recent.unshift(term); + localStorage.setItem(searchName, JSON.stringify(recent)); +} + +/** + * Get the search history from localstorage. + * + * @return {Array} The search history. + */ +function getSearchHistory() { + var history = localStorage.getItem(searchName); + if (!history) { + return []; + } + return JSON.parse(localStorage.getItem(searchName)); +} + +/** + * Clear search history. + */ +function clearSearchHistory() { + localStorage.removeItem(searchName); +} + +/** + * Save generic setting to localstorage as an key/value object pair. + * + * @param {string} key The object key. + * @param {value} value The object value. + */ +function saveSettings(key, value) { + var settings = localStorage.getItem(settingsName); + var setting = _defineProperty({}, key, value); + if (!settings) { + localStorage.setItem(settingsName, JSON.stringify(setting)); + } else { + var parsed = JSON.parse(settings); + parsed[key] = value; + localStorage.setItem(settingsName, JSON.stringify(parsed)); + } +} + +/** + * Get an individual setting from local storage. + * + * @param {string} key The stoarge key. + * @return {string|boolean} The storage value. + */ +function getSetting(key) { + var settings = localStorage.getItem(settingsName); + if (!settings) { + return false; + } + var parsed = JSON.parse(settings); + return parsed[key] ? parsed[key] : false; +} + +/***/ }), + +/***/ "./src/js/functions/providers/openverse.js": +/*!*************************************************!*\ + !*** ./src/js/functions/providers/openverse.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "openverseParams": () => (/* binding */ openverseParams) +/* harmony export */ }); +/* harmony import */ var _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters/openverse */ "./src/js/constants/filters/openverse.js"); + + +/** + * Format the params for Openverse. + * + * @param {string} type Query type (search, photos, id). + * @param {Object} params Query params object. + * @return {Object} Updated params. + */ +function openverseParams(type, params) { + if (type === "photos" && !params.source) { + params.source = "wordpress"; // Add `wordpress` as the default openverse `source`. + } + + if (type === "search") { + // Include these sources only. + var sources = _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__.OPENVERSE_SOURCES.map(function (source) { + return source.value; + }).toString(); // e.g. `wordpress,flickr,nasa,spacex,wikimedia` + params.source = sources; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/providers/unsplash.js": +/*!************************************************!*\ + !*** ./src/js/functions/providers/unsplash.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "unsplashDownload": () => (/* binding */ unsplashDownload) +/* harmony export */ }); +/* harmony import */ var _buildURL__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getQueryParams */ "./src/js/functions/getQueryParams.js"); + + + +/** + * Function to trigger an image download at unsplash.com. + * Note: This is used to give authors download credits and nothing more. + * + * @see https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download + * + * @param {string} download_url The URL to trigger a download. + * @since 3.1 + */ +function unsplashDownload(download_url) { + var params = (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__.getAuth)({}, "unsplash"); + params.download_url = download_url; // Append download URL to query params. + var url = (0,_buildURL__WEBPACK_IMPORTED_MODULE_0__["default"])("photos", params); + fetch(url).then(function (data) { + return data.json(); + }).then(function () { + // Success, nothing else happens here + console.log("Image download successsfully triggered at Unsplash."); // eslint-disable-line no-console + })["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/functions/session.js": +/*!*************************************!*\ + !*** ./src/js/functions/session.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "deleteSession": () => (/* binding */ deleteSession), +/* harmony export */ "getSession": () => (/* binding */ getSession), +/* harmony export */ "saveSession": () => (/* binding */ saveSession) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + + +/** + * Get results from session storage by URL. + * + * @param {string} url The API URL. + * @return {Array|boolean} Session results. + */ +function getSession(url) { + if (!url || _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.testmode) { + return false; // Exit if no URL or test mode is enabled. + } + + var session = sessionStorage.getItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); + if (!session) { + return false; // Exit if no session data. + } + + var data = JSON.parse(session); + var _data$expires = data.expires, + expires = _data$expires === void 0 ? 0 : _data$expires, + _data$error = data.error, + error = _data$error === void 0 ? null : _data$error; + if (error) { + return false; // Exit if session data has error entry. + } + + // Check if expiration time has passed. + var expired = Date.now() > expires; + + // Delete session data when expired. + if (expired) { + deleteSession(url); + } + return data && !expired ? data : false; +} + +/** + * Save API data to session storage by URL. + * + * @param {string} url Save results to session by URL. + * @param {Array} results The API results. + */ +function saveSession(url, results) { + if (!url || !results || results !== null && results !== void 0 && results.error) { + return false; + } + // Set expiration to 1 hour. + results.expires = Date.now() + 3600000; + + // Save session data. + sessionStorage.setItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url), JSON.stringify(results)); +} + +/** + * Remove/delete session storage by URL. + * + * @param {string} url The API URL. + */ +function deleteSession(url) { + if (!url) { + return false; + } + sessionStorage.removeItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); +} + +/***/ }), + +/***/ "./src/js/functions/updatePluginSetting.js": +/*!*************************************************!*\ + !*** ./src/js/functions/updatePluginSetting.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ updatePluginSetting) +/* harmony export */ }); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); + + +/** + * Update plugin settings by specific key/value pair. + * + * @param {string} setting The previous provider. + * @param {string} value The value to save. + */ +function updatePluginSetting(setting, value) { + var _instant_img_localize; + var api = ((_instant_img_localize = instant_img_localize) === null || _instant_img_localize === void 0 ? void 0 : _instant_img_localize.root) + "instant-images/settings/"; // eslint-disable-line no-undef + + var params = { + setting: setting, + value: value + }; + var config = { + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + // eslint-disable-line no-undef + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_0__["default"].post(api, JSON.stringify(params), config).then(function () {})["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/hooks/useArrowControls.js": +/*!******************************************!*\ + !*** ./src/js/hooks/useArrowControls.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useArrowControls": () => (/* binding */ useArrowControls) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + +/** + * Detect up and down arrow presses. + * + * @param {boolean} active Is the element currently active. + * @param {Object} ref The container ref to select the focusable elements. + */ +function useArrowControls(active, ref) { + var focusedRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(active); + + /** + * Add event listener for arrow keys. + * + * @param {KeyboardEvent} e The event. + */ + function arrowHandler(e) { + var key = e.key; + if (focusedRef !== null && focusedRef !== void 0 && focusedRef.current && ref !== null && ref !== void 0 && ref.current) { + var focusable = ref === null || ref === void 0 ? void 0 : ref.current.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input"); + if (!(focusable !== null && focusable !== void 0 && focusable.length)) { + // Exit if no focusable elements. + return; + } + var first = focusable[0]; + var last = focusable[focusable.length - 1]; + var _active = document.activeElement; // eslint-disable-line + var activeIndex = _toConsumableArray(focusable).indexOf(_active); + + // Up arrow. + if (key === "ArrowUp") { + e.preventDefault(); + if (activeIndex === 0) { + last.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex - 1].focus({ + preventScroll: true + }); + } + } + // Down Arrow + if (key === "ArrowDown") { + e.preventDefault(); + if (activeIndex === focusable.length - 1 || activeIndex === -1) { + first.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex + 1].focus({ + preventScroll: true + }); + } + } + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + focusedRef.current = active; + }, [active]); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + document.addEventListener("keydown", arrowHandler, false); + return function () { + // Dispose of events. + document.removeEventListener("keydown", arrowHandler, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./src/js/hooks/useClickOutside.js": +/*!*****************************************!*\ + !*** ./src/js/hooks/useClickOutside.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useClickOutside": () => (/* binding */ useClickOutside) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Detect clicks outside of ref. + * + * @param {Object} ref React ref. + * @param {Function} onClickOutside Function to invoke when clicked outside. + */ +function useClickOutside(ref, onClickOutside) { + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escapeClick(e) { + var key = e.key; + if (key === "Escape") { + onClickOutside(); + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + /** + * Invoke Function onClick outside of element + * + * @param {Event} event The event object. + */ + function handleClickOutside(event) { + if (ref.current && !ref.current.contains(event.target)) { + onClickOutside(); + } + } + + // Bind events. + document.addEventListener("mousedown", handleClickOutside); + document.addEventListener("keyup", handleClickOutside); + document.addEventListener("keydown", escapeClick, false); + return function () { + // Dispose of events. + document.removeEventListener("mousedown", handleClickOutside); + document.removeEventListener("keyup", handleClickOutside); + document.removeEventListener("keydown", escapeClick, false); + }; + }, [ref, onClickOutside]); //eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./src/js/index.js": +/*!*************************!*\ + !*** ./src/js/index.js ***! + \*************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _components_InstantImages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/InstantImages */ "./src/js/components/InstantImages.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_getProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./functions/getProvider */ "./src/js/functions/getProvider.js"); +/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions/getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./functions/session */ "./src/js/functions/session.js"); +/* harmony import */ var _scss_style_scss__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../scss/style.scss */ "./src/scss/style.scss"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + + + + + + + + + + + +// Get provider from settings. +var defaultProvider = (0,_functions_getProvider__WEBPACK_IMPORTED_MODULE_5__["default"])(); + +/** + * Get the initial set of photos. + * + * @param {string} provider The current service provider. + */ +function getImages() { + var provider = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.defaults.provider; + // Build URL. + var params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_6__["default"])(provider); + var url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_3__["default"])("photos", params); + function initialize() { + return _initialize.apply(this, arguments); + } + function _initialize() { + _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var app, sessionData, root, response, status, headers, results, _results$error, error, _root; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + app = document.getElementById("app"); + if (!app) { + _context.next = 25; + break; + } + // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_8__.getSession)(url); + if (!sessionData) { + _context.next = 7; + break; + } + // Display results from session. + if (_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot) { + root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot)(app); + root.render( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "classic", + data: sessionData, + container: app, + provider: provider, + api_error: null + })); + } else { + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.render)( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "classic", + data: sessionData, + container: app, + provider: provider, + api_error: null + }), app); + } + _context.next = 25; + break; + case 7: + _context.next = 9; + return fetch(url); + case 9: + response = _context.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_7__.checkRateLimit)(headers); + _context.prev = 12; + _context.next = 15; + return response.json(); + case 15: + results = _context.sent; + _results$error = results.error, error = _results$error === void 0 ? null : _results$error; + if (_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot) { + _root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot)(app); + _root.render( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "classic", + data: results, + container: app, + provider: provider, + api_error: error + })); + } else { + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.render)( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "classic", + data: results, + container: app, + provider: provider, + api_error: error + }), app); + } + (0,_functions_session__WEBPACK_IMPORTED_MODULE_8__.saveSession)(url, results); + _context.next = 25; + break; + case 21: + _context.prev = 21; + _context.t0 = _context["catch"](12); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_4__["default"])(provider, status); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_8__.deleteSession)(url); + case 25: + case "end": + return _context.stop(); + } + }, _callee, null, [[12, 21]]); + })); + return _initialize.apply(this, arguments); + } + initialize(); +} + +/** + * Dispatch an initial fetch request to confirm the default API key is valid. + */ +_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + getImages(defaultProvider); + case 1: + case "end": + return _context2.stop(); + } + }, _callee2); +}))(); + +/***/ }), + +/***/ "./node_modules/classnames/index.js": +/*!******************************************!*\ + !*** ./node_modules/classnames/index.js ***! + \******************************************/ +/***/ ((module, exports) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + var nativeCodeString = '[native code]'; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { + classes.push(arg.toString()); + continue; + } + + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + + +/***/ }), + +/***/ "./node_modules/crypto-js/aes.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/aes.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; + } + } + + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; + + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; + + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); + + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + var t; + + // Skip reset of nRounds has been set before and key did not change + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + // Shortcuts + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6; + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; + + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + + // Key schedule row counter + var ksRow = 4; + + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + + keySize: 256/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); + }()); + + + return CryptoJS.AES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/cipher-core.js": +/*!***********************************************!*\ + !*** ./node_modules/crypto-js/cipher-core.js ***! + \***********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher core components. + */ + CryptoJS.lib.Cipher || (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; + + // Set initial values + this.reset(); + }, + + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-cipher logic + this._doReset(); + }, + + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); + + // Process available blocks + return this._process(); + }, + + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } + + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + + keySize: 128/32, + + ivSize: 128/32, + + _ENC_XFORM_MODE: 1, + + _DEC_XFORM_MODE: 2, + + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); + + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); + + return finalProcessedBlocks; + }, + + blockSize: 1 + }); + + /** + * Mode namespace. + */ + var C_mode = C.mode = {}; + + /** + * Abstract base block cipher mode template. + */ + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); + + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + var block; + + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }()); + + /** + * Padding namespace. + */ + var C_pad = C.pad = {}; + + /** + * PKCS #5/7 padding strategy. + */ + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + + // Add padding + data.concat(padding); + }, + + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + /** + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) + */ + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + + reset: function () { + var modeCreator; + + // Reset cipher + Cipher.reset.call(this); + + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + modeCreator = mode.createDecryptor; + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } + + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, + + _doFinalize: function () { + var finalProcessedBlocks; + + // Shortcut + var padding = this.cfg.padding; + + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); + + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + + // Unpad data + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + + blockSize: 128/32 + }); + + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); + }, + + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + + /** + * Format namespace. + */ + var C_format = C.format = {}; + + /** + * OpenSSL formatting strategy. + */ + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + var wordArray; + + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + // Format + if (salt) { + wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + var salt; + + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); + + // Shortcut + var ciphertextWords = ciphertext.words; + + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + salt = WordArray.create(ciphertextWords.slice(2, 4)); + + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; + + /** + * A cipher wrapper that returns ciphertext as a serializable cipher params object. + */ + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + + // Shortcut + var cipherCfg = encryptor.cfg; + + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + + return plaintext; + }, + + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; + + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); + } + + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); + } + }; + + /** + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. + */ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + + // Mix in derived params + ciphertext.mixIn(derivedParams); + + return ciphertext; + }, + + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + + return plaintext; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/core.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/core.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(); + } + else {} +}(this, function () { + + /*globals window, global, require*/ + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + + var crypto; + + // Native crypto from window (Browser) + if (typeof window !== 'undefined' && window.crypto) { + crypto = window.crypto; + } + + // Native crypto in web worker (Browser) + if (typeof self !== 'undefined' && self.crypto) { + crypto = self.crypto; + } + + // Native crypto from worker + if (typeof globalThis !== 'undefined' && globalThis.crypto) { + crypto = globalThis.crypto; + } + + // Native (experimental IE 11) crypto from window (Browser) + if (!crypto && typeof window !== 'undefined' && window.msCrypto) { + crypto = window.msCrypto; + } + + // Native crypto from global (NodeJS) + if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { + crypto = __webpack_require__.g.crypto; + } + + // Native crypto import via require (NodeJS) + if (!crypto && "function" === 'function') { + try { + crypto = __webpack_require__(/*! crypto */ "?9157"); + } catch (err) {} + } + + /* + * Cryptographically secure pseudorandom number generator + * + * As Math.random() is cryptographically not safe to use + */ + var cryptoSecureRandomInt = function () { + if (crypto) { + // Use getRandomValues method (Browser) + if (typeof crypto.getRandomValues === 'function') { + try { + return crypto.getRandomValues(new Uint32Array(1))[0]; + } catch (err) {} + } + + // Use randomBytes method (NodeJS) + if (typeof crypto.randomBytes === 'function') { + try { + return crypto.randomBytes(4).readInt32LE(); + } catch (err) {} + } + } + + throw new Error('Native crypto module could not be used to get secure random number.'); + }; + + /* + * Local polyfill of Object.create + + */ + var create = Object.create || (function () { + function F() {} + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()); + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var j = 0; j < thatSigBytes; j += 4) { + thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + var processedWords; + + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/enc-base64.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + + return CryptoJS.enc.Base64; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64url.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/enc-base64url.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64url encoding strategy. + */ + var Base64url = C_enc.Base64url = { + /** + * Converts a word array to a Base64url string. + * + * @param {WordArray} wordArray The word array. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {string} The Base64url string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); + */ + stringify: function (wordArray, urlSafe=true) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = urlSafe ? this._safe_map : this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64url string to a word array. + * + * @param {string} base64Str The Base64url string. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64url.parse(base64String); + */ + parse: function (base64Str, urlSafe=true) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = urlSafe ? this._safe_map : this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + return CryptoJS.enc.Base64url; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-utf16.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/enc-utf16.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * UTF-16 BE encoding strategy. + */ + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + /** + * UTF-16 LE encoding strategy. + */ + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + function swapEndian(word) { + return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); + } + }()); + + + return CryptoJS.enc.Utf16; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/evpkdf.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/evpkdf.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + + /** + * This key derivation function is meant to conform with EVP_BytesToKey. + * www.openssl.org/docs/crypto/EVP_BytesToKey.html + */ + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: MD5, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + var block; + + // Shortcut + var cfg = this.cfg; + + // Init hasher + var hasher = cfg.hasher.create(); + + // Initial values + var derivedKey = WordArray.create(); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + block = hasher.update(password).finalize(salt); + hasher.reset(); + + // Iterations + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.EvpKDF(password, salt); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.EvpKDF; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/format-hex.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/format-hex.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + + var HexFormatter = C_format.Hex = { + /** + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The hexadecimally encoded string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); + */ + stringify: function (cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + + /** + * Converts a hexadecimally encoded ciphertext string to a cipher params object. + * + * @param {string} input The hexadecimally encoded string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.Hex.parse(hexString); + */ + parse: function (input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext: ciphertext }); + } + }; + }()); + + + return CryptoJS.format.Hex; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/hmac.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/hmac.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/crypto-js/index.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./lib-typedarrays */ "./node_modules/crypto-js/lib-typedarrays.js"), __webpack_require__(/*! ./enc-utf16 */ "./node_modules/crypto-js/enc-utf16.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./enc-base64url */ "./node_modules/crypto-js/enc-base64url.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./sha224 */ "./node_modules/crypto-js/sha224.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"), __webpack_require__(/*! ./sha384 */ "./node_modules/crypto-js/sha384.js"), __webpack_require__(/*! ./sha3 */ "./node_modules/crypto-js/sha3.js"), __webpack_require__(/*! ./ripemd160 */ "./node_modules/crypto-js/ripemd160.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"), __webpack_require__(/*! ./pbkdf2 */ "./node_modules/crypto-js/pbkdf2.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"), __webpack_require__(/*! ./mode-cfb */ "./node_modules/crypto-js/mode-cfb.js"), __webpack_require__(/*! ./mode-ctr */ "./node_modules/crypto-js/mode-ctr.js"), __webpack_require__(/*! ./mode-ctr-gladman */ "./node_modules/crypto-js/mode-ctr-gladman.js"), __webpack_require__(/*! ./mode-ofb */ "./node_modules/crypto-js/mode-ofb.js"), __webpack_require__(/*! ./mode-ecb */ "./node_modules/crypto-js/mode-ecb.js"), __webpack_require__(/*! ./pad-ansix923 */ "./node_modules/crypto-js/pad-ansix923.js"), __webpack_require__(/*! ./pad-iso10126 */ "./node_modules/crypto-js/pad-iso10126.js"), __webpack_require__(/*! ./pad-iso97971 */ "./node_modules/crypto-js/pad-iso97971.js"), __webpack_require__(/*! ./pad-zeropadding */ "./node_modules/crypto-js/pad-zeropadding.js"), __webpack_require__(/*! ./pad-nopadding */ "./node_modules/crypto-js/pad-nopadding.js"), __webpack_require__(/*! ./format-hex */ "./node_modules/crypto-js/format-hex.js"), __webpack_require__(/*! ./aes */ "./node_modules/crypto-js/aes.js"), __webpack_require__(/*! ./tripledes */ "./node_modules/crypto-js/tripledes.js"), __webpack_require__(/*! ./rc4 */ "./node_modules/crypto-js/rc4.js"), __webpack_require__(/*! ./rabbit */ "./node_modules/crypto-js/rabbit.js"), __webpack_require__(/*! ./rabbit-legacy */ "./node_modules/crypto-js/rabbit-legacy.js")); + } + else {} +}(this, function (CryptoJS) { + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/lib-typedarrays.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/lib-typedarrays.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Check if typed arrays are supported + if (typeof ArrayBuffer != 'function') { + return; + } + + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + + // Reference original init + var superInit = WordArray.init; + + // Augment WordArray.init to handle typed arrays + var subInit = WordArray.init = function (typedArray) { + // Convert buffers to uint8 + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + + // Convert other array views to uint8 + if ( + typedArray instanceof Int8Array || + (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || + typedArray instanceof Int16Array || + typedArray instanceof Uint16Array || + typedArray instanceof Int32Array || + typedArray instanceof Uint32Array || + typedArray instanceof Float32Array || + typedArray instanceof Float64Array + ) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + + // Handle Uint8Array + if (typedArray instanceof Uint8Array) { + // Shortcut + var typedArrayByteLength = typedArray.byteLength; + + // Extract bytes + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + } + + // Initialize this word array + superInit.call(this, words, typedArrayByteLength); + } else { + // Else call normal init + superInit.apply(this, arguments); + } + }; + + subInit.prototype = WordArray; + }()); + + + return CryptoJS.lib.WordArray; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/md5.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/md5.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcuts + var H = this._hash.words; + + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + + // Working varialbes + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); + + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); + + + return CryptoJS.MD5; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-cfb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-cfb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher Feedback block mode. + */ + CryptoJS.mode.CFB = (function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + + CFB.Encryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + CFB.Decryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var keystream; + + // Shortcut + var iv = this._iv; + + // Generate keystream + if (iv) { + keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + + return CFB; + }()); + + + return CryptoJS.mode.CFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr-gladman.js": +/*!****************************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr-gladman.js ***! + \****************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = (function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + + function incWord(word) + { + if (((word >> 24) & 0xff) === 0xff) { //overflow + var b1 = (word >> 16)&0xff; + var b2 = (word >> 8)&0xff; + var b3 = word & 0xff; + + if (b1 === 0xff) // overflow b1 + { + b1 = 0; + if (b2 === 0xff) + { + b2 = 0; + if (b3 === 0xff) + { + b3 = 0; + } + else + { + ++b3; + } + } + else + { + ++b2; + } + } + else + { + ++b1; + } + + word = 0; + word += (b1 << 16); + word += (b2 << 8); + word += b3; + } + else + { + word += (0x01 << 24); + } + return word; + } + + function incCounter(counter) + { + if ((counter[0] = incWord(counter[0])) === 0) + { + // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 + counter[1] = incWord(counter[1]); + } + return counter; + } + + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + + incCounter(counter); + + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTRGladman.Decryptor = Encryptor; + + return CTRGladman; + }()); + + + + + return CryptoJS.mode.CTRGladman; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Counter block mode. + */ + CryptoJS.mode.CTR = (function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Increment counter + counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTR.Decryptor = Encryptor; + + return CTR; + }()); + + + return CryptoJS.mode.CTR; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ecb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ecb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + + return ECB; + }()); + + + return CryptoJS.mode.ECB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ofb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ofb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Output Feedback block mode. + */ + CryptoJS.mode.OFB = (function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + + // Generate keystream + if (iv) { + keystream = this._keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + OFB.Decryptor = Encryptor; + + return OFB; + }()); + + + return CryptoJS.mode.OFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-ansix923.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-ansix923.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ANSI X.923 padding strategy. + */ + CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Ansix923; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso10126.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso10126.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO 10126 padding strategy. + */ + CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Iso10126; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso97971.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso97971.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO/IEC 9797-1 Padding Method 2. + */ + CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); + + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } + }; + + + return CryptoJS.pad.Iso97971; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-nopadding.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/pad-nopadding.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * A noop padding strategy. + */ + CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } + }; + + + return CryptoJS.pad.NoPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-zeropadding.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/pad-zeropadding.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Zero padding strategy. + */ + CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + + unpad: function (data) { + // Shortcut + var dataWords = data.words; + + // Unpad + var i = data.sigBytes - 1; + for (var i = data.sigBytes - 1; i >= 0; i--) { + if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + data.sigBytes = i + 1; + break; + } + } + } + }; + + + return CryptoJS.pad.ZeroPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pbkdf2.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/pbkdf2.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; + + /** + * Password-Based Key Derivation Function 2 algorithm. + */ + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA1 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: SHA1, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + // Shortcut + var cfg = this.cfg; + + // Init HMAC + var hmac = HMAC.create(cfg.hasher, password); + + // Initial values + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + + // Shortcuts + var blockWords = block.words; + var blockWordsLength = blockWords.length; + + // Iterations + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + + // Shortcut + var intermediateWords = intermediate.words; + + // XOR intermediate with block + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + + derivedKey.concat(block); + blockIndexWords[0]++; + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.PBKDF2(password, salt); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.PBKDF2; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit-legacy.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/rabbit-legacy.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm. + * + * This is a legacy version that neglected to convert the key to little-endian. + * This error doesn't affect the cipher's security, + * but it does affect its compatibility with other implementations. + */ + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); + */ + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + }()); + + + return CryptoJS.RabbitLegacy; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/rabbit.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Swap endian + for (var i = 0; i < 4; i++) { + K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | + (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); + } + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); + }()); + + + return CryptoJS.Rabbit; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rc4.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/rc4.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + /** + * RC4 stream cipher algorithm. + */ + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + + // Init sbox + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; + } + + // Key setup + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + // Counters + this._i = this._j = 0; + }, + + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + + keySize: 256/32, + + ivSize: 0 + }); + + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; + + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } + + // Update counters + this._i = i; + this._j = j; + + return keystreamWord; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); + + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + + _doReset: function () { + RC4._doReset.call(this); + + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + }()); + + + return CryptoJS.RC4; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/ripemd160.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/ripemd160.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var _zl = WordArray.create([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); + var _zr = WordArray.create([ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); + var _sl = WordArray.create([ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); + var _sr = WordArray.create([ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); + + var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); + + /** + * RIPEMD160 hash algorithm. + */ + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, + + _doProcessBlock: function (M, offset) { + + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + // Shortcut + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 5; i++) { + // Shortcut + var H_i = H[i]; + + // Swap + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + + function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); + + } + + function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); + } + + function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); + } + + function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); + } + + function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); + + } + + function rotl(x,n) { + return (x<>>(32-n)); + } + + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.RIPEMD160('message'); + * var hash = CryptoJS.RIPEMD160(wordArray); + */ + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacRIPEMD160(message, key); + */ + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + }(Math)); + + + return CryptoJS.RIPEMD160; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha1.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha1.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + return CryptoJS.SHA1; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha224.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha224.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); + }, + + _doFinalize: function () { + var hash = SHA256._doFinalize.call(this); + + hash.sigBytes -= 4; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); + */ + C.SHA224 = SHA256._createHelper(SHA224); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); + */ + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + }()); + + + return CryptoJS.SHA224; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha256.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha256.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); + + + return CryptoJS.SHA256; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha3.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha3.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + + // Constants tables + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + + // Compute Constants + (function () { + // Compute rho offset constants + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; + + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + + // Compute pi index constants + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + } + } + + // Compute round constants + var LFSR = 0x01; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else /* if (bitPosition >= 32) */ { + roundConstantMsw ^= 1 << (bitPosition - 32); + } + } + + // Compute next LFSR + if (LFSR & 0x80) { + // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 + LFSR = (LFSR << 1) ^ 0x71; + } else { + LFSR <<= 1; + } + } + + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + }()); + + // Reusable objects for temporary values + var T = []; + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + }()); + + /** + * SHA-3 hash algorithm. + */ + var SHA3 = C_algo.SHA3 = Hasher.extend({ + /** + * Configuration options. + * + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 + */ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + + _doReset: function () { + var state = this._state = [] + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + + // Absorb + for (var i = 0; i < nBlockSizeLanes; i++) { + // Shortcuts + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + + // Swap endian + M2i = ( + (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | + (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) + ); + M2i1 = ( + (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | + (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) + ); + + // Absorb message into state + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + + // Rounds + for (var round = 0; round < 24; round++) { + // Theta + for (var x = 0; x < 5; x++) { + // Mix column lanes + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + + // Temporary values + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + // Shortcuts + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + + // Mix surrounding columns + var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); + var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + + // Rho Pi + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var tMsw; + var tLsw; + + // Shortcuts + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + + // Rotate lanes + if (rhoOffset < 32) { + tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); + tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); + } else /* if (rhoOffset >= 32) */ { + tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); + tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); + } + + // Transpose lanes + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + + // Rho pi at x = y = 0 + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + + // Chi + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + // Shortcuts + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[((x + 1) % 5) + 5 * y]; + var Tx2Lane = T[((x + 2) % 5) + 5 * y]; + + // Mix rows + lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); + lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); + } + } + + // Iota + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + } + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); + dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + + // Squeeze + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + // Shortcuts + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + + // Swap endian + laneMsw = ( + (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | + (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) + ); + laneLsw = ( + (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | + (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) + ); + + // Squeeze state to retrieve hash + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + // Return final computed hash + return new WordArray.init(hashWords, outputLengthBytes); + }, + + clone: function () { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA3('message'); + * var hash = CryptoJS.SHA3(wordArray); + */ + C.SHA3 = Hasher._createHelper(SHA3); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA3(message, key); + */ + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + }(Math)); + + + return CryptoJS.SHA3; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha384.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha384.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + + /** + * SHA-384 hash algorithm. + */ + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), + new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), + new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), + new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); + */ + C.SHA384 = SHA512._createHelper(SHA384); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + }()); + + + return CryptoJS.SHA384; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha512.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha512.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; + + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); + + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), + new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), + new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), + new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; + + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + // Rounds + for (var i = 0; i < 80; i++) { + var Wil; + var Wih; + + // Shortcut + var Wi = W[i]; + + // Extend message + if (i < 16) { + Wih = Wi.high = M[offset + i * 2] | 0; + Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + + Wil = gamma0l + Wi7l; + Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + Wil = Wil + gamma1l; + Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + Wil = Wil + Wi16l; + Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + var hash = this._hash.toX32(); + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + }()); + + + return CryptoJS.SHA512; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/tripledes.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/tripledes.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Permuted Choice 1 constants + var PC1 = [ + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, 27, 19, 11, 3, + 60, 52, 44, 36, 63, 55, 47, 39, + 31, 23, 15, 7, 62, 54, 46, 38, + 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 + ]; + + // Permuted Choice 2 constants + var PC2 = [ + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 + ]; + + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; + + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; + + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } + + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; + + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; + + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } + + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } + + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + + keySize: 64/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); + + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + // Make sure the key length is valid (64, 128 or >= 192 bit) + if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { + throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); + } + + // Extend the key according to the keying options defined in 3DES standard + var key1 = keyWords.slice(0, 2); + var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); + var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); + + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(key1)); + this._des2 = DES.createEncryptor(WordArray.create(key2)); + this._des3 = DES.createEncryptor(WordArray.create(key3)); + }, + + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + + keySize: 192/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); + }()); + + + return CryptoJS.TripleDES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/x64-core.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/x64-core.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + + /** + * x64 namespace. + */ + var C_x64 = C.x64 = {}; + + /** + * A 64-bit word. + */ + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function (high, low) { + this.high = high; + this.low = low; + } + + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + + // return X64Word.create(high, low); + // } + }); + + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; + + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + + // Clone "words" array + var words = clone.words = this.words.slice(0); + + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); + }()); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/desandro-matches-selector/matches-selector.js": +/*!********************************************************************!*\ + !*** ./node_modules/desandro-matches-selector/matches-selector.js ***! + \********************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * matchesSelector v2.0.2 + * matchesSelector( element, '.selector' ) + * MIT license + */ + +/*jshint browser: true, strict: true, undef: true, unused: true */ + +( function( window, factory ) { + /*global define: false, module: false */ + 'use strict'; + // universal module definition + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory() { + 'use strict'; + + var matchesMethod = ( function() { + var ElemProto = window.Element.prototype; + // check for the standard method name first + if ( ElemProto.matches ) { + return 'matches'; + } + // check un-prefixed + if ( ElemProto.matchesSelector ) { + return 'matchesSelector'; + } + // check vendor prefixes + var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; + + for ( var i=0; i < prefixes.length; i++ ) { + var prefix = prefixes[i]; + var method = prefix + 'MatchesSelector'; + if ( ElemProto[ method ] ) { + return method; + } + } + })(); + + return function matchesSelector( elem, selector ) { + return elem[ matchesMethod ]( selector ); + }; + +})); + + +/***/ }), + +/***/ "./node_modules/ev-emitter/ev-emitter.js": +/*!***********************************************!*\ + !*** ./node_modules/ev-emitter/ev-emitter.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * EvEmitter v2.1.1 + * Lil' event emitter + * MIT License + */ + +( function( global, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS - Browserify, Webpack + module.exports = factory(); + } else { + // Browser globals + global.EvEmitter = factory(); + } + +}( typeof window != 'undefined' ? window : this, function() { + +function EvEmitter() {} + +let proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // set events hash + let events = this._events = this._events || {}; + // set listeners array + let listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( !listeners.includes( listener ) ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + let onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + let index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + // copy over to avoid interference if .off() in listener + listeners = listeners.slice( 0 ); + args = args || []; + // once stuff + let onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( let listener of listeners ) { + let isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; + return this; +}; + +return EvEmitter; + +} ) ); + + +/***/ }), + +/***/ "./node_modules/fizzy-ui-utils/utils.js": +/*!**********************************************!*\ + !*** ./node_modules/fizzy-ui-utils/utils.js ***! + \**********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Fizzy UI utils v2.0.7 + * MIT license + */ + +/*jshint browser: true, undef: true, unused: true, strict: true */ + +( function( window, factory ) { + // universal module definition + /*jshint strict: false */ /*globals define, module, require */ + + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! desandro-matches-selector/matches-selector */ "./node_modules/desandro-matches-selector/matches-selector.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) { + return factory( window, matchesSelector ); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, matchesSelector ) { + +'use strict'; + +var utils = {}; + +// ----- extend ----- // + +// extends objects +utils.extend = function( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +}; + +// ----- modulo ----- // + +utils.modulo = function( num, div ) { + return ( ( num % div ) + div ) % div; +}; + +// ----- makeArray ----- // + +var arraySlice = Array.prototype.slice; + +// turn element or nodeList into an array +utils.makeArray = function( obj ) { + if ( Array.isArray( obj ) ) { + // use object if already an array + return obj; + } + // return empty array if undefined or null. #6 + if ( obj === null || obj === undefined ) { + return []; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { + // convert nodeList to array + return arraySlice.call( obj ); + } + + // array of single index + return [ obj ]; +}; + +// ----- removeFrom ----- // + +utils.removeFrom = function( ary, obj ) { + var index = ary.indexOf( obj ); + if ( index != -1 ) { + ary.splice( index, 1 ); + } +}; + +// ----- getParent ----- // + +utils.getParent = function( elem, selector ) { + while ( elem.parentNode && elem != document.body ) { + elem = elem.parentNode; + if ( matchesSelector( elem, selector ) ) { + return elem; + } + } +}; + +// ----- getQueryElement ----- // + +// use element as selector string +utils.getQueryElement = function( elem ) { + if ( typeof elem == 'string' ) { + return document.querySelector( elem ); + } + return elem; +}; + +// ----- handleEvent ----- // + +// enable .ontype to trigger from .addEventListener( elem, 'type' ) +utils.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +// ----- filterFindElements ----- // + +utils.filterFindElements = function( elems, selector ) { + // make array of elems + elems = utils.makeArray( elems ); + var ffElems = []; + + elems.forEach( function( elem ) { + // check that elem is an actual element + if ( !( elem instanceof HTMLElement ) ) { + return; + } + // add elem if no selector + if ( !selector ) { + ffElems.push( elem ); + return; + } + // filter & find items if we have a selector + // filter + if ( matchesSelector( elem, selector ) ) { + ffElems.push( elem ); + } + // find children + var childElems = elem.querySelectorAll( selector ); + // concat childElems to filterFound array + for ( var i=0; i < childElems.length; i++ ) { + ffElems.push( childElems[i] ); + } + }); + + return ffElems; +}; + +// ----- debounceMethod ----- // + +utils.debounceMethod = function( _class, methodName, threshold ) { + threshold = threshold || 100; + // original method + var method = _class.prototype[ methodName ]; + var timeoutName = methodName + 'Timeout'; + + _class.prototype[ methodName ] = function() { + var timeout = this[ timeoutName ]; + clearTimeout( timeout ); + + var args = arguments; + var _this = this; + this[ timeoutName ] = setTimeout( function() { + method.apply( _this, args ); + delete _this[ timeoutName ]; + }, threshold ); + }; +}; + +// ----- docReady ----- // + +utils.docReady = function( callback ) { + var readyState = document.readyState; + if ( readyState == 'complete' || readyState == 'interactive' ) { + // do async to allow for other scripts to run. metafizzy/flickity#441 + setTimeout( callback ); + } else { + document.addEventListener( 'DOMContentLoaded', callback ); + } +}; + +// ----- htmlInit ----- // + +// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ +utils.toDashed = function( str ) { + return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { + return $1 + '-' + $2; + }).toLowerCase(); +}; + +var console = window.console; +/** + * allow user to initialize classes via [data-namespace] or .js-namespace class + * htmlInit( Widget, 'widgetName' ) + * options are parsed from data-namespace-options + */ +utils.htmlInit = function( WidgetClass, namespace ) { + utils.docReady( function() { + var dashedNamespace = utils.toDashed( namespace ); + var dataAttr = 'data-' + dashedNamespace; + var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); + var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); + var elems = utils.makeArray( dataAttrElems ) + .concat( utils.makeArray( jsDashElems ) ); + var dataOptionsAttr = dataAttr + '-options'; + var jQuery = window.jQuery; + + elems.forEach( function( elem ) { + var attr = elem.getAttribute( dataAttr ) || + elem.getAttribute( dataOptionsAttr ); + var options; + try { + options = attr && JSON.parse( attr ); + } catch ( error ) { + // log error, do not initialize + if ( console ) { + console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + + ': ' + error ); + } + return; + } + // initialize + var instance = new WidgetClass( elem, options ); + // make available via $().data('namespace') + if ( jQuery ) { + jQuery.data( elem, namespace, instance ); + } + }); + + }); +}; + +// ----- ----- // + +return utils; + +})); + + +/***/ }), + +/***/ "./node_modules/get-size/get-size.js": +/*!*******************************************!*\ + !*** ./node_modules/get-size/get-size.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * getSize v2.0.3 + * measure size of elements + * MIT license + */ + +/* jshint browser: true, strict: true, undef: true, unused: true */ +/* globals console: false */ + +( function( window, factory ) { + /* jshint strict: false */ /* globals define, module */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +})( window, function factory() { +'use strict'; + +// -------------------------- helpers -------------------------- // + +// get a number from a string, not a percentage +function getStyleSize( value ) { + var num = parseFloat( value ); + // not a percent like '100%', and a number + var isValid = value.indexOf('%') == -1 && !isNaN( num ); + return isValid && num; +} + +function noop() {} + +var logError = typeof console == 'undefined' ? noop : + function( message ) { + console.error( message ); + }; + +// -------------------------- measurements -------------------------- // + +var measurements = [ + 'paddingLeft', + 'paddingRight', + 'paddingTop', + 'paddingBottom', + 'marginLeft', + 'marginRight', + 'marginTop', + 'marginBottom', + 'borderLeftWidth', + 'borderRightWidth', + 'borderTopWidth', + 'borderBottomWidth' +]; + +var measurementsLength = measurements.length; + +function getZeroSize() { + var size = { + width: 0, + height: 0, + innerWidth: 0, + innerHeight: 0, + outerWidth: 0, + outerHeight: 0 + }; + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + size[ measurement ] = 0; + } + return size; +} + +// -------------------------- getStyle -------------------------- // + +/** + * getStyle, get style of element, check for Firefox bug + * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + */ +function getStyle( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + logError( 'Style returned ' + style + + '. Are you running this code in a hidden iframe on Firefox? ' + + 'See https://bit.ly/getsizebug1' ); + } + return style; +} + +// -------------------------- setup -------------------------- // + +var isSetup = false; + +var isBoxSizeOuter; + +/** + * setup + * check isBoxSizerOuter + * do on first getSize() rather than on page load for Firefox bug + */ +function setup() { + // setup once + if ( isSetup ) { + return; + } + isSetup = true; + + // -------------------------- box sizing -------------------------- // + + /** + * Chrome & Safari measure the outer-width on style.width on border-box elems + * IE11 & Firefox<29 measures the inner-width + */ + var div = document.createElement('div'); + div.style.width = '200px'; + div.style.padding = '1px 2px 3px 4px'; + div.style.borderStyle = 'solid'; + div.style.borderWidth = '1px 2px 3px 4px'; + div.style.boxSizing = 'border-box'; + + var body = document.body || document.documentElement; + body.appendChild( div ); + var style = getStyle( div ); + // round value for browser zoom. desandro/masonry#928 + isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; + getSize.isBoxSizeOuter = isBoxSizeOuter; + + body.removeChild( div ); +} + +// -------------------------- getSize -------------------------- // + +function getSize( elem ) { + setup(); + + // use querySeletor if elem is string + if ( typeof elem == 'string' ) { + elem = document.querySelector( elem ); + } + + // do not proceed on non-objects + if ( !elem || typeof elem != 'object' || !elem.nodeType ) { + return; + } + + var style = getStyle( elem ); + + // if hidden, everything is 0 + if ( style.display == 'none' ) { + return getZeroSize(); + } + + var size = {}; + size.width = elem.offsetWidth; + size.height = elem.offsetHeight; + + var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; + + // get all measurements + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + var value = style[ measurement ]; + var num = parseFloat( value ); + // any 'auto', 'medium' value will be 0 + size[ measurement ] = !isNaN( num ) ? num : 0; + } + + var paddingWidth = size.paddingLeft + size.paddingRight; + var paddingHeight = size.paddingTop + size.paddingBottom; + var marginWidth = size.marginLeft + size.marginRight; + var marginHeight = size.marginTop + size.marginBottom; + var borderWidth = size.borderLeftWidth + size.borderRightWidth; + var borderHeight = size.borderTopWidth + size.borderBottomWidth; + + var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; + + // overwrite width and height if we can get it from style + var styleWidth = getStyleSize( style.width ); + if ( styleWidth !== false ) { + size.width = styleWidth + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); + } + + var styleHeight = getStyleSize( style.height ); + if ( styleHeight !== false ) { + size.height = styleHeight + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); + } + + size.innerWidth = size.width - ( paddingWidth + borderWidth ); + size.innerHeight = size.height - ( paddingHeight + borderHeight ); + + size.outerWidth = size.width + marginWidth; + size.outerHeight = size.height + marginHeight; + + return size; +} + +return getSize; + +}); + + +/***/ }), + +/***/ "./node_modules/imagesloaded/imagesloaded.js": +/*!***************************************************!*\ + !*** ./node_modules/imagesloaded/imagesloaded.js ***! + \***************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/*! + * imagesLoaded v5.0.0 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS + module.exports = factory( window, __webpack_require__(/*! ev-emitter */ "./node_modules/ev-emitter/ev-emitter.js") ); + } else { + // browser global + window.imagesLoaded = factory( window, window.EvEmitter ); + } + +} )( typeof window !== 'undefined' ? window : this, + function factory( window, EvEmitter ) { + +let $ = window.jQuery; +let console = window.console; + +// -------------------------- helpers -------------------------- // + +// turn element or nodeList into an array +function makeArray( obj ) { + // use object if already an array + if ( Array.isArray( obj ) ) return obj; + + let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + // convert nodeList to array + if ( isArrayLike ) return [ ...obj ]; + + // array of single index + return [ obj ]; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {[Array, Element, NodeList, String]} elem + * @param {[Object, Function]} options - if function, use as callback + * @param {Function} onAlways - callback function + * @returns {ImagesLoaded} + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + let queryElem = elem; + if ( typeof elem == 'string' ) { + queryElem = document.querySelectorAll( elem ); + } + // bail if bad element + if ( !queryElem ) { + console.error(`Bad element for imagesLoaded ${queryElem || elem}`); + return; + } + + this.elements = makeArray( queryElem ); + this.options = {}; + // shift arguments if no options set + if ( typeof options == 'function' ) { + onAlways = options; + } else { + Object.assign( this.options, options ); + } + + if ( onAlways ) this.on( 'always', onAlways ); + + this.getImages(); + // add jQuery Deferred object + if ( $ ) this.jqDeferred = new $.Deferred(); + + // HACK check async to allow time to bind listeners + setTimeout( this.check.bind( this ) ); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +const elementNodeTypes = [ 1, 9, 11 ]; + +/** + * @param {Node} elem + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName === 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + let { nodeType } = elem; + if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return; + + let childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( let img of childImgs ) { + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + let children = elem.querySelectorAll( this.options.background ); + for ( let child of children ) { + this.addElementBackgroundImages( child ); + } + } +}; + +const reURL = /url\((['"])?(.*?)\1\)/gi; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + let style = getComputedStyle( elem ); + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + if ( !style ) return; + + // get url inside url("...") + let matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + let url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + let loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + let background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + /* eslint-disable-next-line func-style */ + let onProgress = ( image, elem, message ) => { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( () => { + this.progress( image, elem, message ); + } ); + }; + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + } ); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount === this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( `progress: ${message}`, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + let eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + // add crossOrigin attribute. #204 + if ( this.img.crossOrigin ) { + this.proxyImage.crossOrigin = this.img.crossOrigin; + } + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.currentSrc || this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + // check for non-zero, non-undefined naturalWidth + // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 + return this.img.complete && this.img.naturalWidth; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + let { parentNode } = this.img; + // emit progress with parent or self + let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img; + this.emitEvent( 'progress', [ this, elem, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + let method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) return; + + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, onAlways ) { + let instance = new ImagesLoaded( this, options, onAlways ); + return instance.jqDeferred.promise( $( this ) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +} ); + + +/***/ }), + +/***/ "./node_modules/masonry-layout/masonry.js": +/*!************************************************!*\ + !*** ./node_modules/masonry-layout/masonry.js ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Masonry v4.2.2 + * Cascading grid layout library + * https://masonry.desandro.com + * MIT License + * by David DeSandro + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /*globals define, module, require */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! outlayer/outlayer */ "./node_modules/outlayer/outlayer.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( Outlayer, getSize ) { + +'use strict'; + +// -------------------------- masonryDefinition -------------------------- // + + // create an Outlayer layout class + var Masonry = Outlayer.create('masonry'); + // isFitWidth -> fitWidth + Masonry.compatOptions.fitWidth = 'isFitWidth'; + + var proto = Masonry.prototype; + + proto._resetLayout = function() { + this.getSize(); + this._getMeasurement( 'columnWidth', 'outerWidth' ); + this._getMeasurement( 'gutter', 'outerWidth' ); + this.measureColumns(); + + // reset column Y + this.colYs = []; + for ( var i=0; i < this.cols; i++ ) { + this.colYs.push( 0 ); + } + + this.maxY = 0; + this.horizontalColIndex = 0; + }; + + proto.measureColumns = function() { + this.getContainerWidth(); + // if columnWidth is 0, default to outerWidth of first item + if ( !this.columnWidth ) { + var firstItem = this.items[0]; + var firstItemElem = firstItem && firstItem.element; + // columnWidth fall back to item of first element + this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth || + // if first elem has no width, default to size of container + this.containerWidth; + } + + var columnWidth = this.columnWidth += this.gutter; + + // calculate columns + var containerWidth = this.containerWidth + this.gutter; + var cols = containerWidth / columnWidth; + // fix rounding errors, typically with gutters + var excess = columnWidth - containerWidth % columnWidth; + // if overshoot is less than a pixel, round up, otherwise floor it + var mathMethod = excess && excess < 1 ? 'round' : 'floor'; + cols = Math[ mathMethod ]( cols ); + this.cols = Math.max( cols, 1 ); + }; + + proto.getContainerWidth = function() { + // container is parent if fit width + var isFitWidth = this._getOption('fitWidth'); + var container = isFitWidth ? this.element.parentNode : this.element; + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var size = getSize( container ); + this.containerWidth = size && size.innerWidth; + }; + + proto._getItemLayoutPosition = function( item ) { + item.getSize(); + // how many columns does this brick span + var remainder = item.size.outerWidth % this.columnWidth; + var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; + // round if off by 1 pixel, otherwise use ceil + var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth ); + colSpan = Math.min( colSpan, this.cols ); + // use horizontal or top column position + var colPosMethod = this.options.horizontalOrder ? + '_getHorizontalColPosition' : '_getTopColPosition'; + var colPosition = this[ colPosMethod ]( colSpan, item ); + // position the brick + var position = { + x: this.columnWidth * colPosition.col, + y: colPosition.y + }; + // apply setHeight to necessary columns + var setHeight = colPosition.y + item.size.outerHeight; + var setMax = colSpan + colPosition.col; + for ( var i = colPosition.col; i < setMax; i++ ) { + this.colYs[i] = setHeight; + } + + return position; + }; + + proto._getTopColPosition = function( colSpan ) { + var colGroup = this._getTopColGroup( colSpan ); + // get the minimum Y value from the columns + var minimumY = Math.min.apply( Math, colGroup ); + + return { + col: colGroup.indexOf( minimumY ), + y: minimumY, + }; + }; + + /** + * @param {Number} colSpan - number of columns the element spans + * @returns {Array} colGroup + */ + proto._getTopColGroup = function( colSpan ) { + if ( colSpan < 2 ) { + // if brick spans only one column, use all the column Ys + return this.colYs; + } + + var colGroup = []; + // how many different places could this brick fit horizontally + var groupCount = this.cols + 1 - colSpan; + // for each group potential horizontal position + for ( var i = 0; i < groupCount; i++ ) { + colGroup[i] = this._getColGroupY( i, colSpan ); + } + return colGroup; + }; + + proto._getColGroupY = function( col, colSpan ) { + if ( colSpan < 2 ) { + return this.colYs[ col ]; + } + // make an array of colY values for that one group + var groupColYs = this.colYs.slice( col, col + colSpan ); + // and get the max value of the array + return Math.max.apply( Math, groupColYs ); + }; + + // get column position based on horizontal index. #873 + proto._getHorizontalColPosition = function( colSpan, item ) { + var col = this.horizontalColIndex % this.cols; + var isOver = colSpan > 1 && col + colSpan > this.cols; + // shift to next row if item can't fit on current row + col = isOver ? 0 : col; + // don't let zero-size items take up space + var hasSize = item.size.outerWidth && item.size.outerHeight; + this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; + + return { + col: col, + y: this._getColGroupY( col, colSpan ), + }; + }; + + proto._manageStamp = function( stamp ) { + var stampSize = getSize( stamp ); + var offset = this._getElementOffset( stamp ); + // get the columns that this stamp affects + var isOriginLeft = this._getOption('originLeft'); + var firstX = isOriginLeft ? offset.left : offset.right; + var lastX = firstX + stampSize.outerWidth; + var firstCol = Math.floor( firstX / this.columnWidth ); + firstCol = Math.max( 0, firstCol ); + var lastCol = Math.floor( lastX / this.columnWidth ); + // lastCol should not go over if multiple of columnWidth #425 + lastCol -= lastX % this.columnWidth ? 0 : 1; + lastCol = Math.min( this.cols - 1, lastCol ); + // set colYs to bottom of the stamp + + var isOriginTop = this._getOption('originTop'); + var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) + + stampSize.outerHeight; + for ( var i = firstCol; i <= lastCol; i++ ) { + this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); + } + }; + + proto._getContainerSize = function() { + this.maxY = Math.max.apply( Math, this.colYs ); + var size = { + height: this.maxY + }; + + if ( this._getOption('fitWidth') ) { + size.width = this._getContainerFitWidth(); + } + + return size; + }; + + proto._getContainerFitWidth = function() { + var unusedCols = 0; + // count unused columns + var i = this.cols; + while ( --i ) { + if ( this.colYs[i] !== 0 ) { + break; + } + unusedCols++; + } + // fit container to columns that have been used + return ( this.cols - unusedCols ) * this.columnWidth - this.gutter; + }; + + proto.needsResizeLayout = function() { + var previousWidth = this.containerWidth; + this.getContainerWidth(); + return previousWidth != this.containerWidth; + }; + + return Masonry; + +})); + + +/***/ }), + +/***/ "./src/scss/style.scss": +/*!*****************************!*\ + !*** ./src/scss/style.scss ***! + \*****************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./node_modules/outlayer/item.js": +/*!***************************************!*\ + !*** ./node_modules/outlayer/item.js ***! + \***************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Outlayer Item + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( EvEmitter, getSize ) { +'use strict'; + +// ----- helpers ----- // + +function isEmptyObj( obj ) { + for ( var prop in obj ) { + return false; + } + prop = null; + return true; +} + +// -------------------------- CSS3 support -------------------------- // + + +var docElemStyle = document.documentElement.style; + +var transitionProperty = typeof docElemStyle.transition == 'string' ? + 'transition' : 'WebkitTransition'; +var transformProperty = typeof docElemStyle.transform == 'string' ? + 'transform' : 'WebkitTransform'; + +var transitionEndEvent = { + WebkitTransition: 'webkitTransitionEnd', + transition: 'transitionend' +}[ transitionProperty ]; + +// cache all vendor properties that could have vendor prefix +var vendorProperties = { + transform: transformProperty, + transition: transitionProperty, + transitionDuration: transitionProperty + 'Duration', + transitionProperty: transitionProperty + 'Property', + transitionDelay: transitionProperty + 'Delay' +}; + +// -------------------------- Item -------------------------- // + +function Item( element, layout ) { + if ( !element ) { + return; + } + + this.element = element; + // parent layout class, i.e. Masonry, Isotope, or Packery + this.layout = layout; + this.position = { + x: 0, + y: 0 + }; + + this._create(); +} + +// inherit EvEmitter +var proto = Item.prototype = Object.create( EvEmitter.prototype ); +proto.constructor = Item; + +proto._create = function() { + // transition objects + this._transn = { + ingProperties: {}, + clean: {}, + onEnd: {} + }; + + this.css({ + position: 'absolute' + }); +}; + +// trigger specified handler for event type +proto.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * apply CSS styles to element + * @param {Object} style + */ +proto.css = function( style ) { + var elemStyle = this.element.style; + + for ( var prop in style ) { + // use vendor property if available + var supportedProp = vendorProperties[ prop ] || prop; + elemStyle[ supportedProp ] = style[ prop ]; + } +}; + + // measure position, and sets it +proto.getPosition = function() { + var style = getComputedStyle( this.element ); + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + var xValue = style[ isOriginLeft ? 'left' : 'right' ]; + var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; + var x = parseFloat( xValue ); + var y = parseFloat( yValue ); + // convert percent to pixels + var layoutSize = this.layout.size; + if ( xValue.indexOf('%') != -1 ) { + x = ( x / 100 ) * layoutSize.width; + } + if ( yValue.indexOf('%') != -1 ) { + y = ( y / 100 ) * layoutSize.height; + } + // clean up 'auto' or other non-integer values + x = isNaN( x ) ? 0 : x; + y = isNaN( y ) ? 0 : y; + // remove padding from measurement + x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; + y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; + + this.position.x = x; + this.position.y = y; +}; + +// set settled position, apply padding +proto.layoutPosition = function() { + var layoutSize = this.layout.size; + var style = {}; + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + + // x + var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; + var xProperty = isOriginLeft ? 'left' : 'right'; + var xResetProperty = isOriginLeft ? 'right' : 'left'; + + var x = this.position.x + layoutSize[ xPadding ]; + // set in percentage or pixels + style[ xProperty ] = this.getXValue( x ); + // reset other property + style[ xResetProperty ] = ''; + + // y + var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; + var yProperty = isOriginTop ? 'top' : 'bottom'; + var yResetProperty = isOriginTop ? 'bottom' : 'top'; + + var y = this.position.y + layoutSize[ yPadding ]; + // set in percentage or pixels + style[ yProperty ] = this.getYValue( y ); + // reset other property + style[ yResetProperty ] = ''; + + this.css( style ); + this.emitEvent( 'layout', [ this ] ); +}; + +proto.getXValue = function( x ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && !isHorizontal ? + ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px'; +}; + +proto.getYValue = function( y ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && isHorizontal ? + ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px'; +}; + +proto._transitionTo = function( x, y ) { + this.getPosition(); + // get current x & y from top/left + var curX = this.position.x; + var curY = this.position.y; + + var didNotMove = x == this.position.x && y == this.position.y; + + // save end position + this.setPosition( x, y ); + + // if did not move and not transitioning, just go to layout + if ( didNotMove && !this.isTransitioning ) { + this.layoutPosition(); + return; + } + + var transX = x - curX; + var transY = y - curY; + var transitionStyle = {}; + transitionStyle.transform = this.getTranslate( transX, transY ); + + this.transition({ + to: transitionStyle, + onTransitionEnd: { + transform: this.layoutPosition + }, + isCleaning: true + }); +}; + +proto.getTranslate = function( x, y ) { + // flip cooridinates if origin on right or bottom + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + x = isOriginLeft ? x : -x; + y = isOriginTop ? y : -y; + return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; +}; + +// non transition + transform support +proto.goTo = function( x, y ) { + this.setPosition( x, y ); + this.layoutPosition(); +}; + +proto.moveTo = proto._transitionTo; + +proto.setPosition = function( x, y ) { + this.position.x = parseFloat( x ); + this.position.y = parseFloat( y ); +}; + +// ----- transition ----- // + +/** + * @param {Object} style - CSS + * @param {Function} onTransitionEnd + */ + +// non transition, just trigger callback +proto._nonTransition = function( args ) { + this.css( args.to ); + if ( args.isCleaning ) { + this._removeStyles( args.to ); + } + for ( var prop in args.onTransitionEnd ) { + args.onTransitionEnd[ prop ].call( this ); + } +}; + +/** + * proper transition + * @param {Object} args - arguments + * @param {Object} to - style to transition to + * @param {Object} from - style to start transition from + * @param {Boolean} isCleaning - removes transition styles after transition + * @param {Function} onTransitionEnd - callback + */ +proto.transition = function( args ) { + // redirect to nonTransition if no transition duration + if ( !parseFloat( this.layout.options.transitionDuration ) ) { + this._nonTransition( args ); + return; + } + + var _transition = this._transn; + // keep track of onTransitionEnd callback by css property + for ( var prop in args.onTransitionEnd ) { + _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ]; + } + // keep track of properties that are transitioning + for ( prop in args.to ) { + _transition.ingProperties[ prop ] = true; + // keep track of properties to clean up when transition is done + if ( args.isCleaning ) { + _transition.clean[ prop ] = true; + } + } + + // set from styles + if ( args.from ) { + this.css( args.from ); + // force redraw. http://blog.alexmaccaw.com/css-transitions + var h = this.element.offsetHeight; + // hack for JSHint to hush about unused var + h = null; + } + // enable transition + this.enableTransition( args.to ); + // set styles that are transitioning + this.css( args.to ); + + this.isTransitioning = true; + +}; + +// dash before all cap letters, including first for +// WebkitTransform => -webkit-transform +function toDashedAll( str ) { + return str.replace( /([A-Z])/g, function( $1 ) { + return '-' + $1.toLowerCase(); + }); +} + +var transitionProps = 'opacity,' + toDashedAll( transformProperty ); + +proto.enableTransition = function(/* style */) { + // HACK changing transitionProperty during a transition + // will cause transition to jump + if ( this.isTransitioning ) { + return; + } + + // make `transition: foo, bar, baz` from style object + // HACK un-comment this when enableTransition can work + // while a transition is happening + // var transitionValues = []; + // for ( var prop in style ) { + // // dash-ify camelCased properties like WebkitTransition + // prop = vendorProperties[ prop ] || prop; + // transitionValues.push( toDashedAll( prop ) ); + // } + // munge number to millisecond, to match stagger + var duration = this.layout.options.transitionDuration; + duration = typeof duration == 'number' ? duration + 'ms' : duration; + // enable transition styles + this.css({ + transitionProperty: transitionProps, + transitionDuration: duration, + transitionDelay: this.staggerDelay || 0 + }); + // listen for transition end event + this.element.addEventListener( transitionEndEvent, this, false ); +}; + +// ----- events ----- // + +proto.onwebkitTransitionEnd = function( event ) { + this.ontransitionend( event ); +}; + +proto.onotransitionend = function( event ) { + this.ontransitionend( event ); +}; + +// properties that I munge to make my life easier +var dashedVendorProperties = { + '-webkit-transform': 'transform' +}; + +proto.ontransitionend = function( event ) { + // disregard bubbled events from children + if ( event.target !== this.element ) { + return; + } + var _transition = this._transn; + // get property name of transitioned property, convert to prefix-free + var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName; + + // remove property that has completed transitioning + delete _transition.ingProperties[ propertyName ]; + // check if any properties are still transitioning + if ( isEmptyObj( _transition.ingProperties ) ) { + // all properties have completed transitioning + this.disableTransition(); + } + // clean style + if ( propertyName in _transition.clean ) { + // clean up style + this.element.style[ event.propertyName ] = ''; + delete _transition.clean[ propertyName ]; + } + // trigger onTransitionEnd callback + if ( propertyName in _transition.onEnd ) { + var onTransitionEnd = _transition.onEnd[ propertyName ]; + onTransitionEnd.call( this ); + delete _transition.onEnd[ propertyName ]; + } + + this.emitEvent( 'transitionEnd', [ this ] ); +}; + +proto.disableTransition = function() { + this.removeTransitionStyles(); + this.element.removeEventListener( transitionEndEvent, this, false ); + this.isTransitioning = false; +}; + +/** + * removes style property from element + * @param {Object} style +**/ +proto._removeStyles = function( style ) { + // clean up transition styles + var cleanStyle = {}; + for ( var prop in style ) { + cleanStyle[ prop ] = ''; + } + this.css( cleanStyle ); +}; + +var cleanTransitionStyle = { + transitionProperty: '', + transitionDuration: '', + transitionDelay: '' +}; + +proto.removeTransitionStyles = function() { + // remove transition + this.css( cleanTransitionStyle ); +}; + +// ----- stagger ----- // + +proto.stagger = function( delay ) { + delay = isNaN( delay ) ? 0 : delay; + this.staggerDelay = delay + 'ms'; +}; + +// ----- show/hide/remove ----- // + +// remove element from DOM +proto.removeElem = function() { + this.element.parentNode.removeChild( this.element ); + // remove display: none + this.css({ display: '' }); + this.emitEvent( 'remove', [ this ] ); +}; + +proto.remove = function() { + // just remove element if no transition support or no transition + if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) { + this.removeElem(); + return; + } + + // start transition + this.once( 'transitionEnd', function() { + this.removeElem(); + }); + this.hide(); +}; + +proto.reveal = function() { + delete this.isHidden; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd; + + this.transition({ + from: options.hiddenStyle, + to: options.visibleStyle, + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onRevealTransitionEnd = function() { + // check if still visible + // during transition, item may have been hidden + if ( !this.isHidden ) { + this.emitEvent('reveal'); + } +}; + +/** + * get style property use for hide/reveal transition end + * @param {String} styleProperty - hiddenStyle/visibleStyle + * @returns {String} + */ +proto.getHideRevealTransitionEndProperty = function( styleProperty ) { + var optionStyle = this.layout.options[ styleProperty ]; + // use opacity + if ( optionStyle.opacity ) { + return 'opacity'; + } + // get first property + for ( var prop in optionStyle ) { + return prop; + } +}; + +proto.hide = function() { + // set flag + this.isHidden = true; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd; + + this.transition({ + from: options.visibleStyle, + to: options.hiddenStyle, + // keep hidden stuff hidden + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onHideTransitionEnd = function() { + // check if still hidden + // during transition, item may have been un-hidden + if ( this.isHidden ) { + this.css({ display: 'none' }); + this.emitEvent('hide'); + } +}; + +proto.destroy = function() { + this.css({ + position: '', + left: '', + right: '', + top: '', + bottom: '', + transition: '', + transform: '' + }); +}; + +return Item; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js": +/*!*********************************************************************!*\ + !*** ./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js ***! + \*********************************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * EvEmitter v1.1.0 + * Lil' event emitter + * MIT License + */ + +/* jshint unused: true, undef: true, strict: true */ + +( function( global, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, window */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( typeof window != 'undefined' ? window : this, function() { + +"use strict"; + +function EvEmitter() {} + +var proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // set events hash + var events = this._events = this._events || {}; + // set listeners array + var listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( listeners.indexOf( listener ) == -1 ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + var onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + // copy over to avoid interference if .off() in listener + listeners = listeners.slice(0); + args = args || []; + // once stuff + var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( var i=0; i < listeners.length; i++ ) { + var listener = listeners[i] + var isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; +}; + +return EvEmitter; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/outlayer.js": +/*!*******************************************!*\ + !*** ./node_modules/outlayer/outlayer.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Outlayer v2.1.1 + * the brains and guts of a layout library + * MIT license + */ + +( function( window, factory ) { + 'use strict'; + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js"), + __webpack_require__(/*! fizzy-ui-utils/utils */ "./node_modules/fizzy-ui-utils/utils.js"), + __webpack_require__(/*! ./item */ "./node_modules/outlayer/item.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter, getSize, utils, Item ) { + return factory( window, EvEmitter, getSize, utils, Item); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, EvEmitter, getSize, utils, Item ) { +'use strict'; + +// ----- vars ----- // + +var console = window.console; +var jQuery = window.jQuery; +var noop = function() {}; + +// -------------------------- Outlayer -------------------------- // + +// globally unique identifiers +var GUID = 0; +// internal store of all Outlayer intances +var instances = {}; + + +/** + * @param {Element, String} element + * @param {Object} options + * @constructor + */ +function Outlayer( element, options ) { + var queryElement = utils.getQueryElement( element ); + if ( !queryElement ) { + if ( console ) { + console.error( 'Bad element for ' + this.constructor.namespace + + ': ' + ( queryElement || element ) ); + } + return; + } + this.element = queryElement; + // add jQuery + if ( jQuery ) { + this.$element = jQuery( this.element ); + } + + // options + this.options = utils.extend( {}, this.constructor.defaults ); + this.option( options ); + + // add id for Outlayer.getFromElement + var id = ++GUID; + this.element.outlayerGUID = id; // expando + instances[ id ] = this; // associate via id + + // kick it off + this._create(); + + var isInitLayout = this._getOption('initLayout'); + if ( isInitLayout ) { + this.layout(); + } +} + +// settings are for internal use only +Outlayer.namespace = 'outlayer'; +Outlayer.Item = Item; + +// default options +Outlayer.defaults = { + containerStyle: { + position: 'relative' + }, + initLayout: true, + originLeft: true, + originTop: true, + resize: true, + resizeContainer: true, + // item options + transitionDuration: '0.4s', + hiddenStyle: { + opacity: 0, + transform: 'scale(0.001)' + }, + visibleStyle: { + opacity: 1, + transform: 'scale(1)' + } +}; + +var proto = Outlayer.prototype; +// inherit EvEmitter +utils.extend( proto, EvEmitter.prototype ); + +/** + * set options + * @param {Object} opts + */ +proto.option = function( opts ) { + utils.extend( this.options, opts ); +}; + +/** + * get backwards compatible option value, check old name + */ +proto._getOption = function( option ) { + var oldOption = this.constructor.compatOptions[ option ]; + return oldOption && this.options[ oldOption ] !== undefined ? + this.options[ oldOption ] : this.options[ option ]; +}; + +Outlayer.compatOptions = { + // currentName: oldName + initLayout: 'isInitLayout', + horizontal: 'isHorizontal', + layoutInstant: 'isLayoutInstant', + originLeft: 'isOriginLeft', + originTop: 'isOriginTop', + resize: 'isResizeBound', + resizeContainer: 'isResizingContainer' +}; + +proto._create = function() { + // get items from children + this.reloadItems(); + // elements that affect layout, but are not laid out + this.stamps = []; + this.stamp( this.options.stamp ); + // set container style + utils.extend( this.element.style, this.options.containerStyle ); + + // bind resize method + var canBindResize = this._getOption('resize'); + if ( canBindResize ) { + this.bindResize(); + } +}; + +// goes through all children again and gets bricks in proper order +proto.reloadItems = function() { + // collection of item elements + this.items = this._itemize( this.element.children ); +}; + + +/** + * turn elements into Outlayer.Items to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - collection of new Outlayer Items + */ +proto._itemize = function( elems ) { + + var itemElems = this._filterFindItemElements( elems ); + var Item = this.constructor.Item; + + // create new Outlayer Items for collection + var items = []; + for ( var i=0; i < itemElems.length; i++ ) { + var elem = itemElems[i]; + var item = new Item( elem, this ); + items.push( item ); + } + + return items; +}; + +/** + * get item elements to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - item elements + */ +proto._filterFindItemElements = function( elems ) { + return utils.filterFindElements( elems, this.options.itemSelector ); +}; + +/** + * getter method for getting item elements + * @returns {Array} elems - collection of item elements + */ +proto.getItemElements = function() { + return this.items.map( function( item ) { + return item.element; + }); +}; + +// ----- init & layout ----- // + +/** + * lays out all items + */ +proto.layout = function() { + this._resetLayout(); + this._manageStamps(); + + // don't animate first layout + var layoutInstant = this._getOption('layoutInstant'); + var isInstant = layoutInstant !== undefined ? + layoutInstant : !this._isLayoutInited; + this.layoutItems( this.items, isInstant ); + + // flag for initalized + this._isLayoutInited = true; +}; + +// _init is alias for layout +proto._init = proto.layout; + +/** + * logic before any new layout + */ +proto._resetLayout = function() { + this.getSize(); +}; + + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * get measurement from option, for columnWidth, rowHeight, gutter + * if option is String -> get element from selector string, & get size of element + * if option is Element -> get size of element + * else use option as a number + * + * @param {String} measurement + * @param {String} size - width or height + * @private + */ +proto._getMeasurement = function( measurement, size ) { + var option = this.options[ measurement ]; + var elem; + if ( !option ) { + // default to 0 + this[ measurement ] = 0; + } else { + // use option as an element + if ( typeof option == 'string' ) { + elem = this.element.querySelector( option ); + } else if ( option instanceof HTMLElement ) { + elem = option; + } + // use size of element, if element + this[ measurement ] = elem ? getSize( elem )[ size ] : option; + } +}; + +/** + * layout a collection of item elements + * @api public + */ +proto.layoutItems = function( items, isInstant ) { + items = this._getItemsForLayout( items ); + + this._layoutItems( items, isInstant ); + + this._postLayout(); +}; + +/** + * get the items to be laid out + * you may want to skip over some items + * @param {Array} items + * @returns {Array} items + */ +proto._getItemsForLayout = function( items ) { + return items.filter( function( item ) { + return !item.isIgnored; + }); +}; + +/** + * layout items + * @param {Array} items + * @param {Boolean} isInstant + */ +proto._layoutItems = function( items, isInstant ) { + this._emitCompleteOnItems( 'layout', items ); + + if ( !items || !items.length ) { + // no items, emit event with empty array + return; + } + + var queue = []; + + items.forEach( function( item ) { + // get x/y object from method + var position = this._getItemLayoutPosition( item ); + // enqueue + position.item = item; + position.isInstant = isInstant || item.isLayoutInstant; + queue.push( position ); + }, this ); + + this._processLayoutQueue( queue ); +}; + +/** + * get item layout position + * @param {Outlayer.Item} item + * @returns {Object} x and y position + */ +proto._getItemLayoutPosition = function( /* item */ ) { + return { + x: 0, + y: 0 + }; +}; + +/** + * iterate over array and position each item + * Reason being - separating this logic prevents 'layout invalidation' + * thx @paul_irish + * @param {Array} queue + */ +proto._processLayoutQueue = function( queue ) { + this.updateStagger(); + queue.forEach( function( obj, i ) { + this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i ); + }, this ); +}; + +// set stagger from option in milliseconds number +proto.updateStagger = function() { + var stagger = this.options.stagger; + if ( stagger === null || stagger === undefined ) { + this.stagger = 0; + return; + } + this.stagger = getMilliseconds( stagger ); + return this.stagger; +}; + +/** + * Sets position of item in DOM + * @param {Outlayer.Item} item + * @param {Number} x - horizontal position + * @param {Number} y - vertical position + * @param {Boolean} isInstant - disables transitions + */ +proto._positionItem = function( item, x, y, isInstant, i ) { + if ( isInstant ) { + // if not transition, just set CSS + item.goTo( x, y ); + } else { + item.stagger( i * this.stagger ); + item.moveTo( x, y ); + } +}; + +/** + * Any logic you want to do after each layout, + * i.e. size the container + */ +proto._postLayout = function() { + this.resizeContainer(); +}; + +proto.resizeContainer = function() { + var isResizingContainer = this._getOption('resizeContainer'); + if ( !isResizingContainer ) { + return; + } + var size = this._getContainerSize(); + if ( size ) { + this._setContainerMeasure( size.width, true ); + this._setContainerMeasure( size.height, false ); + } +}; + +/** + * Sets width or height of container if returned + * @returns {Object} size + * @param {Number} width + * @param {Number} height + */ +proto._getContainerSize = noop; + +/** + * @param {Number} measure - size of width or height + * @param {Boolean} isWidth + */ +proto._setContainerMeasure = function( measure, isWidth ) { + if ( measure === undefined ) { + return; + } + + var elemSize = this.size; + // add padding and border width if border box + if ( elemSize.isBorderBox ) { + measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + + elemSize.borderLeftWidth + elemSize.borderRightWidth : + elemSize.paddingBottom + elemSize.paddingTop + + elemSize.borderTopWidth + elemSize.borderBottomWidth; + } + + measure = Math.max( measure, 0 ); + this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; +}; + +/** + * emit eventComplete on a collection of items events + * @param {String} eventName + * @param {Array} items - Outlayer.Items + */ +proto._emitCompleteOnItems = function( eventName, items ) { + var _this = this; + function onComplete() { + _this.dispatchEvent( eventName + 'Complete', null, [ items ] ); + } + + var count = items.length; + if ( !items || !count ) { + onComplete(); + return; + } + + var doneCount = 0; + function tick() { + doneCount++; + if ( doneCount == count ) { + onComplete(); + } + } + + // bind callback + items.forEach( function( item ) { + item.once( eventName, tick ); + }); +}; + +/** + * emits events via EvEmitter and jQuery events + * @param {String} type - name of event + * @param {Event} event - original event + * @param {Array} args - extra arguments + */ +proto.dispatchEvent = function( type, event, args ) { + // add original event to arguments + var emitArgs = event ? [ event ].concat( args ) : args; + this.emitEvent( type, emitArgs ); + + if ( jQuery ) { + // set this.$element + this.$element = this.$element || jQuery( this.element ); + if ( event ) { + // create jQuery event + var $event = jQuery.Event( event ); + $event.type = type; + this.$element.trigger( $event, args ); + } else { + // just trigger with type if no event available + this.$element.trigger( type, args ); + } + } +}; + +// -------------------------- ignore & stamps -------------------------- // + + +/** + * keep item in collection, but do not lay it out + * ignored items do not get skipped in layout + * @param {Element} elem + */ +proto.ignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + item.isIgnored = true; + } +}; + +/** + * return item to layout collection + * @param {Element} elem + */ +proto.unignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + delete item.isIgnored; + } +}; + +/** + * adds elements to stamps + * @param {NodeList, Array, Element, or String} elems + */ +proto.stamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ) { + return; + } + + this.stamps = this.stamps.concat( elems ); + // ignore + elems.forEach( this.ignore, this ); +}; + +/** + * removes elements to stamps + * @param {NodeList, Array, or Element} elems + */ +proto.unstamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ){ + return; + } + + elems.forEach( function( elem ) { + // filter out removed stamp elements + utils.removeFrom( this.stamps, elem ); + this.unignore( elem ); + }, this ); +}; + +/** + * finds child elements + * @param {NodeList, Array, Element, or String} elems + * @returns {Array} elems + */ +proto._find = function( elems ) { + if ( !elems ) { + return; + } + // if string, use argument as selector string + if ( typeof elems == 'string' ) { + elems = this.element.querySelectorAll( elems ); + } + elems = utils.makeArray( elems ); + return elems; +}; + +proto._manageStamps = function() { + if ( !this.stamps || !this.stamps.length ) { + return; + } + + this._getBoundingRect(); + + this.stamps.forEach( this._manageStamp, this ); +}; + +// update boundingLeft / Top +proto._getBoundingRect = function() { + // get bounding rect for container element + var boundingRect = this.element.getBoundingClientRect(); + var size = this.size; + this._boundingRect = { + left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, + top: boundingRect.top + size.paddingTop + size.borderTopWidth, + right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), + bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) + }; +}; + +/** + * @param {Element} stamp +**/ +proto._manageStamp = noop; + +/** + * get x/y position of element relative to container element + * @param {Element} elem + * @returns {Object} offset - has left, top, right, bottom + */ +proto._getElementOffset = function( elem ) { + var boundingRect = elem.getBoundingClientRect(); + var thisRect = this._boundingRect; + var size = getSize( elem ); + var offset = { + left: boundingRect.left - thisRect.left - size.marginLeft, + top: boundingRect.top - thisRect.top - size.marginTop, + right: thisRect.right - boundingRect.right - size.marginRight, + bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom + }; + return offset; +}; + +// -------------------------- resize -------------------------- // + +// enable event handlers for listeners +// i.e. resize -> onresize +proto.handleEvent = utils.handleEvent; + +/** + * Bind layout to window resizing + */ +proto.bindResize = function() { + window.addEventListener( 'resize', this ); + this.isResizeBound = true; +}; + +/** + * Unbind layout to window resizing + */ +proto.unbindResize = function() { + window.removeEventListener( 'resize', this ); + this.isResizeBound = false; +}; + +proto.onresize = function() { + this.resize(); +}; + +utils.debounceMethod( Outlayer, 'onresize', 100 ); + +proto.resize = function() { + // don't trigger if size did not change + // or if resize was unbound. See #9 + if ( !this.isResizeBound || !this.needsResizeLayout() ) { + return; + } + + this.layout(); +}; + +/** + * check if layout is needed post layout + * @returns Boolean + */ +proto.needsResizeLayout = function() { + var size = getSize( this.element ); + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var hasSizes = this.size && size; + return hasSizes && size.innerWidth !== this.size.innerWidth; +}; + +// -------------------------- methods -------------------------- // + +/** + * add items to Outlayer instance + * @param {Array or NodeList or Element} elems + * @returns {Array} items - Outlayer.Items +**/ +proto.addItems = function( elems ) { + var items = this._itemize( elems ); + // add items to collection + if ( items.length ) { + this.items = this.items.concat( items ); + } + return items; +}; + +/** + * Layout newly-appended item elements + * @param {Array or NodeList or Element} elems + */ +proto.appended = function( elems ) { + var items = this.addItems( elems ); + if ( !items.length ) { + return; + } + // layout and reveal just the new items + this.layoutItems( items, true ); + this.reveal( items ); +}; + +/** + * Layout prepended elements + * @param {Array or NodeList or Element} elems + */ +proto.prepended = function( elems ) { + var items = this._itemize( elems ); + if ( !items.length ) { + return; + } + // add items to beginning of collection + var previousItems = this.items.slice(0); + this.items = items.concat( previousItems ); + // start new layout + this._resetLayout(); + this._manageStamps(); + // layout new stuff without transition + this.layoutItems( items, true ); + this.reveal( items ); + // layout previous items + this.layoutItems( previousItems ); +}; + +/** + * reveal a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.reveal = function( items ) { + this._emitCompleteOnItems( 'reveal', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.reveal(); + }); +}; + +/** + * hide a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.hide = function( items ) { + this._emitCompleteOnItems( 'hide', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.hide(); + }); +}; + +/** + * reveal item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.revealItemElements = function( elems ) { + var items = this.getItems( elems ); + this.reveal( items ); +}; + +/** + * hide item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.hideItemElements = function( elems ) { + var items = this.getItems( elems ); + this.hide( items ); +}; + +/** + * get Outlayer.Item, given an Element + * @param {Element} elem + * @param {Function} callback + * @returns {Outlayer.Item} item + */ +proto.getItem = function( elem ) { + // loop through items to get the one that matches + for ( var i=0; i < this.items.length; i++ ) { + var item = this.items[i]; + if ( item.element == elem ) { + // return item + return item; + } + } +}; + +/** + * get collection of Outlayer.Items, given Elements + * @param {Array} elems + * @returns {Array} items - Outlayer.Items + */ +proto.getItems = function( elems ) { + elems = utils.makeArray( elems ); + var items = []; + elems.forEach( function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + items.push( item ); + } + }, this ); + + return items; +}; + +/** + * remove element(s) from instance and DOM + * @param {Array or NodeList or Element} elems + */ +proto.remove = function( elems ) { + var removeItems = this.getItems( elems ); + + this._emitCompleteOnItems( 'remove', removeItems ); + + // bail if no items to remove + if ( !removeItems || !removeItems.length ) { + return; + } + + removeItems.forEach( function( item ) { + item.remove(); + // remove item from collection + utils.removeFrom( this.items, item ); + }, this ); +}; + +// ----- destroy ----- // + +// remove and disable Outlayer instance +proto.destroy = function() { + // clean up dynamic styles + var style = this.element.style; + style.height = ''; + style.position = ''; + style.width = ''; + // destroy items + this.items.forEach( function( item ) { + item.destroy(); + }); + + this.unbindResize(); + + var id = this.element.outlayerGUID; + delete instances[ id ]; // remove reference to instance by id + delete this.element.outlayerGUID; + // remove data for jQuery + if ( jQuery ) { + jQuery.removeData( this.element, this.constructor.namespace ); + } + +}; + +// -------------------------- data -------------------------- // + +/** + * get Outlayer instance from element + * @param {Element} elem + * @returns {Outlayer} + */ +Outlayer.data = function( elem ) { + elem = utils.getQueryElement( elem ); + var id = elem && elem.outlayerGUID; + return id && instances[ id ]; +}; + + +// -------------------------- create Outlayer class -------------------------- // + +/** + * create a layout class + * @param {String} namespace + */ +Outlayer.create = function( namespace, options ) { + // sub-class Outlayer + var Layout = subclass( Outlayer ); + // apply new options and compatOptions + Layout.defaults = utils.extend( {}, Outlayer.defaults ); + utils.extend( Layout.defaults, options ); + Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions ); + + Layout.namespace = namespace; + + Layout.data = Outlayer.data; + + // sub-class Item + Layout.Item = subclass( Item ); + + // -------------------------- declarative -------------------------- // + + utils.htmlInit( Layout, namespace ); + + // -------------------------- jQuery bridge -------------------------- // + + // make into jQuery plugin + if ( jQuery && jQuery.bridget ) { + jQuery.bridget( namespace, Layout ); + } + + return Layout; +}; + +function subclass( Parent ) { + function SubClass() { + Parent.apply( this, arguments ); + } + + SubClass.prototype = Object.create( Parent.prototype ); + SubClass.prototype.constructor = SubClass; + + return SubClass; +} + +// ----- helpers ----- // + +// how many milliseconds are in each unit +var msUnits = { + ms: 1, + s: 1000 +}; + +// munge time-like parameter into millisecond number +// '0.4s' -> 40 +function getMilliseconds( time ) { + if ( typeof time == 'number' ) { + return time; + } + var matches = time.match( /(^\d*\.?\d*)(\w*)/ ); + var num = matches && matches[1]; + var unit = matches && matches[2]; + if ( !num.length ) { + return 0; + } + num = parseFloat( num ); + var mult = msUnits[ unit ] || 1; + return num * mult; +} + +// ----- fin ----- // + +// back in global +Outlayer.Item = Item; + +return Outlayer; + +})); + + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["React"]; + +/***/ }), + +/***/ "@wordpress/blocks": +/*!********************************!*\ + !*** external ["wp","blocks"] ***! + \********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["blocks"]; + +/***/ }), + +/***/ "@wordpress/data": +/*!******************************!*\ + !*** external ["wp","data"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["data"]; + +/***/ }), + +/***/ "@wordpress/element": +/*!*********************************!*\ + !*** external ["wp","element"] ***! + \*********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["element"]; + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "?9157": +/*!************************!*\ + !*** crypto (ignored) ***! + \************************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/adapters.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/adapters/adapters.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); +/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const knownAdapters = { + http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], + xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"] +} + +_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(knownAdapters, (fn, value) => { + if(fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + getAdapter: (adapters) => { + adapters = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if((adapter = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + break; + } + } + + if (!adapter) { + if (adapter === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( + `Adapter ${nameOrAdapter} is not supported by the environment`, + 'ERR_NOT_SUPPORT' + ); + } + + throw new Error( + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].hasOwnProp(knownAdapters, nameOrAdapter) ? + `Adapter '${nameOrAdapter}' is not available in the build` : + `Unknown adapter '${nameOrAdapter}'` + ); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFunction(adapter)) { + throw new TypeError('adapter is not a function'); + } + + return adapter; + }, + adapters: knownAdapters +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); +/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); + + + + + + + + + + + + + + + + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers).normalize(); + const responseType = config.responseType; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(requestData) && (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserWebWorkerEnv)) { + requestHeaders.setContentType(false); // Let the browser set it + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__["default"]; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv) { + // Add xsrf header + const xsrfValue = (config.withCredentials || (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath)) + && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__["default"].read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__["default"](null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__["default"])(fullPath); + + if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].protocols.indexOf(protocol) === -1) { + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); +/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); +/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); +/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); + + + + + + + + + + + + + + + + + + + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); + const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); + + // Copy axios.prototype to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); + + // Copy context to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); + +// Expose Axios class to allow class inheritance +axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + +// Expose Cancel & CancelToken +axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; +axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; +axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; +axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; +axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; + +// Expose AxiosError class +axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; + +// Expose isAxiosError +axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; + +// Expose mergeConfig +axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; + +axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; + +axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__["default"]; + +axios.default = axios; + +// this module should only have a default export +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); + + + + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CanceledError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { + __CANCEL__: true +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isCancel) +/* harmony export */ }); + + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); +/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); +/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + + + + + + +const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), + response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + let contextHeaders; + + // Flatten headers + contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( + headers.common, + headers[config.method] + ); + + contextHeaders && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url); + return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosError.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosError.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); + + + + + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +function isValidHeaderName(str) { + return /^[-_a-zA-Z]+$/.test(str.trim()); +} + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { + return parser.call(this, value, key); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders.prototype); +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildFullPath) +/* harmony export */ }); +/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); + + + + + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { + return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); + } + return requestedURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ dispatchRequest) +/* harmony export */ }); +/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); + + + + + + + + + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); + + // Transform request data + config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + response + ); + + response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergeConfig) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + +const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ settle) +/* harmony export */ }); +/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( + 'Request failed with status code ' + response.status, + [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ transformData) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + const context = response || config; + const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); + let data = context.data; + + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/index.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/defaults/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); + + + + + + + + + + +const DEFAULT_CONTENT_TYPE = { + 'Content-Type': undefined +}; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); + + if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) + ) { + return data; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { + return data.buffer; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); + } + + if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, + Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(DEFAULT_CONTENT_TYPE); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/transitional.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/defaults/transitional.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/env/data.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/env/data.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "VERSION": () => (/* binding */ VERSION) +/* harmony export */ }); +const VERSION = "1.3.4"; + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": +/*!****************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); + + + + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ bind) +/* harmony export */ }); + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildURL) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + + + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? + params.toString() : + new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ combineURLs) +/* harmony export */ }); + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) { + cookie.push('path=' + path); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + +// Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; + + if (isLast) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { + const obj = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAbsoluteURL) +/* harmony export */ }); + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAxiosError) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/null.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/null.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +// eslint-disable-next-line strict +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ parseProtocol) +/* harmony export */ }); + + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/speedometer.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/speedometer.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ spread) +/* harmony export */ }); + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toFormData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toFormData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); + + + + +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored + + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); +} + +const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || + ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { + const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( + formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": +/*!************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ toURLEncodedForm) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + + +function toURLEncodedForm(data, options) { + return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/validator.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/validator.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); + } + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assertOptions, + validators +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": +/*!*****************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": +/*!*********************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": +/*!****************************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/index.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); +/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); +/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); + + + + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== 'undefined' && ( + (product = navigator.product) === 'ReactNative' || + product === 'NativeScript' || + product === 'NS') + ) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; +})(); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + const isStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isBrowser: true, + classes: { + URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], + FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], + Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); + + + + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + const pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + if (reducer(descriptor, name, obj) !== false) { + reducedDescriptors[name] = descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject +}); + + +/***/ }), + +/***/ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs": +/*!*****************************************************************************************!*\ + !*** ./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "InView": () => (/* binding */ InView), +/* harmony export */ "defaultFallbackInView": () => (/* binding */ defaultFallbackInView), +/* harmony export */ "observe": () => (/* binding */ observe), +/* harmony export */ "useInView": () => (/* binding */ useInView) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); + + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const observerMap = new Map(); +const RootIds = new WeakMap(); +let rootId = 0; +let unsupportedValue = undefined; +/** + * What should be the default behavior if the IntersectionObserver is unsupported? + * Ideally the polyfill has been loaded, you can have the following happen: + * - `undefined`: Throw an error + * - `true` or `false`: Set the `inView` value to this regardless of intersection state + * **/ + +function defaultFallbackInView(inView) { + unsupportedValue = inView; +} +/** + * Generate a unique ID for the root element + * @param root + */ + +function getRootId(root) { + if (!root) return '0'; + if (RootIds.has(root)) return RootIds.get(root); + rootId += 1; + RootIds.set(root, rootId.toString()); + return RootIds.get(root); +} +/** + * Convert the options to a string Id, based on the values. + * Ensures we can reuse the same observer when observing elements with the same options. + * @param options + */ + + +function optionsToId(options) { + return Object.keys(options).sort().filter(key => options[key] !== undefined).map(key => { + return `${key}_${key === 'root' ? getRootId(options.root) : options[key]}`; + }).toString(); +} + +function createObserver(options) { + // Create a unique ID for this observer instance, based on the root, root margin and threshold. + let id = optionsToId(options); + let instance = observerMap.get(id); + + if (!instance) { + // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view. + const elements = new Map(); + let thresholds; + const observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + var _elements$get; + + // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it. + // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0 + const inView = entry.isIntersecting && thresholds.some(threshold => entry.intersectionRatio >= threshold); // @ts-ignore support IntersectionObserver v2 + + if (options.trackVisibility && typeof entry.isVisible === 'undefined') { + // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. + // @ts-ignore + entry.isVisible = inView; + } + + (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(callback => { + callback(inView, entry); + }); + }); + }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options + + thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]); + instance = { + id, + observer, + elements + }; + observerMap.set(id, instance); + } + + return instance; +} +/** + * @param element - DOM Element to observe + * @param callback - Callback function to trigger when intersection status changes + * @param options - Intersection Observer options + * @param fallbackInView - Fallback inView value. + * @return Function - Cleanup function that should be triggered to unregister the observer + */ + + +function observe(element, callback, options = {}, fallbackInView = unsupportedValue) { + if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) { + const bounds = element.getBoundingClientRect(); + callback(fallbackInView, { + isIntersecting: fallbackInView, + target: element, + intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0, + time: 0, + boundingClientRect: bounds, + intersectionRect: bounds, + rootBounds: bounds + }); + return () => {// Nothing to cleanup + }; + } // An observer with the same options can be reused, so lets use this fact + + + const { + id, + observer, + elements + } = createObserver(options); // Register the callback listener for this element + + let callbacks = elements.get(element) || []; + + if (!elements.has(element)) { + elements.set(element, callbacks); + } + + callbacks.push(callback); + observer.observe(element); + return function unobserve() { + // Remove the callback from the callback list + callbacks.splice(callbacks.indexOf(callback), 1); + + if (callbacks.length === 0) { + // No more callback exists for element, so destroy it + elements.delete(element); + observer.unobserve(element); + } + + if (elements.size === 0) { + // No more elements are being observer by this instance, so destroy it + observer.disconnect(); + observerMap.delete(id); + } + }; +} + +const _excluded = ["children", "as", "triggerOnce", "threshold", "root", "rootMargin", "onChange", "skip", "trackVisibility", "delay", "initialInView", "fallbackInView"]; + +function isPlainChildren(props) { + return typeof props.children !== 'function'; +} +/** + ## Render props + + To use the `` component, you pass it a function. It will be called + whenever the state changes, with the new value of `inView`. In addition to the + `inView` prop, children also receive a `ref` that should be set on the + containing DOM element. This is the element that the IntersectionObserver will + monitor. + + If you need it, you can also access the + [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) + on `entry`, giving you access to all the details about the current intersection + state. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + + {({ inView, ref, entry }) => ( +

+

{`Header inside viewport ${inView}.`}

+
+ )} + + ); + + export default Component; + ``` + + ## Plain children + + You can pass any element to the ``, and it will handle creating the + wrapping DOM element. Add a handler to the `onChange` method, and control the + state in your own component. Any extra props you add to `` will be + passed to the HTML element, allowing you set the `className`, `style`, etc. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + console.log('Inview:', inView)}> +

Plain children are always rendered. Use onChange to monitor state.

+
+ ); + + export default Component; + ``` + */ + + +class InView extends react__WEBPACK_IMPORTED_MODULE_0__.Component { + constructor(props) { + super(props); + this.node = null; + this._unobserveCb = null; + + this.handleNode = node => { + if (this.node) { + // Clear the old observer, before we start observing a new element + this.unobserve(); + + if (!node && !this.props.triggerOnce && !this.props.skip) { + // Reset the state if we get a new node, and we aren't ignoring updates + this.setState({ + inView: !!this.props.initialInView, + entry: undefined + }); + } + } + + this.node = node ? node : null; + this.observeNode(); + }; + + this.handleChange = (inView, entry) => { + if (inView && this.props.triggerOnce) { + // If `triggerOnce` is true, we should stop observing the element. + this.unobserve(); + } + + if (!isPlainChildren(this.props)) { + // Store the current State, so we can pass it to the children in the next render update + // There's no reason to update the state for plain children, since it's not used in the rendering. + this.setState({ + inView, + entry + }); + } + + if (this.props.onChange) { + // If the user is actively listening for onChange, always trigger it + this.props.onChange(inView, entry); + } + }; + + this.state = { + inView: !!props.initialInView, + entry: undefined + }; + } + + componentDidUpdate(prevProps) { + // If a IntersectionObserver option changed, reinit the observer + if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) { + this.unobserve(); + this.observeNode(); + } + } + + componentWillUnmount() { + this.unobserve(); + this.node = null; + } + + observeNode() { + if (!this.node || this.props.skip) return; + const { + threshold, + root, + rootMargin, + trackVisibility, + delay, + fallbackInView + } = this.props; + this._unobserveCb = observe(this.node, this.handleChange, { + threshold, + root, + rootMargin, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + } + + unobserve() { + if (this._unobserveCb) { + this._unobserveCb(); + + this._unobserveCb = null; + } + } + + render() { + if (!isPlainChildren(this.props)) { + const { + inView, + entry + } = this.state; + return this.props.children({ + inView, + entry, + ref: this.handleNode + }); + } + + const _this$props = this.props, + { + children, + as + } = _this$props, + props = _objectWithoutPropertiesLoose(_this$props, _excluded); + + return react__WEBPACK_IMPORTED_MODULE_0__.createElement(as || 'div', _extends({ + ref: this.handleNode + }, props), children); + } + +} + +/** + * React Hooks make it easy to monitor the `inView` state of your components. Call + * the `useInView` hook with the (optional) [options](#options) you need. It will + * return an array containing a `ref`, the `inView` status and the current + * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry). + * Assign the `ref` to the DOM element you want to monitor, and the hook will + * report the status. + * + * @example + * ```jsx + * import React from 'react'; + * import { useInView } from 'react-intersection-observer'; + * + * const Component = () => { + * const { ref, inView, entry } = useInView({ + * threshold: 0, + * }); + * + * return ( + *
+ *

{`Header inside viewport ${inView}.`}

+ *
+ * ); + * }; + * ``` + */ + +function useInView({ + threshold, + delay, + trackVisibility, + rootMargin, + root, + triggerOnce, + skip, + initialInView, + fallbackInView, + onChange +} = {}) { + var _state$entry; + + const [ref, setRef] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null); + const callback = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + const [state, setState] = react__WEBPACK_IMPORTED_MODULE_0__.useState({ + inView: !!initialInView, + entry: undefined + }); // Store the onChange callback in a `ref`, so we can access the latest instance + // inside the `useEffect`, but without triggering a rerender. + + callback.current = onChange; + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { + // Ensure we have node ref, and that we shouldn't skip observing + if (skip || !ref) return; + let unobserve; + unobserve = observe(ref, (inView, entry) => { + setState({ + inView, + entry + }); + if (callback.current) callback.current(inView, entry); + + if (entry.isIntersecting && triggerOnce && unobserve) { + // If it should only trigger once, unobserve the element after it's inView + unobserve(); + unobserve = undefined; + } + }, { + root, + rootMargin, + threshold, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + return () => { + if (unobserve) { + unobserve(); + } + }; + }, // We break the rule here, because we aren't including the actual `threshold` variable + // eslint-disable-next-line react-hooks/exhaustive-deps + [// If the threshold is an array, convert it to a string, so it won't change between renders. + // eslint-disable-next-line react-hooks/exhaustive-deps + Array.isArray(threshold) ? threshold.toString() : threshold, ref, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]); + const entryTarget = (_state$entry = state.entry) == null ? void 0 : _state$entry.target; + const previousEntryTarget = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + + if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) { + // If we don't have a node ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`) + // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView + previousEntryTarget.current = entryTarget; + setState({ + inView: !!initialInView, + entry: undefined + }); + } + + const result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values. + + result.ref = result[0]; + result.inView = result[1]; + result.entry = result[2]; + return result; +} + + +//# sourceMappingURL=react-intersection-observer.modern.mjs.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var chunkIds = deferred[i][0]; +/******/ var fn = deferred[i][1]; +/******/ var priority = deferred[i][2]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "instant-images": 0, +/******/ "./style-instant-images": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var chunkIds = data[0]; +/******/ var moreModules = data[1]; +/******/ var runtime = data[2]; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self["webpackChunkinstant_images"] = self["webpackChunkinstant_images"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-instant-images"], () => (__webpack_require__("./src/js/index.js"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; +//# sourceMappingURL=instant-images.js.map \ No newline at end of file diff --git a/build/media-modal/index.asset.php b/build/media-modal/index.asset.php index 191f6c0..dc13625 100644 --- a/build/media-modal/index.asset.php +++ b/build/media-modal/index.asset.php @@ -1 +1 @@ - array('react', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'd7cfb89cc06c9b2ad5e3'); + array('react', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'f3a9dd01d98490ff3dfc'); diff --git a/build/media-modal/index.js b/build/media-modal/index.js index f172959..499e4be 100644 --- a/build/media-modal/index.js +++ b/build/media-modal/index.js @@ -1 +1,19927 @@ -(()=>{var t={4184:(t,e)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e>>8^255&p^99,i[n]=p,o[p]=n;var m=t[n],v=t[m],g=t[v],y=257*t[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[p]=y<<24|y>>>8,f[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,n?(n=m^t[t[t[g^m]]],r^=t[t[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a6&&a%n==4&&(l=i[l>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l]):(l=i[(l=l<<8|l>>>24)>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l],l^=p[a/n|0]<<24),o[a]=o[a-n]^l);for(var s=this._invKeySchedule=[],c=0;c>>24]]^f[i[l>>>16&255]]^h[i[l>>>8&255]]^d[i[255&l]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,c,l,i)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,u,f,h,d,o),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,o,a,s){for(var c=this._nRounds,l=t[e]^n[0],u=t[e+1]^n[1],f=t[e+2]^n[2],h=t[e+3]^n[3],d=4,p=1;p>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&h]^n[d++],v=r[u>>>24]^i[f>>>16&255]^o[h>>>8&255]^a[255&l]^n[d++],g=r[f>>>24]^i[h>>>16&255]^o[l>>>8&255]^a[255&u]^n[d++],y=r[h>>>24]^i[l>>>16&255]^o[u>>>8&255]^a[255&f]^n[d++];l=m,u=v,f=g,h=y}m=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^n[d++],v=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^n[d++],g=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^n[d++],y=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[d++],t[e]=m,t[e+1]=v,t[e+2]=g,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),r.AES)},5109:function(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,m,v,g,y,_,b,w;t.exports=(r=n(8249),n(888),void(r.lib.Cipher||(i=r,o=i.lib,a=o.Base,s=o.WordArray,c=o.BufferedBlockAlgorithm,l=i.enc,l.Utf8,u=l.Base64,f=i.algo.EvpKDF,h=o.Cipher=c.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?w:_}return function(e){return{encrypt:function(n,r,i){return t(r).encrypt(e,n,r,i)},decrypt:function(n,r,i){return t(r).decrypt(e,n,r,i)}}}}()}),o.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),m=d.CBC=function(){var t=p.extend();function e(t,e,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,n=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,n&&n.words):(this._mode=t.call(r,this,n&&n.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),g=o.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(e):e).toString(u)},parse:function(t){var e,n=u.parse(t),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:e})}},_=o.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r),o=i.finalize(e),a=i.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),b=(i.kdf={}).OpenSSL={execute:function(t,e,n,r){r||(r=s.random(8));var i=f.create({keySize:e+n}).compute(t,r),o=s.create(i.words.slice(e),4*n);return i.sigBytes=4*e,g.create({key:i,iv:o,salt:r})}},w=o.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:b}),encrypt:function(t,e,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize);r.iv=i.iv;var o=_.encrypt.call(this,t,e,i.key,r);return o.mixIn(i),o},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var i=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);return r.iv=i.iv,_.decrypt.call(this,t,e,i.key,r)}}))))},8249:function(t,e,n){var r;t.exports=(r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(2480)}catch(t){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),a={},s=a.lib={},c=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},l=s.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=u.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new l.init(n,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},p=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,u=t.min(4*c,o);if(c){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},3786:function(t,e,n){var r,i,o;t.exports=(r=n(8249),o=(i=r).lib.WordArray,i.enc.Base64url={stringify:function(t,e=!0){var n=t.words,r=t.sigBytes,i=e?this._safe_map:this._map;t.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c>>6*(3-c)&63));var l=i.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(t,e=!0){var n=t.length,r=e?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(t,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},r.enc.Base64url)},298:function(t,e,n){var r;t.exports=(r=n(8249),function(){var t=r,e=t.lib.WordArray,n=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var n=t.length,r=[],i=0;i>>1]|=t.charCodeAt(i)<<16-i%2*16;return e.create(r,2*n)}},n.Utf16LE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(t){for(var n=t.length,r=[],o=0;o>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(r,2*n)}}}(),r.enc.Utf16)},888:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(u=n(8249),n(2783),n(9824),o=(i=(r=u).lib).Base,a=i.WordArray,c=(s=r.algo).MD5,l=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n,r=this.cfg,i=r.hasher.create(),o=a.create(),s=o.words,c=r.keySize,l=r.iterations;s.lengthr&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),a=this._iKey=e.clone(),s=i.words,c=a.words,l=0;l>>2]|=t[i]<<24-i%4*8;e.call(this,r,n)}else e.apply(this,arguments)};n.prototype=t}}(),r.lib.WordArray)},8214:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=t[e+0],c=t[e+1],d=t[e+2],p=t[e+3],m=t[e+4],v=t[e+5],g=t[e+6],y=t[e+7],_=t[e+8],b=t[e+9],w=t[e+10],E=t[e+11],S=t[e+12],R=t[e+13],x=t[e+14],k=t[e+15],O=o[0],C=o[1],A=o[2],L=o[3];O=l(O,C,A,L,a,7,s[0]),L=l(L,O,C,A,c,12,s[1]),A=l(A,L,O,C,d,17,s[2]),C=l(C,A,L,O,p,22,s[3]),O=l(O,C,A,L,m,7,s[4]),L=l(L,O,C,A,v,12,s[5]),A=l(A,L,O,C,g,17,s[6]),C=l(C,A,L,O,y,22,s[7]),O=l(O,C,A,L,_,7,s[8]),L=l(L,O,C,A,b,12,s[9]),A=l(A,L,O,C,w,17,s[10]),C=l(C,A,L,O,E,22,s[11]),O=l(O,C,A,L,S,7,s[12]),L=l(L,O,C,A,R,12,s[13]),A=l(A,L,O,C,x,17,s[14]),O=u(O,C=l(C,A,L,O,k,22,s[15]),A,L,c,5,s[16]),L=u(L,O,C,A,g,9,s[17]),A=u(A,L,O,C,E,14,s[18]),C=u(C,A,L,O,a,20,s[19]),O=u(O,C,A,L,v,5,s[20]),L=u(L,O,C,A,w,9,s[21]),A=u(A,L,O,C,k,14,s[22]),C=u(C,A,L,O,m,20,s[23]),O=u(O,C,A,L,b,5,s[24]),L=u(L,O,C,A,x,9,s[25]),A=u(A,L,O,C,p,14,s[26]),C=u(C,A,L,O,_,20,s[27]),O=u(O,C,A,L,R,5,s[28]),L=u(L,O,C,A,d,9,s[29]),A=u(A,L,O,C,y,14,s[30]),O=f(O,C=u(C,A,L,O,S,20,s[31]),A,L,v,4,s[32]),L=f(L,O,C,A,_,11,s[33]),A=f(A,L,O,C,E,16,s[34]),C=f(C,A,L,O,x,23,s[35]),O=f(O,C,A,L,c,4,s[36]),L=f(L,O,C,A,m,11,s[37]),A=f(A,L,O,C,y,16,s[38]),C=f(C,A,L,O,w,23,s[39]),O=f(O,C,A,L,R,4,s[40]),L=f(L,O,C,A,a,11,s[41]),A=f(A,L,O,C,p,16,s[42]),C=f(C,A,L,O,g,23,s[43]),O=f(O,C,A,L,b,4,s[44]),L=f(L,O,C,A,S,11,s[45]),A=f(A,L,O,C,k,16,s[46]),O=h(O,C=f(C,A,L,O,d,23,s[47]),A,L,a,6,s[48]),L=h(L,O,C,A,y,10,s[49]),A=h(A,L,O,C,x,15,s[50]),C=h(C,A,L,O,v,21,s[51]),O=h(O,C,A,L,S,6,s[52]),L=h(L,O,C,A,p,10,s[53]),A=h(A,L,O,C,w,15,s[54]),C=h(C,A,L,O,c,21,s[55]),O=h(O,C,A,L,_,6,s[56]),L=h(L,O,C,A,k,10,s[57]),A=h(A,L,O,C,g,15,s[58]),C=h(C,A,L,O,R,21,s[59]),O=h(O,C,A,L,m,6,s[60]),L=h(L,O,C,A,E,10,s[61]),A=h(A,L,O,C,d,15,s[62]),C=h(C,A,L,O,b,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+L|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function l(t,e,n,r,i,o,a){var s=t+(e&n|~e&r)+i+a;return(s<>>32-o)+e}function u(t,e,n,r,i,o,a){var s=t+(e&r|n&~r)+i+a;return(s<>>32-o)+e}function f(t,e,n,r,i,o,a){var s=t+(e^n^r)+i+a;return(s<>>32-o)+e}function h(t,e,n,r,i,o,a){var s=t+(n^(e|~r))+i+a;return(s<>>32-o)+e}e.MD5=o._createHelper(c),e.HmacMD5=o._createHmacHelper(c)}(Math),r.MD5)},8568:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.mode.CFB=function(){var t=r.lib.BlockCipherMode.extend();function e(t,e,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a>24&255)){var e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}var n=t.Encryptor=t.extend({processBlock:function(t,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Ansix923)},2807:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.Iso10126={pad:function(t,e){var n=4*e,i=n-t.sigBytes%n;t.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Iso10126)},1077:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.Iso97971={pad:function(t,e){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,e)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)},6991:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},6475:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){var e=t.words,n=t.sigBytes-1;for(n=t.sigBytes-1;n>=0;n--)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},r.pad.ZeroPadding)},2112:function(t,e,n){var r,i,o,a,s,c,l,u,f;t.exports=(f=n(8249),n(2783),n(9824),o=(i=(r=f).lib).Base,a=i.WordArray,c=(s=r.algo).SHA1,l=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=l.create(n.hasher,t),i=a.create(),o=a.create([1]),s=i.words,c=o.words,u=n.keySize,f=n.iterations;s.length>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(e){var o=e.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,h=u<<16|65535&l;for(r[0]^=l,r[1]^=f,r[2]^=u,r[3]^=h,r[4]^=l,r[5]^=f,r[6]^=u,r[7]^=h,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(t,e){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),t[e+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var r=t[n]+e[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(s)}(),r.RabbitLegacy)},4454:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=[],o=[],a=[],s=n.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,n=0;n<4;n++)t[n]=16711935&(t[n]<<8|t[n]>>>24)|4278255360&(t[n]<<24|t[n]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,h=u<<16|65535&l;for(i[0]^=l,i[1]^=f,i[2]^=u,i[3]^=h,i[4]^=l,i[5]^=f,i[6]^=u,i[7]^=h,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),t[e+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var r=t[n]+e[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(s)}(),r.Rabbit)},1857:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=n.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=e[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[n],t[n]=o,r|=t[(t[e]+t[n])%256]<<24-8*i}return this._i=e,this._j=n,r}t.RC4=e._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(a)}(),r.RC4)},706:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,b,w,E,S,R,x,k,O,C=this._hash.words,A=f.words,L=h.words,B=s.words,j=c.words,N=l.words,P=u.words;for(E=o=C[0],S=a=C[1],R=d=C[2],x=b=C[3],k=w=C[4],n=0;n<80;n+=1)O=o+t[e+B[n]]|0,O+=n<16?p(a,d,b)+A[0]:n<32?m(a,d,b)+A[1]:n<48?v(a,d,b)+A[2]:n<64?g(a,d,b)+A[3]:y(a,d,b)+A[4],O=(O=_(O|=0,N[n]))+w|0,o=w,w=b,b=_(d,10),d=a,a=O,O=E+t[e+j[n]]|0,O+=n<16?y(S,R,x)+L[0]:n<32?g(S,R,x)+L[1]:n<48?v(S,R,x)+L[2]:n<64?m(S,R,x)+L[3]:p(S,R,x)+L[4],O=(O=_(O|=0,P[n]))+k|0,E=k,k=x,x=_(R,10),R=S,S=O;O=C[1]+d+x|0,C[1]=C[2]+b+k|0,C[2]=C[3]+w+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+R|0,C[0]=O},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,n){return t^e^n}function m(t,e,n){return t&e|~t&n}function v(t,e,n){return(t|~e)^n}function g(t,e,n){return t&n|e&~n}function y(t,e,n){return t^(e|~n)}function _(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(Math),r.RIPEMD160)},2783:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(i=(r=u=n(8249)).lib,o=i.WordArray,a=i.Hasher,s=r.algo,c=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=0;l<80;l++){if(l<16)c[l]=0|t[e+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var f=(r<<5|r>>>27)+s+c[l];f+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),r.SHA1=a._createHelper(l),r.HmacSHA1=a._createHmacHelper(l),u.SHA1)},7792:function(t,e,n){var r,i,o,a,s,c;t.exports=(c=n(8249),n(2153),i=(r=c).lib.WordArray,o=r.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),r.SHA224=a._createHelper(s),r.HmacSHA224=a._createHmacHelper(s),c.SHA224)},2153:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var l=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=0;d<64;d++){if(d<16)l[d]=0|t[e+d];else{var p=l[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=l[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;l[d]=m+l[d-7]+g+l[d-16]}var y=r&i^r&o^i&o,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&f)+c[d]+l[d];h=f,f=u,u=s,s=a+b|0,a=o,o=i,i=r,r=b+(_+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(u),e.HmacSHA256=o._createHmacHelper(u)}(Math),r.SHA256)},3327:function(t,e,n){var r;t.exports=(r=n(8249),n(4938),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.x64.Word,s=e.algo,c=[],l=[],u=[];!function(){for(var t=1,e=0,n=0;n<24;n++){c[t+5*e]=(n+1)*(n+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r}for(t=0;t<5;t++)for(e=0;e<5;e++)l[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=n[i]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,m=0;m<5;m++)d^=(C=n[h+5*m]).high,p^=C.low;var v=f[h];v.high=d,v.low=p}for(h=0;h<5;h++){var g=f[(h+4)%5],y=f[(h+1)%5],_=y.high,b=y.low;for(d=g.high^(_<<1|b>>>31),p=g.low^(b<<1|_>>>31),m=0;m<5;m++)(C=n[h+5*m]).high^=d,C.low^=p}for(var w=1;w<25;w++){var E=(C=n[w]).high,S=C.low,R=c[w];R<32?(d=E<>>32-R,p=S<>>32-R):(d=S<>>64-R,p=E<>>64-R);var x=f[l[w]];x.high=d,x.low=p}var k=f[0],O=n[0];for(k.high=O.high,k.low=O.low,h=0;h<5;h++)for(m=0;m<5;m++){var C=n[w=h+5*m],A=f[w],L=f[(h+1)%5+5*m],B=f[(h+2)%5+5*m];C.high=A.high^~L.high&B.high,C.low=A.low^~L.low&B.low}C=n[0];var j=u[s];C.high^=j.high,C.low^=j.low}},_doFinalize:function(){var e=this._data,n=e.words,r=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(h)}return new i.init(l,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});e.SHA3=o._createHelper(h),e.HmacSHA3=o._createHmacHelper(h)}(Math),r.SHA3)},7460:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(u=n(8249),n(4938),n(34),i=(r=u).x64,o=i.Word,a=i.WordArray,s=r.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},34:function(t,e,n){var r;t.exports=(r=n(8249),n(4938),function(){var t=r,e=t.lib.Hasher,n=t.x64,i=n.Word,o=n.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var t=0;t<80;t++)l[t]=s()}();var u=a.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=r.high,p=r.low,m=i.high,v=i.low,g=o.high,y=o.low,_=a.high,b=a.low,w=s.high,E=s.low,S=u.high,R=u.low,x=f.high,k=f.low,O=h.high,C=h.low,A=d,L=p,B=m,j=v,N=g,P=y,z=_,T=b,I=w,M=E,D=S,F=R,H=x,W=k,U=O,q=C,V=0;V<80;V++){var G,Y,J=l[V];if(V<16)Y=J.high=0|t[e+2*V],G=J.low=0|t[e+2*V+1];else{var K=l[V-15],X=K.high,$=K.low,Z=(X>>>1|$<<31)^(X>>>8|$<<24)^X>>>7,Q=($>>>1|X<<31)^($>>>8|X<<24)^($>>>7|X<<25),tt=l[V-2],et=tt.high,nt=tt.low,rt=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,it=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=l[V-7],at=ot.high,st=ot.low,ct=l[V-16],lt=ct.high,ut=ct.low;Y=(Y=(Y=Z+at+((G=Q+st)>>>0>>0?1:0))+rt+((G+=it)>>>0>>0?1:0))+lt+((G+=ut)>>>0>>0?1:0),J.high=Y,J.low=G}var ft,ht=I&D^~I&H,dt=M&F^~M&W,pt=A&B^A&N^B&N,mt=L&j^L&P^j&P,vt=(A>>>28|L<<4)^(A<<30|L>>>2)^(A<<25|L>>>7),gt=(L>>>28|A<<4)^(L<<30|A>>>2)^(L<<25|A>>>7),yt=(I>>>14|M<<18)^(I>>>18|M<<14)^(I<<23|M>>>9),_t=(M>>>14|I<<18)^(M>>>18|I<<14)^(M<<23|I>>>9),bt=c[V],wt=bt.high,Et=bt.low,St=U+yt+((ft=q+_t)>>>0>>0?1:0),Rt=gt+mt;U=H,q=W,H=D,W=F,D=I,F=M,I=z+(St=(St=(St=St+ht+((ft+=dt)>>>0
>>0?1:0))+wt+((ft+=Et)>>>0>>0?1:0))+Y+((ft+=G)>>>0>>0?1:0))+((M=T+ft|0)>>>0>>0?1:0)|0,z=N,T=P,N=B,P=j,B=A,j=L,A=St+(vt+pt+(Rt>>>0>>0?1:0))+((L=ft+Rt|0)>>>0>>0?1:0)|0}p=r.low=p+L,r.high=d+A+(p>>>0>>0?1:0),v=i.low=v+j,i.high=m+B+(v>>>0>>0?1:0),y=o.low=y+P,o.high=g+N+(y>>>0

>>0?1:0),b=a.low=b+T,a.high=_+z+(b>>>0>>0?1:0),E=s.low=E+M,s.high=w+I+(E>>>0>>0?1:0),R=u.low=R+F,u.high=S+D+(R>>>0>>0?1:0),k=f.low=k+W,f.high=x+H+(k>>>0>>0?1:0),C=h.low=C+q,h.high=O+U+(C>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(u),t.HmacSHA512=e._createHmacHelper(u)}(),r.SHA512)},4253:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib,n=e.WordArray,i=e.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;n<56;n++){var r=a[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],u=c[o];for(n=0;n<24;n++)l[n/6|0]|=e[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=e[28+(s[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,n){this._lBlock=t[e],this._rBlock=t[e+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((a^i[c])&u[c])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<192.");var e=t.slice(0,2),r=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=f.createEncryptor(n.create(e)),this._des2=f.createEncryptor(n.create(r)),this._des3=f.createEncryptor(n.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),r.TripleDES)},4938:function(t,e,n){var r,i,o,a,s,c;t.exports=(r=n(8249),o=(i=r).lib,a=o.Base,s=o.WordArray,(c=i.x64={}).Word=a.extend({init:function(t,e){this.high=t,this.low=e}}),c.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r{var r,i;!function(o,a){"use strict";void 0===(i="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],n=0;n{var r,i;!function(o,a){r=[n(9741)],i=function(t){return function(t,e){"use strict";var n={extend:function(t,e){for(var n in e)t[n]=e[n];return t},modulo:function(t,e){return(t%e+e)%e}},r=Array.prototype.slice;n.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?r.call(t):[t]},n.removeFrom=function(t,e){var n=t.indexOf(e);-1!=n&&t.splice(n,1)},n.getParent=function(t,n){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,n))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.filterFindElements=function(t,r){t=n.makeArray(t);var i=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(r){e(t,r)&&i.push(t);for(var n=t.querySelectorAll(r),o=0;o{var r,i;window,void 0===(i="function"==typeof(r=function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var e="undefined"==typeof console?function(){}:function(t){console.error(t)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=n.length;function i(t){var n=getComputedStyle(t);return n||e("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var o,a=!1;function s(e){if(function(){if(!a){a=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(e);var r=i(e);o=200==Math.round(t(r.width)),s.isBoxSizeOuter=o,n.removeChild(e)}}(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var c=i(e);if("none"==c.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e{setTimeout((()=>{this.progress(t,e,n)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},i.prototype.progress=function(t,e,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log(`progress: ${n}`,t,e)},i.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},s.prototype=Object.create(e.prototype),s.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},s.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},s.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:n}=this.img,r="PICTURE"===n.nodeName?n:this.img;this.emitEvent("progress",[this,r,e])},s.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},s.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},s.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},s.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype=Object.create(s.prototype),c.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},c.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},i.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(n=e,n.fn.imagesLoaded=function(t,e){return new i(this,t,e).jqDeferred.promise(n(this))})},i.makeJQueryPlugin(),i}))},8751:(t,e,n)=>{var r,i,o;window,i=[n(1794),n(6131)],void 0===(o="function"==typeof(r=function(t,e){"use strict";var n=t.create("masonry");n.compatOptions.fitWidth="isFitWidth";var r=n.prototype;return r._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t1&&n+t>this.cols?0:n;var r=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=r?n+t:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,t)}},r._manageStamp=function(t){var n=e(t),r=this._getElementOffset(t),i=this._getOption("originLeft")?r.left:r.right,o=i+n.outerWidth,a=Math.floor(i/this.columnWidth);a=Math.max(0,a);var s=Math.floor(o/this.columnWidth);s-=o%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var c=(this._getOption("originTop")?r.top:r.bottom)+n.outerHeight,l=a;l<=s;l++)this.colYs[l]=Math.max(c,this.colYs[l])},r._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},r._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},r.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},n})?r.apply(e,i):r)||(t.exports=o)},652:(t,e,n)=>{var r,i,o;window,i=[n(1206),n(6131)],void 0===(o="function"==typeof(r=function(t,e){"use strict";var n=document.documentElement.style,r="string"==typeof n.transition?"transition":"WebkitTransition",i="string"==typeof n.transform?"transform":"WebkitTransform",o={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],a={transform:i,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"};function s(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var c=s.prototype=Object.create(t.prototype);c.constructor=s,c._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},c.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},c.getSize=function(){this.size=e(this.element)},c.css=function(t){var e=this.element.style;for(var n in t)e[a[n]||n]=t[n]},c.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),r=t[e?"left":"right"],i=t[n?"top":"bottom"],o=parseFloat(r),a=parseFloat(i),s=this.layout.size;-1!=r.indexOf("%")&&(o=o/100*s.width),-1!=i.indexOf("%")&&(a=a/100*s.height),o=isNaN(o)?0:o,a=isNaN(a)?0:a,o-=e?s.paddingLeft:s.paddingRight,a-=n?s.paddingTop:s.paddingBottom,this.position.x=o,this.position.y=a},c.layoutPosition=function(){var t=this.layout.size,e={},n=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop"),i=n?"paddingLeft":"paddingRight",o=n?"left":"right",a=n?"right":"left",s=this.position.x+t[i];e[o]=this.getXValue(s),e[a]="";var c=r?"paddingTop":"paddingBottom",l=r?"top":"bottom",u=r?"bottom":"top",f=this.position.y+t[c];e[l]=this.getYValue(f),e[u]="",this.css(e),this.emitEvent("layout",[this])},c.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},c.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},c._transitionTo=function(t,e){this.getPosition();var n=this.position.x,r=this.position.y,i=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),!i||this.isTransitioning){var o=t-n,a=e-r,s={};s.transform=this.getTranslate(o,a),this.transition({to:s,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},c.getTranslate=function(t,e){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(e=this.layout._getOption("originTop")?e:-e)+"px, 0)"},c.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},c.moveTo=c._transitionTo,c.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},c._nonTransition=function(t){for(var e in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[e].call(this)},c.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var e=this._transn;for(var n in t.onTransitionEnd)e.onEnd[n]=t.onTransitionEnd[n];for(n in t.to)e.ingProperties[n]=!0,t.isCleaning&&(e.clean[n]=!0);t.from&&(this.css(t.from),this.element.offsetHeight),this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var l="opacity,"+i.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}));c.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(o,this,!1)}},c.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},c.onotransitionend=function(t){this.ontransitionend(t)};var u={"-webkit-transform":"transform"};c.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=u[t.propertyName]||t.propertyName;delete e.ingProperties[n],function(t){for(var e in t)return!1;return!0}(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd&&(e.onEnd[n].call(this),delete e.onEnd[n]),this.emitEvent("transitionEnd",[this])}},c.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},c._removeStyles=function(t){var e={};for(var n in t)e[n]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return c.removeTransitionStyles=function(){this.css(f)},c.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},c.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},c.remove=function(){r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},c.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},c.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},c.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var n in e)return n},c.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},c.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},c.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s})?r.apply(e,i):r)||(t.exports=o)},1206:function(t,e,n){var r,i;"undefined"!=typeof window&&window,void 0===(i="function"==typeof(r=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},r=n[t]=n[t]||[];return-1==r.indexOf(e)&&r.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var r=n.indexOf(e);return-1!=r&&n.splice(r,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var r=this._onceEvents&&this._onceEvents[t],i=0;i{var r,i;!function(o,a){"use strict";r=[n(1206),n(6131),n(9047),n(652)],i=function(t,e,n,r){return function(t,e,n,r,i){var o=t.console,a=t.jQuery,s=function(){},c=0,l={};function u(t,e){var n=r.getQueryElement(t);if(n){this.element=n,a&&(this.$element=a(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(e);var i=++c;this.element.outlayerGUID=i,l[i]=this,this._create(),this._getOption("initLayout")&&this.layout()}else o&&o.error("Bad element for "+this.constructor.namespace+": "+(n||t))}u.namespace="outlayer",u.Item=i,u.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=u.prototype;function h(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}r.extend(f,e.prototype),f.option=function(t){r.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},u.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),n=this.constructor.Item,r=[],i=0;i{}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=window.wp.element;function e(t,e){return function(){return t.apply(e,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,o=(a=Object.create(null),t=>{const e=r.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const s=t=>(t=t.toLowerCase(),e=>o(e)===t),c=t=>e=>typeof e===t,{isArray:l}=Array,u=c("undefined"),f=s("ArrayBuffer"),h=c("string"),d=c("function"),p=c("number"),m=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==o(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},g=s("Date"),y=s("File"),_=s("Blob"),b=s("FileList"),w=s("URLSearchParams");function E(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),l(t))for(r=0,i=t.length;r0;)if(r=n[i],e===r.toLowerCase())return r;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=t=>!u(t)&&t!==R,k=(O="undefined"!=typeof Uint8Array&&i(Uint8Array),t=>O&&t instanceof O);var O;const C=s("HTMLFormElement"),A=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),L=s("RegExp"),B=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};E(n,((n,i)=>{!1!==e(n,i,t)&&(r[i]=n)})),Object.defineProperties(t,r)},j="abcdefghijklmnopqrstuvwxyz",N="0123456789",P={DIGIT:N,ALPHA:j,ALPHA_DIGIT:j+j.toUpperCase()+N},z={isArray:l,isArrayBuffer:f,isBuffer:function(t){return null!==t&&!u(t)&&null!==t.constructor&&!u(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||r.call(t)===e||d(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&f(t.buffer),e},isString:h,isNumber:p,isBoolean:t=>!0===t||!1===t,isObject:m,isPlainObject:v,isUndefined:u,isDate:g,isFile:y,isBlob:_,isRegExp:L,isFunction:d,isStream:t=>m(t)&&d(t.pipe),isURLSearchParams:w,isTypedArray:k,isFileList:b,forEach:E,merge:function t(){const{caseless:e}=x(this)&&this||{},n={},r=(r,i)=>{const o=e&&S(n,i)||i;v(n[o])&&v(r)?n[o]=t(n[o],r):v(r)?n[o]=t({},r):l(r)?n[o]=r.slice():n[o]=r};for(let t=0,e=arguments.length;t(E(n,((n,i)=>{r&&d(n)?t[i]=e(n,r):t[i]=n}),{allOwnKeys:i}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,a,s;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)s=o[a],r&&!r(s,t,e)||c[s]||(e[s]=t[s],c[s]=!0);t=!1!==n&&i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:o,kindOfTest:s,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(l(t))return t;let e=t.length;if(!p(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:C,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:B,freezeMethods:t=>{B(t,((e,n)=>{if(d(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];d(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return l(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:S,global:R,isContextDefined:x,ALPHABET:P,generateString:(t=16,e=P.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&d(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(m(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=l(t)?[]:{};return E(t,((t,e)=>{const o=n(t,r+1);!u(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)}};function T(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}z.inherits(T,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const I=T.prototype,M={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{M[t]={value:t}})),Object.defineProperties(T,M),Object.defineProperty(I,"isAxiosError",{value:!0}),T.from=(t,e,n,r,i,o)=>{const a=Object.create(I);return z.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),T.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};const D=T;function F(t){return z.isPlainObject(t)||z.isArray(t)}function H(t){return z.endsWith(t,"[]")?t.slice(0,-2):t}function W(t,e,n){return t?t.concat(e).map((function(t,e){return t=H(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const U=z.toFlatObject(z,{},null,(function(t){return/^is[A-Z]/.test(t)})),q=function(t,e,n){if(!z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!z.isUndefined(e[t])}))).metaTokens,i=n.visitor||l,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&z.isSpecCompliantForm(e);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(z.isDate(t))return t.toISOString();if(!s&&z.isBlob(t))throw new D("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(t)||z.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function l(t,n,i){let s=t;if(t&&!i&&"object"==typeof t)if(z.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(z.isArray(t)&&function(t){return z.isArray(t)&&!t.some(F)}(t)||(z.isFileList(t)||z.endsWith(n,"[]"))&&(s=z.toArray(t)))return n=H(n),s.forEach((function(t,r){!z.isUndefined(t)&&null!==t&&e.append(!0===a?W([n],r,o):null===a?n:n+"[]",c(t))})),!1;return!!F(t)||(e.append(W(i,n,o),c(t)),!1)}const u=[],f=Object.assign(U,{defaultVisitor:l,convertValue:c,isVisitable:F});if(!z.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!z.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),z.forEach(n,(function(n,o){!0===(!(z.isUndefined(n)||null===n)&&i.call(e,n,z.isString(o)?o.trim():o,r,f))&&t(n,r?r.concat(o):[o])})),u.pop()}}(t),e};function V(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function G(t,e){this._pairs=[],t&&q(t,this,e)}const Y=G.prototype;Y.append=function(t,e){this._pairs.push([t,e])},Y.toString=function(t){const e=t?function(e){return t.call(this,e,V)}:V;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const J=G;function K(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(t,e,n){if(!e)return t;const r=n&&n.encode||K,i=n&&n.serialize;let o;if(o=i?i(e,n):z.isURLSearchParams(e)?e.toString():new J(e,n).toString(r),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}const $=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:J,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},tt=function(t){function e(t,n,r,i){let o=t[i++];const a=Number.isFinite(+o),s=i>=t.length;return o=!o&&z.isArray(r)?r.length:o,s?(z.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&z.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&z.isArray(r[o])&&(r[o]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r{e(function(t){return z.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},et={"Content-Type":void 0},nt={transitional:Z,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=z.isObject(t);if(i&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return r&&r?JSON.stringify(tt(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return q(t,new Q.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return Q.isNode&&z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((o=z.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return q(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(z.isString(t))try{return(0,JSON.parse)(t),z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||nt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&z.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw D.from(t,D.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],(function(t){nt.headers[t]={}})),z.forEach(["post","put","patch"],(function(t){nt.headers[t]=z.merge(et)}));const rt=nt,it=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ot=Symbol("internals");function at(t){return t&&String(t).trim().toLowerCase()}function st(t){return!1===t||null==t?t:z.isArray(t)?t.map(st):String(t)}function ct(t,e,n,r,i){return z.isFunction(r)?r.call(this,e,n):(i&&(e=n),z.isString(e)?z.isString(r)?-1!==e.indexOf(r):z.isRegExp(r)?r.test(e):void 0:void 0)}class lt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=at(e);if(!i)throw new Error("header name must be a non-empty string");const o=z.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=st(t))}const o=(t,e)=>z.forEach(t,((t,n)=>i(t,n,e)));return z.isPlainObject(t)||t instanceof this.constructor?o(t,e):z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?o((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&it[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&i(e,t,n),this}get(t,e){if(t=at(t)){const n=z.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(z.isFunction(e))return e.call(this,t,n);if(z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=at(t)){const n=z.findKey(this,t);return!(!n||void 0===this[n]||e&&!ct(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=at(t)){const i=z.findKey(n,t);!i||e&&!ct(0,n[i],i,e)||(delete n[i],r=!0)}}return z.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!ct(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return z.forEach(this,((r,i)=>{const o=z.findKey(n,i);if(o)return e[o]=st(r),void delete e[i];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete e[i],e[a]=st(r),n[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return z.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&z.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[ot]=this[ot]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=at(t);e[r]||(function(t,e){const n=z.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return z.isArray(t)?t.forEach(r):r(t),this}}lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.freezeMethods(lt.prototype),z.freezeMethods(lt);const ut=lt;function ft(t,e){const n=this||rt,r=e||n,i=ut.from(r.headers);let o=r.data;return z.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function ht(t){return!(!t||!t.__CANCEL__)}function dt(t,e,n){D.call(this,null==t?"canceled":t,D.ERR_CANCELED,e,n),this.name="CanceledError"}z.inherits(dt,D,{__CANCEL__:!0});const pt=dt,mt=Q.isStandardBrowserEnv?{write:function(t,e,n,r,i,o){const a=[];a.push(t+"="+encodeURIComponent(e)),z.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),z.isString(r)&&a.push("path="+r),z.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function vt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const gt=Q.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=z.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0},yt=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,o=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),l=r[a];i||(i=c),n[o]=s,r[o]=c;let u=a,f=0;for(;u!==o;)f+=n[u++],u%=t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),c-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,c=r(s);n=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&o<=a?(a-o)/c:void 0,event:i};l[e?"download":"upload"]=!0,t(l)}}const bt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const i=ut.from(t.headers).normalize(),o=t.responseType;let a;function s(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}z.isFormData(r)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(e+":"+n))}const l=vt(t.baseURL,t.url);function u(){if(!c)return;const r=ut.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new D("Request failed with status code "+n.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),s()}),(function(t){n(t),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),X(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(n(new D("Request aborted",D.ECONNABORTED,t,c)),c=null)},c.onerror=function(){n(new D("Network Error",D.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||Z;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new D(e,r.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,t,c)),c=null},Q.isStandardBrowserEnv){const e=(t.withCredentials||gt(l))&&t.xsrfCookieName&&mt.read(t.xsrfCookieName);e&&i.set(t.xsrfHeaderName,e)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&z.forEach(i.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),z.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&"json"!==o&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",_t(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",_t(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{c&&(n(!e||e.type?new pt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(l);f&&-1===Q.protocols.indexOf(f)?n(new D("Unsupported protocol "+f+":",D.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};z.forEach(bt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const wt={getAdapter:t=>{t=z.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let i=0;it instanceof ut?t.toJSON():t;function xt(t,e){e=e||{};const n={};function r(t,e,n){return z.isPlainObject(t)&&z.isPlainObject(e)?z.merge.call({caseless:n},t,e):z.isPlainObject(e)?z.merge({},e):z.isArray(e)?e.slice():e}function i(t,e,n){return z.isUndefined(e)?z.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function o(t,e){if(!z.isUndefined(e))return r(void 0,e)}function a(t,e){return z.isUndefined(e)?z.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>i(Rt(t),Rt(e),!0)};return z.forEach(Object.keys(t).concat(Object.keys(e)),(function(r){const o=c[r]||i,a=o(t[r],e[r],r);z.isUndefined(a)&&o!==s||(n[r]=a)})),n}const kt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{kt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Ot={};kt.transitional=function(t,e,n){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,o)=>{if(!1===t)throw new D(r(i," has been removed"+(e?" in "+e:"")),D.ERR_DEPRECATED);return e&&!Ot[i]&&(Ot[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}};const Ct={assertOptions:function(t,e,n){if("object"!=typeof t)throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],a=e[o];if(a){const e=t[o],n=void 0===e||a(e,o,t);if(!0!==n)throw new D("option "+o+" must be "+n,D.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new D("Unknown option "+o,D.ERR_BAD_OPTION)}},validators:kt},At=Ct.validators;class Lt{constructor(t){this.defaults=t,this.interceptors={request:new $,response:new $}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=xt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;let o;void 0!==n&&Ct.assertOptions(n,{silentJSONParsing:At.transitional(At.boolean),forcedJSONParsing:At.transitional(At.boolean),clarifyTimeoutError:At.transitional(At.boolean)},!1),void 0!==r&&Ct.assertOptions(r,{encode:At.function,serialize:At.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),o=i&&z.merge(i.common,i[e.method]),o&&z.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=ut.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let u,f=0;if(!s){const t=[St.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),u=t.length,l=Promise.resolve(e);f{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new pt(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new jt((function(e){t=e})),cancel:t}}}const Nt=jt,Pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pt).forEach((([t,e])=>{Pt[e]=t}));const zt=Pt,Tt=function t(n){const r=new Bt(n),i=e(Bt.prototype.request,r);return z.extend(i,Bt.prototype,r,{allOwnKeys:!0}),z.extend(i,r,null,{allOwnKeys:!0}),i.create=function(e){return t(xt(n,e))},i}(rt);Tt.Axios=Bt,Tt.CanceledError=pt,Tt.CancelToken=Nt,Tt.isCancel=ht,Tt.VERSION="1.3.4",Tt.toFormData=q,Tt.AxiosError=D,Tt.Cancel=Tt.CanceledError,Tt.all=function(t){return Promise.all(t)},Tt.spread=function(t){return function(e){return t.apply(null,e)}},Tt.isAxiosError=function(t){return z.isObject(t)&&!0===t.isAxiosError},Tt.mergeConfig=xt,Tt.AxiosHeaders=ut,Tt.formToJSON=t=>tt(z.isHTMLForm(t)?new FormData(t):t),Tt.HttpStatusCode=zt,Tt.default=Tt;const It=Tt;var Mt=n(4184),Dt=n.n(Mt),Ft=n(8751),Ht=n.n(Ft);const Wt=window.React,Ut=new Map,qt=new WeakMap;let Vt=0;function Gt(t,e,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:a}=function(t){let e=function(t){return Object.keys(t).sort().filter((e=>void 0!==t[e])).map((e=>{return`${e}_${"root"===e?(n=t.root,n?(qt.has(n)||(Vt+=1,qt.set(n,Vt.toString())),qt.get(n)):"0"):t[e]}`;var n})).toString()}(t),n=Ut.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver((e=>{e.forEach((e=>{var n;const o=e.isIntersecting&&i.some((t=>e.intersectionRatio>=t));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach((t=>{t(o,e)}))}))}),t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},Ut.set(e,n)}return n}(n);let s=a.get(t)||[];return a.has(t)||a.set(t,s),s.push(e),o.observe(t),function(){s.splice(s.indexOf(e),1),0===s.length&&(a.delete(t),o.unobserve(t)),0===a.size&&(o.disconnect(),Ut.delete(i))}}class Yt extends Wt.Component{constructor(t){super(t),this.node=null,this._unobserveCb=null,this.handleNode=t=>{this.node&&(this.unobserve(),t||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()},this.handleChange=(t,e)=>{t&&this.props.triggerOnce&&this.unobserve(),isPlainChildren(this.props)||this.setState({inView:t,entry:e}),this.props.onChange&&this.props.onChange(t,e)},this.state={inView:!!t.initialInView,entry:void 0}}componentDidUpdate(t){t.rootMargin===this.props.rootMargin&&t.root===this.props.root&&t.threshold===this.props.threshold&&t.skip===this.props.skip&&t.trackVisibility===this.props.trackVisibility&&t.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:o}=this.props;this._unobserveCb=Gt(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!isPlainChildren(this.props)){const{inView:t,entry:e}=this.state;return this.props.children({inView:t,entry:e,ref:this.handleNode})}const t=this.props,{children:e,as:n}=t,r=function(t,e){if(null==t)return{};for(var n,r,i={},o=Object.keys(t);r=0||(i[n]=t[n]);return i}(t);return React.createElement(n||"div",_extends({ref:this.handleNode},r),e)}}function Jt({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:c,onChange:l}={}){var u;const[f,h]=Wt.useState(null),d=Wt.useRef(),[p,m]=Wt.useState({inView:!!s,entry:void 0});d.current=l,Wt.useEffect((()=>{if(a||!f)return;let s;return s=Gt(f,((t,e)=>{m({inView:t,entry:e}),d.current&&d.current(t,e),e.isIntersecting&&o&&s&&(s(),s=void 0)}),{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},c),()=>{s&&s()}}),[Array.isArray(t)?t.toString():t,f,i,r,o,a,n,c,e]);const v=null==(u=p.entry)?void 0:u.target,g=Wt.useRef();f||!v||o||a||g.current===v||(g.current=v,m({inView:!!s,entry:void 0}));const y=[h,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}var Kt=(0,t.createContext)();function Xt(t){var e=t.value,n=t.children;return React.createElement(Kt.Provider,{value:e},n)}function $t(){return(0,t.useContext)(Kt)}function Zt(t){return t&&Qt[t.toLowerCase()].icon?Qt[t.toLowerCase()].icon():null}var Qt={proxy:"https://proxy.getinstantimages.com/api/",testmode:!1,defaults:{provider:"unsplash",order:"latest",per_page:"20",arr_key:"results"},providers:["Unsplash","Openverse","Pixabay","Pexels"],unsplash:{name:"Unsplash",requires_key:!0,new:!1,api_var:"client_id",collections_api:"https://api.unsplash.com/collections/",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",fill:"black"}))}},pixabay:{name:"Pixabay",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{clipPath:"url(#clip0_307_143)"},React.createElement("path",{d:"M0 0V32H32V0H0Z",fill:"#48A947"}),React.createElement("path",{d:"M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",fill:"#F9FBF9"}),React.createElement("path",{d:"M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",fill:"#FAFCFA"}),React.createElement("path",{d:"M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",fill:"#4AA949"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_307_143"},React.createElement("rect",{width:"32",height:"32",fill:"white"}))))}},pexels:{name:"Pexels",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",fill:"#05A081"}),React.createElement("path",{d:"M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",fill:"#fff"}))}},openverse:{name:"Openverse",requires_key:!1,new:!1,api_var:"key",key:"",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",fill:"#000000"}))}}};const te=window.wp.i18n;var ee=[{label:(0,te.__)("WordPress","instant-images"),value:"wordpress"},{label:(0,te.__)("Flickr","instant-images"),value:"flickr"},{label:(0,te.__)("Nasa","instant-images"),value:"nasa"},{label:(0,te.__)("SpaceX","instant-images"),value:"spacex"},{label:(0,te.__)("Wikimedia","instant-images"),value:"wikimedia"}],ne=[{label:(0,te.__)("Square","instant-images"),value:"square"},{label:(0,te.__)("Tall","instant-images"),value:"tall"},{label:(0,te.__)("Wide","instant-images"),value:"wide"}],re=[{label:(0,te.__)("Red","instant-images"),value:"red"},{label:(0,te.__)("Orange","instant-images"),value:"orange"},{label:(0,te.__)("Yellow","instant-images"),value:"yellow"},{label:(0,te.__)("Green","instant-images"),value:"green"},{label:(0,te.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,te.__)("Blue","instant-images"),value:"blue"},{label:(0,te.__)("Violet","instant-images"),value:"violet"},{label:(0,te.__)("Pink","instant-images"),value:"pink"},{label:(0,te.__)("Brown","instant-images"),value:"brown"},{label:(0,te.__)("Black","instant-images"),value:"black"},{label:(0,te.__)("Gray","instant-images"),value:"gray"},{label:(0,te.__)("White","instant-images"),value:"white"}],ie=[{label:(0,te.__)("Landscape","instant-images"),value:"landscape"},{label:(0,te.__)("Portrait","instant-images"),value:"portrait"},{label:(0,te.__)("Square","instant-images"),value:"squarish"}],oe=[{label:(0,te.__)("Grayscale","instant-images"),value:"grayscale"},{label:(0,te.__)("Red","instant-images"),value:"red"},{label:(0,te.__)("Orange","instant-images"),value:"orange"},{label:(0,te.__)("Yellow","instant-images"),value:"yellow"},{label:(0,te.__)("Green","instant-images"),value:"green"},{label:(0,te.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,te.__)("Blue","instant-images"),value:"blue"},{label:(0,te.__)("Lilac","instant-images"),value:"lilac"},{label:(0,te.__)("Pink","instant-images"),value:"pink"},{label:(0,te.__)("White","instant-images"),value:"white"},{label:(0,te.__)("Gray","instant-images"),value:"gray"},{label:(0,te.__)("Black","instant-images"),value:"black"},{label:(0,te.__)("Brown","instant-images"),value:"brown"},{label:(0,te.__)("Transparent","instant-images"),value:"transparent"}],ae=[{label:(0,te.__)("Backgrounds","instant-images"),value:"backgrounds"},{label:(0,te.__)("Fashion","instant-images"),value:"fashion"},{label:(0,te.__)("Nature","instant-images"),value:"nature"},{label:(0,te.__)("Science","instant-images"),value:"science"},{label:(0,te.__)("Education","instant-images"),value:"education"},{label:(0,te.__)("Feelings","instant-images"),value:"feelings"},{label:(0,te.__)("Health","instant-images"),value:"health"},{label:(0,te.__)("People","instant-images"),value:"people"},{label:(0,te.__)("Religion","instant-images"),value:"religion"},{label:(0,te.__)("Places","instant-images"),value:"places"},{label:(0,te.__)("Animals","instant-images"),value:"animals"},{label:(0,te.__)("Industry","instant-images"),value:"industry"},{label:(0,te.__)("Computer","instant-images"),value:"computer"},{label:(0,te.__)("Food","instant-images"),value:"food"},{label:(0,te.__)("Sports","instant-images"),value:"sports"},{label:(0,te.__)("Food","instant-images"),value:"food"},{label:(0,te.__)("Transportation","instant-images"),value:"transportation"},{label:(0,te.__)("Travel","instant-images"),value:"travel"},{label:(0,te.__)("Buildings","instant-images"),value:"buildings"},{label:(0,te.__)("Business","instant-images"),value:"business"},{label:(0,te.__)("Music","instant-images"),value:"music"}],se=[{label:(0,te.__)("Horizontal","instant-images"),value:"horizontal"},{label:(0,te.__)("Vertical","instant-images"),value:"vertical"}],ce=[{label:(0,te.__)("Photo","instant-images"),value:"photo"},{label:(0,te.__)("Illustration","instant-images"),value:"illustration"},{label:(0,te.__)("Vector","instant-images"),value:"vector"}],le=[{label:(0,te.__)("Black & White","instant-images"),value:"black_and_white"},{label:(0,te.__)("Black","instant-images"),value:"black"},{label:(0,te.__)("White","instant-images"),value:"white"},{label:(0,te.__)("Yellow","instant-images"),value:"yellow"},{label:(0,te.__)("Green","instant-images"),value:"green"},{label:(0,te.__)("Orange","instant-images"),value:"orange"},{label:(0,te.__)("Red","instant-images"),value:"red"},{label:(0,te.__)("Purple","instant-images"),value:"purple"},{label:(0,te.__)("Magenta","instant-images"),value:"magenta"},{label:(0,te.__)("Teal","instant-images"),value:"teal"},{label:(0,te.__)("Blue","instant-images"),value:"blue"}],ue=[{label:(0,te.__)("Landscape","instant-images"),value:"landscape"},{label:(0,te.__)("Portrait","instant-images"),value:"portrait"},{label:(0,te.__)("Square","instant-images"),value:"squarish"}];function fe(t){return function(t){if(Array.isArray(t))return he(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return he(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&parseInt(n)<2&&alert(instant_img_localize.api_ratelimit_msg)}}function Pe(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ze="";function Te(t){var e=t.currentTarget,n=e.getBoundingClientRect(),r=Math.round(n.left),i=Math.round(n.top),o=e.closest("#photo-listing").querySelector("#tooltip");o.classList.remove("over"),e.classList.contains("tooltip--above")?o.classList.add("above"):o.classList.remove("above"),ze=setInterval((function(){clearInterval(ze),o.innerHTML=e.dataset.title,r=r-o.offsetWidth+e.offsetWidth+5,o.style.left="".concat(r,"px"),o.style.top="".concat(i,"px"),setTimeout((function(){o.classList.add("over")}),25)}),750)}function Ie(t){clearInterval(ze),t.currentTarget.closest("#photo-listing").querySelector("#tooltip").classList.remove("over")}function Me(t){t&&window&&window.open(t,"_blank")}function De(){var t=instant_img_localize;switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200){case 400:case 401:return t.api_invalid_msg;case 403:return t.api_invalid_403_msg;case 404:return t.api_invalid_404_msg;case 429:return t.api_ratelimit_msg;case 500:case 503:return t.api_invalid_500_msg;case 501:return t.api_invalid_501_msg}}function Fe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=instant_img_localize,r=De(e);switch(e){case 400:case 401:case 500:case 429:console.warn("[".concat(n.instant_images," - ").concat(e," Error] ").concat(Pe(t),": ").concat(r))}}function He(t){return t&&t[Qt.defaults.arr_key]||[]}function We(t){return void 0===t.total||null===t.total?0:t.total}function Ue(t){if(!t||Qt.testmode)return!1;var e=sessionStorage.getItem(je(t));if(!e)return!1;var n=JSON.parse(e),r=n.expires,i=void 0===r?0:r,o=n.error;if(void 0!==o&&o)return!1;var a=Date.now()>i;return a&&Ve(t),!(!n||a)&&n}function qe(t,e){if(!t||!e||null!=e&&e.error)return!1;e.expires=Date.now()+36e5,sessionStorage.setItem(je(t),JSON.stringify(e))}function Ve(t){if(!t)return!1;sessionStorage.removeItem(je(t))}function Ge(t){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(t)}function Ye(){Ye=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==Ge(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Je(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Ke(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,_x,o,a=[],_n=!0,s=!1;try{if(_x=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(a.push(r.value),a.length!==e);_n=!0);}catch(t){s=!0,i=t}finally{try{if(!_n&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Xe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=1?null:React.createElement("div",{className:"instant-images-no-results"},React.createElement("div",null,React.createElement("h3",null,instant_img_localize.no_results," "),React.createElement("p",null,instant_img_localize.no_results_desc," ")))}var sn=Qt.providers;function cn(e){var n=e.switchProvider,r=$t().provider;return React.createElement(t.Fragment,null,!(null==sn||!sn.length)&&React.createElement("nav",{className:"provider-nav"},sn.map((function(t,e){return React.createElement("div",{key:"provider-".concat(e)},React.createElement("button",{onClick:function(){return n(t.toLowerCase())},className:r===t.toLowerCase()?"provider-nav--btn active":"provider-nav--btn"},Zt(t),React.createElement("span",null,t),Qt[t.toLowerCase()].new&&React.createElement("span",{className:"provider-nav--new"},instant_img_localize.new)))}))))}function ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=200&&e.status<400&&JSON.parse(e.response).success||o(!1)},e.onerror=function(t){console.warn(t),o(!1)}}),[]),React.createElement(t.Fragment,null,i?null:React.createElement("div",{className:"error-messaging"},React.createElement("strong",null,instant_img_localize.error_restapi),instant_img_localize.error_restapi_desc))}const fn=window.wp.blocks,hn=window.wp.data;function dn(t,e){var n=t.id,r=void 0===n?null:n,i=t.url,o=void 0===i?null:i,a=t.caption,s=void 0===a?"":a,c=t.alt,l=void 0===c?"":c;if(o&&r){var u=(0,fn.createBlock)("core/image",{id:r,url:o,caption:s,alt:l});e?(0,hn.dispatch)("core/block-editor").replaceBlock(e,u):(0,hn.dispatch)("core/block-editor").insertBlocks(u)}}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function mn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vn(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&React.createElement("img",{className:"user-wrap--photo",src:L,alt:""}),A)),React.createElement("div",{className:"photo-options"},f&&!$?React.createElement(t.Fragment,null,React.createElement("button",{type:"button",className:"set-featured fade","data-title":instant_img_localize.set_as_featured,onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)},onClick:function(t){return function(t){Ie(t),tt.current&&(rt=!0,tt.current.click())}(t)}},React.createElement("i",{className:"fa fa-picture-o","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.set_as_featured)),React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)},onClick:function(t){return ot(t)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post))):null,!!s&&React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)},onClick:function(t){return ot(t)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post)),$?React.createElement("button",{onClick:function(){$&&(window.location=$)},className:"edit-photo-admin fade","data-title":instant_img_localize.edit_upload,onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)}},React.createElement("i",{className:"fa fa-pencil","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_upload)):React.createElement("button",{onClick:function(t){return function(t){t.preventDefault(),Ie(t);var e=document.querySelectorAll(".edit-screen.editing");e&&e.forEach((function(t){t.classList.remove("editing")})),et.current.classList.add("editing"),setTimeout((function(){et.current.focus({preventScroll:!0})}),150)}(t)},className:"edit-photo fade","data-title":instant_img_localize.edit_details,onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)}},React.createElement("i",{className:"fa fa-cog","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_details)))),React.createElement("div",{className:"photo-meta"},E?React.createElement("span",{className:"likes tooltip--above","data-title":E+" "+N,onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)}},React.createElement("i",{className:"fa fa-heart heart-like","aria-hidden":"true"})," ",E):null,React.createElement("a",{className:"tooltip--above",href:m,"data-title":"".concat(instant_img_localize.open_external," ").concat(Pe(o)),onMouseEnter:function(t){return Te(t)},onMouseLeave:function(t){return Ie(t)},rel:"noopener noreferrer",target:"_blank"},React.createElement("i",{className:"fa fa-external-link","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},"".concat(instant_img_localize.open_external," ").concat(Pe(o)))))),React.createElement("div",{className:"edit-screen",tabIndex:"0",ref:et},React.createElement("div",{className:"edit-screen--title"},React.createElement("div",null,React.createElement("p",{className:"heading"},instant_img_localize.edit_details),S&&S.length>0&&React.createElement("p",{className:"dimensions"},S)),React.createElement("div",{className:"preview",style:{backgroundImage:"url(".concat(k,")")}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_filename,":"),React.createElement("input",{type:"text",name:"filename","data-original":p,placeholder:W.filename,value:W.filename,onChange:function(t){return ct(t)}}),React.createElement("em",null,".",w)),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_title,":"),React.createElement("input",{type:"text",name:"title","data-original":v,placeholder:v,value:W.title||"",onChange:function(t){return ct(t)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_alt,":"),React.createElement("input",{type:"text",name:"alt","data-original":g,value:W.alt||"",onChange:function(t){return ct(t)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_caption,":"),React.createElement("textarea",{rows:"4",name:"caption","data-original":F,onChange:function(t){return ct(t)},value:W.caption||"",ref:nt})),D?React.createElement("div",{className:"add-attribution-row"},React.createElement("button",{onClick:function(t){return function(t){t.preventDefault(),nt.current.value=D,U(vn(vn({},W),{},{caption:D}))}(t)},type:"button"},instant_img_localize.attribution)):null,React.createElement("div",{className:"edit-screen--controls"},React.createElement("button",{type:"button",className:"button button-secondary",onClick:function(t){return U({filename:p,title:v,alt:g,caption:F}),et.current.classList.remove("editing"),void tt.current.focus({preventScrol:!0})}},instant_img_localize.cancel)," "," ",React.createElement("button",{type:"button",className:"button button-primary",onClick:function(){return et.current.classList.remove("editing"),void tt.current.click()}},s?instant_img_localize.insert_into_post:instant_img_localize.upload_now))),React.createElement("div",{className:"photo-status"})))}function En(e){var n=e.result.data,r=void 0===n?null:n,i=(null==r?void 0:r.url)||"",o=(null==r?void 0:r.title)||"",a=(null==r?void 0:r.description)||"",s=(null==r?void 0:r.avatar)||"",c=r.image,l=void 0===c?null:c,u=l.src,f=void 0===u?null:u,h=l.alt,d=void 0===h?null:h,p=(0,t.useRef)(),m=(0,t.useRef)();return React.createElement(t.Fragment,null,l&&i?React.createElement("article",{className:"photo feature",title:a,ref:p,onClick:function(){return m.current.click()}},React.createElement("div",{className:"photo--wrap"},React.createElement("span",{className:"flag",title:instant_img_localize.advertisement},instant_img_localize.ad),React.createElement("div",{className:"img-wrap"},React.createElement("a",{className:"loaded",href:i,target:"_blank",ref:m,rel:"noreferrer"},React.createElement("img",{src:f,alt:d}))),React.createElement("div",{className:"feature-title"},s&&React.createElement("img",{src:s,alt:o}),React.createElement("span",null,o)))):null)}function Sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&e.splice(n,1),e.length>=10&&(e.length=10),e.unshift(t),localStorage.setItem(jn,JSON.stringify(e))}else localStorage.setItem(jn,JSON.stringify([t]))}(r),g(Pn())))}(t)},autoComplete:"off"},React.createElement("label",{htmlFor:"search-input",className:"offscreen"},instant_img_localize.search_label),React.createElement("div",{ref:w},React.createElement("input",{ref:n,type:"text",id:"search-input",placeholder:instant_img_localize.search,disabled:h,onChange:function(t){return l&&p(t.target.value)},onFocus:function(){return b(!0)}}),l&&((null==v?void 0:v.length)||(null==d?void 0:d.length))?React.createElement(Hn,{show:_,history:v,setHistory:g,setSearchValue:function(t){var e=null==n?void 0:n.current;e.value=t,null==E||E.current.click(),e.focus()},container:w}):null,!s&&React.createElement(Fn,{show:_})),React.createElement("button",{type:"submit",disabled:h,ref:E},React.createElement("i",{className:"fa fa-search"}),React.createElement("span",{className:"offscreen"},instant_img_localize.search)),React.createElement(Wn,{show:_})))}));function Gn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $n(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==h[0]&&h[0],!M){t.next=3;break}return t.abrupt("return",!1);case 3:if(n||""===(null==pt||null===(e=pt.current)||void 0===e?void 0:e.value)){t.next=7;break}if(!v||!y){t.next=7;break}return Ot(pt.current.value),t.abrupt("return");case 7:if(T(!0),d=void 0,(null==pt||null===(d=pt.current)||void 0===d?void 0:d.value)&&(pt.current.value=""),$(w),tt([]),Pt(),ar=1,r=Ee(k,ot),i=Ce("photos",r),!(o=Ue(i))){t.next=18;break}At(He(o),!1,null),t.next=37;break;case 18:return t.next=20,fetch(i);case 20:return a=t.sent,c=a.status,Ne(a.headers),t.prev=23,t.next=26,a.json();case 26:l=t.sent,u=l.error,f=void 0===u?null:u,At(He(l),!1,f),qe(i,l),t.next=37;break;case 32:t.prev=32,t.t0=t.catch(23),Fe(s,c),T(!1),Ve(i);case 37:setTimeout((function(){T(!1)}),_);case 38:case"end":return t.stop()}var d}),t,null,[[23,32]])}))),Rt.apply(this,arguments)}function xt(){return kt.apply(this,arguments)}function kt(){return(kt=er(Kn().mark((function t(){var e,n,r,i,o,a,c,l,u,f,h,d;return Kn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j&&!z&&!M&&!H){t.next=2;break}return t.abrupt("return");case 2:if(D(!0),ar=parseInt(ar)+1,e=null!=X&&X.active&&null!=X&&X.term?{term:X.term}:{},n=null!=X&&X.active?"search":"photos",r=null!=X&&X.active?ct:ot,i=$n($n($n({},{page:ar}),e),r),o=Ee(k,i),a=Ce(n,o),!(c=Ue(a))){t.next=15;break}At(He(c),!0,null),t.next=34;break;case 15:return t.next=17,fetch(a);case 17:return l=t.sent,u=l.status,Ne(l.headers),t.prev=20,t.next=23,l.json();case 23:f=t.sent,h=f.error,d=void 0===h?null:h,At(He(f),!0,d),qe(a,f),t.next=34;break;case 29:t.prev=29,t.t0=t.catch(20),Fe(s,u),D(!1),Ve(a);case 34:case"end":return t.stop()}}),t,null,[[20,29]])})))).apply(this,arguments)}function Ot(t){return Ct.apply(this,arguments)}function Ct(){return(Ct=er(Kn().mark((function t(e){var n,r,i,o,a,c,l,u,f,h,d;return Kn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T(!0),Pt(),ar=1,n="id:"===e.substring(0,3)?"id":"term",r="id"===n?{id:e.replace("id:","").replace(/\s+/,"")}:{term:e},i=$n($n($n({},{page:ar}),r),ct),o=Ee(k,i),a=Ce("search",o),!(c=Ue(a))){t.next=14;break}At(He(c),!1,null),$({active:!0,term:e,type:n,results:We(c)}),t.next=35;break;case 14:return t.next=16,fetch(a);case 16:return l=t.sent,u=l.status,Ne(l.headers),t.prev=19,t.next=22,l.json();case 22:f=t.sent,h=f.error,d=void 0===h?null:h,At(He(f),!1,d),$({active:!0,term:e,type:n,results:We(f)}),qe(a,f),t.next=35;break;case 29:t.prev=29,t.t0=t.catch(19),W(!0),T(!1),Fe(s,u),Ve(a);case 35:pt.current.classList.remove(b);case 36:case"end":return t.stop()}}),t,null,[[19,29]])})))).apply(this,arguments)}function At(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;t=null==e?void 0:e.length,W(0===parseInt(t)||void 0===t),R(n?function(t){return[].concat(Qn(t),Qn(e))}:e),V(r)}function Lt(t,e){var n=$n({},ot);n[t]&&"#"===e||""===e||"all"===e?delete n[t]:n[t]=e,at($n({},n))}function Bt(t){return jt.apply(this,arguments)}function jt(){return(jt=er(Kn().mark((function t(e){var n,r;return Kn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(k!==e){t.next=2;break}return t.abrupt("return");case 2:if(T(!0),V(!1),J(!1),bt.classList.remove("overflow-hidden"),!Qt[e].requires_key||A.includes(e)){t.next=27;break}return t.prev=7,t.next=10,fetch(Ae(e));case 10:if(n=t.sent,r=n.status,Ne(n.headers),200===r){t.next=18;break}return J(e),V(!0),bt.classList.add("overflow-hidden"),t.abrupt("return");case 18:200===r&&L((function(t){return[].concat(Qn(t),[e])})),t.next=27;break;case 21:return t.prev=21,t.t0=t.catch(7),J(e),bt.classList.add("overflow-hidden"),V(!0),t.abrupt("return");case 27:setTimeout((function(){rt(pe[e].filters),O(e)}),_);case 28:case"end":return t.stop()}}),t,null,[[7,21]])})))).apply(this,arguments)}function Nt(){return(Nt=er(Kn().mark((function t(e){var n;return Kn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&!((null==e?void 0:e.length)<3)){t.next=2;break}return t.abrupt("return");case 2:return n=instant_img_localize.root+"instant-images-extended/suggestions/?term=".concat(e),t.next=5,It.get(n).then((function(t){tt(t.data)})).catch((function(t){console.warn(t)}));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Pt(){vt&&null!=dt&&dt.current&&(null==dt||dt.current.scroll({top:0,left:0,behavior:"smooth"}))}function zt(t){if("Escape"===t.key){var e=dt.current.querySelectorAll(".edit-screen.editing");e&&Qn(e).forEach((function(t){null==t||t.classList.remove("editing")}))}}return(0,t.useEffect)((function(){null!=X&&X.active||lt({})}),[X]),(0,t.useEffect)((function(){j&&null!=X&&X.active&&Ot(null==X?void 0:X.term)}),[ct]),(0,t.useEffect)((function(){j&&St()}),[ot]),(0,t.useEffect)((function(){rt(pe[k].filters),at({})}),[k]),(0,t.useEffect)((function(){xt()}),[ht]),(0,t.useEffect)((function(){or(dt.current,(function(){yt||(mt.current=new(Ht())(dt.current,{itemSelector:".photo"}),dt.current.querySelectorAll(".photo").forEach((function(t){t.classList.add("in-view")}))),setTimeout((function(){T(!1),D(!1),j||N(!0)}),_)}))}),[S]),(0,t.useEffect)((function(){return T(!1),Et.classList.add("loaded"),yt&&St(),document.addEventListener("keydown",zt,!1),function(){document.removeEventListener("keydown",zt,!1)}}),[]),React.createElement(t.Fragment,null,React.createElement(Xt,{value:{provider:k,wpBlock:vt,mediaModal:_t,blockSidebar:gt,clientId:d,search:X,apiError:q,getPhotos:St,searchHandler:function(t){t.preventDefault();var e=pt.current.value;e.length>2?(pt.current.classList.add(b),Ot(e)):pt.current.focus()},filterSearch:function(t,e){var n=$n({},ct);n[t]&&"#"===e||""===e||"all"===e?delete n[t]:n[t]=e,lt($n({},n))},suggestions:Q,getSuggestions:function(t){return Nt.apply(this,arguments)}}},vt?React.createElement(ge,{switchProvider:Bt}):React.createElement(React.Fragment,null,React.createElement(cn,{switchProvider:Bt}),React.createElement(Dn,null)),React.createElement(un,null),React.createElement("div",{className:"control-nav"},React.createElement("div",{className:Dt()("control-nav--filters-wrap",q||null!=X&&X.active?"inactive":null)},nt&&null!==(i=Object.entries(nt))&&void 0!==i&&i.length?React.createElement("div",{className:"control-nav--filters"},Object.entries(nt).map((function(t,e){var n=nr(t,2),r=n[0],i=n[1];return React.createElement(rn,{key:"".concat(k,"-").concat(e,"-").concat(r),data:i,filterKey:r,handler:Lt})}))):null),React.createElement(Vn,{ref:pt})),React.createElement("div",{id:"photo-listing",className:z?"loading":null},React.createElement(Yn,null),vt?React.createElement(An,{ref:dt,data:S,done:H,loadMorePhotos:xt}):React.createElement(Rn,{ref:dt,data:S}),React.createElement(an,{total:null==X?void 0:X.results,is_search:null==X?void 0:X.active}),React.createElement(on,{ref:ft,loadMorePhotos:xt,loading:M,done:H}),React.createElement($e,{provider:Y,callback:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t&&O(t),J(!1),T(!1),V(!1),bt.classList.remove("overflow-hidden")}}),React.createElement(Ze,null),React.createElement(Ln,null))))}function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(){lr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==cr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function ur(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}var fr="",hr="",dr=wp.media.view.MediaFrame.Post,pr=wp.media.view.MediaFrame.Select;wp.media.view.MediaFrame.Select=pr.extend({browseRouter:function(t){var e;pr.prototype.browseRouter.apply(this,arguments),t.set({instantimages:{text:null===(e=instant_img_localize)||void 0===e?void 0:e.instant_images,priority:120}})},bindHandlers:function(){pr.prototype.bindHandlers.apply(this,arguments),this.on("content:create:instantimages",this.frameContent,this)},frameContent:function(){var t=this.state();t&&(fr=t.id,hr=t.frame.el)},getFrame:function(t){return this.states.findWhere({id:t})}}),wp.media.view.MediaFrame.Post=dr.extend({browseRouter:function(t){var e;pr.prototype.browseRouter.apply(this,arguments),t.set({instantimages:{text:null===(e=instant_img_localize)||void 0===e?void 0:e.instant_images,priority:120}})},bindHandlers:function(){dr.prototype.bindHandlers.apply(this,arguments),this.on("content:create:instantimages",this.frameContent,this)},frameContent:function(){var t=this.state();t&&(fr=t.id,hr=t.frame.el)},getFrame:function(t){return this.states.findWhere({id:t})}});var mr=function(){if(!hr)return!1;var t=hr.querySelector(".media-frame-content");if(!t)return!1;t.innerHTML="";var e=yr();t.appendChild(e);var n=t.querySelector("#instant-images-media-router-"+fr);if(!n)return!1;vr(n)},vr=function(){var t,e=(t=lr().mark((function t(e){var n,r,i,o,a,s,c,l;return lr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=instant_img_localize&&instant_img_localize.default_provider?instant_img_localize.default_provider:Qt.defaults.provider,r=Ee(n),i=Ce("photos",r),!(o=Ue(i))){t.next=8;break}gr(e,n,o,null),t.next=26;break;case 8:return t.next=10,fetch(i);case 10:return a=t.sent,s=a.status,Ne(a.headers),t.prev=13,t.next=16,a.json();case 16:c=t.sent,l=c.error,gr(e,n,c,void 0===l?null:l),qe(i,c),t.next=26;break;case 22:t.prev=22,t.t0=t.catch(13),Fe(n,s),Ve(i);case 26:case"end":return t.stop()}}),t,null,[[13,22]])})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ur(o,r,i,a,s,"next",t)}function s(t){ur(o,r,i,a,s,"throw",t)}a(void 0)}))});return function(_x){return e.apply(this,arguments)}}(),gr=function(e,n,r,i){t.createRoot?(0,t.createRoot)(e).render(React.createElement(sr,{editor:"media-modal",data:r,container:e,api_error:i,provider:n})):(0,t.render)(React.createElement(sr,{editor:"media-modal",data:r,container:e,api_error:i,provider:n}),e)},yr=function(){var t=document.createElement("div");t.classList.add("instant-img-container");var e=document.createElement("div");e.classList.add("instant-images-wrapper");var n=document.createElement("div");return n.setAttribute("id","instant-images-media-router-"+fr),e.appendChild(n),t.appendChild(e),t};jQuery(document).ready((function(t){wp.media&&(wp.media.view.Modal.prototype.on("open",(function(){if(!hr)return!1;var t=hr.querySelector(".media-router button.media-menu-item.active");t&&"menu-item-instantimages"===t.id&&mr()})),t(document).on("click",".media-router button.media-menu-item",(function(){var t=hr.querySelector(".media-router button.media-menu-item.active");t&&"menu-item-instantimages"===t.id&&mr()})))}))})()})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/js/common/pluginProvider.js": +/*!*****************************************!*\ + !*** ./src/js/common/pluginProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PluginProvider": () => (/* binding */ PluginProvider), +/* harmony export */ "usePluginContext": () => (/* binding */ usePluginContext) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +// Create Context object. +var PluginContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(); + +// Export Provider. +function PluginProvider(props) { + var value = props.value, + children = props.children; + return /*#__PURE__*/React.createElement(PluginContext.Provider, { + value: value + }, children); +} + +// Export useContext Hook. +function usePluginContext() { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(PluginContext); +} + +/***/ }), + +/***/ "./src/js/components/APILightbox.js": +/*!******************************************!*\ + !*** ./src/js/components/APILightbox.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ APILightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/updatePluginSetting */ "./src/js/functions/updatePluginSetting.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the APILightbox component. + * Note: Component is display when switching providers and the API is invalid. + * + * @param {Object} props The component props. + * @return {JSX.Element} The APILightbox component. + */ +function APILightbox(props) { + var provider = props.provider, + callback = props.callback; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("invalid"), + _useState2 = _slicedToArray(_useState, 2), + apiStatus = _useState2[0], + setAPIStatus = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState4 = _slicedToArray(_useState3, 2), + response = _useState4[0], + setResponse = _useState4[1]; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var submitRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var api_key = instant_img_localize["".concat(provider, "_app_id")]; + var title = apiStatus === "invalid" ? instant_img_localize.api_key_invalid : ""; + + /** + * Handler for the form submission. + * + * @param {Event} e The form event. + */ + function handleSubmit(_x2) { + return _handleSubmit.apply(this, arguments); + } + /** + * Close the lightbox + */ + function _handleSubmit() { + _handleSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) { + var _inputRef$current; + var key, data, ok, status, headers; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + e.preventDefault(); + setAPIStatus("loading"); + + // Get API key value. + key = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value; // Set API key to localized variable. + instant_img_localize["".concat(provider, "_app_id")] = key; + + // Update plugin settings via REST API. + (0,_functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__["default"])("".concat(provider, "_api"), key); + _context.prev = 5; + _context.next = 8; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_2__.buildTestURL)(provider)); + case 8: + data = _context.sent; + // Handle response. + ok = data.ok, status = data.status, headers = data.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.checkRateLimit)(headers); + + // Handle response actions. + if (ok) { + // Success. + setAPIStatus("valid"); + setResponse(instant_img_localize.api_success_msg); + setTimeout(function () { + setResponse(""); + setAPIStatus("invalid"); + callback(provider); + }, 1000); + } else { + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, status); // Render console warning. + + if (status === 400 || status === 401) { + setResponse(instant_img_localize.api_invalid_msg); // Unsplash/Pixabay incorrect API key. + } + + if (status === 429) { + setResponse(instant_img_localize.api_ratelimit_msg); // Pixabay - too many requests. + } + } + _context.next = 19; + break; + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](5); + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, 500); // Render console warning. + setResponse(instant_img_localize.api_invalid_500_msg); + case 19: + case "end": + return _context.stop(); + } + }, _callee, null, [[5, 14]]); + })); + return _handleSubmit.apply(this, arguments); + } + function closeLightbox() { + if (lightbox !== null && lightbox !== void 0 && lightbox.current) { + lightbox.current.classList.remove("active"); + setTimeout(function () { + callback(); + }, 150); + } + } + + /** + * Close the lightbox with a background click. + * + * @param {Event} e The form event. + */ + function bkgClick(e) { + var target = e.target; + // If clicked element is the background. + if (target === (lightbox === null || lightbox === void 0 ? void 0 : lightbox.current)) { + closeLightbox(); + } + } + + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + closeLightbox(); + } + } + + /** + * Reset the key to use Instant Images default. + */ + function getDefaultKey() { + inputRef.current.value = ""; + setTimeout(function () { + submitRef.current.click(); + }, 25); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + var _lightbox$current; + document.addEventListener("keydown", escFunction, false); + lightbox === null || lightbox === void 0 ? void 0 : (_lightbox$current = lightbox.current) === null || _lightbox$current === void 0 ? void 0 : _lightbox$current.classList.add("active"); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, [provider]); //eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, provider ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("div", { + className: "api-lightbox", + ref: lightbox, + onClick: function onClick(e) { + return bkgClick(e); + }, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", { + className: "api-lightbox--close", + onClick: function onClick() { + return closeLightbox(); + } + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.btnClose)), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--details" + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_6__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", null, instant_img_localize["".concat(provider, "_api_desc")]), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key), /*#__PURE__*/React.createElement("span", null, "|"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getDefaultKey(); + } + }, instant_img_localize.use_instant_images_key))), /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return handleSubmit(e); + } + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "key", + className: "offscreen" + }, instant_img_localize.enter_api_key), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--input-wrap" + }, /*#__PURE__*/React.createElement("span", { + className: apiStatus, + title: title && title + }, apiStatus === "invalid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-exclamation-triangle", + "aria-hidden": "true" + }), apiStatus === "valid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-check-circle", + "aria-hidden": "true" + }), apiStatus === "loading" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-spinner fa-spin", + "aria-hidden": "true" + })), /*#__PURE__*/React.createElement("input", { + type: "text", + id: "key", + ref: inputRef, + placeholder: "Enter API Key", + defaultValue: api_key + })), response && /*#__PURE__*/React.createElement("p", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--response", apiStatus) + }, response), /*#__PURE__*/React.createElement("button", { + type: "submit", + ref: submitRef + }, instant_img_localize.btnVerify))))) : null); +} + +/***/ }), + +/***/ "./src/js/components/ErrorLightbox.js": +/*!********************************************!*\ + !*** ./src/js/components/ErrorLightbox.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ErrorLightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/getErrorMessage */ "./src/js/functions/getErrorMessage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + + + + +/** + * Render the ErrorLightbox component. + * Note: Component is display on initial plugin load if the default provider has an invalid API key. + * + * @return {JSX.Element} The ErrorLightbox component. + */ +function ErrorLightbox() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + apiError = _usePluginContext.apiError; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var status = apiError !== null && apiError !== void 0 && apiError.status ? apiError.status : null; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, apiError && status && /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox", "error-lightbox", "active"), + ref: lightbox, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--details", "error-lightbox") + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_5__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", { + className: "callout-warning" + }, status, " ", instant_img_localize.error), /*#__PURE__*/React.createElement("p", null, (0,_functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(status)), /*#__PURE__*/React.createElement("p", { + className: "more-info" + }, instant_img_localize.api_default_provider), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key)))))); +} + +/***/ }), + +/***/ "./src/js/components/Filter.js": +/*!*************************************!*\ + !*** ./src/js/components/Filter.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Filter) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/** + * Render the Filter component. + * + * @param {Object} props The component props. + * @param {Object} props.data The filter data. + * @param {string} props.filterKey The filter key. + * @param {Function} props.handler The change/click handler function. + * @return {JSX.Element} The Filter component. + */ +function Filter(props) { + var _data$filters; + var data = props.data, + filterKey = props.filterKey, + handler = props.handler; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider; + var defaultValue = data === null || data === void 0 ? void 0 : data["default"]; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + expanded = _useState2[0], + setExpanded = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue), + _useState4 = _slicedToArray(_useState3, 2), + selected = _useState4[0], + setSelected = _useState4[1]; + var dropdown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var button = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var menu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var id = "".concat(provider, "-").concat(filterKey); + var isColor = filterKey === "colors" || filterKey === "color"; + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__.useArrowControls)(expanded, dropdown); + + /** + * Toggle menu open/closed. + * + * @param {Event} event The click event. + */ + function toggleMenu(event) { + event.preventDefault(); + + // If disabled, don't open menu. + var target = event.currentTarget; + if (target.disabled) { + return false; + } + if (expanded) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } else { + setExpanded(true); + document.addEventListener("click", closeMenuOutside); + } + } + + /** + * Close menu when clicking outside. + * + * @param {Event} event The click event. + */ + function closeMenuOutside(event) { + var _menu$current, _button$current; + if (!(menu !== null && menu !== void 0 && (_menu$current = menu.current) !== null && _menu$current !== void 0 && _menu$current.contains(event.target)) && !(button !== null && button !== void 0 && (_button$current = button.current) !== null && _button$current !== void 0 && _button$current.contains(event.target))) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } + } + + /** + * Checks for focus outside of component. + * + * @param {Event} event The click event. + */ + function focusOutside(event) { + if (!(dropdown !== null && dropdown !== void 0 && dropdown.current.contains(event.target))) { + closeMenuOutside(event); + } + } + + /** + * Detect esc key press. + * + * @param {Event} event The click event. + */ + function escClick(event) { + if (event.key === "Escape") { + setExpanded(false); + } + } + + /** + * Click handler for the filter buttons. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function click(filter, value) { + var newValue = selected !== value ? value : defaultValue; + setSelected(newValue); + handler(filter, newValue); + setTimeout(function () { + var _button$current2; + button === null || button === void 0 ? void 0 : (_button$current2 = button.current) === null || _button$current2 === void 0 ? void 0 : _button$current2.click(); + }, 100); + } + + /** + * Convert a color to a CSS value. + * + * @see https://www.w3schools.com/colors/colors_names.asp + * + * @param {string} color The current color. + * @return {string} The color. + */ + function convertColor(color) { + if (color === "lilac") { + color = "DarkViolet"; + } + if (color === "grayscale" || color === "black_and_white") { + color = "LightGray"; + } + return color; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Initiate arrow menus. + // a11yarrows.init(dropdown?.current, { + // selector: "button", + // }); + + // Check for focus outside. + document.addEventListener("keyup", focusOutside); + document.addEventListener("keydown", escClick); + return function () { + document.removeEventListener("keyup", focusOutside); + document.removeEventListener("keydown", escClick); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement("div", { + className: "filter-dropdown", + id: id, + ref: dropdown + }, /*#__PURE__*/React.createElement("button", { + onClick: toggleMenu, + className: "filter-dropdown--button", + "aria-expanded": expanded ? "true" : "false", + ref: button + }, /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-label" + }, data === null || data === void 0 ? void 0 : data.label), /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-selected" + }, selected.replace(/_/g, " "), /*#__PURE__*/React.createElement("i", { + className: "fa fa-caret-down", + "aria-hidden": "true" + }))), /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--menu", expanded ? "expanded" : null), + "data-key": filterKey, + "aria-hidden": expanded ? "false" : "true", + ref: menu + }, (data === null || data === void 0 ? void 0 : (_data$filters = data.filters) === null || _data$filters === void 0 ? void 0 : _data$filters.length) && data.filters.map(function (filter, key) { + var label = filter.label, + value = filter.value; + return /*#__PURE__*/React.createElement("button", { + key: key, + disabled: selected === value, + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--item", selected === value ? "selected" : null), + onClick: function onClick() { + return click(filterKey, value); + } + }, label, value !== "all" && value !== "transparent" && isColor ? /*#__PURE__*/React.createElement("span", { + className: "_color", + style: { + color: convertColor(value) + } + }) : null); + }))); +} + +/***/ }), + +/***/ "./src/js/components/Icon.js": +/*!***********************************!*\ + !*** ./src/js/components/Icon.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "IconLogo": () => (/* binding */ IconLogo), +/* harmony export */ "IconSVG": () => (/* binding */ IconSVG), +/* harmony export */ "default": () => (/* binding */ Icon) +/* harmony export */ }); +/** + * The Icon component. + * + * @return {JSX.Element} The Icon component. + */ +function Icon() { + return /*#__PURE__*/React.createElement("span", { + className: "instant-images-sidebar-icon" + }, /*#__PURE__*/React.createElement(IconSVG, null)); +} + +/** + * The SVG icon. + * + * @return {JSX.Element} The IconSVG component. + */ +function IconSVG() { + return /*#__PURE__*/React.createElement("svg", { + viewBox: "0 0 31 58", + width: "13px", + height: "24px" + }, /*#__PURE__*/React.createElement("polygon", { + points: "20 0 20 23 31 23 11 58 11 34 0 34 20 0", + fill: "#4a7bc5" + })); +} + +/** + * The SVG Logo. + * + * @return {JSX.Element} The IconLogo component. + */ +function IconLogo() { + return /*#__PURE__*/React.createElement("svg", { + width: "80", + height: "80", + viewBox: "0 0 80 80", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("title", null, "Instant Images Icon"), /*#__PURE__*/React.createElement("path", { + d: "M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z", + fill: "#647FE8" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + })); +} + +/***/ }), + +/***/ "./src/js/components/InstantImages.js": +/*!********************************************!*\ + !*** ./src/js/components/InstantImages.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ InstantImages) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! masonry-layout */ "./node_modules/masonry-layout/masonry.js"); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(masonry_layout__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor/block/components/Header */ "./src/js/editor/block/components/Header.js"); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../functions/getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _functions_getResults__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../functions/getResults */ "./src/js/functions/getResults.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../functions/session */ "./src/js/functions/session.js"); +/* harmony import */ var _APILightbox__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./APILightbox */ "./src/js/components/APILightbox.js"); +/* harmony import */ var _ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ErrorLightbox */ "./src/js/components/ErrorLightbox.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _LoadMore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LoadMore */ "./src/js/components/LoadMore.js"); +/* harmony import */ var _NoResults__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./NoResults */ "./src/js/components/NoResults.js"); +/* harmony import */ var _ProviderNav__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ProviderNav */ "./src/js/components/ProviderNav.js"); +/* harmony import */ var _RestAPIError__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RestAPIError */ "./src/js/components/RestAPIError.js"); +/* harmony import */ var _Results__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Results */ "./src/js/components/Results.js"); +/* harmony import */ var _ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ResultsWPBlock */ "./src/js/components/ResultsWPBlock.js"); +/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Tooltip */ "./src/js/components/Tooltip.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _search_SearchForm__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./search/SearchForm */ "./src/js/components/search/SearchForm.js"); +/* harmony import */ var _search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./search/SearchHeader */ "./src/js/components/search/SearchHeader.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var imagesLoaded = __webpack_require__(/*! imagesloaded */ "./node_modules/imagesloaded/imagesloaded.js"); +var page = 1; + +/** + * Render the main InstantImages application component. + * + * @param {Object} props The component props. + * @param {string} props.editor Editor type. + * @param {string} props.provider Image provider. + * @param {Array} props.data API results. + * @param {Element} props.container Instant Images container element. + * @param {Object} props.api_error API error object. + * @param {string} props.clientId WP block client ID. + * @return {JSX.Element} InstantImages component. + */ +function InstantImages(props) { + var _instant_img_localize4, _instant_img_localize5, _Object$entries; + var _props$editor = props.editor, + editor = _props$editor === void 0 ? "classic" : _props$editor, + provider = props.provider, + data = props.data, + container = props.container, + _props$api_error = props.api_error, + api_error = _props$api_error === void 0 ? null : _props$api_error, + _props$clientId = props.clientId, + clientId = _props$clientId === void 0 ? null : _props$clientId; + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var delay = 250; + var searchClass = "searching"; + var searchDefaults = { + active: false, + term: "", + type: "", + results: 0 + }; + + // App state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(data)), + _useState2 = _slicedToArray(_useState, 2), + results = _useState2[0], + setResults = _useState2[1]; // Image results. + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(provider), + _useState4 = _slicedToArray(_useState3, 2), + activeProvider = _useState4[0], + setActiveProvider = _useState4[1]; // Current provider. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState6 = _slicedToArray(_useState5, 2), + apiTested = _useState6[0], + setAPITested = _useState6[1]; // API key test results. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState8 = _slicedToArray(_useState7, 2), + mounted = _useState8[0], + setMounted = _useState8[1]; // App mounted state. + var _useState9 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState10 = _slicedToArray(_useState9, 2), + loading = _useState10[0], + setLoading = _useState10[1]; // Loading state + var _useState11 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState12 = _slicedToArray(_useState11, 2), + loadingMore = _useState12[0], + setLoadingMore = _useState12[1]; // Load more state. + var _useState13 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState14 = _slicedToArray(_useState13, 2), + done = _useState14[0], + setDone = _useState14[1]; // Done state. + var _useState15 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(api_error), + _useState16 = _slicedToArray(_useState15, 2), + apiError = _useState16[0], + setAPIError = _useState16[1]; // API Error. + var _useState17 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState18 = _slicedToArray(_useState17, 2), + showAPILightbox = _useState18[0], + setShowAPILightbox = _useState18[1]; // Render API key lightbox. + var _useState19 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(searchDefaults), + _useState20 = _slicedToArray(_useState19, 2), + search = _useState20[0], + setSearch = _useState20[1]; + var _useState21 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState22 = _slicedToArray(_useState21, 2), + suggestions = _useState22[0], + setSuggestions = _useState22[1]; + var _useState23 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters), + _useState24 = _slicedToArray(_useState23, 2), + filterOptions = _useState24[0], + setFilterOptions = _useState24[1]; + var _useState25 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState26 = _slicedToArray(_useState25, 2), + filters = _useState26[0], + setFilters = _useState26[1]; + var _useState27 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState28 = _slicedToArray(_useState27, 2), + searchFilters = _useState28[0], + setSearchFilters = _useState28[1]; + + // Refs. + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + var photosRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var searchInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var msnryRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // WP Editor props. + var wpBlock = editor === "block" ? true : false; + var blockSidebar = editor === "sidebar" ? true : false; + var isBlockEditor = wpBlock || blockSidebar ? true : false; + var mediaModal = editor === "media-modal" ? true : false; + var body = document.body; + var plugin = isBlockEditor ? container : container.parentNode.parentNode; + var wrapper = isBlockEditor ? container : plugin.querySelector(".instant-images-wrapper"); + + /** + * Get the initial set of photos for the current view (New/Popular/Filters/etc...). + * + * @param {boolean} reset Reset the current view. + * @since 3.0 + */ + function getPhotos() { + return _getPhotos.apply(this, arguments); + } + /** + * Load more photos in infinite scroll style. + * + * @since 3.0 + */ + function _getPhotos() { + _getPhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _searchInputRef$curre2; + var reset, + params, + url, + sessionData, + response, + status, + headers, + apiResults, + _apiResults$error, + error, + _args = arguments; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + reset = _args.length > 0 && _args[0] !== undefined ? _args[0] : false; + if (!loadingMore) { + _context.next = 3; + break; + } + return _context.abrupt("return", false); + case 3: + if (!(!reset && (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre2 = searchInputRef.current) === null || _searchInputRef$curre2 === void 0 ? void 0 : _searchInputRef$curre2.value) !== "")) { + _context.next = 7; + break; + } + if (!(extended_activated && extended_license)) { + _context.next = 7; + break; + } + doSearch(searchInputRef.current.value); + return _context.abrupt("return"); + case 7: + setLoading(true); // Set loading state. + clearSearch(); // Reset search results. + + resetScrollPosition(); + page = 1; + + // Build URL. + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, filters); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("photos", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context.next = 18; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + _context.next = 37; + break; + case 18: + _context.next = 20; + return fetch(url); + case 20: + response = _context.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context.prev = 23; + _context.next = 26; + return response.json(); + case 26: + apiResults = _context.sent; + _apiResults$error = apiResults.error, error = _apiResults$error === void 0 ? null : _apiResults$error; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context.next = 37; + break; + case 32: + _context.prev = 32; + _context.t0 = _context["catch"](23); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoading(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 37: + // Delay loading animatons for effect. + setTimeout(function () { + setLoading(false); + }, delay); + case 38: + case "end": + return _context.stop(); + } + }, _callee, null, [[23, 32]]); + })); + return _getPhotos.apply(this, arguments); + } + function loadMorePhotos() { + return _loadMorePhotos.apply(this, arguments); + } + /** + * Perform a photo search. + * + * @param {string} term Search term. + * @since 3.0 + */ + function _loadMorePhotos() { + _loadMorePhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var searchQuery, type, activeFilters, loadmoreParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error2, error; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(!mounted || loading || loadingMore || done)) { + _context2.next = 2; + break; + } + return _context2.abrupt("return"); + case 2: + setLoadingMore(true); + page = parseInt(page) + 1; + + // Get search query. + searchQuery = search !== null && search !== void 0 && search.active && search !== null && search !== void 0 && search.term ? { + term: search.term + } : {}; // Build URL. + type = search !== null && search !== void 0 && search.active ? "search" : "photos"; + activeFilters = search !== null && search !== void 0 && search.active ? searchFilters : filters; + loadmoreParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), activeFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, loadmoreParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])(type, params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context2.next = 15; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), true, null); + _context2.next = 34; + break; + case 15: + _context2.next = 17; + return fetch(url); + case 17: + response = _context2.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context2.prev = 20; + _context2.next = 23; + return response.json(); + case 23: + apiResults = _context2.sent; + _apiResults$error2 = apiResults.error, error = _apiResults$error2 === void 0 ? null : _apiResults$error2; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), true, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context2.next = 34; + break; + case 29: + _context2.prev = 29; + _context2.t0 = _context2["catch"](20); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoadingMore(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 34: + case "end": + return _context2.stop(); + } + }, _callee2, null, [[20, 29]]); + })); + return _loadMorePhotos.apply(this, arguments); + } + function doSearch(_x2) { + return _doSearch.apply(this, arguments); + } + /** + * Handle the display results. + * + * @param {Array} images Image array. + * @param {boolean} append Append images to existing results display. + * @param {string|null} error Error message. + */ + function _doSearch() { + _doSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(term) { + var searchType, searchQuery, searchParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error3, error; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + setLoading(true); + resetScrollPosition(); + page = 1; // Reset current page num. + searchType = term.substring(0, 3) === "id:" ? "id" : "term"; // Get search query. + searchQuery = searchType === "id" ? { + id: term.replace("id:", "").replace(/\s+/, "") + } : { + term: term + }; // Build URL. + searchParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), searchFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, searchParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("search", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context3.next = 14; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(sessionData) + }); + _context3.next = 35; + break; + case 14: + _context3.next = 16; + return fetch(url); + case 16: + response = _context3.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context3.prev = 19; + _context3.next = 22; + return response.json(); + case 22: + apiResults = _context3.sent; + _apiResults$error3 = apiResults.error, error = _apiResults$error3 === void 0 ? null : _apiResults$error3; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(apiResults) + }); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context3.next = 35; + break; + case 29: + _context3.prev = 29; + _context3.t0 = _context3["catch"](19); + // Reset all search parameters. + setDone(true); + setLoading(false); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 35: + searchInputRef.current.classList.remove(searchClass); + case 36: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[19, 29]]); + })); + return _doSearch.apply(this, arguments); + } + function displayResults() { + var images = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var error = arguments.length > 2 ? arguments[2] : undefined; + checkResults(images === null || images === void 0 ? void 0 : images.length); + if (append) { + setResults(function (prevState) { + return [].concat(_toConsumableArray(prevState), _toConsumableArray(images)); + }); // Load more. + } else { + setResults(images); // Standard switch. + } + + setAPIError(error); + } + + /** + * Handle the Photo Search. + * + * @param {Event} event The dispatched submit event. + * @since 3.0 + */ + function searchHandler(event) { + event.preventDefault(); + var term = searchInputRef.current.value; + if (term.length > 2) { + searchInputRef.current.classList.add(searchClass); + doSearch(term); + } else { + searchInputRef.current.focus(); + } + } + + /** + * Reset search results, settings and results view. + * + * @since 3.0 + */ + function clearSearch() { + var _searchInputRef$curre; + var term = (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.value) || ""; + if (term) { + searchInputRef.current.value = ""; + } + setSearch(searchDefaults); + setSuggestions([]); + } + + /** + * Filter the photo listing. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterPhotos(filter, value) { + var newFilters = _objectSpread({}, filters); + if (newFilters[filter] && value === "#" || value === "" || value === "all") { + delete newFilters[filter]; + } else { + newFilters[filter] = value; + } + setFilters(_objectSpread({}, newFilters)); + } + + /** + * Filter the search results. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterSearch(filter, value) { + var newSearchFilters = _objectSpread({}, searchFilters); + if (newSearchFilters[filter] && value === "#" || value === "" || value === "all") { + delete newSearchFilters[filter]; + } else { + newSearchFilters[filter] = value; + } + setSearchFilters(_objectSpread({}, newSearchFilters)); + } + + /** + * Close the API Lightbox. + * + * @param {string} target The target provider to close the lightbox for. + * @since 4.5 + */ + function closeAPILightbox() { + var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + if (target) { + setActiveProvider(target); + } + setShowAPILightbox(false); + setLoading(false); + setAPIError(false); + body.classList.remove("overflow-hidden"); + } + + /** + * Switch API providers. + * + * @param {string} newProvider The provider to switch to. + * @since 4.5 + */ + function switchProvider(_x3) { + return _switchProvider.apply(this, arguments); + } + /** + * Get autocomplete search suggestions. + * + * @param {string} term The search term. + * @return {Array} The autocomplete suggestions. + */ + function _switchProvider() { + _switchProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(newProvider) { + var response, status, headers; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!(activeProvider === newProvider)) { + _context4.next = 2; + break; + } + return _context4.abrupt("return"); + case 2: + setLoading(true); + setAPIError(false); + setShowAPILightbox(false); + body.classList.remove("overflow-hidden"); + + // API verification - check API key for provider. + if (!(_constants_API__WEBPACK_IMPORTED_MODULE_4__.API[newProvider].requires_key && !apiTested.includes(newProvider))) { + _context4.next = 27; + break; + } + _context4.prev = 7; + _context4.next = 10; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__.buildTestURL)(newProvider)); + case 10: + response = _context4.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + if (!(status !== 200)) { + _context4.next = 18; + break; + } + // Catch API errors and 401s. + setShowAPILightbox(newProvider); // Show API Lightbox. + setAPIError(true); + body.classList.add("overflow-hidden"); + return _context4.abrupt("return"); + case 18: + if (status === 200) { + // Valid API key - Add to array of tested providers. + setAPITested(function (prevState) { + return [].concat(_toConsumableArray(prevState), [newProvider]); + }); + } + _context4.next = 27; + break; + case 21: + _context4.prev = 21; + _context4.t0 = _context4["catch"](7); + // Catch all other errors. + setShowAPILightbox(newProvider); // Show API Lightbox. + body.classList.add("overflow-hidden"); + setAPIError(true); + return _context4.abrupt("return"); + case 27: + // Add slight delay for loading effect. + setTimeout(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[newProvider].filters); // Update filter options. + setActiveProvider(newProvider); // Switch the provider. + }, delay); + case 28: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[7, 21]]); + })); + return _switchProvider.apply(this, arguments); + } + function getSuggestions(_x4) { + return _getSuggestions.apply(this, arguments); + } + /** + * Renders the Masonry layout. + * + * @since 3.0 + */ + function _getSuggestions() { + _getSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(term) { + var api_url; + return _regeneratorRuntime().wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (!(!term || (term === null || term === void 0 ? void 0 : term.length) < 3)) { + _context5.next = 2; + break; + } + return _context5.abrupt("return"); + case 2: + // API endpoint URL. + api_url = instant_img_localize.root + "instant-images-extended/suggestions/?term=".concat(term); // Get suggestions. + _context5.next = 5; + return axios__WEBPACK_IMPORTED_MODULE_27__["default"].get(api_url).then(function (res) { + setSuggestions(res.data); + })["catch"](function (error) { + console.warn(error); + }); + case 5: + case "end": + return _context5.stop(); + } + }, _callee5); + })); + return _getSuggestions.apply(this, arguments); + } + function renderLayout() { + imagesLoaded(photosRef.current, function () { + if (!isBlockEditor) { + msnryRef.current = new (masonry_layout__WEBPACK_IMPORTED_MODULE_2___default())(photosRef.current, { + itemSelector: ".photo" + }); + photosRef.current.querySelectorAll(".photo").forEach(function (el) { + el.classList.add("in-view"); + }); + } + setTimeout(function () { + // Delay to allow for rendering and set up. + setLoading(false); + setLoadingMore(false); + if (!mounted) { + setMounted(true); + } + }, delay); + }); + } + + /** + * Reset the scroll position for the WP block only. + */ + function resetScrollPosition() { + if (wpBlock && photosRef !== null && photosRef !== void 0 && photosRef.current) { + photosRef === null || photosRef === void 0 ? void 0 : photosRef.current.scroll({ + top: 0, + left: 0, + behavior: "smooth" + }); + } + } + + /** + * A checker to determine if there are remaining search results. + * + * @param {number} num Total search results. + * @since 3.0 + */ + function checkResults(num) { + setDone(parseInt(num) === 0 || num === undefined); + } + + /** + * Escape handler to close edit windows on photos. + * + * @param {Event} e The key event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + var editing = photosRef.current.querySelectorAll(".edit-screen.editing"); + if (editing) { + _toConsumableArray(editing).forEach(function (element) { + element === null || element === void 0 ? void 0 : element.classList.remove("editing"); + }); + } + } + } + + /* Search callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (!(search !== null && search !== void 0 && search.active)) { + // Reset search filters when search is false. + setSearchFilters({}); + } + }, [search]); // eslint-disable-line react-hooks/exhaustive-deps + + /* Search filters change callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted && search !== null && search !== void 0 && search.active) { + doSearch(search === null || search === void 0 ? void 0 : search.term); + } + }, [searchFilters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Filters change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted) { + getPhotos(); + } + }, [filters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Provider change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters); + setFilters({}); // Trigger filter change. + }, [activeProvider]); // eslint-disable-line react-hooks/exhaustive-deps + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Infinite scrolling. + loadMorePhotos(); + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + // Results callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + renderLayout(); + }, [results]); // eslint-disable-line react-hooks/exhaustive-deps + + // Initial page load. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setLoading(false); + wrapper.classList.add("loaded"); + + // Block editor, get initial set of photos. + if (isBlockEditor) { + getPhotos(); + } + // Add global escape listener. + document.addEventListener("keydown", escFunction, false); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.PluginProvider, { + value: { + provider: activeProvider, + wpBlock: wpBlock, + mediaModal: mediaModal, + blockSidebar: blockSidebar, + clientId: clientId, + search: search, + apiError: apiError, + getPhotos: getPhotos, + searchHandler: searchHandler, + filterSearch: filterSearch, + suggestions: suggestions, + getSuggestions: getSuggestions + } + }, wpBlock ? /*#__PURE__*/React.createElement(_editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], { + switchProvider: switchProvider + }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_ProviderNav__WEBPACK_IMPORTED_MODULE_18__["default"], { + switchProvider: switchProvider + }), /*#__PURE__*/React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_23__.ExtendedCTA, null)), /*#__PURE__*/React.createElement(_RestAPIError__WEBPACK_IMPORTED_MODULE_19__["default"], null), /*#__PURE__*/React.createElement("div", { + className: "control-nav" + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--filters-wrap", apiError || search !== null && search !== void 0 && search.active ? "inactive" : null) + }, filterOptions && (_Object$entries = Object.entries(filterOptions)) !== null && _Object$entries !== void 0 && _Object$entries.length ? /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filterOptions).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_15__["default"], { + key: "".concat(activeProvider, "-").concat(index, "-").concat(key), + data: filter, + filterKey: key, + handler: filterPhotos + }); + })) : null), /*#__PURE__*/React.createElement(_search_SearchForm__WEBPACK_IMPORTED_MODULE_24__["default"], { + ref: searchInputRef + })), /*#__PURE__*/React.createElement("div", { + id: "photo-listing", + className: loading ? "loading" : null + }, /*#__PURE__*/React.createElement(_search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__["default"], null), wpBlock ? /*#__PURE__*/React.createElement(_ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__["default"], { + ref: photosRef, + data: results, + done: done, + loadMorePhotos: loadMorePhotos + }) : /*#__PURE__*/React.createElement(_Results__WEBPACK_IMPORTED_MODULE_20__["default"], { + ref: photosRef, + data: results + }), /*#__PURE__*/React.createElement(_NoResults__WEBPACK_IMPORTED_MODULE_17__["default"], { + total: search === null || search === void 0 ? void 0 : search.results, + is_search: search === null || search === void 0 ? void 0 : search.active + }), /*#__PURE__*/React.createElement(_LoadMore__WEBPACK_IMPORTED_MODULE_16__["default"], { + ref: loadMoreRef, + loadMorePhotos: loadMorePhotos, + loading: loadingMore, + done: done + }), /*#__PURE__*/React.createElement(_APILightbox__WEBPACK_IMPORTED_MODULE_13__["default"], { + provider: showAPILightbox, + callback: closeAPILightbox + }), /*#__PURE__*/React.createElement(_ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__["default"], null), /*#__PURE__*/React.createElement(_Tooltip__WEBPACK_IMPORTED_MODULE_22__["default"], null)))); +} + +/***/ }), + +/***/ "./src/js/components/LoadMore.js": +/*!***************************************!*\ + !*** ./src/js/components/LoadMore.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); + + + + +/** + * Render the LoadMore component. + * + * @return {JSX.Element} The LoadMore component. + */ +var LoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var loadMorePhotos = props.loadMorePhotos, + loading = props.loading, + done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("load-more-wrap", loading ? "loading" : null, done ? "done" : null), + ref: ref + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button", + onClick: function onClick() { + return loadMorePhotos(); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Load More Images", "instant-images"))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMore); + +/***/ }), + +/***/ "./src/js/components/NoResults.js": +/*!****************************************!*\ + !*** ./src/js/components/NoResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ NoResults) +/* harmony export */ }); +/** + * Render the NoResults component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The NoResults component. + */ +function NoResults(props) { + var _props$total = props.total, + total = _props$total === void 0 ? 0 : _props$total, + _props$is_search = props.is_search, + is_search = _props$is_search === void 0 ? false : _props$is_search; + if (!is_search || is_search && total >= 1) { + // Bail if not search or search total is greater than 1. + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-no-results" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, instant_img_localize.no_results, " "), /*#__PURE__*/React.createElement("p", null, instant_img_localize.no_results_desc, " "))); +} + +/***/ }), + +/***/ "./src/js/components/Photo.js": +/*!************************************!*\ + !*** ./src/js/components/Photo.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Photo) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/utils/insertImage */ "./src/js/editor/utils/insertImage.js"); +/* harmony import */ var _editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editor/utils/setFeaturedImage */ "./src/js/editor/utils/setFeaturedImage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../functions/providers/unsplash */ "./src/js/functions/providers/unsplash.js"); +/* harmony import */ var _functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/generateAttribution */ "./src/js/functions/generateAttribution.js"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + +/** + * Render the Photo component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Photo component. + */ +function Photo(props) { + var result = props.result, + setInactive = props.setInactive; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB, + _usePluginContext$med = _usePluginContext.mediaModal, + mediaModal = _usePluginContext$med === void 0 ? false : _usePluginContext$med, + _usePluginContext$blo = _usePluginContext.blockSidebar, + blockSidebar = _usePluginContext$blo === void 0 ? false : _usePluginContext$blo, + clientId = _usePluginContext.clientId; + var id = result.id, + filename = result.id, + permalink = result.permalink, + title = result.title, + alt = result.alt, + caption = result.caption, + attribution = result.attribution, + _result$extension = result.extension, + extension = _result$extension === void 0 ? "jpg" : _result$extension, + likes = result.likes, + dimensions = result.dimensions, + urls = result.urls, + user = result.user; + + // Deconstruct image URLs. + var thumb = urls.thumb, + full = urls.full, + download_url = urls.download_url; + + // Deconstruct user data. + var user_name = user.name, + user_photo = user.photo, + user_url = user.url; + var container = document.querySelector(".instant-img-container"); + var likeDisplay = parseInt(likes) === 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Like", "instant-images") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Likes", "instant-images"); + var _instant_img_localize = instant_img_localize, + _instant_img_localize2 = _instant_img_localize.attribution_hook, + attribution_hook = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.auto_attribution, + auto_attribution = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + + // Get the attribution text. + var imageAttribution = attribution_hook ? (0,_functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__["default"])(attribution_hook, provider, permalink, user) : attribution; + var imageCaption = auto_attribution === "1" ? imageAttribution : caption; + + // Photo state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }), + _useState2 = _slicedToArray(_useState, 2), + imageDetails = _useState2[0], + setImageDetails = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + inProgress = _useState4[0], + setInProgress = _useState4[1]; // inProgress state. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("loaded"), + _useState6 = _slicedToArray(_useState5, 2), + status = _useState6[0], + setStatus = _useState6[1]; // Status state. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState8 = _slicedToArray(_useState7, 2), + editURL = _useState8[0], + setEditURL = _useState8[1]; // Edit URL state. + + // Refs. + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var upload = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var editScreen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var captionRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // Gutenberg. + var setAsFeaturedImage = false; + var insertIntoPost = false; + + /** + * Function to trigger the image download. + * + * @since 4.3 + */ + function download() { + if (inProgress || status === "success" || status === "uploaded") { + return false; // Exit if uploading, uploaded or success. + } + + var target = upload === null || upload === void 0 ? void 0 : upload.current; + setInProgress(true); + setStatus("uploading"); + if (wpBlock) { + setInactive(true); // Make Instant Images inactive after selecting an image. + } + + // API URL + var api = instant_img_localize.root + "instant-images/download/"; + + // Data Params + var data = { + provider: provider, + id: target.getAttribute("data-id"), + image_url: target.getAttribute("data-url"), + filename: target.getAttribute("data-id"), + extension: extension, + custom_filename: target.getAttribute("data-filename"), + title: target.getAttribute("data-title"), + alt: target.getAttribute("data-alt"), + caption: target.getAttribute("data-caption"), + parent_id: instant_img_localize.parent_id, + lang: instant_img_localize.lang + }; + + // Config Params + var config = { + credentials: "same-origin", + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_9__["default"].post(api, JSON.stringify(data), config).then(function (res) { + var response = res.data; + if (response) { + // Successful response from server + var success = response.success; + var attachment = response.attachment; + var admin_url = response.admin_url; + var msg = response.msg; + if (success) { + var edit_url = "".concat(admin_url, "post.php?post=").concat(attachment.id, "&action=edit"); // Edit URL. + setEditURL(edit_url); + uploadComplete(target, msg, attachment.id); // Success/Upload Complete + + // Trigger a download at Unsplash. + if (provider === "unsplash" && download_url) { + (0,_functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__.unsplashDownload)(download_url); + } + + /** + * Gutenberg options. + */ + + // Set Featured Image via Sidebar. + if (blockSidebar && setAsFeaturedImage) { + (0,_editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__["default"])(attachment); + setAsFeaturedImage = false; + closeMediaModal(); + } + + // Insert Image via Sidebar. + if (blockSidebar && insertIntoPost) { + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment); + }, 250); + closeMediaModal(); + insertIntoPost = false; + } + + // Insert Image via WP Block. + if (wpBlock && clientId) { + setStatus("uploaded"); + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment, clientId); + }, 350); + closeMediaModal(); + insertIntoPost = false; + } + + /** + * Media Modal. + * If is media popup, redirect user to media-upload settings. + */ + if (container.dataset.mediaPopup === "true" && !blockSidebar) { + window.location = "media-upload.php?type=image&tab=library&attachment_id=" + attachment.id; + } + } else { + // Error + uploadError(target, msg); + } + } else { + // Error + uploadError(target, instant_img_localize.error_upload); + } + })["catch"](function (error) { + console.warn(error); + }); + } + + /** + * Upload complete function. + * + * @param {Element} target Clicked item. + * @param {string} msg Success Msg. + * @param {string} imageID Attachment id. + * @since 3.0 + */ + function uploadComplete(target, msg, imageID) { + if (!(photo !== null && photo !== void 0 && photo.current)) { + return; + } + setImageTitle(target, msg); + setStatus("uploaded"); + setInProgress(false); + + // Remove uploaded status after 3.5 seconds. + setTimeout(function () { + setStatus("success"); + }, 3500); + + // Refresh Media Router/Modal. + refreshMediaModal(imageID); + } + + /** + * Handler to send user to edit photo link after upload. + * + * @since 5.2.0 + */ + function editAfterUpload() { + if (editURL) { + window.location = editURL; + } + } + + /** + * Function used to trigger a download and then set as featured image + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function setFeaturedImageClick(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + setAsFeaturedImage = true; + upload.current.click(); + } + } + + /** + * Function used to insert an image directly into the block (Gutenberg) editor. + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function insertImageIntoPost(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + insertIntoPost = true; + upload.current.click(); + } + } + + /** + * Refresh Media Modal and select item after it's been uploaded. + * + * @param {string} modalID The media modal ID. + * @since 4.3 + */ + function refreshMediaModal(modalID) { + if (mediaModal && wp.media && wp.media.frame && wp.media.frame.el) { + var mediaModalEl = wp.media.frame.el; + var mediaTab = mediaModalEl.querySelector("#menu-item-browse"); + if (mediaTab) { + // Open the 'Media Library' tab. + mediaTab.click(); + } + + // Delay to allow for tab switching + setTimeout(function () { + if (wp.media.frame.content.get() !== null) { + // Force a refresh of the mdeia modal content. + wp.media.frame.content.get().collection._requery(true); + } + + // Select the attached that was just uploaded. + var selection = wp.media.frame.state().get("selection"); + var selected = parseInt(modalID); + selection.reset(selected ? [wp.media.attachment(selected)] : []); + }, 100); + } + } + + /** + * Function runs when error occurs on upload or resize. + * + * @param {Element} target Current clicked item. + * @param {string} msg Error Msg. + * @since 3.0 + */ + function uploadError(target, msg) { + setImageTitle(target, msg); + setInProgress(false); + setStatus("error"); + setInactive(false); + console.warn(msg); + } + + /** + * Set the title attribute of target. + * + * @param {Element} target Clicked element. + * @param {string} msg Title message from JSON. + * @since 3.0 + */ + function setImageTitle(target, msg) { + target.setAttribute("title", msg); // Remove 'Click to upload...', set new value + } + + /** + * Displays the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function showEditScreen(e) { + e.preventDefault(); + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + + // Get all open edit screens and close them. + var openEdits = document.querySelectorAll(".edit-screen.editing"); + if (openEdits) { + openEdits.forEach(function (edit) { + edit.classList.remove("editing"); + }); + } + + // Show edit screen + editScreen.current.classList.add("editing"); + + // Set focus on edit screen + setTimeout(function () { + editScreen.current.focus({ + preventScroll: true + }); + }, 150); + } + + /** + * Handles the change event for the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function handleEditChange(e) { + var target = e.target.name; + switch (target) { + case "filename": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + filename: e.target.value + })); + break; + case "title": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + title: e.target.value + })); + break; + case "alt": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + alt: e.target.value + })); + break; + case "caption": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: e.target.value + })); + break; + } + } + + /** + * Handles the Upload event from the edit screen. + * + * @since 3.2 + */ + function uploadNow() { + editScreen.current.classList.remove("editing"); // Hide edit screen. + upload.current.click(); // Trigger click. + } + + /** + * Cancel event for the edit screen. + * + * @since 3.2 + */ + function cancelEdit() { + // Reset image state. + setImageDetails({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }); + + // Hide edit screen + editScreen.current.classList.remove("editing"); + + // Set focus back on photo. + upload.current.focus({ + preventScrol: true + }); + } + + /** + * Close the media modal after an action. + * + * @since 4.3 + */ + function closeMediaModal() { + var mediaModalEl = document.querySelector(".media-modal"); + if (mediaModalEl) { + var closeBtn = mediaModalEl.querySelector("button.media-modal-close"); + if (!closeBtn) { + return false; + } + closeBtn.click(); + } + } + + /** + * Handles adding attribution for images. + * + * @param {Element} e The target element. + * @since 4.5 + */ + function addAttribution(e) { + e.preventDefault(); + captionRef.current.value = imageAttribution; // Set form value. + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: imageAttribution + })); // Set caption state. + } + + return /*#__PURE__*/React.createElement("article", { + className: "photo", + ref: photo + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("photo-wrap", "photo-".concat(status)) + }, /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("button", { + className: "photo-upload", + ref: upload, + "data-id": id, + "data-url": full, + "data-filename": imageDetails.filename, + "data-title": imageDetails.title, + "data-alt": imageDetails.alt, + "data-caption": imageDetails.caption, + title: wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload, + onClick: function onClick() { + return download(); + } + }, /*#__PURE__*/React.createElement("img", { + src: thumb, + alt: alt, + className: status + })), /*#__PURE__*/React.createElement("div", { + className: "photo-controls" + }, /*#__PURE__*/React.createElement("a", { + target: "_blank", + className: "user fade", + href: user_url, + rel: "noopener noreferrer", + title: "".concat(instant_img_localize.view_all, " @ ").concat(user_name) + }, /*#__PURE__*/React.createElement("div", { + className: "user-wrap" + }, (user_photo === null || user_photo === void 0 ? void 0 : user_photo.length) > 0 && /*#__PURE__*/React.createElement("img", { + className: "user-wrap--photo", + src: user_photo, + alt: "" + }), user_name)), /*#__PURE__*/React.createElement("div", { + className: "photo-options" + }, blockSidebar && !editURL ? /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "set-featured fade", + "data-title": instant_img_localize.set_as_featured, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return setFeaturedImageClick(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-picture-o", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.set_as_featured)), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post))) : null, !!wpBlock && /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post)), editURL ? /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return editAfterUpload(); + }, + className: "edit-photo-admin fade", + "data-title": instant_img_localize.edit_upload, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-pencil", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_upload)) : /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return showEditScreen(e); + }, + className: "edit-photo fade", + "data-title": instant_img_localize.edit_details, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-cog", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_details)))), /*#__PURE__*/React.createElement("div", { + className: "photo-meta" + }, likes ? /*#__PURE__*/React.createElement("span", { + className: "likes tooltip--above", + "data-title": likes + " " + likeDisplay, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-heart heart-like", + "aria-hidden": "true" + }), " ", likes) : null, /*#__PURE__*/React.createElement("a", { + className: "tooltip--above", + href: permalink, + "data-title": "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)), + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + rel: "noopener noreferrer", + target: "_blank" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-external-link", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)))))), /*#__PURE__*/React.createElement("div", { + className: "edit-screen", + tabIndex: "0", + ref: editScreen + }, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--title" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", { + className: "heading" + }, instant_img_localize.edit_details), dimensions && dimensions.length > 0 && /*#__PURE__*/React.createElement("p", { + className: "dimensions" + }, dimensions)), /*#__PURE__*/React.createElement("div", { + className: "preview", + style: { + backgroundImage: "url(".concat(thumb, ")") + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_filename, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "filename", + "data-original": filename, + placeholder: imageDetails.filename, + value: imageDetails.filename, + onChange: function onChange(e) { + return handleEditChange(e); + } + }), /*#__PURE__*/React.createElement("em", null, ".", extension)), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_title, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "title", + "data-original": title, + placeholder: title, + value: imageDetails.title || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_alt, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "alt", + "data-original": alt, + value: imageDetails.alt || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_caption, ":"), /*#__PURE__*/React.createElement("textarea", { + rows: "4", + name: "caption", + "data-original": imageCaption, + onChange: function onChange(e) { + return handleEditChange(e); + }, + value: imageDetails.caption || "", + ref: captionRef + })), imageAttribution ? /*#__PURE__*/React.createElement("div", { + className: "add-attribution-row" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return addAttribution(e); + }, + type: "button" + }, instant_img_localize.attribution)) : null, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--controls" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick(e) { + return cancelEdit(e); + } + }, instant_img_localize.cancel), " ", "\xA0", /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-primary", + onClick: function onClick() { + return uploadNow(); + } + }, wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload_now))), /*#__PURE__*/React.createElement("div", { + className: "photo-status" + }))); +} + +/***/ }), + +/***/ "./src/js/components/ProviderIcons.js": +/*!********************************************!*\ + !*** ./src/js/components/ProviderIcons.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OpenverseIcon": () => (/* binding */ OpenverseIcon), +/* harmony export */ "PexelsIcon": () => (/* binding */ PexelsIcon), +/* harmony export */ "PixabayIcon": () => (/* binding */ PixabayIcon), +/* harmony export */ "UnsplashIcon": () => (/* binding */ UnsplashIcon), +/* harmony export */ "getProviderIcon": () => (/* binding */ getProviderIcon) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Return the provider icon. + * + * @param {string} provider The provider. + * @return {JSX.Element} The provider icon. + */ +function getProviderIcon(provider) { + if (!provider) { + return null; + } + return _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon ? _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon() : null; +} + +/** + * Unsplash Icon. + */ +function UnsplashIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z", + fill: "black" + })); +} + +/** + * Pixabay Icon. + */ +function PixabayIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("g", { + clipPath: "url(#clip0_307_143)" + }, /*#__PURE__*/React.createElement("path", { + d: "M0 0V32H32V0H0Z", + fill: "#48A947" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z", + fill: "#F9FBF9" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z", + fill: "#FAFCFA" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z", + fill: "#4AA949" + })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { + id: "clip0_307_143" + }, /*#__PURE__*/React.createElement("rect", { + width: "32", + height: "32", + fill: "white" + })))); +} + +/** + * Openverse Icon. + */ +function OpenverseIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z", + fill: "#000000" + })); +} + +/** + * Pexels Icon. + */ +function PexelsIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32px", + height: "32px", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z", + fill: "#05A081" + }), /*#__PURE__*/React.createElement("path", { + d: "M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z", + fill: "#fff" + })); +} + +/***/ }), + +/***/ "./src/js/components/ProviderNav.js": +/*!******************************************!*\ + !*** ./src/js/components/ProviderNav.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ProviderNav) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the ProviderNav component. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The ProviderNav component. + */ +function ProviderNav(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !!(providers !== null && providers !== void 0 && providers.length) && /*#__PURE__*/React.createElement("nav", { + className: "provider-nav" + }, providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("div", { + key: "provider-".concat(index) + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return switchProvider(item.toLowerCase()); + }, + className: provider === item.toLowerCase() ? "provider-nav--btn active" : "provider-nav--btn" + }, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_3__.getProviderIcon)(item), /*#__PURE__*/React.createElement("span", null, item), _constants_API__WEBPACK_IMPORTED_MODULE_2__.API[item.toLowerCase()]["new"] && /*#__PURE__*/React.createElement("span", { + className: "provider-nav--new" + }, instant_img_localize["new"]))); + }))); +} + +/***/ }), + +/***/ "./src/js/components/RestAPIError.js": +/*!*******************************************!*\ + !*** ./src/js/components/RestAPIError.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ RestAPIError) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + +/** + * Render the RestAPIError component. + * + * @return {JSX.Element} The RestAPIError component. + */ +function RestAPIError() { + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState2 = _slicedToArray(_useState, 2), + access = _useState2[0], + setAccess = _useState2[1]; + + /** + * Test users access to the REST API endpoint. + * + * @since 3.2 + */ + function test() { + var testURL = instant_img_localize.root + "instant-images/test/"; + var restAPITest = new XMLHttpRequest(); + restAPITest.open("POST", testURL, true); + restAPITest.setRequestHeader("X-WP-Nonce", instant_img_localize.nonce); + restAPITest.setRequestHeader("Content-Type", "application/json"); + restAPITest.send(); + restAPITest.onload = function () { + if (restAPITest.status >= 200 && restAPITest.status < 400) { + var response = JSON.parse(restAPITest.response); + var success = response.success; + if (!success) { + setAccess(false); + } + } else { + setAccess(false); + } + }; + restAPITest.onerror = function (errorMsg) { + console.warn(errorMsg); + setAccess(false); + }; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + test(); + }, []); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !access ? /*#__PURE__*/React.createElement("div", { + className: "error-messaging" + }, /*#__PURE__*/React.createElement("strong", null, instant_img_localize.error_restapi), instant_img_localize.error_restapi_desc) : null); +} + +/***/ }), + +/***/ "./src/js/components/Results.js": +/*!**************************************!*\ + !*** ./src/js/components/Results.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var Results = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + return /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_2__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_1__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Results); + +/***/ }), + +/***/ "./src/js/components/ResultsWPBlock.js": +/*!*********************************************!*\ + !*** ./src/js/components/ResultsWPBlock.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editor/block/components/Instructions */ "./src/js/editor/block/components/Instructions.js"); +/* harmony import */ var _editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/block/components/LoadMore */ "./src/js/editor/block/components/LoadMore.js"); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var ResultsWPBlock = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data, + _props$done = props.done, + done = _props$done === void 0 ? false : _props$done, + loadMorePhotos = props.loadMorePhotos; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (wpBlock) { + loadMorePhotos(); + } + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_5__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_4__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + }), /*#__PURE__*/React.createElement(_editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__["default"], { + done: done, + ref: loadMoreRef + })), /*#__PURE__*/React.createElement(_editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__["default"], { + show: data === null || data === void 0 ? void 0 : data.length + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResultsWPBlock); + +/***/ }), + +/***/ "./src/js/components/Sponsor.js": +/*!**************************************!*\ + !*** ./src/js/components/Sponsor.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Sponsor) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render the Sponsor component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Sponsor component. + */ +function Sponsor(props) { + var result = props.result; + var _result$data = result.data, + data = _result$data === void 0 ? null : _result$data; + var url = (data === null || data === void 0 ? void 0 : data.url) || ""; + var title = (data === null || data === void 0 ? void 0 : data.title) || ""; + var desc = (data === null || data === void 0 ? void 0 : data.description) || ""; + var avatar = (data === null || data === void 0 ? void 0 : data.avatar) || ""; + var _data$image = data.image, + image = _data$image === void 0 ? null : _data$image; + var _image$src = image.src, + src = _image$src === void 0 ? null : _image$src, + _image$alt = image.alt, + alt = _image$alt === void 0 ? null : _image$alt; + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var link = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, image && url ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("article", { + className: "photo feature", + title: desc, + ref: photo, + onClick: function onClick() { + return link.current.click(); + } + }, /*#__PURE__*/React.createElement("div", { + className: "photo--wrap" + }, /*#__PURE__*/React.createElement("span", { + className: "flag", + title: instant_img_localize.advertisement + }, instant_img_localize.ad), /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("a", { + className: "loaded", + href: url, + target: "_blank", + ref: link, + rel: "noreferrer" + }, /*#__PURE__*/React.createElement("img", { + src: src, + alt: alt + }))), /*#__PURE__*/React.createElement("div", { + className: "feature-title" + }, avatar && /*#__PURE__*/React.createElement("img", { + src: avatar, + alt: title + }), /*#__PURE__*/React.createElement("span", null, title)))) : null); +} + +/***/ }), + +/***/ "./src/js/components/Tooltip.js": +/*!**************************************!*\ + !*** ./src/js/components/Tooltip.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Tooltip) +/* harmony export */ }); +/** + * Render the Tooltip component. + * + * @return {JSX.Element} The Tooltip component. + */ +function Tooltip() { + return /*#__PURE__*/React.createElement("div", { + id: "tooltip" + }); +} + +/***/ }), + +/***/ "./src/js/components/cta/Extended.js": +/*!*******************************************!*\ + !*** ./src/js/components/cta/Extended.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ExtendedCTA": () => (/* binding */ ExtendedCTA), +/* harmony export */ "ExtendedSearchCTA": () => (/* binding */ ExtendedSearchCTA) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/* eslint-disable */ + +/** + * Generic CTA for the Extended add-on. + * + * @return {JSX.Element} The ExtendedCTA component. + */ +function ExtendedCTA() { + var _instant_img_localize3, _instant_img_localize4; + var _instant_img_localize = (_instant_img_localize3 = instant_img_localize) === null || _instant_img_localize3 === void 0 ? void 0 : (_instant_img_localize4 = _instant_img_localize3.addons) === null || _instant_img_localize4 === void 0 ? void 0 : _instant_img_localize4.extended, + _instant_img_localize2 = _instant_img_localize.activated, + activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2; + var name = "extended-cta-2024"; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) === "hide"), + _useState2 = _slicedToArray(_useState, 2), + dissmissed = _useState2[0], + setDismissed = _useState2[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setDismissed(true); + } + return /*#__PURE__*/React.createElement(React.Fragment, null, !activated && !dissmissed ? /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--standard" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-bullhorn", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, "Introducing the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), " ", "\u2192 An extension pack of premium features and functionality to enhance the Instant Images plugin."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")))) : null); +} + +/** + * CTA for the Extended add-on in the search dropdown. + * + * @param {Object} props The component props. + * @param {boolean} props.show Display the component. + * @return {JSX.Element} The ExtendedSearchCTA component. + */ +function ExtendedSearchCTA(_ref) { + var _ref$show = _ref.show, + show = _ref$show === void 0 ? false : _ref$show; + var name = "extended-cta-search-2024"; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) !== "hide"), + _useState4 = _slicedToArray(_useState3, 2), + active = _useState4[0], + setActive = _useState4[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setActive(false); + } + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history extended-cta", show && active ? "active" : null) + }, /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--search" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "closeBtn", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", { + className: "fa fa-magic", + "aria-hidden": "true" + }), "Enable search suggestions, history, and maintain current search term while switching providers with the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")))))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchForm.js": +/*!************************************************!*\ + !*** ./src/js/components/search/SearchForm.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useClickOutside */ "./src/js/hooks/useClickOutside.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _SearchHistory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SearchHistory */ "./src/js/components/search/SearchHistory.js"); +/* harmony import */ var _SearchToolTip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SearchToolTip */ "./src/js/components/search/SearchToolTip.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } + + + + + + + + + +/** + * Render the search form as a component. + * + * @return {JSX.Element} The SearchForm component. + */ +var SearchForm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) { + var _instant_img_localize4, _instant_img_localize5; + _objectDestructuringEmpty(_ref); + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + searchHandler = _usePluginContext.searchHandler, + apiError = _usePluginContext.apiError, + suggestions = _usePluginContext.suggestions, + getSuggestions = _usePluginContext.getSuggestions; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState2 = _slicedToArray(_useState, 2), + history = _useState2[0], + setHistory = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + show = _useState4[0], + setShow = _useState4[1]; + var historyRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + var submitBtnRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Handle clickoutside hook. + (0,_hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__.useClickOutside)(historyRef, function () { + setShow(false); + }); + + /** + * Set the search value in the form. + * + * @param {string} value The value to set. + */ + function setSearchValue(value) { + var input = ref === null || ref === void 0 ? void 0 : ref.current; + input.value = value; + submitBtnRef === null || submitBtnRef === void 0 ? void 0 : submitBtnRef.current.click(); + + // Set focus on input. + input.focus(); + } + + /** + * Search submit handler. + * + * @param {Event} e The event object. + */ + function formSubmit(e) { + var _ref$current; + e.preventDefault(); + var term = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.value; + if (term) { + searchHandler(e); + if (extended_license) { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSearchHistory)(term); + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + } + } + } + + /** + * Should the history div be shown? + * + * @return {boolean} Show history. + */ + function showHistory() { + return (history === null || history === void 0 ? void 0 : history.length) || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + }, []); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--search", apiError ? "inactive" : null) + }, /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return formSubmit(e); + }, + autoComplete: "off" + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "search-input", + className: "offscreen" + }, instant_img_localize.search_label), /*#__PURE__*/React.createElement("div", { + ref: historyRef + }, /*#__PURE__*/React.createElement("input", { + ref: ref, + type: "text", + id: "search-input", + placeholder: instant_img_localize.search, + disabled: apiError, + onChange: function onChange(e) { + return extended_license && getSuggestions(e.target.value); + }, + onFocus: function onFocus() { + return setShow(true); + } + }), extended_license && showHistory() ? + /*#__PURE__*/ + /* Extended: Show only with valid add-on license */ + React.createElement(_SearchHistory__WEBPACK_IMPORTED_MODULE_6__["default"], { + show: show, + history: history, + setHistory: setHistory, + setSearchValue: setSearchValue, + container: historyRef + }) : null, !extended_activated && + /*#__PURE__*/ + /* Extended: Show only when add-on not installed. */ + React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_5__.ExtendedSearchCTA, { + show: show + })), /*#__PURE__*/React.createElement("button", { + type: "submit", + disabled: apiError, + ref: submitBtnRef + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-search" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.search)), /*#__PURE__*/React.createElement(_SearchToolTip__WEBPACK_IMPORTED_MODULE_7__["default"], { + show: show + }))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchForm); + +/***/ }), + +/***/ "./src/js/components/search/SearchHeader.js": +/*!**************************************************!*\ + !*** ./src/js/components/search/SearchHeader.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHeader) +/* harmony export */ }); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the SearchHeader component. + * + * @return {JSX.Element} The SearchHeader component. + */ +function SearchHeader() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + search = _usePluginContext.search, + getPhotos = _usePluginContext.getPhotos, + filterSearch = _usePluginContext.filterSearch; + var _search$active = search.active, + active = _search$active === void 0 ? false : _search$active, + _search$term = search.term, + term = _search$term === void 0 ? "" : _search$term, + _search$results = search.results, + total = _search$results === void 0 ? 0 : _search$results; + var filters = _constants_filters__WEBPACK_IMPORTED_MODULE_0__.FILTERS[provider].search; + if (!active) { + // Exit if search is not active. + return null; + } + return /*#__PURE__*/React.createElement("header", { + className: "search-header" + }, /*#__PURE__*/React.createElement("h2", null, term.replace("id:", "ID: ")), /*#__PURE__*/React.createElement("div", { + className: "search-header--text" + }, "".concat(total, " ").concat(instant_img_localize.search_results), " ", /*#__PURE__*/React.createElement("strong", null, "".concat(term)), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getPhotos(); + } + }, instant_img_localize.clear_search)), filters && Object.entries(filters).length && /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters-wrap" + }, /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filters).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_1__["default"], { + key: "".concat(provider, "-search-").concat(key, "-").concat(index), + filterKey: key, + provider: provider, + data: filter, + handler: filterSearch + }); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchHistory.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchHistory.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHistory) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); + + + + + + + +/** + * The History list component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The SearchHistory component. + */ +function SearchHistory(props) { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.usePluginContext)(), + suggestions = _usePluginContext.suggestions; + var show = props.show, + history = props.history, + setHistory = props.setHistory, + setSearchValue = props.setSearchValue, + container = props.container; + var dropRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__.useArrowControls)(show, container); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history", show ? "active" : null), + role: "listbox", + ref: dropRef + }, !!suggestions.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Suggestions", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-suggestions" + }, suggestions.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + }))), !!history.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Recent Searches", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_4__.clearSearchHistory)(); + setHistory([]); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Clear", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-history" + }, history.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "history", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchToolTip.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchToolTip.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchToolTip) +/* harmony export */ }); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); + + + +/** + * Render the search results tooltip component. + * + * @return {JSX.Element} The SearchToolTip component. + */ +function SearchToolTip() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + getPhotos = _usePluginContext.getPhotos, + search = _usePluginContext.search; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_0___default()("control-nav--search-tooltip", search !== null && search !== void 0 && search.active ? null : "hide") + }, /*#__PURE__*/React.createElement("span", { + title: "".concat(search === null || search === void 0 ? void 0 : search.results, " ").concat(instant_img_localize.search_results, " ").concat(search === null || search === void 0 ? void 0 : search.term) + }, search === null || search === void 0 ? void 0 : search.results), /*#__PURE__*/React.createElement("button", { + type: "button", + title: instant_img_localize.clear_search, + onClick: function onClick() { + return getPhotos(true); + } + }, "x", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.clear_search))); +} + +/***/ }), + +/***/ "./src/js/constants/API.js": +/*!*********************************!*\ + !*** ./src/js/constants/API.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "API": () => (/* binding */ API) +/* harmony export */ }); +/* harmony import */ var _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ProviderIcons */ "./src/js/components/ProviderIcons.js"); + +var API = { + proxy: "https://proxy.getinstantimages.com/api/" || 0, + // eslint-disable-line + testmode: false, + defaults: { + provider: "unsplash", + order: "latest", + per_page: "20", + arr_key: "results" + }, + providers: ["Unsplash", "Openverse", "Pixabay", "Pexels"], + unsplash: { + name: "Unsplash", + requires_key: true, + "new": false, + api_var: "client_id", + collections_api: "https://api.unsplash.com/collections/", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.UnsplashIcon + }, + pixabay: { + name: "Pixabay", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PixabayIcon + }, + pexels: { + name: "Pexels", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PexelsIcon + }, + openverse: { + name: "Openverse", + requires_key: false, + "new": false, + api_var: "key", + key: "", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.OpenverseIcon + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters.js": +/*!*************************************!*\ + !*** ./src/js/constants/filters.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "FILTERS": () => (/* binding */ FILTERS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _filters_openverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters/openverse */ "./src/js/constants/filters/openverse.js"); +/* harmony import */ var _filters_pexels__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/pexels */ "./src/js/constants/filters/pexels.js"); +/* harmony import */ var _filters_pixabay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filters/pixabay */ "./src/js/constants/filters/pixabay.js"); +/* harmony import */ var _filters_unsplash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filters/unsplash */ "./src/js/constants/filters/unsplash.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + + + + +var ALL = { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("All", "instant-images"), + value: "all" +}; +var FILTERS = { + openverse: { + filters: { + source: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Source", "instant-images"), + "default": "wordpress", + filters: _toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_SOURCES) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + } + }, + search: { + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photograph", "instant-images"), + value: "photograph" + }] + }, + extension: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Extension", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_EXTENSIONS)) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + }, + license: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("License", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_LICENSES)) + }, + license_type: { + label: "license_type", + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Commercial", "instant-images"), + value: "commercial" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Modification", "instant-images"), + value: "modification" + }] + } + } + }, + pexels: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "curated", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Curated", "instant-images"), + value: "curated" + }] + } + }, + search: { + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_COLORS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + } + } + }, + unsplash: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "latest", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Oldest", "instant-images"), + value: "oldest" + }] + } + }, + search: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "relevance", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Relevance", "instant-images"), + value: "relevance" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_COLORS)) + } + } + }, + pixabay: { + filters: { + order: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "popular", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Category", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_CATS)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + }, + search: { + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + } + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters/openverse.js": +/*!***********************************************!*\ + !*** ./src/js/constants/filters/openverse.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OPENVERSE_EXTENSIONS": () => (/* binding */ OPENVERSE_EXTENSIONS), +/* harmony export */ "OPENVERSE_LICENSES": () => (/* binding */ OPENVERSE_LICENSES), +/* harmony export */ "OPENVERSE_ORIENTATIONS": () => (/* binding */ OPENVERSE_ORIENTATIONS), +/* harmony export */ "OPENVERSE_SOURCES": () => (/* binding */ OPENVERSE_SOURCES) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var OPENVERSE_SOURCES = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("WordPress", "instant-images"), + value: "wordpress" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Flickr", "instant-images"), + value: "flickr" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nasa", "instant-images"), + value: "nasa" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("SpaceX", "instant-images"), + value: "spacex" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wikimedia", "instant-images"), + value: "wikimedia" +}]; +var OPENVERSE_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "square" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Tall", "instant-images"), + value: "tall" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wide", "instant-images"), + value: "wide" +}]; +var OPENVERSE_EXTENSIONS = [{ + label: "JPG", + value: "JPG" +}, { + label: "GIF", + value: "GIF" +}, { + label: "PNG", + value: "PNG" +}, { + label: "SVG", + value: "SVG" +}]; +var OPENVERSE_LICENSES = [{ + label: "BY", + value: "BY" +}, { + label: "BY-NC", + value: "BY-NC" +}, { + label: "BY-NC-ND", + value: "BY-NC-ND" +}, { + label: "BY-NC-SA", + value: "BY-NC-SA" +}, { + label: "BY-ND", + value: "BY-ND" +}, { + label: "BY-SA", + value: "BY-SA" +}, { + label: "CC0", + value: "CC0" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pexels.js": +/*!********************************************!*\ + !*** ./src/js/constants/filters/pexels.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PEXELS_COLORS": () => (/* binding */ PEXELS_COLORS), +/* harmony export */ "PEXELS_ORIENTATIONS": () => (/* binding */ PEXELS_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PEXELS_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Violet", "instant-images"), + value: "violet" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}]; +var PEXELS_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pixabay.js": +/*!*********************************************!*\ + !*** ./src/js/constants/filters/pixabay.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PIXABAY_CATS": () => (/* binding */ PIXABAY_CATS), +/* harmony export */ "PIXABAY_COLORS": () => (/* binding */ PIXABAY_COLORS), +/* harmony export */ "PIXABAY_IMAGE_TYPE": () => (/* binding */ PIXABAY_IMAGE_TYPE), +/* harmony export */ "PIXABAY_ORIENTATIONS": () => (/* binding */ PIXABAY_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PIXABAY_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grayscale", "instant-images"), + value: "grayscale" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Lilac", "instant-images"), + value: "lilac" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transparent", "instant-images"), + value: "transparent" +}]; +var PIXABAY_CATS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Backgrounds", "instant-images"), + value: "backgrounds" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Fashion", "instant-images"), + value: "fashion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nature", "instant-images"), + value: "nature" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Science", "instant-images"), + value: "science" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Education", "instant-images"), + value: "education" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Feelings", "instant-images"), + value: "feelings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Health", "instant-images"), + value: "health" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("People", "instant-images"), + value: "people" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Religion", "instant-images"), + value: "religion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Places", "instant-images"), + value: "places" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Animals", "instant-images"), + value: "animals" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Industry", "instant-images"), + value: "industry" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Computer", "instant-images"), + value: "computer" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sports", "instant-images"), + value: "sports" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transportation", "instant-images"), + value: "transportation" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Travel", "instant-images"), + value: "travel" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Buildings", "instant-images"), + value: "buildings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Business", "instant-images"), + value: "business" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Music", "instant-images"), + value: "music" +}]; +var PIXABAY_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Horizontal", "instant-images"), + value: "horizontal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vertical", "instant-images"), + value: "vertical" +}]; +var PIXABAY_IMAGE_TYPE = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photo", "instant-images"), + value: "photo" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vector", "instant-images"), + value: "vector" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/unsplash.js": +/*!**********************************************!*\ + !*** ./src/js/constants/filters/unsplash.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "UNSPLASH_COLORS": () => (/* binding */ UNSPLASH_COLORS), +/* harmony export */ "UNSPLASH_ORIENTATIONS": () => (/* binding */ UNSPLASH_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var UNSPLASH_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black & White", "instant-images"), + value: "black_and_white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Purple", "instant-images"), + value: "purple" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Magenta", "instant-images"), + value: "magenta" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Teal", "instant-images"), + value: "teal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}]; +var UNSPLASH_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/editor/block/components/Header.js": +/*!**************************************************!*\ + !*** ./src/js/editor/block/components/Header.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockHeader) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the block header. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The BlockHeader component. + */ +function BlockHeader(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + + /** + * Switch the provider via select. + * + * @param {string} value The provider value. + */ + function providerChange(value) { + if (value) { + switchProvider(value); + } + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header" + }, /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-logo" + }, /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_3__.IconLogo, null), /*#__PURE__*/React.createElement("span", null, "Instant Images")), /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-nav" + }, /*#__PURE__*/React.createElement("label", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images")), /*#__PURE__*/React.createElement("select", { + defaultValue: provider, + onChange: function onChange(e) { + return providerChange(e.target.value); + } + }, /*#__PURE__*/React.createElement("option", { + value: "" + }, "-- ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images"), " --"), providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("option", { + key: index, + value: item.toLowerCase() + }, item); + })))); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/Instructions.js": +/*!********************************************************!*\ + !*** ./src/js/editor/block/components/Instructions.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockInstructions) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render instructional text for the WP Block. + * + * @param {Object} props The component props. + * @return {JSX.Element} The BlockInstructions component. + */ +function BlockInstructions(props) { + var _props$show = props.show, + show = _props$show === void 0 ? false : _props$show; + if (!show) { + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--instructions" + }, /*#__PURE__*/React.createElement("span", null, "\u2190"), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Scroll to Load Images", "instant-images"), /*#__PURE__*/React.createElement("span", null, "\u2192")); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/LoadMore.js": +/*!****************************************************!*\ + !*** ./src/js/editor/block/components/LoadMore.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Render the BlockLoadMore component. + * + * @return {JSX.Element} The BlockLoadMore component. + */ +var BlockLoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("instant-images-block--loader", done ? "done" : null), + ref: ref + }); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockLoadMore); + +/***/ }), + +/***/ "./src/js/editor/utils/insertImage.js": +/*!********************************************!*\ + !*** ./src/js/editor/utils/insertImage.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ insertImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Insert an image block into the block editor. + * + * @param {Object} attachment The attachment object. + * @param {string} clientId The block ID. + */ +function insertImage(attachment, clientId) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id, + _attachment$url = attachment.url, + url = _attachment$url === void 0 ? null : _attachment$url, + _attachment$caption = attachment.caption, + caption = _attachment$caption === void 0 ? "" : _attachment$caption, + _attachment$alt = attachment.alt, + alt = _attachment$alt === void 0 ? "" : _attachment$alt; + if (!url || !id) { + return; + } + + // Create block. + var block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)("core/image", { + id: id, + url: url, + caption: caption, + alt: alt + }); + if (clientId) { + // Replace the Instant Images block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").replaceBlock(clientId, block); + } else { + // Insert Image block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").insertBlocks(block); + } +} + +/***/ }), + +/***/ "./src/js/editor/utils/setFeaturedImage.js": +/*!*************************************************!*\ + !*** ./src/js/editor/utils/setFeaturedImage.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ setFeaturedImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Set image as featured image in Gutenberg. + * + * @param {Object} attachment The attachment object. + */ +function setFeaturedImage(attachment) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id; + if (!id) { + return; + } + + // Set the featured image. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/editor").editPost({ + featured_media: id + }); + + // Open the document sidebar. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/edit-post").openGeneralSidebar("edit-post/document"); +} + +/***/ }), + +/***/ "./src/js/functions/buildURL.js": +/*!**************************************!*\ + !*** ./src/js/functions/buildURL.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "buildTestURL": () => (/* binding */ buildTestURL), +/* harmony export */ "default": () => (/* binding */ buildURL), +/* harmony export */ "getProxyURL": () => (/* binding */ getProxyURL) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _providers_openverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers/openverse */ "./src/js/functions/providers/openverse.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + + + +/** + * Build the API query parameters. + * + * @param {string} type The query type (search, photos, id). + * @param {Object} params The current params object. + * @return {string} The new API URL with querystring params. + */ +function buildURL(type, params) { + if (!type) { + // Bail early if API query type is missing. + return ""; + } + // Get the current provider. + var _params = params, + _params$provider = _params.provider, + provider = _params$provider === void 0 ? "unsplash" : _params$provider; + + // Provider doesn't need to be sent. + delete params.provider; + + // Set Openverse params. + params = provider === "openverse" ? (0,_providers_openverse__WEBPACK_IMPORTED_MODULE_2__.openverseParams)(type, params) : params; + + // Build the API URL. + var url = new URL(getProxyURL(provider)); + + // Add `type` to params. + url.searchParams.append("type", type); + + // Append query params. + Object.keys(params).forEach(function (key) { + url.searchParams.append(key, params[key]); + }); + + // Add `version` to params. + url.searchParams.append("version", instant_img_localize.version); + return url === null || url === void 0 ? void 0 : url.href; +} + +/** + * Get the proxy URL from ENV vars. + * + * @param {string} provider The image provider. + * @return {string} The proxy URL. + */ +function getProxyURL(provider) { + var _API$proxy = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.proxy, + proxy = _API$proxy === void 0 ? "https://proxy.getinstantimages.com/api/" : _API$proxy; + return "".concat(proxy).concat(provider); +} + +/** + * Build a API testing URL. + * + * @param {string} provider The current service provider. + * @return {string} The API URL. + */ +function buildTestURL(provider) { + var options = { + per_page: 5, + page: 1 + }; + + // Build URL. + var params = _objectSpread(_objectSpread({ + test: true + }, (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__["default"])(provider)), options); + return buildURL("photos", params); +} + +/***/ }), + +/***/ "./src/js/functions/consoleStatus.js": +/*!*******************************************!*\ + !*** ./src/js/functions/consoleStatus.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ consoleStatus) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _getErrorMessage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getErrorMessage */ "./src/js/functions/getErrorMessage.js"); + + + +/** + * Display a console.warn message about API status. + * + * @param {string} provider The API service provider. + * @param {string} status The API status. + */ +function consoleStatus(provider) { + var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; + var local = instant_img_localize; + var message = (0,_getErrorMessage__WEBPACK_IMPORTED_MODULE_1__["default"])(status); + switch (status) { + case 400: + case 401: + case 500: + // Unsplash/Pixabay/Pexels incorrect API key + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/generateAttribution.js": +/*!*************************************************!*\ + !*** ./src/js/functions/generateAttribution.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ generateAttribution) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + +/** + * Get the API URL for searches by ID. + * + * @param {string} text Attribution hook content. + * @param {string} provider Image provider. + * @param {string} permalink Image url. + * @param {Object} user The user data. + * @return {string} The raw attribution HTML. + */ +function generateAttribution(text, provider, permalink, user) { + if (!text || !provider || !permalink || !user) { + return text; + } + + // Get user data. + var username = user.name, + user_url = user.url; + + // Format provider data. + var provider_url = instant_img_localize["".concat(provider, "_url")]; + var provider_name = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider); + + // Generate attribution template. + var attribution = text; + attribution = attribution.replace("{username}", username); + attribution = attribution.replace("{user_url}", user_url); + attribution = attribution.replace("{image_url}", permalink); + attribution = attribution.replace("{provider_url}", provider_url); + attribution = attribution.replace("{provider}", provider_name); + return attribution; +} + +/***/ }), + +/***/ "./src/js/functions/getErrorMessage.js": +/*!*********************************************!*\ + !*** ./src/js/functions/getErrorMessage.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getErrorMessage) +/* harmony export */ }); +/** + * Get the correct error message by status code. + * + * @param {string} status The API status. + */ +function getErrorMessage() { + var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200; + var local = instant_img_localize; + switch (status) { + case 400: + case 401: + // Unsplash/Pixabay/Pexels incorrect API key. + return local.api_invalid_msg; + case 403: + return local.api_invalid_403_msg; + case 404: + return local.api_invalid_404_msg; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + return local.api_ratelimit_msg; + case 500: + case 503: + // Internal server error. + return local.api_invalid_500_msg; + case 501: + // Missing params. + return local.api_invalid_501_msg; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/getProvider.js": +/*!*****************************************!*\ + !*** ./src/js/functions/getProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getProvider) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Get the default provider on page load. + * + * @return {string} The default service provider. + */ +function getProvider() { + return instant_img_localize && instant_img_localize.default_provider ? instant_img_localize.default_provider : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.provider; +} + +/***/ }), + +/***/ "./src/js/functions/getQueryParams.js": +/*!********************************************!*\ + !*** ./src/js/functions/getQueryParams.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getQueryParams), +/* harmony export */ "getAuth": () => (/* binding */ getAuth), +/* harmony export */ "getContentSafety": () => (/* binding */ getContentSafety) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + +// eslint-disable + +/** + * Build the API query parameters + * + * @param {string} provider The current service provider. + * @param {Object} queryParams Optional query parameters to append to base params. + * @return {Object} Parameters used for the fetch request. + */ +function getQueryParams(provider, queryParams) { + if (!provider) { + return {}; + } + + // Construct per page amount. + var per_page = queryParams && queryParams.id ? 1 : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.per_page; + + // Set default params. + var params = { + provider: provider, + per_page: per_page + }; + + // Append additional params. + params = getContentSafety(params, provider); + params = _objectSpread(_objectSpread({}, params), queryParams); + params = getAuth(params, provider); + + /** + * Display query params in the browser console. + * + * Global plugin hook. + */ + if (instant_img_localize.query_debug) { + console.table(params); + } + return params; +} + +/** + * Get auth keys and append to API query request. + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The auth parameter object. + */ +function getAuth(params, provider) { + var has_auth = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].requires_key; + if (!has_auth || !provider) { + return params; + } + var app_id = instant_img_localize["".concat(provider, "_app_id")]; + if (app_id) { + // Pass API keys if not using defaults. + params[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].api_var] = app_id; + } + return params; +} + +/** + * Set the photo safety for indicating that only images suitable for all ages should be returned. + * + * @see https://unsplash.com/documentation#content-safety + * @see https://pixabay.com/api/docs/ + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The fetch parameters object. + */ +function getContentSafety(params, provider) { + switch (provider) { + case "unsplash": + if (instant_img_localize.unsplash_content_filter) { + params.content_filter = instant_img_localize.unsplash_content_filter; + } + break; + case "pixabay": + if (instant_img_localize.pixabay_safesearch) { + params.safesearch = "true"; + } + break; + case "openverse": + if (instant_img_localize.openverse_mature) { + params.mature = "true"; + } + break; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/getResults.js": +/*!****************************************!*\ + !*** ./src/js/functions/getResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getResults), +/* harmony export */ "getResultById": () => (/* binding */ getResultById), +/* harmony export */ "getSearchTotal": () => (/* binding */ getSearchTotal) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Pluck `results` from the API response. + * + * @param {Object} data The API results object. + * @return {Array} The results as an array. + */ +function getResults(data) { + if (!data) { + return []; + } + var results = data[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.arr_key] || []; + return results; +} + +/** + * Get the total search results. + * + * @param {Object} data The search data object. + * @return {string} The total results. + */ +function getSearchTotal(data) { + // Return 0 if undefined or null. + return data.total === undefined || data.total === null ? 0 : data.total; +} + +/** + * Get results by photo ID. + * + * @param {string} provider The current service provider. + * @param {string} key The match key to access. + * @param {Object} data The API results object. + * @return {Array} The results as an array. + * @deprecated 5.0 + */ +function getResultById(provider, key, data) { + if (!data) { + return []; + } + var result = []; + switch (provider) { + case "unsplash": + case "pexels": + result = data || []; + break; + case "pixabay": + result = data[key] && data[key][0] ? data[key][0] : []; + break; + } + return result; +} + +/***/ }), + +/***/ "./src/js/functions/helpers.js": +/*!*************************************!*\ + !*** ./src/js/functions/helpers.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "capitalizeFirstLetter": () => (/* binding */ capitalizeFirstLetter), +/* harmony export */ "checkRateLimit": () => (/* binding */ checkRateLimit), +/* harmony export */ "gotoURL": () => (/* binding */ gotoURL), +/* harmony export */ "hideTooltip": () => (/* binding */ hideTooltip), +/* harmony export */ "isObjectEmpty": () => (/* binding */ isObjectEmpty), +/* harmony export */ "md5Hash": () => (/* binding */ md5Hash), +/* harmony export */ "showTooltip": () => (/* binding */ showTooltip) +/* harmony export */ }); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js"); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Get the MD5 hash value of a URL. + * + * @param {string} url The API URL to hash. + * @return {string} The MD5 hash. + */ +function md5Hash(url) { + return crypto_js__WEBPACK_IMPORTED_MODULE_0___default().MD5(url).toString(); +} + +/** + * Check if an object is empty. + * + * @param {Object} obj The object to test against. + * @return {boolean} Is this an object. + */ +function isObjectEmpty(obj) { + if (obj === null || obj === undefined) { + return true; + } + return Object.keys(obj).length === 0; +} + +/** + * Check the `x-ratelimit-remaining` headers to confirm the API is available. + * + * @param {Object} headers The request headers object. + */ +function checkRateLimit(headers) { + if (!headers) { + return; + } + var limit = headers.get("X-RateLimit-Limit") || -1; + var remaining = headers.get("X-RateLimit-Remaining") || -1; + if (limit > -1 && parseInt(remaining) < 2) { + alert(instant_img_localize.api_ratelimit_msg); // eslint-disable-line + } +} + +/** + * Capitalize the first letter of a string. + * + * @param {string} str The string to format. + * @return {string} The formatted string. + */ +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +var tooltipInterval = ""; + +/** + * Show the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function showTooltip(e) { + var target = e.currentTarget; + var rect = target.getBoundingClientRect(); + var left = Math.round(rect.left); + var top = Math.round(rect.top); + var container = target.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); + if (target.classList.contains("tooltip--above")) { + tooltip.classList.add("above"); + } else { + tooltip.classList.remove("above"); + } + + // Delay Tooltip Reveal. + tooltipInterval = setInterval(function () { + clearInterval(tooltipInterval); + tooltip.innerHTML = target.dataset.title; // Tooltip content. + + // Position Tooltip. + left = left - tooltip.offsetWidth + target.offsetWidth + 5; + tooltip.style.left = "".concat(left, "px"); + tooltip.style.top = "".concat(top, "px"); + setTimeout(function () { + tooltip.classList.add("over"); + }, 25); + }, 750); +} + +/** + * Hide the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function hideTooltip(e) { + clearInterval(tooltipInterval); + var container = e.currentTarget.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); +} + +/** + * Open the URL in new window. + * + * @param {string} url The destination URL. + */ +function gotoURL(url) { + if (url && window) { + window.open(url, "_blank"); + } +} + +/***/ }), + +/***/ "./src/js/functions/localStorage.js": +/*!******************************************!*\ + !*** ./src/js/functions/localStorage.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clearSearchHistory": () => (/* binding */ clearSearchHistory), +/* harmony export */ "getSearchHistory": () => (/* binding */ getSearchHistory), +/* harmony export */ "getSetting": () => (/* binding */ getSetting), +/* harmony export */ "saveSearchHistory": () => (/* binding */ saveSearchHistory), +/* harmony export */ "saveSettings": () => (/* binding */ saveSettings) +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var searchName = "instant-images-recent-searches"; +var settingsName = "instant-images-settings"; +var most = 10; + +/** + * Save search value to localstorage. + * + * @param {string} term The search term. + */ +function saveSearchHistory(term) { + var recent = getSearchHistory(); + if (!recent) { + localStorage.setItem(searchName, JSON.stringify([term])); + return; + } + + // Find duplicates. + var duplicate = recent.indexOf(term); + if (duplicate > -1) { + recent.splice(duplicate, 1); + } + + // Limit to 6 items. + if (recent.length >= most) { + recent.length = most; + } + + // Add new term to the beginning of the array. + recent.unshift(term); + localStorage.setItem(searchName, JSON.stringify(recent)); +} + +/** + * Get the search history from localstorage. + * + * @return {Array} The search history. + */ +function getSearchHistory() { + var history = localStorage.getItem(searchName); + if (!history) { + return []; + } + return JSON.parse(localStorage.getItem(searchName)); +} + +/** + * Clear search history. + */ +function clearSearchHistory() { + localStorage.removeItem(searchName); +} + +/** + * Save generic setting to localstorage as an key/value object pair. + * + * @param {string} key The object key. + * @param {value} value The object value. + */ +function saveSettings(key, value) { + var settings = localStorage.getItem(settingsName); + var setting = _defineProperty({}, key, value); + if (!settings) { + localStorage.setItem(settingsName, JSON.stringify(setting)); + } else { + var parsed = JSON.parse(settings); + parsed[key] = value; + localStorage.setItem(settingsName, JSON.stringify(parsed)); + } +} + +/** + * Get an individual setting from local storage. + * + * @param {string} key The stoarge key. + * @return {string|boolean} The storage value. + */ +function getSetting(key) { + var settings = localStorage.getItem(settingsName); + if (!settings) { + return false; + } + var parsed = JSON.parse(settings); + return parsed[key] ? parsed[key] : false; +} + +/***/ }), + +/***/ "./src/js/functions/providers/openverse.js": +/*!*************************************************!*\ + !*** ./src/js/functions/providers/openverse.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "openverseParams": () => (/* binding */ openverseParams) +/* harmony export */ }); +/* harmony import */ var _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters/openverse */ "./src/js/constants/filters/openverse.js"); + + +/** + * Format the params for Openverse. + * + * @param {string} type Query type (search, photos, id). + * @param {Object} params Query params object. + * @return {Object} Updated params. + */ +function openverseParams(type, params) { + if (type === "photos" && !params.source) { + params.source = "wordpress"; // Add `wordpress` as the default openverse `source`. + } + + if (type === "search") { + // Include these sources only. + var sources = _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__.OPENVERSE_SOURCES.map(function (source) { + return source.value; + }).toString(); // e.g. `wordpress,flickr,nasa,spacex,wikimedia` + params.source = sources; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/providers/unsplash.js": +/*!************************************************!*\ + !*** ./src/js/functions/providers/unsplash.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "unsplashDownload": () => (/* binding */ unsplashDownload) +/* harmony export */ }); +/* harmony import */ var _buildURL__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getQueryParams */ "./src/js/functions/getQueryParams.js"); + + + +/** + * Function to trigger an image download at unsplash.com. + * Note: This is used to give authors download credits and nothing more. + * + * @see https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download + * + * @param {string} download_url The URL to trigger a download. + * @since 3.1 + */ +function unsplashDownload(download_url) { + var params = (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__.getAuth)({}, "unsplash"); + params.download_url = download_url; // Append download URL to query params. + var url = (0,_buildURL__WEBPACK_IMPORTED_MODULE_0__["default"])("photos", params); + fetch(url).then(function (data) { + return data.json(); + }).then(function () { + // Success, nothing else happens here + console.log("Image download successsfully triggered at Unsplash."); // eslint-disable-line no-console + })["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/functions/session.js": +/*!*************************************!*\ + !*** ./src/js/functions/session.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "deleteSession": () => (/* binding */ deleteSession), +/* harmony export */ "getSession": () => (/* binding */ getSession), +/* harmony export */ "saveSession": () => (/* binding */ saveSession) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + + +/** + * Get results from session storage by URL. + * + * @param {string} url The API URL. + * @return {Array|boolean} Session results. + */ +function getSession(url) { + if (!url || _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.testmode) { + return false; // Exit if no URL or test mode is enabled. + } + + var session = sessionStorage.getItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); + if (!session) { + return false; // Exit if no session data. + } + + var data = JSON.parse(session); + var _data$expires = data.expires, + expires = _data$expires === void 0 ? 0 : _data$expires, + _data$error = data.error, + error = _data$error === void 0 ? null : _data$error; + if (error) { + return false; // Exit if session data has error entry. + } + + // Check if expiration time has passed. + var expired = Date.now() > expires; + + // Delete session data when expired. + if (expired) { + deleteSession(url); + } + return data && !expired ? data : false; +} + +/** + * Save API data to session storage by URL. + * + * @param {string} url Save results to session by URL. + * @param {Array} results The API results. + */ +function saveSession(url, results) { + if (!url || !results || results !== null && results !== void 0 && results.error) { + return false; + } + // Set expiration to 1 hour. + results.expires = Date.now() + 3600000; + + // Save session data. + sessionStorage.setItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url), JSON.stringify(results)); +} + +/** + * Remove/delete session storage by URL. + * + * @param {string} url The API URL. + */ +function deleteSession(url) { + if (!url) { + return false; + } + sessionStorage.removeItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); +} + +/***/ }), + +/***/ "./src/js/functions/updatePluginSetting.js": +/*!*************************************************!*\ + !*** ./src/js/functions/updatePluginSetting.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ updatePluginSetting) +/* harmony export */ }); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); + + +/** + * Update plugin settings by specific key/value pair. + * + * @param {string} setting The previous provider. + * @param {string} value The value to save. + */ +function updatePluginSetting(setting, value) { + var _instant_img_localize; + var api = ((_instant_img_localize = instant_img_localize) === null || _instant_img_localize === void 0 ? void 0 : _instant_img_localize.root) + "instant-images/settings/"; // eslint-disable-line no-undef + + var params = { + setting: setting, + value: value + }; + var config = { + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + // eslint-disable-line no-undef + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_0__["default"].post(api, JSON.stringify(params), config).then(function () {})["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/hooks/useArrowControls.js": +/*!******************************************!*\ + !*** ./src/js/hooks/useArrowControls.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useArrowControls": () => (/* binding */ useArrowControls) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + +/** + * Detect up and down arrow presses. + * + * @param {boolean} active Is the element currently active. + * @param {Object} ref The container ref to select the focusable elements. + */ +function useArrowControls(active, ref) { + var focusedRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(active); + + /** + * Add event listener for arrow keys. + * + * @param {KeyboardEvent} e The event. + */ + function arrowHandler(e) { + var key = e.key; + if (focusedRef !== null && focusedRef !== void 0 && focusedRef.current && ref !== null && ref !== void 0 && ref.current) { + var focusable = ref === null || ref === void 0 ? void 0 : ref.current.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input"); + if (!(focusable !== null && focusable !== void 0 && focusable.length)) { + // Exit if no focusable elements. + return; + } + var first = focusable[0]; + var last = focusable[focusable.length - 1]; + var _active = document.activeElement; // eslint-disable-line + var activeIndex = _toConsumableArray(focusable).indexOf(_active); + + // Up arrow. + if (key === "ArrowUp") { + e.preventDefault(); + if (activeIndex === 0) { + last.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex - 1].focus({ + preventScroll: true + }); + } + } + // Down Arrow + if (key === "ArrowDown") { + e.preventDefault(); + if (activeIndex === focusable.length - 1 || activeIndex === -1) { + first.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex + 1].focus({ + preventScroll: true + }); + } + } + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + focusedRef.current = active; + }, [active]); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + document.addEventListener("keydown", arrowHandler, false); + return function () { + // Dispose of events. + document.removeEventListener("keydown", arrowHandler, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./src/js/hooks/useClickOutside.js": +/*!*****************************************!*\ + !*** ./src/js/hooks/useClickOutside.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useClickOutside": () => (/* binding */ useClickOutside) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Detect clicks outside of ref. + * + * @param {Object} ref React ref. + * @param {Function} onClickOutside Function to invoke when clicked outside. + */ +function useClickOutside(ref, onClickOutside) { + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escapeClick(e) { + var key = e.key; + if (key === "Escape") { + onClickOutside(); + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + /** + * Invoke Function onClick outside of element + * + * @param {Event} event The event object. + */ + function handleClickOutside(event) { + if (ref.current && !ref.current.contains(event.target)) { + onClickOutside(); + } + } + + // Bind events. + document.addEventListener("mousedown", handleClickOutside); + document.addEventListener("keyup", handleClickOutside); + document.addEventListener("keydown", escapeClick, false); + return function () { + // Dispose of events. + document.removeEventListener("mousedown", handleClickOutside); + document.removeEventListener("keyup", handleClickOutside); + document.removeEventListener("keydown", escapeClick, false); + }; + }, [ref, onClickOutside]); //eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./node_modules/classnames/index.js": +/*!******************************************!*\ + !*** ./node_modules/classnames/index.js ***! + \******************************************/ +/***/ ((module, exports) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + var nativeCodeString = '[native code]'; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { + classes.push(arg.toString()); + continue; + } + + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + + +/***/ }), + +/***/ "./node_modules/crypto-js/aes.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/aes.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; + } + } + + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; + + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; + + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); + + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + var t; + + // Skip reset of nRounds has been set before and key did not change + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + // Shortcuts + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6; + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; + + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + + // Key schedule row counter + var ksRow = 4; + + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + + keySize: 256/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); + }()); + + + return CryptoJS.AES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/cipher-core.js": +/*!***********************************************!*\ + !*** ./node_modules/crypto-js/cipher-core.js ***! + \***********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher core components. + */ + CryptoJS.lib.Cipher || (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; + + // Set initial values + this.reset(); + }, + + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-cipher logic + this._doReset(); + }, + + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); + + // Process available blocks + return this._process(); + }, + + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } + + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + + keySize: 128/32, + + ivSize: 128/32, + + _ENC_XFORM_MODE: 1, + + _DEC_XFORM_MODE: 2, + + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); + + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); + + return finalProcessedBlocks; + }, + + blockSize: 1 + }); + + /** + * Mode namespace. + */ + var C_mode = C.mode = {}; + + /** + * Abstract base block cipher mode template. + */ + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); + + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + var block; + + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }()); + + /** + * Padding namespace. + */ + var C_pad = C.pad = {}; + + /** + * PKCS #5/7 padding strategy. + */ + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + + // Add padding + data.concat(padding); + }, + + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + /** + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) + */ + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + + reset: function () { + var modeCreator; + + // Reset cipher + Cipher.reset.call(this); + + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + modeCreator = mode.createDecryptor; + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } + + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, + + _doFinalize: function () { + var finalProcessedBlocks; + + // Shortcut + var padding = this.cfg.padding; + + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); + + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + + // Unpad data + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + + blockSize: 128/32 + }); + + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); + }, + + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + + /** + * Format namespace. + */ + var C_format = C.format = {}; + + /** + * OpenSSL formatting strategy. + */ + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + var wordArray; + + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + // Format + if (salt) { + wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + var salt; + + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); + + // Shortcut + var ciphertextWords = ciphertext.words; + + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + salt = WordArray.create(ciphertextWords.slice(2, 4)); + + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; + + /** + * A cipher wrapper that returns ciphertext as a serializable cipher params object. + */ + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + + // Shortcut + var cipherCfg = encryptor.cfg; + + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + + return plaintext; + }, + + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; + + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); + } + + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); + } + }; + + /** + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. + */ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + + // Mix in derived params + ciphertext.mixIn(derivedParams); + + return ciphertext; + }, + + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + + return plaintext; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/core.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/core.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(); + } + else {} +}(this, function () { + + /*globals window, global, require*/ + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + + var crypto; + + // Native crypto from window (Browser) + if (typeof window !== 'undefined' && window.crypto) { + crypto = window.crypto; + } + + // Native crypto in web worker (Browser) + if (typeof self !== 'undefined' && self.crypto) { + crypto = self.crypto; + } + + // Native crypto from worker + if (typeof globalThis !== 'undefined' && globalThis.crypto) { + crypto = globalThis.crypto; + } + + // Native (experimental IE 11) crypto from window (Browser) + if (!crypto && typeof window !== 'undefined' && window.msCrypto) { + crypto = window.msCrypto; + } + + // Native crypto from global (NodeJS) + if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { + crypto = __webpack_require__.g.crypto; + } + + // Native crypto import via require (NodeJS) + if (!crypto && "function" === 'function') { + try { + crypto = __webpack_require__(/*! crypto */ "?9157"); + } catch (err) {} + } + + /* + * Cryptographically secure pseudorandom number generator + * + * As Math.random() is cryptographically not safe to use + */ + var cryptoSecureRandomInt = function () { + if (crypto) { + // Use getRandomValues method (Browser) + if (typeof crypto.getRandomValues === 'function') { + try { + return crypto.getRandomValues(new Uint32Array(1))[0]; + } catch (err) {} + } + + // Use randomBytes method (NodeJS) + if (typeof crypto.randomBytes === 'function') { + try { + return crypto.randomBytes(4).readInt32LE(); + } catch (err) {} + } + } + + throw new Error('Native crypto module could not be used to get secure random number.'); + }; + + /* + * Local polyfill of Object.create + + */ + var create = Object.create || (function () { + function F() {} + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()); + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var j = 0; j < thatSigBytes; j += 4) { + thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + var processedWords; + + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/enc-base64.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + + return CryptoJS.enc.Base64; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64url.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/enc-base64url.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64url encoding strategy. + */ + var Base64url = C_enc.Base64url = { + /** + * Converts a word array to a Base64url string. + * + * @param {WordArray} wordArray The word array. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {string} The Base64url string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); + */ + stringify: function (wordArray, urlSafe=true) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = urlSafe ? this._safe_map : this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64url string to a word array. + * + * @param {string} base64Str The Base64url string. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64url.parse(base64String); + */ + parse: function (base64Str, urlSafe=true) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = urlSafe ? this._safe_map : this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + return CryptoJS.enc.Base64url; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-utf16.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/enc-utf16.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * UTF-16 BE encoding strategy. + */ + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + /** + * UTF-16 LE encoding strategy. + */ + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + function swapEndian(word) { + return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); + } + }()); + + + return CryptoJS.enc.Utf16; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/evpkdf.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/evpkdf.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + + /** + * This key derivation function is meant to conform with EVP_BytesToKey. + * www.openssl.org/docs/crypto/EVP_BytesToKey.html + */ + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: MD5, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + var block; + + // Shortcut + var cfg = this.cfg; + + // Init hasher + var hasher = cfg.hasher.create(); + + // Initial values + var derivedKey = WordArray.create(); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + block = hasher.update(password).finalize(salt); + hasher.reset(); + + // Iterations + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.EvpKDF(password, salt); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.EvpKDF; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/format-hex.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/format-hex.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + + var HexFormatter = C_format.Hex = { + /** + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The hexadecimally encoded string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); + */ + stringify: function (cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + + /** + * Converts a hexadecimally encoded ciphertext string to a cipher params object. + * + * @param {string} input The hexadecimally encoded string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.Hex.parse(hexString); + */ + parse: function (input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext: ciphertext }); + } + }; + }()); + + + return CryptoJS.format.Hex; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/hmac.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/hmac.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/crypto-js/index.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./lib-typedarrays */ "./node_modules/crypto-js/lib-typedarrays.js"), __webpack_require__(/*! ./enc-utf16 */ "./node_modules/crypto-js/enc-utf16.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./enc-base64url */ "./node_modules/crypto-js/enc-base64url.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./sha224 */ "./node_modules/crypto-js/sha224.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"), __webpack_require__(/*! ./sha384 */ "./node_modules/crypto-js/sha384.js"), __webpack_require__(/*! ./sha3 */ "./node_modules/crypto-js/sha3.js"), __webpack_require__(/*! ./ripemd160 */ "./node_modules/crypto-js/ripemd160.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"), __webpack_require__(/*! ./pbkdf2 */ "./node_modules/crypto-js/pbkdf2.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"), __webpack_require__(/*! ./mode-cfb */ "./node_modules/crypto-js/mode-cfb.js"), __webpack_require__(/*! ./mode-ctr */ "./node_modules/crypto-js/mode-ctr.js"), __webpack_require__(/*! ./mode-ctr-gladman */ "./node_modules/crypto-js/mode-ctr-gladman.js"), __webpack_require__(/*! ./mode-ofb */ "./node_modules/crypto-js/mode-ofb.js"), __webpack_require__(/*! ./mode-ecb */ "./node_modules/crypto-js/mode-ecb.js"), __webpack_require__(/*! ./pad-ansix923 */ "./node_modules/crypto-js/pad-ansix923.js"), __webpack_require__(/*! ./pad-iso10126 */ "./node_modules/crypto-js/pad-iso10126.js"), __webpack_require__(/*! ./pad-iso97971 */ "./node_modules/crypto-js/pad-iso97971.js"), __webpack_require__(/*! ./pad-zeropadding */ "./node_modules/crypto-js/pad-zeropadding.js"), __webpack_require__(/*! ./pad-nopadding */ "./node_modules/crypto-js/pad-nopadding.js"), __webpack_require__(/*! ./format-hex */ "./node_modules/crypto-js/format-hex.js"), __webpack_require__(/*! ./aes */ "./node_modules/crypto-js/aes.js"), __webpack_require__(/*! ./tripledes */ "./node_modules/crypto-js/tripledes.js"), __webpack_require__(/*! ./rc4 */ "./node_modules/crypto-js/rc4.js"), __webpack_require__(/*! ./rabbit */ "./node_modules/crypto-js/rabbit.js"), __webpack_require__(/*! ./rabbit-legacy */ "./node_modules/crypto-js/rabbit-legacy.js")); + } + else {} +}(this, function (CryptoJS) { + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/lib-typedarrays.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/lib-typedarrays.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Check if typed arrays are supported + if (typeof ArrayBuffer != 'function') { + return; + } + + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + + // Reference original init + var superInit = WordArray.init; + + // Augment WordArray.init to handle typed arrays + var subInit = WordArray.init = function (typedArray) { + // Convert buffers to uint8 + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + + // Convert other array views to uint8 + if ( + typedArray instanceof Int8Array || + (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || + typedArray instanceof Int16Array || + typedArray instanceof Uint16Array || + typedArray instanceof Int32Array || + typedArray instanceof Uint32Array || + typedArray instanceof Float32Array || + typedArray instanceof Float64Array + ) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + + // Handle Uint8Array + if (typedArray instanceof Uint8Array) { + // Shortcut + var typedArrayByteLength = typedArray.byteLength; + + // Extract bytes + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + } + + // Initialize this word array + superInit.call(this, words, typedArrayByteLength); + } else { + // Else call normal init + superInit.apply(this, arguments); + } + }; + + subInit.prototype = WordArray; + }()); + + + return CryptoJS.lib.WordArray; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/md5.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/md5.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcuts + var H = this._hash.words; + + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + + // Working varialbes + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); + + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); + + + return CryptoJS.MD5; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-cfb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-cfb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher Feedback block mode. + */ + CryptoJS.mode.CFB = (function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + + CFB.Encryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + CFB.Decryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var keystream; + + // Shortcut + var iv = this._iv; + + // Generate keystream + if (iv) { + keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + + return CFB; + }()); + + + return CryptoJS.mode.CFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr-gladman.js": +/*!****************************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr-gladman.js ***! + \****************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = (function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + + function incWord(word) + { + if (((word >> 24) & 0xff) === 0xff) { //overflow + var b1 = (word >> 16)&0xff; + var b2 = (word >> 8)&0xff; + var b3 = word & 0xff; + + if (b1 === 0xff) // overflow b1 + { + b1 = 0; + if (b2 === 0xff) + { + b2 = 0; + if (b3 === 0xff) + { + b3 = 0; + } + else + { + ++b3; + } + } + else + { + ++b2; + } + } + else + { + ++b1; + } + + word = 0; + word += (b1 << 16); + word += (b2 << 8); + word += b3; + } + else + { + word += (0x01 << 24); + } + return word; + } + + function incCounter(counter) + { + if ((counter[0] = incWord(counter[0])) === 0) + { + // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 + counter[1] = incWord(counter[1]); + } + return counter; + } + + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + + incCounter(counter); + + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTRGladman.Decryptor = Encryptor; + + return CTRGladman; + }()); + + + + + return CryptoJS.mode.CTRGladman; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Counter block mode. + */ + CryptoJS.mode.CTR = (function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Increment counter + counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTR.Decryptor = Encryptor; + + return CTR; + }()); + + + return CryptoJS.mode.CTR; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ecb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ecb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + + return ECB; + }()); + + + return CryptoJS.mode.ECB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ofb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ofb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Output Feedback block mode. + */ + CryptoJS.mode.OFB = (function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + + // Generate keystream + if (iv) { + keystream = this._keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + OFB.Decryptor = Encryptor; + + return OFB; + }()); + + + return CryptoJS.mode.OFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-ansix923.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-ansix923.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ANSI X.923 padding strategy. + */ + CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Ansix923; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso10126.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso10126.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO 10126 padding strategy. + */ + CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Iso10126; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso97971.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso97971.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO/IEC 9797-1 Padding Method 2. + */ + CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); + + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } + }; + + + return CryptoJS.pad.Iso97971; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-nopadding.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/pad-nopadding.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * A noop padding strategy. + */ + CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } + }; + + + return CryptoJS.pad.NoPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-zeropadding.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/pad-zeropadding.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Zero padding strategy. + */ + CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + + unpad: function (data) { + // Shortcut + var dataWords = data.words; + + // Unpad + var i = data.sigBytes - 1; + for (var i = data.sigBytes - 1; i >= 0; i--) { + if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + data.sigBytes = i + 1; + break; + } + } + } + }; + + + return CryptoJS.pad.ZeroPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pbkdf2.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/pbkdf2.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; + + /** + * Password-Based Key Derivation Function 2 algorithm. + */ + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA1 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: SHA1, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + // Shortcut + var cfg = this.cfg; + + // Init HMAC + var hmac = HMAC.create(cfg.hasher, password); + + // Initial values + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + + // Shortcuts + var blockWords = block.words; + var blockWordsLength = blockWords.length; + + // Iterations + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + + // Shortcut + var intermediateWords = intermediate.words; + + // XOR intermediate with block + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + + derivedKey.concat(block); + blockIndexWords[0]++; + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.PBKDF2(password, salt); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.PBKDF2; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit-legacy.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/rabbit-legacy.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm. + * + * This is a legacy version that neglected to convert the key to little-endian. + * This error doesn't affect the cipher's security, + * but it does affect its compatibility with other implementations. + */ + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); + */ + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + }()); + + + return CryptoJS.RabbitLegacy; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/rabbit.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Swap endian + for (var i = 0; i < 4; i++) { + K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | + (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); + } + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); + }()); + + + return CryptoJS.Rabbit; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rc4.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/rc4.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + /** + * RC4 stream cipher algorithm. + */ + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + + // Init sbox + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; + } + + // Key setup + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + // Counters + this._i = this._j = 0; + }, + + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + + keySize: 256/32, + + ivSize: 0 + }); + + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; + + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } + + // Update counters + this._i = i; + this._j = j; + + return keystreamWord; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); + + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + + _doReset: function () { + RC4._doReset.call(this); + + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + }()); + + + return CryptoJS.RC4; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/ripemd160.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/ripemd160.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var _zl = WordArray.create([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); + var _zr = WordArray.create([ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); + var _sl = WordArray.create([ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); + var _sr = WordArray.create([ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); + + var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); + + /** + * RIPEMD160 hash algorithm. + */ + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, + + _doProcessBlock: function (M, offset) { + + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + // Shortcut + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 5; i++) { + // Shortcut + var H_i = H[i]; + + // Swap + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + + function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); + + } + + function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); + } + + function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); + } + + function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); + } + + function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); + + } + + function rotl(x,n) { + return (x<>>(32-n)); + } + + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.RIPEMD160('message'); + * var hash = CryptoJS.RIPEMD160(wordArray); + */ + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacRIPEMD160(message, key); + */ + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + }(Math)); + + + return CryptoJS.RIPEMD160; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha1.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha1.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + return CryptoJS.SHA1; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha224.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha224.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); + }, + + _doFinalize: function () { + var hash = SHA256._doFinalize.call(this); + + hash.sigBytes -= 4; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); + */ + C.SHA224 = SHA256._createHelper(SHA224); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); + */ + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + }()); + + + return CryptoJS.SHA224; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha256.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha256.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); + + + return CryptoJS.SHA256; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha3.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha3.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + + // Constants tables + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + + // Compute Constants + (function () { + // Compute rho offset constants + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; + + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + + // Compute pi index constants + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + } + } + + // Compute round constants + var LFSR = 0x01; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else /* if (bitPosition >= 32) */ { + roundConstantMsw ^= 1 << (bitPosition - 32); + } + } + + // Compute next LFSR + if (LFSR & 0x80) { + // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 + LFSR = (LFSR << 1) ^ 0x71; + } else { + LFSR <<= 1; + } + } + + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + }()); + + // Reusable objects for temporary values + var T = []; + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + }()); + + /** + * SHA-3 hash algorithm. + */ + var SHA3 = C_algo.SHA3 = Hasher.extend({ + /** + * Configuration options. + * + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 + */ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + + _doReset: function () { + var state = this._state = [] + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + + // Absorb + for (var i = 0; i < nBlockSizeLanes; i++) { + // Shortcuts + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + + // Swap endian + M2i = ( + (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | + (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) + ); + M2i1 = ( + (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | + (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) + ); + + // Absorb message into state + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + + // Rounds + for (var round = 0; round < 24; round++) { + // Theta + for (var x = 0; x < 5; x++) { + // Mix column lanes + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + + // Temporary values + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + // Shortcuts + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + + // Mix surrounding columns + var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); + var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + + // Rho Pi + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var tMsw; + var tLsw; + + // Shortcuts + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + + // Rotate lanes + if (rhoOffset < 32) { + tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); + tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); + } else /* if (rhoOffset >= 32) */ { + tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); + tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); + } + + // Transpose lanes + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + + // Rho pi at x = y = 0 + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + + // Chi + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + // Shortcuts + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[((x + 1) % 5) + 5 * y]; + var Tx2Lane = T[((x + 2) % 5) + 5 * y]; + + // Mix rows + lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); + lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); + } + } + + // Iota + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + } + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); + dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + + // Squeeze + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + // Shortcuts + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + + // Swap endian + laneMsw = ( + (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | + (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) + ); + laneLsw = ( + (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | + (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) + ); + + // Squeeze state to retrieve hash + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + // Return final computed hash + return new WordArray.init(hashWords, outputLengthBytes); + }, + + clone: function () { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA3('message'); + * var hash = CryptoJS.SHA3(wordArray); + */ + C.SHA3 = Hasher._createHelper(SHA3); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA3(message, key); + */ + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + }(Math)); + + + return CryptoJS.SHA3; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha384.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha384.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + + /** + * SHA-384 hash algorithm. + */ + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), + new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), + new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), + new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); + */ + C.SHA384 = SHA512._createHelper(SHA384); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + }()); + + + return CryptoJS.SHA384; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha512.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha512.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; + + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); + + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), + new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), + new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), + new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; + + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + // Rounds + for (var i = 0; i < 80; i++) { + var Wil; + var Wih; + + // Shortcut + var Wi = W[i]; + + // Extend message + if (i < 16) { + Wih = Wi.high = M[offset + i * 2] | 0; + Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + + Wil = gamma0l + Wi7l; + Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + Wil = Wil + gamma1l; + Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + Wil = Wil + Wi16l; + Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + var hash = this._hash.toX32(); + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + }()); + + + return CryptoJS.SHA512; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/tripledes.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/tripledes.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Permuted Choice 1 constants + var PC1 = [ + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, 27, 19, 11, 3, + 60, 52, 44, 36, 63, 55, 47, 39, + 31, 23, 15, 7, 62, 54, 46, 38, + 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 + ]; + + // Permuted Choice 2 constants + var PC2 = [ + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 + ]; + + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; + + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; + + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } + + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; + + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; + + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } + + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } + + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + + keySize: 64/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); + + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + // Make sure the key length is valid (64, 128 or >= 192 bit) + if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { + throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); + } + + // Extend the key according to the keying options defined in 3DES standard + var key1 = keyWords.slice(0, 2); + var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); + var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); + + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(key1)); + this._des2 = DES.createEncryptor(WordArray.create(key2)); + this._des3 = DES.createEncryptor(WordArray.create(key3)); + }, + + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + + keySize: 192/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); + }()); + + + return CryptoJS.TripleDES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/x64-core.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/x64-core.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + + /** + * x64 namespace. + */ + var C_x64 = C.x64 = {}; + + /** + * A 64-bit word. + */ + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function (high, low) { + this.high = high; + this.low = low; + } + + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + + // return X64Word.create(high, low); + // } + }); + + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; + + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + + // Clone "words" array + var words = clone.words = this.words.slice(0); + + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); + }()); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/desandro-matches-selector/matches-selector.js": +/*!********************************************************************!*\ + !*** ./node_modules/desandro-matches-selector/matches-selector.js ***! + \********************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * matchesSelector v2.0.2 + * matchesSelector( element, '.selector' ) + * MIT license + */ + +/*jshint browser: true, strict: true, undef: true, unused: true */ + +( function( window, factory ) { + /*global define: false, module: false */ + 'use strict'; + // universal module definition + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory() { + 'use strict'; + + var matchesMethod = ( function() { + var ElemProto = window.Element.prototype; + // check for the standard method name first + if ( ElemProto.matches ) { + return 'matches'; + } + // check un-prefixed + if ( ElemProto.matchesSelector ) { + return 'matchesSelector'; + } + // check vendor prefixes + var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; + + for ( var i=0; i < prefixes.length; i++ ) { + var prefix = prefixes[i]; + var method = prefix + 'MatchesSelector'; + if ( ElemProto[ method ] ) { + return method; + } + } + })(); + + return function matchesSelector( elem, selector ) { + return elem[ matchesMethod ]( selector ); + }; + +})); + + +/***/ }), + +/***/ "./node_modules/ev-emitter/ev-emitter.js": +/*!***********************************************!*\ + !*** ./node_modules/ev-emitter/ev-emitter.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * EvEmitter v2.1.1 + * Lil' event emitter + * MIT License + */ + +( function( global, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS - Browserify, Webpack + module.exports = factory(); + } else { + // Browser globals + global.EvEmitter = factory(); + } + +}( typeof window != 'undefined' ? window : this, function() { + +function EvEmitter() {} + +let proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // set events hash + let events = this._events = this._events || {}; + // set listeners array + let listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( !listeners.includes( listener ) ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + let onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + let index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + // copy over to avoid interference if .off() in listener + listeners = listeners.slice( 0 ); + args = args || []; + // once stuff + let onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( let listener of listeners ) { + let isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; + return this; +}; + +return EvEmitter; + +} ) ); + + +/***/ }), + +/***/ "./node_modules/fizzy-ui-utils/utils.js": +/*!**********************************************!*\ + !*** ./node_modules/fizzy-ui-utils/utils.js ***! + \**********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Fizzy UI utils v2.0.7 + * MIT license + */ + +/*jshint browser: true, undef: true, unused: true, strict: true */ + +( function( window, factory ) { + // universal module definition + /*jshint strict: false */ /*globals define, module, require */ + + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! desandro-matches-selector/matches-selector */ "./node_modules/desandro-matches-selector/matches-selector.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) { + return factory( window, matchesSelector ); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, matchesSelector ) { + +'use strict'; + +var utils = {}; + +// ----- extend ----- // + +// extends objects +utils.extend = function( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +}; + +// ----- modulo ----- // + +utils.modulo = function( num, div ) { + return ( ( num % div ) + div ) % div; +}; + +// ----- makeArray ----- // + +var arraySlice = Array.prototype.slice; + +// turn element or nodeList into an array +utils.makeArray = function( obj ) { + if ( Array.isArray( obj ) ) { + // use object if already an array + return obj; + } + // return empty array if undefined or null. #6 + if ( obj === null || obj === undefined ) { + return []; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { + // convert nodeList to array + return arraySlice.call( obj ); + } + + // array of single index + return [ obj ]; +}; + +// ----- removeFrom ----- // + +utils.removeFrom = function( ary, obj ) { + var index = ary.indexOf( obj ); + if ( index != -1 ) { + ary.splice( index, 1 ); + } +}; + +// ----- getParent ----- // + +utils.getParent = function( elem, selector ) { + while ( elem.parentNode && elem != document.body ) { + elem = elem.parentNode; + if ( matchesSelector( elem, selector ) ) { + return elem; + } + } +}; + +// ----- getQueryElement ----- // + +// use element as selector string +utils.getQueryElement = function( elem ) { + if ( typeof elem == 'string' ) { + return document.querySelector( elem ); + } + return elem; +}; + +// ----- handleEvent ----- // + +// enable .ontype to trigger from .addEventListener( elem, 'type' ) +utils.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +// ----- filterFindElements ----- // + +utils.filterFindElements = function( elems, selector ) { + // make array of elems + elems = utils.makeArray( elems ); + var ffElems = []; + + elems.forEach( function( elem ) { + // check that elem is an actual element + if ( !( elem instanceof HTMLElement ) ) { + return; + } + // add elem if no selector + if ( !selector ) { + ffElems.push( elem ); + return; + } + // filter & find items if we have a selector + // filter + if ( matchesSelector( elem, selector ) ) { + ffElems.push( elem ); + } + // find children + var childElems = elem.querySelectorAll( selector ); + // concat childElems to filterFound array + for ( var i=0; i < childElems.length; i++ ) { + ffElems.push( childElems[i] ); + } + }); + + return ffElems; +}; + +// ----- debounceMethod ----- // + +utils.debounceMethod = function( _class, methodName, threshold ) { + threshold = threshold || 100; + // original method + var method = _class.prototype[ methodName ]; + var timeoutName = methodName + 'Timeout'; + + _class.prototype[ methodName ] = function() { + var timeout = this[ timeoutName ]; + clearTimeout( timeout ); + + var args = arguments; + var _this = this; + this[ timeoutName ] = setTimeout( function() { + method.apply( _this, args ); + delete _this[ timeoutName ]; + }, threshold ); + }; +}; + +// ----- docReady ----- // + +utils.docReady = function( callback ) { + var readyState = document.readyState; + if ( readyState == 'complete' || readyState == 'interactive' ) { + // do async to allow for other scripts to run. metafizzy/flickity#441 + setTimeout( callback ); + } else { + document.addEventListener( 'DOMContentLoaded', callback ); + } +}; + +// ----- htmlInit ----- // + +// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ +utils.toDashed = function( str ) { + return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { + return $1 + '-' + $2; + }).toLowerCase(); +}; + +var console = window.console; +/** + * allow user to initialize classes via [data-namespace] or .js-namespace class + * htmlInit( Widget, 'widgetName' ) + * options are parsed from data-namespace-options + */ +utils.htmlInit = function( WidgetClass, namespace ) { + utils.docReady( function() { + var dashedNamespace = utils.toDashed( namespace ); + var dataAttr = 'data-' + dashedNamespace; + var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); + var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); + var elems = utils.makeArray( dataAttrElems ) + .concat( utils.makeArray( jsDashElems ) ); + var dataOptionsAttr = dataAttr + '-options'; + var jQuery = window.jQuery; + + elems.forEach( function( elem ) { + var attr = elem.getAttribute( dataAttr ) || + elem.getAttribute( dataOptionsAttr ); + var options; + try { + options = attr && JSON.parse( attr ); + } catch ( error ) { + // log error, do not initialize + if ( console ) { + console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + + ': ' + error ); + } + return; + } + // initialize + var instance = new WidgetClass( elem, options ); + // make available via $().data('namespace') + if ( jQuery ) { + jQuery.data( elem, namespace, instance ); + } + }); + + }); +}; + +// ----- ----- // + +return utils; + +})); + + +/***/ }), + +/***/ "./node_modules/get-size/get-size.js": +/*!*******************************************!*\ + !*** ./node_modules/get-size/get-size.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * getSize v2.0.3 + * measure size of elements + * MIT license + */ + +/* jshint browser: true, strict: true, undef: true, unused: true */ +/* globals console: false */ + +( function( window, factory ) { + /* jshint strict: false */ /* globals define, module */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +})( window, function factory() { +'use strict'; + +// -------------------------- helpers -------------------------- // + +// get a number from a string, not a percentage +function getStyleSize( value ) { + var num = parseFloat( value ); + // not a percent like '100%', and a number + var isValid = value.indexOf('%') == -1 && !isNaN( num ); + return isValid && num; +} + +function noop() {} + +var logError = typeof console == 'undefined' ? noop : + function( message ) { + console.error( message ); + }; + +// -------------------------- measurements -------------------------- // + +var measurements = [ + 'paddingLeft', + 'paddingRight', + 'paddingTop', + 'paddingBottom', + 'marginLeft', + 'marginRight', + 'marginTop', + 'marginBottom', + 'borderLeftWidth', + 'borderRightWidth', + 'borderTopWidth', + 'borderBottomWidth' +]; + +var measurementsLength = measurements.length; + +function getZeroSize() { + var size = { + width: 0, + height: 0, + innerWidth: 0, + innerHeight: 0, + outerWidth: 0, + outerHeight: 0 + }; + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + size[ measurement ] = 0; + } + return size; +} + +// -------------------------- getStyle -------------------------- // + +/** + * getStyle, get style of element, check for Firefox bug + * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + */ +function getStyle( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + logError( 'Style returned ' + style + + '. Are you running this code in a hidden iframe on Firefox? ' + + 'See https://bit.ly/getsizebug1' ); + } + return style; +} + +// -------------------------- setup -------------------------- // + +var isSetup = false; + +var isBoxSizeOuter; + +/** + * setup + * check isBoxSizerOuter + * do on first getSize() rather than on page load for Firefox bug + */ +function setup() { + // setup once + if ( isSetup ) { + return; + } + isSetup = true; + + // -------------------------- box sizing -------------------------- // + + /** + * Chrome & Safari measure the outer-width on style.width on border-box elems + * IE11 & Firefox<29 measures the inner-width + */ + var div = document.createElement('div'); + div.style.width = '200px'; + div.style.padding = '1px 2px 3px 4px'; + div.style.borderStyle = 'solid'; + div.style.borderWidth = '1px 2px 3px 4px'; + div.style.boxSizing = 'border-box'; + + var body = document.body || document.documentElement; + body.appendChild( div ); + var style = getStyle( div ); + // round value for browser zoom. desandro/masonry#928 + isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; + getSize.isBoxSizeOuter = isBoxSizeOuter; + + body.removeChild( div ); +} + +// -------------------------- getSize -------------------------- // + +function getSize( elem ) { + setup(); + + // use querySeletor if elem is string + if ( typeof elem == 'string' ) { + elem = document.querySelector( elem ); + } + + // do not proceed on non-objects + if ( !elem || typeof elem != 'object' || !elem.nodeType ) { + return; + } + + var style = getStyle( elem ); + + // if hidden, everything is 0 + if ( style.display == 'none' ) { + return getZeroSize(); + } + + var size = {}; + size.width = elem.offsetWidth; + size.height = elem.offsetHeight; + + var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; + + // get all measurements + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + var value = style[ measurement ]; + var num = parseFloat( value ); + // any 'auto', 'medium' value will be 0 + size[ measurement ] = !isNaN( num ) ? num : 0; + } + + var paddingWidth = size.paddingLeft + size.paddingRight; + var paddingHeight = size.paddingTop + size.paddingBottom; + var marginWidth = size.marginLeft + size.marginRight; + var marginHeight = size.marginTop + size.marginBottom; + var borderWidth = size.borderLeftWidth + size.borderRightWidth; + var borderHeight = size.borderTopWidth + size.borderBottomWidth; + + var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; + + // overwrite width and height if we can get it from style + var styleWidth = getStyleSize( style.width ); + if ( styleWidth !== false ) { + size.width = styleWidth + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); + } + + var styleHeight = getStyleSize( style.height ); + if ( styleHeight !== false ) { + size.height = styleHeight + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); + } + + size.innerWidth = size.width - ( paddingWidth + borderWidth ); + size.innerHeight = size.height - ( paddingHeight + borderHeight ); + + size.outerWidth = size.width + marginWidth; + size.outerHeight = size.height + marginHeight; + + return size; +} + +return getSize; + +}); + + +/***/ }), + +/***/ "./node_modules/imagesloaded/imagesloaded.js": +/*!***************************************************!*\ + !*** ./node_modules/imagesloaded/imagesloaded.js ***! + \***************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/*! + * imagesLoaded v5.0.0 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS + module.exports = factory( window, __webpack_require__(/*! ev-emitter */ "./node_modules/ev-emitter/ev-emitter.js") ); + } else { + // browser global + window.imagesLoaded = factory( window, window.EvEmitter ); + } + +} )( typeof window !== 'undefined' ? window : this, + function factory( window, EvEmitter ) { + +let $ = window.jQuery; +let console = window.console; + +// -------------------------- helpers -------------------------- // + +// turn element or nodeList into an array +function makeArray( obj ) { + // use object if already an array + if ( Array.isArray( obj ) ) return obj; + + let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + // convert nodeList to array + if ( isArrayLike ) return [ ...obj ]; + + // array of single index + return [ obj ]; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {[Array, Element, NodeList, String]} elem + * @param {[Object, Function]} options - if function, use as callback + * @param {Function} onAlways - callback function + * @returns {ImagesLoaded} + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + let queryElem = elem; + if ( typeof elem == 'string' ) { + queryElem = document.querySelectorAll( elem ); + } + // bail if bad element + if ( !queryElem ) { + console.error(`Bad element for imagesLoaded ${queryElem || elem}`); + return; + } + + this.elements = makeArray( queryElem ); + this.options = {}; + // shift arguments if no options set + if ( typeof options == 'function' ) { + onAlways = options; + } else { + Object.assign( this.options, options ); + } + + if ( onAlways ) this.on( 'always', onAlways ); + + this.getImages(); + // add jQuery Deferred object + if ( $ ) this.jqDeferred = new $.Deferred(); + + // HACK check async to allow time to bind listeners + setTimeout( this.check.bind( this ) ); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +const elementNodeTypes = [ 1, 9, 11 ]; + +/** + * @param {Node} elem + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName === 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + let { nodeType } = elem; + if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return; + + let childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( let img of childImgs ) { + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + let children = elem.querySelectorAll( this.options.background ); + for ( let child of children ) { + this.addElementBackgroundImages( child ); + } + } +}; + +const reURL = /url\((['"])?(.*?)\1\)/gi; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + let style = getComputedStyle( elem ); + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + if ( !style ) return; + + // get url inside url("...") + let matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + let url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + let loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + let background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + /* eslint-disable-next-line func-style */ + let onProgress = ( image, elem, message ) => { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( () => { + this.progress( image, elem, message ); + } ); + }; + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + } ); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount === this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( `progress: ${message}`, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + let eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + // add crossOrigin attribute. #204 + if ( this.img.crossOrigin ) { + this.proxyImage.crossOrigin = this.img.crossOrigin; + } + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.currentSrc || this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + // check for non-zero, non-undefined naturalWidth + // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 + return this.img.complete && this.img.naturalWidth; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + let { parentNode } = this.img; + // emit progress with parent or self + let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img; + this.emitEvent( 'progress', [ this, elem, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + let method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) return; + + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, onAlways ) { + let instance = new ImagesLoaded( this, options, onAlways ); + return instance.jqDeferred.promise( $( this ) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +} ); + + +/***/ }), + +/***/ "./node_modules/masonry-layout/masonry.js": +/*!************************************************!*\ + !*** ./node_modules/masonry-layout/masonry.js ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Masonry v4.2.2 + * Cascading grid layout library + * https://masonry.desandro.com + * MIT License + * by David DeSandro + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /*globals define, module, require */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! outlayer/outlayer */ "./node_modules/outlayer/outlayer.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( Outlayer, getSize ) { + +'use strict'; + +// -------------------------- masonryDefinition -------------------------- // + + // create an Outlayer layout class + var Masonry = Outlayer.create('masonry'); + // isFitWidth -> fitWidth + Masonry.compatOptions.fitWidth = 'isFitWidth'; + + var proto = Masonry.prototype; + + proto._resetLayout = function() { + this.getSize(); + this._getMeasurement( 'columnWidth', 'outerWidth' ); + this._getMeasurement( 'gutter', 'outerWidth' ); + this.measureColumns(); + + // reset column Y + this.colYs = []; + for ( var i=0; i < this.cols; i++ ) { + this.colYs.push( 0 ); + } + + this.maxY = 0; + this.horizontalColIndex = 0; + }; + + proto.measureColumns = function() { + this.getContainerWidth(); + // if columnWidth is 0, default to outerWidth of first item + if ( !this.columnWidth ) { + var firstItem = this.items[0]; + var firstItemElem = firstItem && firstItem.element; + // columnWidth fall back to item of first element + this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth || + // if first elem has no width, default to size of container + this.containerWidth; + } + + var columnWidth = this.columnWidth += this.gutter; + + // calculate columns + var containerWidth = this.containerWidth + this.gutter; + var cols = containerWidth / columnWidth; + // fix rounding errors, typically with gutters + var excess = columnWidth - containerWidth % columnWidth; + // if overshoot is less than a pixel, round up, otherwise floor it + var mathMethod = excess && excess < 1 ? 'round' : 'floor'; + cols = Math[ mathMethod ]( cols ); + this.cols = Math.max( cols, 1 ); + }; + + proto.getContainerWidth = function() { + // container is parent if fit width + var isFitWidth = this._getOption('fitWidth'); + var container = isFitWidth ? this.element.parentNode : this.element; + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var size = getSize( container ); + this.containerWidth = size && size.innerWidth; + }; + + proto._getItemLayoutPosition = function( item ) { + item.getSize(); + // how many columns does this brick span + var remainder = item.size.outerWidth % this.columnWidth; + var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; + // round if off by 1 pixel, otherwise use ceil + var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth ); + colSpan = Math.min( colSpan, this.cols ); + // use horizontal or top column position + var colPosMethod = this.options.horizontalOrder ? + '_getHorizontalColPosition' : '_getTopColPosition'; + var colPosition = this[ colPosMethod ]( colSpan, item ); + // position the brick + var position = { + x: this.columnWidth * colPosition.col, + y: colPosition.y + }; + // apply setHeight to necessary columns + var setHeight = colPosition.y + item.size.outerHeight; + var setMax = colSpan + colPosition.col; + for ( var i = colPosition.col; i < setMax; i++ ) { + this.colYs[i] = setHeight; + } + + return position; + }; + + proto._getTopColPosition = function( colSpan ) { + var colGroup = this._getTopColGroup( colSpan ); + // get the minimum Y value from the columns + var minimumY = Math.min.apply( Math, colGroup ); + + return { + col: colGroup.indexOf( minimumY ), + y: minimumY, + }; + }; + + /** + * @param {Number} colSpan - number of columns the element spans + * @returns {Array} colGroup + */ + proto._getTopColGroup = function( colSpan ) { + if ( colSpan < 2 ) { + // if brick spans only one column, use all the column Ys + return this.colYs; + } + + var colGroup = []; + // how many different places could this brick fit horizontally + var groupCount = this.cols + 1 - colSpan; + // for each group potential horizontal position + for ( var i = 0; i < groupCount; i++ ) { + colGroup[i] = this._getColGroupY( i, colSpan ); + } + return colGroup; + }; + + proto._getColGroupY = function( col, colSpan ) { + if ( colSpan < 2 ) { + return this.colYs[ col ]; + } + // make an array of colY values for that one group + var groupColYs = this.colYs.slice( col, col + colSpan ); + // and get the max value of the array + return Math.max.apply( Math, groupColYs ); + }; + + // get column position based on horizontal index. #873 + proto._getHorizontalColPosition = function( colSpan, item ) { + var col = this.horizontalColIndex % this.cols; + var isOver = colSpan > 1 && col + colSpan > this.cols; + // shift to next row if item can't fit on current row + col = isOver ? 0 : col; + // don't let zero-size items take up space + var hasSize = item.size.outerWidth && item.size.outerHeight; + this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; + + return { + col: col, + y: this._getColGroupY( col, colSpan ), + }; + }; + + proto._manageStamp = function( stamp ) { + var stampSize = getSize( stamp ); + var offset = this._getElementOffset( stamp ); + // get the columns that this stamp affects + var isOriginLeft = this._getOption('originLeft'); + var firstX = isOriginLeft ? offset.left : offset.right; + var lastX = firstX + stampSize.outerWidth; + var firstCol = Math.floor( firstX / this.columnWidth ); + firstCol = Math.max( 0, firstCol ); + var lastCol = Math.floor( lastX / this.columnWidth ); + // lastCol should not go over if multiple of columnWidth #425 + lastCol -= lastX % this.columnWidth ? 0 : 1; + lastCol = Math.min( this.cols - 1, lastCol ); + // set colYs to bottom of the stamp + + var isOriginTop = this._getOption('originTop'); + var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) + + stampSize.outerHeight; + for ( var i = firstCol; i <= lastCol; i++ ) { + this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); + } + }; + + proto._getContainerSize = function() { + this.maxY = Math.max.apply( Math, this.colYs ); + var size = { + height: this.maxY + }; + + if ( this._getOption('fitWidth') ) { + size.width = this._getContainerFitWidth(); + } + + return size; + }; + + proto._getContainerFitWidth = function() { + var unusedCols = 0; + // count unused columns + var i = this.cols; + while ( --i ) { + if ( this.colYs[i] !== 0 ) { + break; + } + unusedCols++; + } + // fit container to columns that have been used + return ( this.cols - unusedCols ) * this.columnWidth - this.gutter; + }; + + proto.needsResizeLayout = function() { + var previousWidth = this.containerWidth; + this.getContainerWidth(); + return previousWidth != this.containerWidth; + }; + + return Masonry; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/item.js": +/*!***************************************!*\ + !*** ./node_modules/outlayer/item.js ***! + \***************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Outlayer Item + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( EvEmitter, getSize ) { +'use strict'; + +// ----- helpers ----- // + +function isEmptyObj( obj ) { + for ( var prop in obj ) { + return false; + } + prop = null; + return true; +} + +// -------------------------- CSS3 support -------------------------- // + + +var docElemStyle = document.documentElement.style; + +var transitionProperty = typeof docElemStyle.transition == 'string' ? + 'transition' : 'WebkitTransition'; +var transformProperty = typeof docElemStyle.transform == 'string' ? + 'transform' : 'WebkitTransform'; + +var transitionEndEvent = { + WebkitTransition: 'webkitTransitionEnd', + transition: 'transitionend' +}[ transitionProperty ]; + +// cache all vendor properties that could have vendor prefix +var vendorProperties = { + transform: transformProperty, + transition: transitionProperty, + transitionDuration: transitionProperty + 'Duration', + transitionProperty: transitionProperty + 'Property', + transitionDelay: transitionProperty + 'Delay' +}; + +// -------------------------- Item -------------------------- // + +function Item( element, layout ) { + if ( !element ) { + return; + } + + this.element = element; + // parent layout class, i.e. Masonry, Isotope, or Packery + this.layout = layout; + this.position = { + x: 0, + y: 0 + }; + + this._create(); +} + +// inherit EvEmitter +var proto = Item.prototype = Object.create( EvEmitter.prototype ); +proto.constructor = Item; + +proto._create = function() { + // transition objects + this._transn = { + ingProperties: {}, + clean: {}, + onEnd: {} + }; + + this.css({ + position: 'absolute' + }); +}; + +// trigger specified handler for event type +proto.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * apply CSS styles to element + * @param {Object} style + */ +proto.css = function( style ) { + var elemStyle = this.element.style; + + for ( var prop in style ) { + // use vendor property if available + var supportedProp = vendorProperties[ prop ] || prop; + elemStyle[ supportedProp ] = style[ prop ]; + } +}; + + // measure position, and sets it +proto.getPosition = function() { + var style = getComputedStyle( this.element ); + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + var xValue = style[ isOriginLeft ? 'left' : 'right' ]; + var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; + var x = parseFloat( xValue ); + var y = parseFloat( yValue ); + // convert percent to pixels + var layoutSize = this.layout.size; + if ( xValue.indexOf('%') != -1 ) { + x = ( x / 100 ) * layoutSize.width; + } + if ( yValue.indexOf('%') != -1 ) { + y = ( y / 100 ) * layoutSize.height; + } + // clean up 'auto' or other non-integer values + x = isNaN( x ) ? 0 : x; + y = isNaN( y ) ? 0 : y; + // remove padding from measurement + x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; + y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; + + this.position.x = x; + this.position.y = y; +}; + +// set settled position, apply padding +proto.layoutPosition = function() { + var layoutSize = this.layout.size; + var style = {}; + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + + // x + var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; + var xProperty = isOriginLeft ? 'left' : 'right'; + var xResetProperty = isOriginLeft ? 'right' : 'left'; + + var x = this.position.x + layoutSize[ xPadding ]; + // set in percentage or pixels + style[ xProperty ] = this.getXValue( x ); + // reset other property + style[ xResetProperty ] = ''; + + // y + var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; + var yProperty = isOriginTop ? 'top' : 'bottom'; + var yResetProperty = isOriginTop ? 'bottom' : 'top'; + + var y = this.position.y + layoutSize[ yPadding ]; + // set in percentage or pixels + style[ yProperty ] = this.getYValue( y ); + // reset other property + style[ yResetProperty ] = ''; + + this.css( style ); + this.emitEvent( 'layout', [ this ] ); +}; + +proto.getXValue = function( x ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && !isHorizontal ? + ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px'; +}; + +proto.getYValue = function( y ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && isHorizontal ? + ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px'; +}; + +proto._transitionTo = function( x, y ) { + this.getPosition(); + // get current x & y from top/left + var curX = this.position.x; + var curY = this.position.y; + + var didNotMove = x == this.position.x && y == this.position.y; + + // save end position + this.setPosition( x, y ); + + // if did not move and not transitioning, just go to layout + if ( didNotMove && !this.isTransitioning ) { + this.layoutPosition(); + return; + } + + var transX = x - curX; + var transY = y - curY; + var transitionStyle = {}; + transitionStyle.transform = this.getTranslate( transX, transY ); + + this.transition({ + to: transitionStyle, + onTransitionEnd: { + transform: this.layoutPosition + }, + isCleaning: true + }); +}; + +proto.getTranslate = function( x, y ) { + // flip cooridinates if origin on right or bottom + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + x = isOriginLeft ? x : -x; + y = isOriginTop ? y : -y; + return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; +}; + +// non transition + transform support +proto.goTo = function( x, y ) { + this.setPosition( x, y ); + this.layoutPosition(); +}; + +proto.moveTo = proto._transitionTo; + +proto.setPosition = function( x, y ) { + this.position.x = parseFloat( x ); + this.position.y = parseFloat( y ); +}; + +// ----- transition ----- // + +/** + * @param {Object} style - CSS + * @param {Function} onTransitionEnd + */ + +// non transition, just trigger callback +proto._nonTransition = function( args ) { + this.css( args.to ); + if ( args.isCleaning ) { + this._removeStyles( args.to ); + } + for ( var prop in args.onTransitionEnd ) { + args.onTransitionEnd[ prop ].call( this ); + } +}; + +/** + * proper transition + * @param {Object} args - arguments + * @param {Object} to - style to transition to + * @param {Object} from - style to start transition from + * @param {Boolean} isCleaning - removes transition styles after transition + * @param {Function} onTransitionEnd - callback + */ +proto.transition = function( args ) { + // redirect to nonTransition if no transition duration + if ( !parseFloat( this.layout.options.transitionDuration ) ) { + this._nonTransition( args ); + return; + } + + var _transition = this._transn; + // keep track of onTransitionEnd callback by css property + for ( var prop in args.onTransitionEnd ) { + _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ]; + } + // keep track of properties that are transitioning + for ( prop in args.to ) { + _transition.ingProperties[ prop ] = true; + // keep track of properties to clean up when transition is done + if ( args.isCleaning ) { + _transition.clean[ prop ] = true; + } + } + + // set from styles + if ( args.from ) { + this.css( args.from ); + // force redraw. http://blog.alexmaccaw.com/css-transitions + var h = this.element.offsetHeight; + // hack for JSHint to hush about unused var + h = null; + } + // enable transition + this.enableTransition( args.to ); + // set styles that are transitioning + this.css( args.to ); + + this.isTransitioning = true; + +}; + +// dash before all cap letters, including first for +// WebkitTransform => -webkit-transform +function toDashedAll( str ) { + return str.replace( /([A-Z])/g, function( $1 ) { + return '-' + $1.toLowerCase(); + }); +} + +var transitionProps = 'opacity,' + toDashedAll( transformProperty ); + +proto.enableTransition = function(/* style */) { + // HACK changing transitionProperty during a transition + // will cause transition to jump + if ( this.isTransitioning ) { + return; + } + + // make `transition: foo, bar, baz` from style object + // HACK un-comment this when enableTransition can work + // while a transition is happening + // var transitionValues = []; + // for ( var prop in style ) { + // // dash-ify camelCased properties like WebkitTransition + // prop = vendorProperties[ prop ] || prop; + // transitionValues.push( toDashedAll( prop ) ); + // } + // munge number to millisecond, to match stagger + var duration = this.layout.options.transitionDuration; + duration = typeof duration == 'number' ? duration + 'ms' : duration; + // enable transition styles + this.css({ + transitionProperty: transitionProps, + transitionDuration: duration, + transitionDelay: this.staggerDelay || 0 + }); + // listen for transition end event + this.element.addEventListener( transitionEndEvent, this, false ); +}; + +// ----- events ----- // + +proto.onwebkitTransitionEnd = function( event ) { + this.ontransitionend( event ); +}; + +proto.onotransitionend = function( event ) { + this.ontransitionend( event ); +}; + +// properties that I munge to make my life easier +var dashedVendorProperties = { + '-webkit-transform': 'transform' +}; + +proto.ontransitionend = function( event ) { + // disregard bubbled events from children + if ( event.target !== this.element ) { + return; + } + var _transition = this._transn; + // get property name of transitioned property, convert to prefix-free + var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName; + + // remove property that has completed transitioning + delete _transition.ingProperties[ propertyName ]; + // check if any properties are still transitioning + if ( isEmptyObj( _transition.ingProperties ) ) { + // all properties have completed transitioning + this.disableTransition(); + } + // clean style + if ( propertyName in _transition.clean ) { + // clean up style + this.element.style[ event.propertyName ] = ''; + delete _transition.clean[ propertyName ]; + } + // trigger onTransitionEnd callback + if ( propertyName in _transition.onEnd ) { + var onTransitionEnd = _transition.onEnd[ propertyName ]; + onTransitionEnd.call( this ); + delete _transition.onEnd[ propertyName ]; + } + + this.emitEvent( 'transitionEnd', [ this ] ); +}; + +proto.disableTransition = function() { + this.removeTransitionStyles(); + this.element.removeEventListener( transitionEndEvent, this, false ); + this.isTransitioning = false; +}; + +/** + * removes style property from element + * @param {Object} style +**/ +proto._removeStyles = function( style ) { + // clean up transition styles + var cleanStyle = {}; + for ( var prop in style ) { + cleanStyle[ prop ] = ''; + } + this.css( cleanStyle ); +}; + +var cleanTransitionStyle = { + transitionProperty: '', + transitionDuration: '', + transitionDelay: '' +}; + +proto.removeTransitionStyles = function() { + // remove transition + this.css( cleanTransitionStyle ); +}; + +// ----- stagger ----- // + +proto.stagger = function( delay ) { + delay = isNaN( delay ) ? 0 : delay; + this.staggerDelay = delay + 'ms'; +}; + +// ----- show/hide/remove ----- // + +// remove element from DOM +proto.removeElem = function() { + this.element.parentNode.removeChild( this.element ); + // remove display: none + this.css({ display: '' }); + this.emitEvent( 'remove', [ this ] ); +}; + +proto.remove = function() { + // just remove element if no transition support or no transition + if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) { + this.removeElem(); + return; + } + + // start transition + this.once( 'transitionEnd', function() { + this.removeElem(); + }); + this.hide(); +}; + +proto.reveal = function() { + delete this.isHidden; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd; + + this.transition({ + from: options.hiddenStyle, + to: options.visibleStyle, + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onRevealTransitionEnd = function() { + // check if still visible + // during transition, item may have been hidden + if ( !this.isHidden ) { + this.emitEvent('reveal'); + } +}; + +/** + * get style property use for hide/reveal transition end + * @param {String} styleProperty - hiddenStyle/visibleStyle + * @returns {String} + */ +proto.getHideRevealTransitionEndProperty = function( styleProperty ) { + var optionStyle = this.layout.options[ styleProperty ]; + // use opacity + if ( optionStyle.opacity ) { + return 'opacity'; + } + // get first property + for ( var prop in optionStyle ) { + return prop; + } +}; + +proto.hide = function() { + // set flag + this.isHidden = true; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd; + + this.transition({ + from: options.visibleStyle, + to: options.hiddenStyle, + // keep hidden stuff hidden + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onHideTransitionEnd = function() { + // check if still hidden + // during transition, item may have been un-hidden + if ( this.isHidden ) { + this.css({ display: 'none' }); + this.emitEvent('hide'); + } +}; + +proto.destroy = function() { + this.css({ + position: '', + left: '', + right: '', + top: '', + bottom: '', + transition: '', + transform: '' + }); +}; + +return Item; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js": +/*!*********************************************************************!*\ + !*** ./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js ***! + \*********************************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * EvEmitter v1.1.0 + * Lil' event emitter + * MIT License + */ + +/* jshint unused: true, undef: true, strict: true */ + +( function( global, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, window */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( typeof window != 'undefined' ? window : this, function() { + +"use strict"; + +function EvEmitter() {} + +var proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // set events hash + var events = this._events = this._events || {}; + // set listeners array + var listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( listeners.indexOf( listener ) == -1 ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + var onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + // copy over to avoid interference if .off() in listener + listeners = listeners.slice(0); + args = args || []; + // once stuff + var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( var i=0; i < listeners.length; i++ ) { + var listener = listeners[i] + var isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; +}; + +return EvEmitter; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/outlayer.js": +/*!*******************************************!*\ + !*** ./node_modules/outlayer/outlayer.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Outlayer v2.1.1 + * the brains and guts of a layout library + * MIT license + */ + +( function( window, factory ) { + 'use strict'; + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js"), + __webpack_require__(/*! fizzy-ui-utils/utils */ "./node_modules/fizzy-ui-utils/utils.js"), + __webpack_require__(/*! ./item */ "./node_modules/outlayer/item.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter, getSize, utils, Item ) { + return factory( window, EvEmitter, getSize, utils, Item); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, EvEmitter, getSize, utils, Item ) { +'use strict'; + +// ----- vars ----- // + +var console = window.console; +var jQuery = window.jQuery; +var noop = function() {}; + +// -------------------------- Outlayer -------------------------- // + +// globally unique identifiers +var GUID = 0; +// internal store of all Outlayer intances +var instances = {}; + + +/** + * @param {Element, String} element + * @param {Object} options + * @constructor + */ +function Outlayer( element, options ) { + var queryElement = utils.getQueryElement( element ); + if ( !queryElement ) { + if ( console ) { + console.error( 'Bad element for ' + this.constructor.namespace + + ': ' + ( queryElement || element ) ); + } + return; + } + this.element = queryElement; + // add jQuery + if ( jQuery ) { + this.$element = jQuery( this.element ); + } + + // options + this.options = utils.extend( {}, this.constructor.defaults ); + this.option( options ); + + // add id for Outlayer.getFromElement + var id = ++GUID; + this.element.outlayerGUID = id; // expando + instances[ id ] = this; // associate via id + + // kick it off + this._create(); + + var isInitLayout = this._getOption('initLayout'); + if ( isInitLayout ) { + this.layout(); + } +} + +// settings are for internal use only +Outlayer.namespace = 'outlayer'; +Outlayer.Item = Item; + +// default options +Outlayer.defaults = { + containerStyle: { + position: 'relative' + }, + initLayout: true, + originLeft: true, + originTop: true, + resize: true, + resizeContainer: true, + // item options + transitionDuration: '0.4s', + hiddenStyle: { + opacity: 0, + transform: 'scale(0.001)' + }, + visibleStyle: { + opacity: 1, + transform: 'scale(1)' + } +}; + +var proto = Outlayer.prototype; +// inherit EvEmitter +utils.extend( proto, EvEmitter.prototype ); + +/** + * set options + * @param {Object} opts + */ +proto.option = function( opts ) { + utils.extend( this.options, opts ); +}; + +/** + * get backwards compatible option value, check old name + */ +proto._getOption = function( option ) { + var oldOption = this.constructor.compatOptions[ option ]; + return oldOption && this.options[ oldOption ] !== undefined ? + this.options[ oldOption ] : this.options[ option ]; +}; + +Outlayer.compatOptions = { + // currentName: oldName + initLayout: 'isInitLayout', + horizontal: 'isHorizontal', + layoutInstant: 'isLayoutInstant', + originLeft: 'isOriginLeft', + originTop: 'isOriginTop', + resize: 'isResizeBound', + resizeContainer: 'isResizingContainer' +}; + +proto._create = function() { + // get items from children + this.reloadItems(); + // elements that affect layout, but are not laid out + this.stamps = []; + this.stamp( this.options.stamp ); + // set container style + utils.extend( this.element.style, this.options.containerStyle ); + + // bind resize method + var canBindResize = this._getOption('resize'); + if ( canBindResize ) { + this.bindResize(); + } +}; + +// goes through all children again and gets bricks in proper order +proto.reloadItems = function() { + // collection of item elements + this.items = this._itemize( this.element.children ); +}; + + +/** + * turn elements into Outlayer.Items to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - collection of new Outlayer Items + */ +proto._itemize = function( elems ) { + + var itemElems = this._filterFindItemElements( elems ); + var Item = this.constructor.Item; + + // create new Outlayer Items for collection + var items = []; + for ( var i=0; i < itemElems.length; i++ ) { + var elem = itemElems[i]; + var item = new Item( elem, this ); + items.push( item ); + } + + return items; +}; + +/** + * get item elements to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - item elements + */ +proto._filterFindItemElements = function( elems ) { + return utils.filterFindElements( elems, this.options.itemSelector ); +}; + +/** + * getter method for getting item elements + * @returns {Array} elems - collection of item elements + */ +proto.getItemElements = function() { + return this.items.map( function( item ) { + return item.element; + }); +}; + +// ----- init & layout ----- // + +/** + * lays out all items + */ +proto.layout = function() { + this._resetLayout(); + this._manageStamps(); + + // don't animate first layout + var layoutInstant = this._getOption('layoutInstant'); + var isInstant = layoutInstant !== undefined ? + layoutInstant : !this._isLayoutInited; + this.layoutItems( this.items, isInstant ); + + // flag for initalized + this._isLayoutInited = true; +}; + +// _init is alias for layout +proto._init = proto.layout; + +/** + * logic before any new layout + */ +proto._resetLayout = function() { + this.getSize(); +}; + + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * get measurement from option, for columnWidth, rowHeight, gutter + * if option is String -> get element from selector string, & get size of element + * if option is Element -> get size of element + * else use option as a number + * + * @param {String} measurement + * @param {String} size - width or height + * @private + */ +proto._getMeasurement = function( measurement, size ) { + var option = this.options[ measurement ]; + var elem; + if ( !option ) { + // default to 0 + this[ measurement ] = 0; + } else { + // use option as an element + if ( typeof option == 'string' ) { + elem = this.element.querySelector( option ); + } else if ( option instanceof HTMLElement ) { + elem = option; + } + // use size of element, if element + this[ measurement ] = elem ? getSize( elem )[ size ] : option; + } +}; + +/** + * layout a collection of item elements + * @api public + */ +proto.layoutItems = function( items, isInstant ) { + items = this._getItemsForLayout( items ); + + this._layoutItems( items, isInstant ); + + this._postLayout(); +}; + +/** + * get the items to be laid out + * you may want to skip over some items + * @param {Array} items + * @returns {Array} items + */ +proto._getItemsForLayout = function( items ) { + return items.filter( function( item ) { + return !item.isIgnored; + }); +}; + +/** + * layout items + * @param {Array} items + * @param {Boolean} isInstant + */ +proto._layoutItems = function( items, isInstant ) { + this._emitCompleteOnItems( 'layout', items ); + + if ( !items || !items.length ) { + // no items, emit event with empty array + return; + } + + var queue = []; + + items.forEach( function( item ) { + // get x/y object from method + var position = this._getItemLayoutPosition( item ); + // enqueue + position.item = item; + position.isInstant = isInstant || item.isLayoutInstant; + queue.push( position ); + }, this ); + + this._processLayoutQueue( queue ); +}; + +/** + * get item layout position + * @param {Outlayer.Item} item + * @returns {Object} x and y position + */ +proto._getItemLayoutPosition = function( /* item */ ) { + return { + x: 0, + y: 0 + }; +}; + +/** + * iterate over array and position each item + * Reason being - separating this logic prevents 'layout invalidation' + * thx @paul_irish + * @param {Array} queue + */ +proto._processLayoutQueue = function( queue ) { + this.updateStagger(); + queue.forEach( function( obj, i ) { + this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i ); + }, this ); +}; + +// set stagger from option in milliseconds number +proto.updateStagger = function() { + var stagger = this.options.stagger; + if ( stagger === null || stagger === undefined ) { + this.stagger = 0; + return; + } + this.stagger = getMilliseconds( stagger ); + return this.stagger; +}; + +/** + * Sets position of item in DOM + * @param {Outlayer.Item} item + * @param {Number} x - horizontal position + * @param {Number} y - vertical position + * @param {Boolean} isInstant - disables transitions + */ +proto._positionItem = function( item, x, y, isInstant, i ) { + if ( isInstant ) { + // if not transition, just set CSS + item.goTo( x, y ); + } else { + item.stagger( i * this.stagger ); + item.moveTo( x, y ); + } +}; + +/** + * Any logic you want to do after each layout, + * i.e. size the container + */ +proto._postLayout = function() { + this.resizeContainer(); +}; + +proto.resizeContainer = function() { + var isResizingContainer = this._getOption('resizeContainer'); + if ( !isResizingContainer ) { + return; + } + var size = this._getContainerSize(); + if ( size ) { + this._setContainerMeasure( size.width, true ); + this._setContainerMeasure( size.height, false ); + } +}; + +/** + * Sets width or height of container if returned + * @returns {Object} size + * @param {Number} width + * @param {Number} height + */ +proto._getContainerSize = noop; + +/** + * @param {Number} measure - size of width or height + * @param {Boolean} isWidth + */ +proto._setContainerMeasure = function( measure, isWidth ) { + if ( measure === undefined ) { + return; + } + + var elemSize = this.size; + // add padding and border width if border box + if ( elemSize.isBorderBox ) { + measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + + elemSize.borderLeftWidth + elemSize.borderRightWidth : + elemSize.paddingBottom + elemSize.paddingTop + + elemSize.borderTopWidth + elemSize.borderBottomWidth; + } + + measure = Math.max( measure, 0 ); + this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; +}; + +/** + * emit eventComplete on a collection of items events + * @param {String} eventName + * @param {Array} items - Outlayer.Items + */ +proto._emitCompleteOnItems = function( eventName, items ) { + var _this = this; + function onComplete() { + _this.dispatchEvent( eventName + 'Complete', null, [ items ] ); + } + + var count = items.length; + if ( !items || !count ) { + onComplete(); + return; + } + + var doneCount = 0; + function tick() { + doneCount++; + if ( doneCount == count ) { + onComplete(); + } + } + + // bind callback + items.forEach( function( item ) { + item.once( eventName, tick ); + }); +}; + +/** + * emits events via EvEmitter and jQuery events + * @param {String} type - name of event + * @param {Event} event - original event + * @param {Array} args - extra arguments + */ +proto.dispatchEvent = function( type, event, args ) { + // add original event to arguments + var emitArgs = event ? [ event ].concat( args ) : args; + this.emitEvent( type, emitArgs ); + + if ( jQuery ) { + // set this.$element + this.$element = this.$element || jQuery( this.element ); + if ( event ) { + // create jQuery event + var $event = jQuery.Event( event ); + $event.type = type; + this.$element.trigger( $event, args ); + } else { + // just trigger with type if no event available + this.$element.trigger( type, args ); + } + } +}; + +// -------------------------- ignore & stamps -------------------------- // + + +/** + * keep item in collection, but do not lay it out + * ignored items do not get skipped in layout + * @param {Element} elem + */ +proto.ignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + item.isIgnored = true; + } +}; + +/** + * return item to layout collection + * @param {Element} elem + */ +proto.unignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + delete item.isIgnored; + } +}; + +/** + * adds elements to stamps + * @param {NodeList, Array, Element, or String} elems + */ +proto.stamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ) { + return; + } + + this.stamps = this.stamps.concat( elems ); + // ignore + elems.forEach( this.ignore, this ); +}; + +/** + * removes elements to stamps + * @param {NodeList, Array, or Element} elems + */ +proto.unstamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ){ + return; + } + + elems.forEach( function( elem ) { + // filter out removed stamp elements + utils.removeFrom( this.stamps, elem ); + this.unignore( elem ); + }, this ); +}; + +/** + * finds child elements + * @param {NodeList, Array, Element, or String} elems + * @returns {Array} elems + */ +proto._find = function( elems ) { + if ( !elems ) { + return; + } + // if string, use argument as selector string + if ( typeof elems == 'string' ) { + elems = this.element.querySelectorAll( elems ); + } + elems = utils.makeArray( elems ); + return elems; +}; + +proto._manageStamps = function() { + if ( !this.stamps || !this.stamps.length ) { + return; + } + + this._getBoundingRect(); + + this.stamps.forEach( this._manageStamp, this ); +}; + +// update boundingLeft / Top +proto._getBoundingRect = function() { + // get bounding rect for container element + var boundingRect = this.element.getBoundingClientRect(); + var size = this.size; + this._boundingRect = { + left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, + top: boundingRect.top + size.paddingTop + size.borderTopWidth, + right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), + bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) + }; +}; + +/** + * @param {Element} stamp +**/ +proto._manageStamp = noop; + +/** + * get x/y position of element relative to container element + * @param {Element} elem + * @returns {Object} offset - has left, top, right, bottom + */ +proto._getElementOffset = function( elem ) { + var boundingRect = elem.getBoundingClientRect(); + var thisRect = this._boundingRect; + var size = getSize( elem ); + var offset = { + left: boundingRect.left - thisRect.left - size.marginLeft, + top: boundingRect.top - thisRect.top - size.marginTop, + right: thisRect.right - boundingRect.right - size.marginRight, + bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom + }; + return offset; +}; + +// -------------------------- resize -------------------------- // + +// enable event handlers for listeners +// i.e. resize -> onresize +proto.handleEvent = utils.handleEvent; + +/** + * Bind layout to window resizing + */ +proto.bindResize = function() { + window.addEventListener( 'resize', this ); + this.isResizeBound = true; +}; + +/** + * Unbind layout to window resizing + */ +proto.unbindResize = function() { + window.removeEventListener( 'resize', this ); + this.isResizeBound = false; +}; + +proto.onresize = function() { + this.resize(); +}; + +utils.debounceMethod( Outlayer, 'onresize', 100 ); + +proto.resize = function() { + // don't trigger if size did not change + // or if resize was unbound. See #9 + if ( !this.isResizeBound || !this.needsResizeLayout() ) { + return; + } + + this.layout(); +}; + +/** + * check if layout is needed post layout + * @returns Boolean + */ +proto.needsResizeLayout = function() { + var size = getSize( this.element ); + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var hasSizes = this.size && size; + return hasSizes && size.innerWidth !== this.size.innerWidth; +}; + +// -------------------------- methods -------------------------- // + +/** + * add items to Outlayer instance + * @param {Array or NodeList or Element} elems + * @returns {Array} items - Outlayer.Items +**/ +proto.addItems = function( elems ) { + var items = this._itemize( elems ); + // add items to collection + if ( items.length ) { + this.items = this.items.concat( items ); + } + return items; +}; + +/** + * Layout newly-appended item elements + * @param {Array or NodeList or Element} elems + */ +proto.appended = function( elems ) { + var items = this.addItems( elems ); + if ( !items.length ) { + return; + } + // layout and reveal just the new items + this.layoutItems( items, true ); + this.reveal( items ); +}; + +/** + * Layout prepended elements + * @param {Array or NodeList or Element} elems + */ +proto.prepended = function( elems ) { + var items = this._itemize( elems ); + if ( !items.length ) { + return; + } + // add items to beginning of collection + var previousItems = this.items.slice(0); + this.items = items.concat( previousItems ); + // start new layout + this._resetLayout(); + this._manageStamps(); + // layout new stuff without transition + this.layoutItems( items, true ); + this.reveal( items ); + // layout previous items + this.layoutItems( previousItems ); +}; + +/** + * reveal a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.reveal = function( items ) { + this._emitCompleteOnItems( 'reveal', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.reveal(); + }); +}; + +/** + * hide a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.hide = function( items ) { + this._emitCompleteOnItems( 'hide', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.hide(); + }); +}; + +/** + * reveal item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.revealItemElements = function( elems ) { + var items = this.getItems( elems ); + this.reveal( items ); +}; + +/** + * hide item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.hideItemElements = function( elems ) { + var items = this.getItems( elems ); + this.hide( items ); +}; + +/** + * get Outlayer.Item, given an Element + * @param {Element} elem + * @param {Function} callback + * @returns {Outlayer.Item} item + */ +proto.getItem = function( elem ) { + // loop through items to get the one that matches + for ( var i=0; i < this.items.length; i++ ) { + var item = this.items[i]; + if ( item.element == elem ) { + // return item + return item; + } + } +}; + +/** + * get collection of Outlayer.Items, given Elements + * @param {Array} elems + * @returns {Array} items - Outlayer.Items + */ +proto.getItems = function( elems ) { + elems = utils.makeArray( elems ); + var items = []; + elems.forEach( function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + items.push( item ); + } + }, this ); + + return items; +}; + +/** + * remove element(s) from instance and DOM + * @param {Array or NodeList or Element} elems + */ +proto.remove = function( elems ) { + var removeItems = this.getItems( elems ); + + this._emitCompleteOnItems( 'remove', removeItems ); + + // bail if no items to remove + if ( !removeItems || !removeItems.length ) { + return; + } + + removeItems.forEach( function( item ) { + item.remove(); + // remove item from collection + utils.removeFrom( this.items, item ); + }, this ); +}; + +// ----- destroy ----- // + +// remove and disable Outlayer instance +proto.destroy = function() { + // clean up dynamic styles + var style = this.element.style; + style.height = ''; + style.position = ''; + style.width = ''; + // destroy items + this.items.forEach( function( item ) { + item.destroy(); + }); + + this.unbindResize(); + + var id = this.element.outlayerGUID; + delete instances[ id ]; // remove reference to instance by id + delete this.element.outlayerGUID; + // remove data for jQuery + if ( jQuery ) { + jQuery.removeData( this.element, this.constructor.namespace ); + } + +}; + +// -------------------------- data -------------------------- // + +/** + * get Outlayer instance from element + * @param {Element} elem + * @returns {Outlayer} + */ +Outlayer.data = function( elem ) { + elem = utils.getQueryElement( elem ); + var id = elem && elem.outlayerGUID; + return id && instances[ id ]; +}; + + +// -------------------------- create Outlayer class -------------------------- // + +/** + * create a layout class + * @param {String} namespace + */ +Outlayer.create = function( namespace, options ) { + // sub-class Outlayer + var Layout = subclass( Outlayer ); + // apply new options and compatOptions + Layout.defaults = utils.extend( {}, Outlayer.defaults ); + utils.extend( Layout.defaults, options ); + Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions ); + + Layout.namespace = namespace; + + Layout.data = Outlayer.data; + + // sub-class Item + Layout.Item = subclass( Item ); + + // -------------------------- declarative -------------------------- // + + utils.htmlInit( Layout, namespace ); + + // -------------------------- jQuery bridge -------------------------- // + + // make into jQuery plugin + if ( jQuery && jQuery.bridget ) { + jQuery.bridget( namespace, Layout ); + } + + return Layout; +}; + +function subclass( Parent ) { + function SubClass() { + Parent.apply( this, arguments ); + } + + SubClass.prototype = Object.create( Parent.prototype ); + SubClass.prototype.constructor = SubClass; + + return SubClass; +} + +// ----- helpers ----- // + +// how many milliseconds are in each unit +var msUnits = { + ms: 1, + s: 1000 +}; + +// munge time-like parameter into millisecond number +// '0.4s' -> 40 +function getMilliseconds( time ) { + if ( typeof time == 'number' ) { + return time; + } + var matches = time.match( /(^\d*\.?\d*)(\w*)/ ); + var num = matches && matches[1]; + var unit = matches && matches[2]; + if ( !num.length ) { + return 0; + } + num = parseFloat( num ); + var mult = msUnits[ unit ] || 1; + return num * mult; +} + +// ----- fin ----- // + +// back in global +Outlayer.Item = Item; + +return Outlayer; + +})); + + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["React"]; + +/***/ }), + +/***/ "@wordpress/blocks": +/*!********************************!*\ + !*** external ["wp","blocks"] ***! + \********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["blocks"]; + +/***/ }), + +/***/ "@wordpress/data": +/*!******************************!*\ + !*** external ["wp","data"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["data"]; + +/***/ }), + +/***/ "@wordpress/element": +/*!*********************************!*\ + !*** external ["wp","element"] ***! + \*********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["element"]; + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "?9157": +/*!************************!*\ + !*** crypto (ignored) ***! + \************************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/adapters.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/adapters/adapters.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); +/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const knownAdapters = { + http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], + xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"] +} + +_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(knownAdapters, (fn, value) => { + if(fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + getAdapter: (adapters) => { + adapters = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if((adapter = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + break; + } + } + + if (!adapter) { + if (adapter === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( + `Adapter ${nameOrAdapter} is not supported by the environment`, + 'ERR_NOT_SUPPORT' + ); + } + + throw new Error( + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].hasOwnProp(knownAdapters, nameOrAdapter) ? + `Adapter '${nameOrAdapter}' is not available in the build` : + `Unknown adapter '${nameOrAdapter}'` + ); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFunction(adapter)) { + throw new TypeError('adapter is not a function'); + } + + return adapter; + }, + adapters: knownAdapters +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); +/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); + + + + + + + + + + + + + + + + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers).normalize(); + const responseType = config.responseType; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(requestData) && (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserWebWorkerEnv)) { + requestHeaders.setContentType(false); // Let the browser set it + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__["default"]; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv) { + // Add xsrf header + const xsrfValue = (config.withCredentials || (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath)) + && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__["default"].read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__["default"](null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__["default"])(fullPath); + + if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].protocols.indexOf(protocol) === -1) { + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); +/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); +/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); +/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); + + + + + + + + + + + + + + + + + + + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); + const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); + + // Copy axios.prototype to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); + + // Copy context to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); + +// Expose Axios class to allow class inheritance +axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + +// Expose Cancel & CancelToken +axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; +axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; +axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; +axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; +axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; + +// Expose AxiosError class +axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; + +// Expose isAxiosError +axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; + +// Expose mergeConfig +axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; + +axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; + +axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__["default"]; + +axios.default = axios; + +// this module should only have a default export +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); + + + + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CanceledError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { + __CANCEL__: true +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isCancel) +/* harmony export */ }); + + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); +/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); +/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + + + + + + +const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), + response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + let contextHeaders; + + // Flatten headers + contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( + headers.common, + headers[config.method] + ); + + contextHeaders && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url); + return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosError.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosError.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); + + + + + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +function isValidHeaderName(str) { + return /^[-_a-zA-Z]+$/.test(str.trim()); +} + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { + return parser.call(this, value, key); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders.prototype); +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildFullPath) +/* harmony export */ }); +/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); + + + + + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { + return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); + } + return requestedURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ dispatchRequest) +/* harmony export */ }); +/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); + + + + + + + + + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); + + // Transform request data + config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + response + ); + + response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergeConfig) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + +const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ settle) +/* harmony export */ }); +/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( + 'Request failed with status code ' + response.status, + [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ transformData) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + const context = response || config; + const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); + let data = context.data; + + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/index.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/defaults/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); + + + + + + + + + + +const DEFAULT_CONTENT_TYPE = { + 'Content-Type': undefined +}; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); + + if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) + ) { + return data; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { + return data.buffer; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); + } + + if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, + Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(DEFAULT_CONTENT_TYPE); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/transitional.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/defaults/transitional.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/env/data.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/env/data.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "VERSION": () => (/* binding */ VERSION) +/* harmony export */ }); +const VERSION = "1.3.4"; + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": +/*!****************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); + + + + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ bind) +/* harmony export */ }); + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildURL) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + + + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? + params.toString() : + new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ combineURLs) +/* harmony export */ }); + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) { + cookie.push('path=' + path); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + +// Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; + + if (isLast) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { + const obj = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAbsoluteURL) +/* harmony export */ }); + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAxiosError) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/null.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/null.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +// eslint-disable-next-line strict +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ parseProtocol) +/* harmony export */ }); + + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/speedometer.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/speedometer.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ spread) +/* harmony export */ }); + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toFormData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toFormData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); + + + + +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored + + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); +} + +const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || + ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { + const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( + formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": +/*!************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ toURLEncodedForm) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + + +function toURLEncodedForm(data, options) { + return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/validator.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/validator.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); + } + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assertOptions, + validators +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": +/*!*****************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": +/*!*********************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": +/*!****************************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/index.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); +/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); +/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); + + + + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== 'undefined' && ( + (product = navigator.product) === 'ReactNative' || + product === 'NativeScript' || + product === 'NS') + ) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; +})(); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + const isStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isBrowser: true, + classes: { + URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], + FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], + Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); + + + + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + const pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + if (reducer(descriptor, name, obj) !== false) { + reducedDescriptors[name] = descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject +}); + + +/***/ }), + +/***/ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs": +/*!*****************************************************************************************!*\ + !*** ./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "InView": () => (/* binding */ InView), +/* harmony export */ "defaultFallbackInView": () => (/* binding */ defaultFallbackInView), +/* harmony export */ "observe": () => (/* binding */ observe), +/* harmony export */ "useInView": () => (/* binding */ useInView) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); + + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const observerMap = new Map(); +const RootIds = new WeakMap(); +let rootId = 0; +let unsupportedValue = undefined; +/** + * What should be the default behavior if the IntersectionObserver is unsupported? + * Ideally the polyfill has been loaded, you can have the following happen: + * - `undefined`: Throw an error + * - `true` or `false`: Set the `inView` value to this regardless of intersection state + * **/ + +function defaultFallbackInView(inView) { + unsupportedValue = inView; +} +/** + * Generate a unique ID for the root element + * @param root + */ + +function getRootId(root) { + if (!root) return '0'; + if (RootIds.has(root)) return RootIds.get(root); + rootId += 1; + RootIds.set(root, rootId.toString()); + return RootIds.get(root); +} +/** + * Convert the options to a string Id, based on the values. + * Ensures we can reuse the same observer when observing elements with the same options. + * @param options + */ + + +function optionsToId(options) { + return Object.keys(options).sort().filter(key => options[key] !== undefined).map(key => { + return `${key}_${key === 'root' ? getRootId(options.root) : options[key]}`; + }).toString(); +} + +function createObserver(options) { + // Create a unique ID for this observer instance, based on the root, root margin and threshold. + let id = optionsToId(options); + let instance = observerMap.get(id); + + if (!instance) { + // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view. + const elements = new Map(); + let thresholds; + const observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + var _elements$get; + + // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it. + // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0 + const inView = entry.isIntersecting && thresholds.some(threshold => entry.intersectionRatio >= threshold); // @ts-ignore support IntersectionObserver v2 + + if (options.trackVisibility && typeof entry.isVisible === 'undefined') { + // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. + // @ts-ignore + entry.isVisible = inView; + } + + (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(callback => { + callback(inView, entry); + }); + }); + }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options + + thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]); + instance = { + id, + observer, + elements + }; + observerMap.set(id, instance); + } + + return instance; +} +/** + * @param element - DOM Element to observe + * @param callback - Callback function to trigger when intersection status changes + * @param options - Intersection Observer options + * @param fallbackInView - Fallback inView value. + * @return Function - Cleanup function that should be triggered to unregister the observer + */ + + +function observe(element, callback, options = {}, fallbackInView = unsupportedValue) { + if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) { + const bounds = element.getBoundingClientRect(); + callback(fallbackInView, { + isIntersecting: fallbackInView, + target: element, + intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0, + time: 0, + boundingClientRect: bounds, + intersectionRect: bounds, + rootBounds: bounds + }); + return () => {// Nothing to cleanup + }; + } // An observer with the same options can be reused, so lets use this fact + + + const { + id, + observer, + elements + } = createObserver(options); // Register the callback listener for this element + + let callbacks = elements.get(element) || []; + + if (!elements.has(element)) { + elements.set(element, callbacks); + } + + callbacks.push(callback); + observer.observe(element); + return function unobserve() { + // Remove the callback from the callback list + callbacks.splice(callbacks.indexOf(callback), 1); + + if (callbacks.length === 0) { + // No more callback exists for element, so destroy it + elements.delete(element); + observer.unobserve(element); + } + + if (elements.size === 0) { + // No more elements are being observer by this instance, so destroy it + observer.disconnect(); + observerMap.delete(id); + } + }; +} + +const _excluded = ["children", "as", "triggerOnce", "threshold", "root", "rootMargin", "onChange", "skip", "trackVisibility", "delay", "initialInView", "fallbackInView"]; + +function isPlainChildren(props) { + return typeof props.children !== 'function'; +} +/** + ## Render props + + To use the `` component, you pass it a function. It will be called + whenever the state changes, with the new value of `inView`. In addition to the + `inView` prop, children also receive a `ref` that should be set on the + containing DOM element. This is the element that the IntersectionObserver will + monitor. + + If you need it, you can also access the + [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) + on `entry`, giving you access to all the details about the current intersection + state. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + + {({ inView, ref, entry }) => ( +

+

{`Header inside viewport ${inView}.`}

+
+ )} + + ); + + export default Component; + ``` + + ## Plain children + + You can pass any element to the ``, and it will handle creating the + wrapping DOM element. Add a handler to the `onChange` method, and control the + state in your own component. Any extra props you add to `` will be + passed to the HTML element, allowing you set the `className`, `style`, etc. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + console.log('Inview:', inView)}> +

Plain children are always rendered. Use onChange to monitor state.

+
+ ); + + export default Component; + ``` + */ + + +class InView extends react__WEBPACK_IMPORTED_MODULE_0__.Component { + constructor(props) { + super(props); + this.node = null; + this._unobserveCb = null; + + this.handleNode = node => { + if (this.node) { + // Clear the old observer, before we start observing a new element + this.unobserve(); + + if (!node && !this.props.triggerOnce && !this.props.skip) { + // Reset the state if we get a new node, and we aren't ignoring updates + this.setState({ + inView: !!this.props.initialInView, + entry: undefined + }); + } + } + + this.node = node ? node : null; + this.observeNode(); + }; + + this.handleChange = (inView, entry) => { + if (inView && this.props.triggerOnce) { + // If `triggerOnce` is true, we should stop observing the element. + this.unobserve(); + } + + if (!isPlainChildren(this.props)) { + // Store the current State, so we can pass it to the children in the next render update + // There's no reason to update the state for plain children, since it's not used in the rendering. + this.setState({ + inView, + entry + }); + } + + if (this.props.onChange) { + // If the user is actively listening for onChange, always trigger it + this.props.onChange(inView, entry); + } + }; + + this.state = { + inView: !!props.initialInView, + entry: undefined + }; + } + + componentDidUpdate(prevProps) { + // If a IntersectionObserver option changed, reinit the observer + if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) { + this.unobserve(); + this.observeNode(); + } + } + + componentWillUnmount() { + this.unobserve(); + this.node = null; + } + + observeNode() { + if (!this.node || this.props.skip) return; + const { + threshold, + root, + rootMargin, + trackVisibility, + delay, + fallbackInView + } = this.props; + this._unobserveCb = observe(this.node, this.handleChange, { + threshold, + root, + rootMargin, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + } + + unobserve() { + if (this._unobserveCb) { + this._unobserveCb(); + + this._unobserveCb = null; + } + } + + render() { + if (!isPlainChildren(this.props)) { + const { + inView, + entry + } = this.state; + return this.props.children({ + inView, + entry, + ref: this.handleNode + }); + } + + const _this$props = this.props, + { + children, + as + } = _this$props, + props = _objectWithoutPropertiesLoose(_this$props, _excluded); + + return react__WEBPACK_IMPORTED_MODULE_0__.createElement(as || 'div', _extends({ + ref: this.handleNode + }, props), children); + } + +} + +/** + * React Hooks make it easy to monitor the `inView` state of your components. Call + * the `useInView` hook with the (optional) [options](#options) you need. It will + * return an array containing a `ref`, the `inView` status and the current + * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry). + * Assign the `ref` to the DOM element you want to monitor, and the hook will + * report the status. + * + * @example + * ```jsx + * import React from 'react'; + * import { useInView } from 'react-intersection-observer'; + * + * const Component = () => { + * const { ref, inView, entry } = useInView({ + * threshold: 0, + * }); + * + * return ( + *
+ *

{`Header inside viewport ${inView}.`}

+ *
+ * ); + * }; + * ``` + */ + +function useInView({ + threshold, + delay, + trackVisibility, + rootMargin, + root, + triggerOnce, + skip, + initialInView, + fallbackInView, + onChange +} = {}) { + var _state$entry; + + const [ref, setRef] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null); + const callback = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + const [state, setState] = react__WEBPACK_IMPORTED_MODULE_0__.useState({ + inView: !!initialInView, + entry: undefined + }); // Store the onChange callback in a `ref`, so we can access the latest instance + // inside the `useEffect`, but without triggering a rerender. + + callback.current = onChange; + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { + // Ensure we have node ref, and that we shouldn't skip observing + if (skip || !ref) return; + let unobserve; + unobserve = observe(ref, (inView, entry) => { + setState({ + inView, + entry + }); + if (callback.current) callback.current(inView, entry); + + if (entry.isIntersecting && triggerOnce && unobserve) { + // If it should only trigger once, unobserve the element after it's inView + unobserve(); + unobserve = undefined; + } + }, { + root, + rootMargin, + threshold, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + return () => { + if (unobserve) { + unobserve(); + } + }; + }, // We break the rule here, because we aren't including the actual `threshold` variable + // eslint-disable-next-line react-hooks/exhaustive-deps + [// If the threshold is an array, convert it to a string, so it won't change between renders. + // eslint-disable-next-line react-hooks/exhaustive-deps + Array.isArray(threshold) ? threshold.toString() : threshold, ref, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]); + const entryTarget = (_state$entry = state.entry) == null ? void 0 : _state$entry.target; + const previousEntryTarget = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + + if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) { + // If we don't have a node ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`) + // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView + previousEntryTarget.current = entryTarget; + setState({ + inView: !!initialInView, + entry: undefined + }); + } + + const result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values. + + result.ref = result[0]; + result.inView = result[1]; + result.entry = result[2]; + return result; +} + + +//# sourceMappingURL=react-intersection-observer.modern.mjs.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!*******************************!*\ + !*** ./src/js/media-modal.js ***! + \*******************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _components_InstantImages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/InstantImages */ "./src/js/components/InstantImages.js"); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_getProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./functions/getProvider */ "./src/js/functions/getProvider.js"); +/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./functions/getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./functions/session */ "./src/js/functions/session.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + + + + + + + + + +// Global vars +var activeFrameId = ""; +var activeFrame = ""; + +// Load MediaFrame deps +var oldMediaFrame = wp.media.view.MediaFrame.Post; +var oldMediaFrameSelect = wp.media.view.MediaFrame.Select; + +// Create Instant Images Tabs +wp.media.view.MediaFrame.Select = oldMediaFrameSelect.extend({ + // Tab / Router + browseRouter: function browseRouter(routerView) { + var _instant_img_localize; + oldMediaFrameSelect.prototype.browseRouter.apply(this, arguments); + routerView.set({ + instantimages: { + text: (_instant_img_localize = instant_img_localize) === null || _instant_img_localize === void 0 ? void 0 : _instant_img_localize.instant_images, + // eslint-disable-line no-undef + priority: 120 + } + }); + }, + // Handlers + bindHandlers: function bindHandlers() { + oldMediaFrameSelect.prototype.bindHandlers.apply(this, arguments); + this.on("content:create:instantimages", this.frameContent, this); + }, + /** + * Render callback for the content region in the `browse` mode. + */ + frameContent: function frameContent() { + var state = this.state(); + // Get active frame + if (state) { + activeFrameId = state.id; + activeFrame = state.frame.el; + } + }, + /** + * Get the current frame. + * + * @param {string} id The ID. + */ + getFrame: function getFrame(id) { + return this.states.findWhere({ + id: id + }); + } +}); +wp.media.view.MediaFrame.Post = oldMediaFrame.extend({ + // Tab / Router + browseRouter: function browseRouter(routerView) { + var _instant_img_localize2; + oldMediaFrameSelect.prototype.browseRouter.apply(this, arguments); + routerView.set({ + instantimages: { + text: (_instant_img_localize2 = instant_img_localize) === null || _instant_img_localize2 === void 0 ? void 0 : _instant_img_localize2.instant_images, + // eslint-disable-line no-undef + priority: 120 + } + }); + }, + // Handlers + bindHandlers: function bindHandlers() { + oldMediaFrame.prototype.bindHandlers.apply(this, arguments); + this.on("content:create:instantimages", this.frameContent, this); + }, + /** + * Render callback for the content region in the `browse` mode. + */ + frameContent: function frameContent() { + var state = this.state(); + // Get active frame + if (state) { + activeFrameId = state.id; + activeFrame = state.frame.el; + } + }, + getFrame: function getFrame(id) { + return this.states.findWhere({ + id: id + }); + } +}); + +// Render Instant Images +var instantImagesMediaTab = function instantImagesMediaTab() { + if (!activeFrame) { + return false; // Exit if not a frame. + } + + var modal = activeFrame.querySelector(".media-frame-content"); // Get all media modals + if (!modal) { + return false; // Exit if not modal. + } + + modal.innerHTML = ""; // Clear any existing modals. + + var html = createWrapperHTML(); // Create HTML wrapper + modal.appendChild(html); // Append Instant Images to modal. + + var element = modal.querySelector("#instant-images-media-router-" + activeFrameId); + if (!element) { + return false; // Exit if not element. + } + + getMediaModalProvider(element); +}; + +/** + * Get the provider before initializing Instant Images. + * + * @param {Element} element The Instant Images HTML element to initialize. + */ +var getMediaModalProvider = /*#__PURE__*/function () { + var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(element) { + var provider, params, url, sessionData, response, status, headers, results, _results$error, error; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + // Get provider and options from settings. + provider = (0,_functions_getProvider__WEBPACK_IMPORTED_MODULE_4__["default"])(); // Build URL. + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_5__["default"])(provider); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_2__["default"])("photos", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_7__.getSession)(url); + if (!sessionData) { + _context.next = 8; + break; + } + // Display results from session. + renderApp(element, provider, sessionData, null); + _context.next = 26; + break; + case 8: + _context.next = 10; + return fetch(url); + case 10: + response = _context.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_6__.checkRateLimit)(headers); + _context.prev = 13; + _context.next = 16; + return response.json(); + case 16: + results = _context.sent; + _results$error = results.error, error = _results$error === void 0 ? null : _results$error; + renderApp(element, provider, results, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_7__.saveSession)(url, results); + _context.next = 26; + break; + case 22: + _context.prev = 22; + _context.t0 = _context["catch"](13); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, status); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_7__.deleteSession)(url); + case 26: + case "end": + return _context.stop(); + } + }, _callee, null, [[13, 22]]); + })); + return function getMediaModalProvider(_x) { + return _ref.apply(this, arguments); + }; +}(); + +/** + * Render the main Instant Images App component. + * + * @param {Element} element The Instant Images HTML element to initialize. + * @param {string} provider The verified provider. + * @param {Array} results The API results. + * @param {object|null} error The API error object. + */ +var renderApp = function renderApp(element, provider, results, error) { + if (_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot) { + var root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot)(element); + root.render( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "media-modal", + data: results, + container: element, + api_error: error, + provider: provider + })); + } else { + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.render)( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "media-modal", + data: results, + container: element, + api_error: error, + provider: provider + }), element); + } +}; + +/** + * Create HTML markup to wrap Instant Images. + * + * @return {Element} Create the HTML markup for the media modal. + */ +var createWrapperHTML = function createWrapperHTML() { + var wrapper = document.createElement("div"); + wrapper.classList.add("instant-img-container"); + var container = document.createElement("div"); + container.classList.add("instant-images-wrapper"); + var frame = document.createElement("div"); + frame.setAttribute("id", "instant-images-media-router-" + activeFrameId); + container.appendChild(frame); + wrapper.appendChild(container); + return wrapper; +}; + +// Document Ready +jQuery(document).ready(function ($) { + if (wp.media) { + // Open + wp.media.view.Modal.prototype.on("open", function () { + if (!activeFrame) { + return false; + } + var selectedTab = activeFrame.querySelector(".media-router button.media-menu-item.active"); + if (selectedTab && selectedTab.id === "menu-item-instantimages") { + instantImagesMediaTab(); + } + }); + + // Click Handler + $(document).on("click", ".media-router button.media-menu-item", function () { + var selectedTab = activeFrame.querySelector(".media-router button.media-menu-item.active"); + if (selectedTab && selectedTab.id === "menu-item-instantimages") { + instantImagesMediaTab(); + } + }); + } +}); +})(); + +/******/ })() +; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/plugin-sidebar/index.asset.php b/build/plugin-sidebar/index.asset.php index 9b681d3..237e5df 100644 --- a/build/plugin-sidebar/index.asset.php +++ b/build/plugin-sidebar/index.asset.php @@ -1 +1 @@ - array('react', 'wp-blocks', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '42313150bd42af3a10df'); + array('react', 'wp-blocks', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '8bf6ac03a29356a7529d'); diff --git a/build/plugin-sidebar/index.js b/build/plugin-sidebar/index.js index 8f4877e..9fe7534 100644 --- a/build/plugin-sidebar/index.js +++ b/build/plugin-sidebar/index.js @@ -1 +1,19860 @@ -(()=>{var e={4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t>>8^255&p^99,i[n]=p,o[p]=n;var m=e[n],v=e[m],g=e[v],y=257*e[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,l[n]=y<<8|y>>>24,c[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[p]=y<<24|y>>>8,f[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,n?(n=m^e[e[e[g^m]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a6&&a%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[a/n|0]<<24),o[a]=o[a-n]^c);for(var s=this._invKeySchedule=[],l=0;l>>24]]^f[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,l,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,f,h,d,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var l=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],f=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&h]^n[d++],v=r[u>>>24]^i[f>>>16&255]^o[h>>>8&255]^a[255&c]^n[d++],g=r[f>>>24]^i[h>>>16&255]^o[c>>>8&255]^a[255&u]^n[d++],y=r[h>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&f]^n[d++];c=m,u=v,f=g,h=y}m=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^n[d++],v=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^n[d++],g=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^n[d++],y=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[d++],e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},5109:function(e,t,n){var r,i,o,a,s,l,c,u,f,h,d,p,m,v,g,y,_,b,w;e.exports=(r=n(8249),n(888),void(r.lib.Cipher||(i=r,o=i.lib,a=o.Base,s=o.WordArray,l=o.BufferedBlockAlgorithm,c=i.enc,c.Utf8,u=c.Base64,f=i.algo.EvpKDF,h=o.Cipher=l.extend({cfg:a.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){l.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:_}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),o.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=a.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=d.CBC=function(){var e=p.extend();function t(e,t,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:v}),reset:function(){var e;h.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),g=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},_=o.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(i.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=s.random(8));var i=f.create({keySize:t+n}).compute(e,r),o=s.create(i.words.slice(t),4*n);return i.sigBytes=4*t,g.create({key:i,iv:o,salt:r})}},w=o.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=_.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,_.decrypt.call(this,e,t,i.key,r)}}))))},8249:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(2480)}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},s=a.lib={},l=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=l.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},d=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*l,o);if(l){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},3786:function(e,t,n){var r,i,o;e.exports=(r=n(8249),o=(i=r).lib.WordArray,i.enc.Base64url={stringify:function(e,t=!0){var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,l=0;l<4&&a+.75*l>>6*(3-l)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e,t=!0){var n=e.length,r=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(e,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},r.enc.Base64url)},298:function(e,t,n){var r;e.exports=(r=n(8249),function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},888:function(e,t,n){var r,i,o,a,s,l,c,u;e.exports=(u=n(8249),n(2783),n(9824),o=(i=(r=u).lib).Base,a=i.WordArray,l=(s=r.algo).MD5,c=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),o=a.create(),s=o.words,l=r.keySize,c=r.iterations;s.lengthr&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,l=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},8214:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],l=e[t+1],d=e[t+2],p=e[t+3],m=e[t+4],v=e[t+5],g=e[t+6],y=e[t+7],_=e[t+8],b=e[t+9],w=e[t+10],E=e[t+11],S=e[t+12],R=e[t+13],x=e[t+14],k=e[t+15],O=o[0],C=o[1],A=o[2],B=o[3];O=c(O,C,A,B,a,7,s[0]),B=c(B,O,C,A,l,12,s[1]),A=c(A,B,O,C,d,17,s[2]),C=c(C,A,B,O,p,22,s[3]),O=c(O,C,A,B,m,7,s[4]),B=c(B,O,C,A,v,12,s[5]),A=c(A,B,O,C,g,17,s[6]),C=c(C,A,B,O,y,22,s[7]),O=c(O,C,A,B,_,7,s[8]),B=c(B,O,C,A,b,12,s[9]),A=c(A,B,O,C,w,17,s[10]),C=c(C,A,B,O,E,22,s[11]),O=c(O,C,A,B,S,7,s[12]),B=c(B,O,C,A,R,12,s[13]),A=c(A,B,O,C,x,17,s[14]),O=u(O,C=c(C,A,B,O,k,22,s[15]),A,B,l,5,s[16]),B=u(B,O,C,A,g,9,s[17]),A=u(A,B,O,C,E,14,s[18]),C=u(C,A,B,O,a,20,s[19]),O=u(O,C,A,B,v,5,s[20]),B=u(B,O,C,A,w,9,s[21]),A=u(A,B,O,C,k,14,s[22]),C=u(C,A,B,O,m,20,s[23]),O=u(O,C,A,B,b,5,s[24]),B=u(B,O,C,A,x,9,s[25]),A=u(A,B,O,C,p,14,s[26]),C=u(C,A,B,O,_,20,s[27]),O=u(O,C,A,B,R,5,s[28]),B=u(B,O,C,A,d,9,s[29]),A=u(A,B,O,C,y,14,s[30]),O=f(O,C=u(C,A,B,O,S,20,s[31]),A,B,v,4,s[32]),B=f(B,O,C,A,_,11,s[33]),A=f(A,B,O,C,E,16,s[34]),C=f(C,A,B,O,x,23,s[35]),O=f(O,C,A,B,l,4,s[36]),B=f(B,O,C,A,m,11,s[37]),A=f(A,B,O,C,y,16,s[38]),C=f(C,A,B,O,w,23,s[39]),O=f(O,C,A,B,R,4,s[40]),B=f(B,O,C,A,a,11,s[41]),A=f(A,B,O,C,p,16,s[42]),C=f(C,A,B,O,g,23,s[43]),O=f(O,C,A,B,b,4,s[44]),B=f(B,O,C,A,S,11,s[45]),A=f(A,B,O,C,k,16,s[46]),O=h(O,C=f(C,A,B,O,d,23,s[47]),A,B,a,6,s[48]),B=h(B,O,C,A,y,10,s[49]),A=h(A,B,O,C,x,15,s[50]),C=h(C,A,B,O,v,21,s[51]),O=h(O,C,A,B,S,6,s[52]),B=h(B,O,C,A,p,10,s[53]),A=h(A,B,O,C,w,15,s[54]),C=h(C,A,B,O,l,21,s[55]),O=h(O,C,A,B,_,6,s[56]),B=h(B,O,C,A,k,10,s[57]),A=h(A,B,O,C,g,15,s[58]),C=h(C,A,B,O,R,21,s[59]),O=h(O,C,A,B,m,6,s[60]),B=h(B,O,C,A,E,10,s[61]),A=h(A,B,O,C,d,15,s[62]),C=h(C,A,B,O,b,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+B|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<>>32-o)+t}function u(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<>>32-o)+t}function f(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<>>32-o)+t}function h(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),r.MD5)},8568:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var l=0;l>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},2807:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},1077:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6991:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},6475:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},2112:function(e,t,n){var r,i,o,a,s,l,c,u,f;e.exports=(f=n(8249),n(2783),n(9824),o=(i=(r=f).lib).Base,a=i.WordArray,l=(s=r.algo).SHA1,c=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=c.create(n.hasher,e),i=a.create(),o=a.create([1]),s=i.words,l=o.words,u=n.keySize,f=n.iterations;s.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,h=u<<16|65535&c;for(r[0]^=c,r[1]^=f,r[2]^=u,r[3]^=h,r[4]^=c,r[5]^=f,r[6]^=u,r[7]^=h,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,l=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=l^c}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)},4454:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,h=u<<16|65535&c;for(i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=h,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=h,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,l=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=l^c}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)},1857:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=t[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var l=r[i];r[i]=r[o],r[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)},706:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,b,w,E,S,R,x,k,O,C=this._hash.words,A=f.words,B=h.words,L=s.words,N=l.words,j=c.words,P=u.words;for(E=o=C[0],S=a=C[1],R=d=C[2],x=b=C[3],k=w=C[4],n=0;n<80;n+=1)O=o+e[t+L[n]]|0,O+=n<16?p(a,d,b)+A[0]:n<32?m(a,d,b)+A[1]:n<48?v(a,d,b)+A[2]:n<64?g(a,d,b)+A[3]:y(a,d,b)+A[4],O=(O=_(O|=0,j[n]))+w|0,o=w,w=b,b=_(d,10),d=a,a=O,O=E+e[t+N[n]]|0,O+=n<16?y(S,R,x)+B[0]:n<32?g(S,R,x)+B[1]:n<48?v(S,R,x)+B[2]:n<64?m(S,R,x)+B[3]:p(S,R,x)+B[4],O=(O=_(O|=0,P[n]))+k|0,E=k,k=x,x=_(R,10),R=S,S=O;O=C[1]+d+x|0,C[1]=C[2]+b+k|0,C[2]=C[3]+w+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+R|0,C[0]=O},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function v(e,t,n){return(e|~t)^n}function g(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function _(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(Math),r.RIPEMD160)},2783:function(e,t,n){var r,i,o,a,s,l,c,u;e.exports=(i=(r=u=n(8249)).lib,o=i.WordArray,a=i.Hasher,s=r.algo,l=[],c=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=0;c<80;c++){if(c<16)l[c]=0|e[t+c];else{var u=l[c-3]^l[c-8]^l[c-14]^l[c-16];l[c]=u<<1|u>>>31}var f=(r<<5|r>>>27)+s+l[c];f+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=a._createHelper(c),r.HmacSHA1=a._createHmacHelper(c),u.SHA1)},7792:function(e,t,n){var r,i,o,a,s,l;e.exports=(l=n(8249),n(2153),i=(r=l).lib.WordArray,o=r.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=a._createHelper(s),r.HmacSHA224=a._createHmacHelper(s),l.SHA224)},2153:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(s[i]=n(e.pow(r,.5))),l[i]=n(e.pow(r,1/3)),i++),r++}();var c=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var p=c[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[d]=m+c[d-7]+g+c[d-16]}var y=r&i^r&o^i&o,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&f)+l[d]+c[d];h=f,f=u,u=s,s=a+b|0,a=o,o=i,i=r,r=b+(_+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(u),t.HmacSHA256=o._createHmacHelper(u)}(Math),r.SHA256)},3327:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,l=[],c=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){l[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=n[i]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,m=0;m<5;m++)d^=(C=n[h+5*m]).high,p^=C.low;var v=f[h];v.high=d,v.low=p}for(h=0;h<5;h++){var g=f[(h+4)%5],y=f[(h+1)%5],_=y.high,b=y.low;for(d=g.high^(_<<1|b>>>31),p=g.low^(b<<1|_>>>31),m=0;m<5;m++)(C=n[h+5*m]).high^=d,C.low^=p}for(var w=1;w<25;w++){var E=(C=n[w]).high,S=C.low,R=l[w];R<32?(d=E<>>32-R,p=S<>>32-R):(d=S<>>64-R,p=E<>>64-R);var x=f[c[w]];x.high=d,x.low=p}var k=f[0],O=n[0];for(k.high=O.high,k.low=O.low,h=0;h<5;h++)for(m=0;m<5;m++){var C=n[w=h+5*m],A=f[w],B=f[(h+1)%5+5*m],L=f[(h+2)%5+5*m];C.high=A.high^~B.high&L.high,C.low=A.low^~B.low&L.low}C=n[0];var N=u[s];C.high^=N.high,C.low^=N.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),c.push(d),c.push(h)}return new i.init(c,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=o._createHelper(h),t.HmacSHA3=o._createHmacHelper(h)}(Math),r.SHA3)},7460:function(e,t,n){var r,i,o,a,s,l,c,u;e.exports=(u=n(8249),n(4938),n(34),i=(r=u).x64,o=i.Word,a=i.WordArray,s=r.algo,l=s.SHA512,c=s.SHA384=l.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=l._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=l._createHelper(c),r.HmacSHA384=l._createHmacHelper(c),u.SHA384)},34:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var u=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=r.high,p=r.low,m=i.high,v=i.low,g=o.high,y=o.low,_=a.high,b=a.low,w=s.high,E=s.low,S=u.high,R=u.low,x=f.high,k=f.low,O=h.high,C=h.low,A=d,B=p,L=m,N=v,j=g,P=y,z=_,I=b,T=w,M=E,D=S,F=R,H=x,W=k,U=O,q=C,V=0;V<80;V++){var G,J,Y=c[V];if(V<16)J=Y.high=0|e[t+2*V],G=Y.low=0|e[t+2*V+1];else{var K=c[V-15],X=K.high,$=K.low,Z=(X>>>1|$<<31)^(X>>>8|$<<24)^X>>>7,Q=($>>>1|X<<31)^($>>>8|X<<24)^($>>>7|X<<25),ee=c[V-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=c[V-7],ae=oe.high,se=oe.low,le=c[V-16],ce=le.high,ue=le.low;J=(J=(J=Z+ae+((G=Q+se)>>>0>>0?1:0))+re+((G+=ie)>>>0>>0?1:0))+ce+((G+=ue)>>>0>>0?1:0),Y.high=J,Y.low=G}var fe,he=T&D^~T&H,de=M&F^~M&W,pe=A&L^A&j^L&j,me=B&N^B&P^N&P,ve=(A>>>28|B<<4)^(A<<30|B>>>2)^(A<<25|B>>>7),ge=(B>>>28|A<<4)^(B<<30|A>>>2)^(B<<25|A>>>7),ye=(T>>>14|M<<18)^(T>>>18|M<<14)^(T<<23|M>>>9),_e=(M>>>14|T<<18)^(M>>>18|T<<14)^(M<<23|T>>>9),be=l[V],we=be.high,Ee=be.low,Se=U+ye+((fe=q+_e)>>>0>>0?1:0),Re=ge+me;U=H,q=W,H=D,W=F,D=T,F=M,T=z+(Se=(Se=(Se=Se+he+((fe+=de)>>>0>>0?1:0))+we+((fe+=Ee)>>>0>>0?1:0))+J+((fe+=G)>>>0>>0?1:0))+((M=I+fe|0)>>>0>>0?1:0)|0,z=j,I=P,j=L,P=N,L=A,N=B,A=Se+(ve+pe+(Re>>>0>>0?1:0))+((B=fe+Re|0)>>>0>>0?1:0)|0}p=r.low=p+B,r.high=d+A+(p>>>0>>0?1:0),v=i.low=v+N,i.high=m+L+(v>>>0>>0?1:0),y=o.low=y+P,o.high=g+j+(y>>>0

>>0?1:0),b=a.low=b+I,a.high=_+z+(b>>>0>>0?1:0),E=s.low=E+M,s.high=w+T+(E>>>0>>0?1:0),R=u.low=R+F,u.high=S+D+(R>>>0>>0?1:0),k=f.low=k+W,f.high=x+H+(k>>>0>>0?1:0),C=h.low=C+q,h.high=O+U+(C>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},4253:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var c=i[o]=[],u=l[o];for(n=0;n<24;n++)c[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,c[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((a^i[l])&u[l])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=f.createEncryptor(n.create(t)),this._des2=f.createEncryptor(n.create(r)),this._des3=f.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),r.TripleDES)},4938:function(e,t,n){var r,i,o,a,s,l;e.exports=(r=n(8249),o=(i=r).lib,a=o.Base,s=o.WordArray,(l=i.x64={}).Word=a.extend({init:function(e,t){this.high=e,this.low=t}}),l.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{var r,i;!function(o,a){"use strict";void 0===(i="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=i)}(window,(function(){"use strict";var e=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0;n{var r,i;!function(o,a){r=[n(9741)],i=function(e){return function(e,t){"use strict";var n={extend:function(e,t){for(var n in t)e[n]=t[n];return e},modulo:function(e,t){return(e%t+t)%t}},r=Array.prototype.slice;n.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?r.call(e):[e]},n.removeFrom=function(e,t){var n=e.indexOf(t);-1!=n&&e.splice(n,1)},n.getParent=function(e,n){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,n))return e},n.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},n.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.filterFindElements=function(e,r){e=n.makeArray(e);var i=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(r){t(e,r)&&i.push(e);for(var n=e.querySelectorAll(r),o=0;o{var r,i;window,void 0===(i="function"==typeof(r=function(){"use strict";function e(e){var t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}var t="undefined"==typeof console?function(){}:function(e){console.error(e)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=n.length;function i(e){var n=getComputedStyle(e);return n||t("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var o,a=!1;function s(t){if(function(){if(!a){a=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(t);var r=i(t);o=200==Math.round(e(r.width)),s.isBoxSizeOuter=o,n.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var l=i(t);if("none"==l.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t{setTimeout((()=>{this.progress(e,t,n)}))};this.images.forEach((function(t){t.once("progress",e),t.check()}))},i.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log(`progress: ${n}`,e,t)},i.prototype.complete=function(){let e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){let e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},s.prototype=Object.create(t.prototype),s.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},s.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},s.prototype.confirm=function(e,t){this.isLoaded=e;let{parentNode:n}=this.img,r="PICTURE"===n.nodeName?n:this.img;this.emitEvent("progress",[this,r,t])},s.prototype.handleEvent=function(e){let t="on"+e.type;this[t]&&this[t](e)},s.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},s.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},s.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype=Object.create(s.prototype),l.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},l.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},i.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&(n=t,n.fn.imagesLoaded=function(e,t){return new i(this,e,t).jqDeferred.promise(n(this))})},i.makeJQueryPlugin(),i}))},8751:(e,t,n)=>{var r,i,o;window,i=[n(1794),n(6131)],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n=e.create("masonry");n.compatOptions.fitWidth="isFitWidth";var r=n.prototype;return r._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var e=0;e1&&n+e>this.cols?0:n;var r=t.size.outerWidth&&t.size.outerHeight;return this.horizontalColIndex=r?n+e:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,e)}},r._manageStamp=function(e){var n=t(e),r=this._getElementOffset(e),i=this._getOption("originLeft")?r.left:r.right,o=i+n.outerWidth,a=Math.floor(i/this.columnWidth);a=Math.max(0,a);var s=Math.floor(o/this.columnWidth);s-=o%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var l=(this._getOption("originTop")?r.top:r.bottom)+n.outerHeight,c=a;c<=s;c++)this.colYs[c]=Math.max(l,this.colYs[c])},r._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var e={height:this.maxY};return this._getOption("fitWidth")&&(e.width=this._getContainerFitWidth()),e},r._getContainerFitWidth=function(){for(var e=0,t=this.cols;--t&&0===this.colYs[t];)e++;return(this.cols-e)*this.columnWidth-this.gutter},r.needsResizeLayout=function(){var e=this.containerWidth;return this.getContainerWidth(),e!=this.containerWidth},n})?r.apply(t,i):r)||(e.exports=o)},652:(e,t,n)=>{var r,i,o;window,i=[n(1206),n(6131)],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n=document.documentElement.style,r="string"==typeof n.transition?"transition":"WebkitTransition",i="string"==typeof n.transform?"transform":"WebkitTransform",o={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],a={transform:i,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"};function s(e,t){e&&(this.element=e,this.layout=t,this.position={x:0,y:0},this._create())}var l=s.prototype=Object.create(e.prototype);l.constructor=s,l._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},l.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},l.getSize=function(){this.size=t(this.element)},l.css=function(e){var t=this.element.style;for(var n in e)t[a[n]||n]=e[n]},l.getPosition=function(){var e=getComputedStyle(this.element),t=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),r=e[t?"left":"right"],i=e[n?"top":"bottom"],o=parseFloat(r),a=parseFloat(i),s=this.layout.size;-1!=r.indexOf("%")&&(o=o/100*s.width),-1!=i.indexOf("%")&&(a=a/100*s.height),o=isNaN(o)?0:o,a=isNaN(a)?0:a,o-=t?s.paddingLeft:s.paddingRight,a-=n?s.paddingTop:s.paddingBottom,this.position.x=o,this.position.y=a},l.layoutPosition=function(){var e=this.layout.size,t={},n=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop"),i=n?"paddingLeft":"paddingRight",o=n?"left":"right",a=n?"right":"left",s=this.position.x+e[i];t[o]=this.getXValue(s),t[a]="";var l=r?"paddingTop":"paddingBottom",c=r?"top":"bottom",u=r?"bottom":"top",f=this.position.y+e[l];t[c]=this.getYValue(f),t[u]="",this.css(t),this.emitEvent("layout",[this])},l.getXValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!t?e/this.layout.size.width*100+"%":e+"px"},l.getYValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&t?e/this.layout.size.height*100+"%":e+"px"},l._transitionTo=function(e,t){this.getPosition();var n=this.position.x,r=this.position.y,i=e==this.position.x&&t==this.position.y;if(this.setPosition(e,t),!i||this.isTransitioning){var o=e-n,a=t-r,s={};s.transform=this.getTranslate(o,a),this.transition({to:s,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},l.getTranslate=function(e,t){return"translate3d("+(e=this.layout._getOption("originLeft")?e:-e)+"px, "+(t=this.layout._getOption("originTop")?t:-t)+"px, 0)"},l.goTo=function(e,t){this.setPosition(e,t),this.layoutPosition()},l.moveTo=l._transitionTo,l.setPosition=function(e,t){this.position.x=parseFloat(e),this.position.y=parseFloat(t)},l._nonTransition=function(e){for(var t in this.css(e.to),e.isCleaning&&this._removeStyles(e.to),e.onTransitionEnd)e.onTransitionEnd[t].call(this)},l.transition=function(e){if(parseFloat(this.layout.options.transitionDuration)){var t=this._transn;for(var n in e.onTransitionEnd)t.onEnd[n]=e.onTransitionEnd[n];for(n in e.to)t.ingProperties[n]=!0,e.isCleaning&&(t.clean[n]=!0);e.from&&(this.css(e.from),this.element.offsetHeight),this.enableTransition(e.to),this.css(e.to),this.isTransitioning=!0}else this._nonTransition(e)};var c="opacity,"+i.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}));l.enableTransition=function(){if(!this.isTransitioning){var e=this.layout.options.transitionDuration;e="number"==typeof e?e+"ms":e,this.css({transitionProperty:c,transitionDuration:e,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(o,this,!1)}},l.onwebkitTransitionEnd=function(e){this.ontransitionend(e)},l.onotransitionend=function(e){this.ontransitionend(e)};var u={"-webkit-transform":"transform"};l.ontransitionend=function(e){if(e.target===this.element){var t=this._transn,n=u[e.propertyName]||e.propertyName;delete t.ingProperties[n],function(e){for(var t in e)return!1;return!0}(t.ingProperties)&&this.disableTransition(),n in t.clean&&(this.element.style[e.propertyName]="",delete t.clean[n]),n in t.onEnd&&(t.onEnd[n].call(this),delete t.onEnd[n]),this.emitEvent("transitionEnd",[this])}},l.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},l._removeStyles=function(e){var t={};for(var n in e)t[n]="";this.css(t)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return l.removeTransitionStyles=function(){this.css(f)},l.stagger=function(e){e=isNaN(e)?0:e,this.staggerDelay=e+"ms"},l.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},l.remove=function(){r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},l.reveal=function(){delete this.isHidden,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:e.hiddenStyle,to:e.visibleStyle,isCleaning:!0,onTransitionEnd:t})},l.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},l.getHideRevealTransitionEndProperty=function(e){var t=this.layout.options[e];if(t.opacity)return"opacity";for(var n in t)return n},l.hide=function(){this.isHidden=!0,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:e.visibleStyle,to:e.hiddenStyle,isCleaning:!0,onTransitionEnd:t})},l.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},l.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s})?r.apply(t,i):r)||(e.exports=o)},1206:function(e,t,n){var r,i;"undefined"!=typeof window&&window,void 0===(i="function"==typeof(r=function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var r=this._onceEvents&&this._onceEvents[e],i=0;i{var r,i;!function(o,a){"use strict";r=[n(1206),n(6131),n(9047),n(652)],i=function(e,t,n,r){return function(e,t,n,r,i){var o=e.console,a=e.jQuery,s=function(){},l=0,c={};function u(e,t){var n=r.getQueryElement(e);if(n){this.element=n,a&&(this.$element=a(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(t);var i=++l;this.element.outlayerGUID=i,c[i]=this,this._create(),this._getOption("initLayout")&&this.layout()}else o&&o.error("Bad element for "+this.constructor.namespace+": "+(n||e))}u.namespace="outlayer",u.Item=i,u.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=u.prototype;function h(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}r.extend(f,t.prototype),f.option=function(e){r.extend(this.options,e)},f._getOption=function(e){var t=this.constructor.compatOptions[e];return t&&void 0!==this.options[t]?this.options[t]:this.options[e]},u.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(e){for(var t=this._filterFindItemElements(e),n=this.constructor.Item,r=[],i=0;i{}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=window.wp.plugins,r=window.wp.editPost;function i(){return React.createElement("span",{className:"instant-images-sidebar-icon"},React.createElement(o,null))}function o(){return React.createElement("svg",{viewBox:"0 0 31 58",width:"13px",height:"24px"},React.createElement("polygon",{points:"20 0 20 23 31 23 11 58 11 34 0 34 20 0",fill:"#4a7bc5"}))}function a(){return React.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("title",null,"Instant Images Icon"),React.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z",fill:"#647FE8"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",fill:"#C7D2FF"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",fill:"#C7D2FF"}))}function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:l}=Object.prototype,{getPrototypeOf:c}=Object,u=(f=Object.create(null),e=>{const t=l.call(e);return f[t]||(f[t]=t.slice(8,-1).toLowerCase())});var f;const h=e=>(e=e.toLowerCase(),t=>u(t)===e),d=e=>t=>typeof t===e,{isArray:p}=Array,m=d("undefined"),v=h("ArrayBuffer"),g=d("string"),y=d("function"),_=d("number"),b=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==u(e))return!1;const t=c(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=h("Date"),S=h("File"),R=h("Blob"),x=h("FileList"),k=h("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=e=>!m(e)&&e!==A,L=(N="undefined"!=typeof Uint8Array&&c(Uint8Array),e=>N&&e instanceof N);var N;const j=h("HTMLFormElement"),P=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),z=h("RegExp"),I=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};O(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},T="abcdefghijklmnopqrstuvwxyz",M="0123456789",D={DIGIT:M,ALPHA:T,ALPHA_DIGIT:T+T.toUpperCase()+M},F={isArray:p,isArrayBuffer:v,isBuffer:function(e){return null!==e&&!m(e)&&null!==e.constructor&&!m(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||l.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&v(e.buffer),t},isString:g,isNumber:_,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:w,isUndefined:m,isDate:E,isFile:S,isBlob:R,isRegExp:z,isFunction:y,isStream:e=>b(e)&&y(e.pipe),isURLSearchParams:k,isTypedArray:L,isFileList:x,forEach:O,merge:function e(){const{caseless:t}=B(this)&&this||{},n={},r=(r,i)=>{const o=t&&C(n,i)||i;w(n[o])&&w(r)?n[o]=e(n[o],r):w(r)?n[o]=e({},r):p(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(O(t,((t,r)=>{n&&y(t)?e[r]=s(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:h,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:I,freezeMethods:e=>{I(e,((t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:C,global:A,isContextDefined:B,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=p(e)?[]:{};return O(e,((e,t)=>{const o=n(e,r+1);!m(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)}};function H(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}F.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const W=H.prototype,U={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{U[e]={value:e}})),Object.defineProperties(H,U),Object.defineProperty(W,"isAxiosError",{value:!0}),H.from=(e,t,n,r,i,o)=>{const a=Object.create(W);return F.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),H.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const q=H;function V(e){return F.isPlainObject(e)||F.isArray(e)}function G(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function J(e,t,n){return e?e.concat(t).map((function(e,t){return e=G(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Y=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)})),K=function(e,t,n){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!s&&F.isBlob(e))throw new q("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(F.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(V)}(e)||(F.isFileList(e)||F.endsWith(n,"[]"))&&(s=F.toArray(e)))return n=G(n),s.forEach((function(e,r){!F.isUndefined(e)&&null!==e&&t.append(!0===a?J([n],r,o):null===a?n:n+"[]",l(e))})),!1;return!!V(e)||(t.append(J(i,n,o),l(e)),!1)}const u=[],f=Object.assign(Y,{defaultVisitor:c,convertValue:l,isVisitable:V});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!F.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),F.forEach(n,(function(n,o){!0===(!(F.isUndefined(n)||null===n)&&i.call(t,n,F.isString(o)?o.trim():o,r,f))&&e(n,r?r.concat(o):[o])})),u.pop()}}(e),t};function X(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $(e,t){this._pairs=[],e&&K(e,this,t)}const Z=$.prototype;Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,X)}:X;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Q=$;function ee(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function te(e,t,n){if(!t)return e;const r=n&&n.encode||ee,i=n&&n.serialize;let o;if(o=i?i(t,n):F.isURLSearchParams(t)?t.toString():new Q(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ne=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},oe=function(e){function t(e,n,r,i){let o=e[i++];const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&F.isArray(r)?r.length:o,s?(F.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&F.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&F.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},ae={"Content-Type":void 0},se={transitional:re,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=F.isObject(e);if(i&&F.isHTMLForm(e)&&(e=new FormData(e)),F.isFormData(e))return r&&r?JSON.stringify(oe(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new ie.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ie.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=F.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(F.isString(e))try{return(0,JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||se.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&F.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw q.from(e,q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};F.forEach(["delete","get","head"],(function(e){se.headers[e]={}})),F.forEach(["post","put","patch"],(function(e){se.headers[e]=F.merge(ae)}));const le=se,ce=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ue=Symbol("internals");function fe(e){return e&&String(e).trim().toLowerCase()}function he(e){return!1===e||null==e?e:F.isArray(e)?e.map(he):String(e)}function de(e,t,n,r,i){return F.isFunction(r)?r.call(this,t,n):(i&&(t=n),F.isString(t)?F.isString(r)?-1!==t.indexOf(r):F.isRegExp(r)?r.test(t):void 0:void 0)}class pe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=fe(t);if(!i)throw new Error("header name must be a non-empty string");const o=F.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=he(e))}const o=(e,t)=>F.forEach(e,((e,n)=>i(e,n,t)));return F.isPlainObject(e)||e instanceof this.constructor?o(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ce[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=fe(e)){const n=F.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(F.isFunction(t))return t.call(this,e,n);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=fe(e)){const n=F.findKey(this,e);return!(!n||void 0===this[n]||t&&!de(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=fe(e)){const i=F.findKey(n,e);!i||t&&!de(0,n[i],i,t)||(delete n[i],r=!0)}}return F.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!de(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return F.forEach(this,((r,i)=>{const o=F.findKey(n,i);if(o)return t[o]=he(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=he(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return F.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&F.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ue]=this[ue]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=fe(e);t[r]||(function(e,t){const n=F.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return F.isArray(e)?e.forEach(r):r(e),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.freezeMethods(pe.prototype),F.freezeMethods(pe);const me=pe;function ve(e,t){const n=this||le,r=t||n,i=me.from(r.headers);let o=r.data;return F.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function ge(e){return!(!e||!e.__CANCEL__)}function ye(e,t,n){q.call(this,null==e?"canceled":e,q.ERR_CANCELED,t,n),this.name="CanceledError"}F.inherits(ye,q,{__CANCEL__:!0});const _e=ye,be=ie.isStandardBrowserEnv?{write:function(e,t,n,r,i,o){const a=[];a.push(e+"="+encodeURIComponent(t)),F.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),F.isString(r)&&a.push("path="+r),F.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function we(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ee=ie.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=F.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},Se=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,f=0;for(;u!==o;)f+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s);n=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const xe={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=me.from(e.headers).normalize(),o=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}F.isFormData(r)&&(ie.isStandardBrowserEnv||ie.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=we(e.baseURL,e.url);function u(){if(!l)return;const r=me.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new q("Request failed with status code "+n.status,[q.ERR_BAD_REQUEST,q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),te(c,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=u:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(u)},l.onabort=function(){l&&(n(new q("Request aborted",q.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new q("Network Error",q.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||re;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new q(t,r.clarifyTimeoutError?q.ETIMEDOUT:q.ECONNABORTED,e,l)),l=null},ie.isStandardBrowserEnv){const t=(e.withCredentials||Ee(c))&&e.xsrfCookieName&&be.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in l&&F.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",Re(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",Re(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{l&&(n(!t||t.type?new _e(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);f&&-1===ie.protocols.indexOf(f)?n(new q("Unsupported protocol "+f+":",q.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};F.forEach(xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ke={getAdapter:e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof me?e.toJSON():e;function Be(e,t){t=t||{};const n={};function r(e,t,n){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:n},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function i(e,t,n){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!F.isUndefined(t))return r(void 0,t)}function a(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return F.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const o=l[r]||i,a=o(e[r],t[r],r);F.isUndefined(a)&&o!==s||(n[r]=a)})),n}const Le={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Le[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ne={};Le.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new q(r(i," has been removed"+(t?" in "+t:"")),q.ERR_DEPRECATED);return t&&!Ne[i]&&(Ne[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};const je={assertOptions:function(e,t,n){if("object"!=typeof e)throw new q("options must be an object",q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new q("option "+o+" must be "+n,q.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new q("Unknown option "+o,q.ERR_BAD_OPTION)}},validators:Le},Pe=je.validators;class ze{constructor(e){this.defaults=e,this.interceptors={request:new ne,response:new ne}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Be(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let o;void 0!==n&&je.assertOptions(n,{silentJSONParsing:Pe.transitional(Pe.boolean),forcedJSONParsing:Pe.transitional(Pe.boolean),clarifyTimeoutError:Pe.transitional(Pe.boolean)},!1),void 0!==r&&je.assertOptions(r,{encode:Pe.function,serialize:Pe.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=i&&F.merge(i.common,i[t.method]),o&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=me.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,f=0;if(!s){const e=[Ce.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new _e(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Te((function(t){e=t})),cancel:e}}}const Me=Te,De={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(De).forEach((([e,t])=>{De[t]=e}));const Fe=De,He=function e(t){const n=new Ie(t),r=s(Ie.prototype.request,n);return F.extend(r,Ie.prototype,n,{allOwnKeys:!0}),F.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Be(t,n))},r}(le);He.Axios=Ie,He.CanceledError=_e,He.CancelToken=Me,He.isCancel=ge,He.VERSION="1.3.4",He.toFormData=K,He.AxiosError=q,He.Cancel=He.CanceledError,He.all=function(e){return Promise.all(e)},He.spread=function(e){return function(t){return e.apply(null,t)}},He.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},He.mergeConfig=Be,He.AxiosHeaders=me,He.formToJSON=e=>oe(F.isHTMLForm(e)?new FormData(e):e),He.HttpStatusCode=Fe,He.default=He;const We=He;var Ue=n(4184),qe=n.n(Ue),Ve=n(8751),Ge=n.n(Ve);const Je=window.React,Ye=new Map,Ke=new WeakMap;let Xe=0;function $e(e,t,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:a}=function(e){let t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Ke.has(n)||(Xe+=1,Ke.set(n,Xe.toString())),Ke.get(n)):"0"):e[t]}`;var n})).toString()}(e),n=Ye.get(t);if(!n){const r=new Map;let i;const o=new IntersectionObserver((t=>{t.forEach((t=>{var n;const o=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=o),null==(n=r.get(t.target))||n.forEach((e=>{e(o,t)}))}))}),e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},Ye.set(t,n)}return n}(n);let s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),o.observe(e),function(){s.splice(s.indexOf(t),1),0===s.length&&(a.delete(e),o.unobserve(e)),0===a.size&&(o.disconnect(),Ye.delete(i))}}class Ze extends Je.Component{constructor(e){super(e),this.node=null,this._unobserveCb=null,this.handleNode=e=>{this.node&&(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()},this.handleChange=(e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),isPlainChildren(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)},this.state={inView:!!e.initialInView,entry:void 0}}componentDidUpdate(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:o}=this.props;this._unobserveCb=$e(this.node,this.handleChange,{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!isPlainChildren(this.props)){const{inView:e,entry:t}=this.state;return this.props.children({inView:e,entry:t,ref:this.handleNode})}const e=this.props,{children:t,as:n}=e,r=function(e,t){if(null==e)return{};for(var n,r,i={},o=Object.keys(e);r=0||(i[n]=e[n]);return i}(e);return React.createElement(n||"div",_extends({ref:this.handleNode},r),t)}}function Qe({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:l,onChange:c}={}){var u;const[f,h]=Je.useState(null),d=Je.useRef(),[p,m]=Je.useState({inView:!!s,entry:void 0});d.current=c,Je.useEffect((()=>{if(a||!f)return;let s;return s=$e(f,((e,t)=>{m({inView:e,entry:t}),d.current&&d.current(e,t),t.isIntersecting&&o&&s&&(s(),s=void 0)}),{root:i,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{s&&s()}}),[Array.isArray(e)?e.toString():e,f,i,r,o,a,n,l,t]);const v=null==(u=p.entry)?void 0:u.target,g=Je.useRef();f||!v||o||a||g.current===v||(g.current=v,m({inView:!!s,entry:void 0}));const y=[h,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}var et=(0,e.createContext)();function tt(e){var t=e.value,n=e.children;return React.createElement(et.Provider,{value:t},n)}function nt(){return(0,e.useContext)(et)}function rt(e){return e&&it[e.toLowerCase()].icon?it[e.toLowerCase()].icon():null}var it={proxy:"https://proxy.getinstantimages.com/api/",testmode:!1,defaults:{provider:"unsplash",order:"latest",per_page:"20",arr_key:"results"},providers:["Unsplash","Openverse","Pixabay","Pexels"],unsplash:{name:"Unsplash",requires_key:!0,new:!1,api_var:"client_id",collections_api:"https://api.unsplash.com/collections/",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",fill:"black"}))}},pixabay:{name:"Pixabay",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{clipPath:"url(#clip0_307_143)"},React.createElement("path",{d:"M0 0V32H32V0H0Z",fill:"#48A947"}),React.createElement("path",{d:"M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",fill:"#F9FBF9"}),React.createElement("path",{d:"M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",fill:"#FAFCFA"}),React.createElement("path",{d:"M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",fill:"#4AA949"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_307_143"},React.createElement("rect",{width:"32",height:"32",fill:"white"}))))}},pexels:{name:"Pexels",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",fill:"#05A081"}),React.createElement("path",{d:"M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",fill:"#fff"}))}},openverse:{name:"Openverse",requires_key:!1,new:!1,api_var:"key",key:"",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",fill:"#000000"}))}}};const ot=window.wp.i18n;var at=[{label:(0,ot.__)("WordPress","instant-images"),value:"wordpress"},{label:(0,ot.__)("Flickr","instant-images"),value:"flickr"},{label:(0,ot.__)("Nasa","instant-images"),value:"nasa"},{label:(0,ot.__)("SpaceX","instant-images"),value:"spacex"},{label:(0,ot.__)("Wikimedia","instant-images"),value:"wikimedia"}],st=[{label:(0,ot.__)("Square","instant-images"),value:"square"},{label:(0,ot.__)("Tall","instant-images"),value:"tall"},{label:(0,ot.__)("Wide","instant-images"),value:"wide"}],lt=[{label:(0,ot.__)("Red","instant-images"),value:"red"},{label:(0,ot.__)("Orange","instant-images"),value:"orange"},{label:(0,ot.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ot.__)("Green","instant-images"),value:"green"},{label:(0,ot.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,ot.__)("Blue","instant-images"),value:"blue"},{label:(0,ot.__)("Violet","instant-images"),value:"violet"},{label:(0,ot.__)("Pink","instant-images"),value:"pink"},{label:(0,ot.__)("Brown","instant-images"),value:"brown"},{label:(0,ot.__)("Black","instant-images"),value:"black"},{label:(0,ot.__)("Gray","instant-images"),value:"gray"},{label:(0,ot.__)("White","instant-images"),value:"white"}],ct=[{label:(0,ot.__)("Landscape","instant-images"),value:"landscape"},{label:(0,ot.__)("Portrait","instant-images"),value:"portrait"},{label:(0,ot.__)("Square","instant-images"),value:"squarish"}],ut=[{label:(0,ot.__)("Grayscale","instant-images"),value:"grayscale"},{label:(0,ot.__)("Red","instant-images"),value:"red"},{label:(0,ot.__)("Orange","instant-images"),value:"orange"},{label:(0,ot.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ot.__)("Green","instant-images"),value:"green"},{label:(0,ot.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,ot.__)("Blue","instant-images"),value:"blue"},{label:(0,ot.__)("Lilac","instant-images"),value:"lilac"},{label:(0,ot.__)("Pink","instant-images"),value:"pink"},{label:(0,ot.__)("White","instant-images"),value:"white"},{label:(0,ot.__)("Gray","instant-images"),value:"gray"},{label:(0,ot.__)("Black","instant-images"),value:"black"},{label:(0,ot.__)("Brown","instant-images"),value:"brown"},{label:(0,ot.__)("Transparent","instant-images"),value:"transparent"}],ft=[{label:(0,ot.__)("Backgrounds","instant-images"),value:"backgrounds"},{label:(0,ot.__)("Fashion","instant-images"),value:"fashion"},{label:(0,ot.__)("Nature","instant-images"),value:"nature"},{label:(0,ot.__)("Science","instant-images"),value:"science"},{label:(0,ot.__)("Education","instant-images"),value:"education"},{label:(0,ot.__)("Feelings","instant-images"),value:"feelings"},{label:(0,ot.__)("Health","instant-images"),value:"health"},{label:(0,ot.__)("People","instant-images"),value:"people"},{label:(0,ot.__)("Religion","instant-images"),value:"religion"},{label:(0,ot.__)("Places","instant-images"),value:"places"},{label:(0,ot.__)("Animals","instant-images"),value:"animals"},{label:(0,ot.__)("Industry","instant-images"),value:"industry"},{label:(0,ot.__)("Computer","instant-images"),value:"computer"},{label:(0,ot.__)("Food","instant-images"),value:"food"},{label:(0,ot.__)("Sports","instant-images"),value:"sports"},{label:(0,ot.__)("Food","instant-images"),value:"food"},{label:(0,ot.__)("Transportation","instant-images"),value:"transportation"},{label:(0,ot.__)("Travel","instant-images"),value:"travel"},{label:(0,ot.__)("Buildings","instant-images"),value:"buildings"},{label:(0,ot.__)("Business","instant-images"),value:"business"},{label:(0,ot.__)("Music","instant-images"),value:"music"}],ht=[{label:(0,ot.__)("Horizontal","instant-images"),value:"horizontal"},{label:(0,ot.__)("Vertical","instant-images"),value:"vertical"}],dt=[{label:(0,ot.__)("Photo","instant-images"),value:"photo"},{label:(0,ot.__)("Illustration","instant-images"),value:"illustration"},{label:(0,ot.__)("Vector","instant-images"),value:"vector"}],pt=[{label:(0,ot.__)("Black & White","instant-images"),value:"black_and_white"},{label:(0,ot.__)("Black","instant-images"),value:"black"},{label:(0,ot.__)("White","instant-images"),value:"white"},{label:(0,ot.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ot.__)("Green","instant-images"),value:"green"},{label:(0,ot.__)("Orange","instant-images"),value:"orange"},{label:(0,ot.__)("Red","instant-images"),value:"red"},{label:(0,ot.__)("Purple","instant-images"),value:"purple"},{label:(0,ot.__)("Magenta","instant-images"),value:"magenta"},{label:(0,ot.__)("Teal","instant-images"),value:"teal"},{label:(0,ot.__)("Blue","instant-images"),value:"blue"}],mt=[{label:(0,ot.__)("Landscape","instant-images"),value:"landscape"},{label:(0,ot.__)("Portrait","instant-images"),value:"portrait"},{label:(0,ot.__)("Square","instant-images"),value:"squarish"}];function vt(e){return function(e){if(Array.isArray(e))return gt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return gt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&parseInt(n)<2&&alert(instant_img_localize.api_ratelimit_msg)}}function Mt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Dt="";function Ft(e){var t=e.currentTarget,n=t.getBoundingClientRect(),r=Math.round(n.left),i=Math.round(n.top),o=t.closest("#photo-listing").querySelector("#tooltip");o.classList.remove("over"),t.classList.contains("tooltip--above")?o.classList.add("above"):o.classList.remove("above"),Dt=setInterval((function(){clearInterval(Dt),o.innerHTML=t.dataset.title,r=r-o.offsetWidth+t.offsetWidth+5,o.style.left="".concat(r,"px"),o.style.top="".concat(i,"px"),setTimeout((function(){o.classList.add("over")}),25)}),750)}function Ht(e){clearInterval(Dt),e.currentTarget.closest("#photo-listing").querySelector("#tooltip").classList.remove("over")}function Wt(e){e&&window&&window.open(e,"_blank")}function Ut(){var e=instant_img_localize;switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200){case 400:case 401:return e.api_invalid_msg;case 403:return e.api_invalid_403_msg;case 404:return e.api_invalid_404_msg;case 429:return e.api_ratelimit_msg;case 500:case 503:return e.api_invalid_500_msg;case 501:return e.api_invalid_501_msg}}function qt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=instant_img_localize,r=Ut(t);switch(t){case 400:case 401:case 500:case 429:console.warn("[".concat(n.instant_images," - ").concat(t," Error] ").concat(Mt(e),": ").concat(r))}}function Vt(e){return e&&e[it.defaults.arr_key]||[]}function Gt(e){return void 0===e.total||null===e.total?0:e.total}function Jt(e){if(!e||it.testmode)return!1;var t=sessionStorage.getItem(It(e));if(!t)return!1;var n=JSON.parse(t),r=n.expires,i=void 0===r?0:r,o=n.error;if(void 0!==o&&o)return!1;var a=Date.now()>i;return a&&Kt(e),!(!n||a)&&n}function Yt(e,t){if(!e||!t||null!=t&&t.error)return!1;t.expires=Date.now()+36e5,sessionStorage.setItem(It(e),JSON.stringify(t))}function Kt(e){if(!e)return!1;sessionStorage.removeItem(It(e))}function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function $t(){$t=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var l=u(e[r],e,o);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Xt(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function Zt(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,_x,o,a=[],_n=!0,s=!1;try{if(_x=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(a.push(r.value),a.length!==t);_n=!0);}catch(e){s=!0,i=e}finally{try{if(!_n&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return en(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?en(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function en(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1?null:React.createElement("div",{className:"instant-images-no-results"},React.createElement("div",null,React.createElement("h3",null,instant_img_localize.no_results," "),React.createElement("p",null,instant_img_localize.no_results_desc," ")))}var fn=it.providers;function hn(t){var n=t.switchProvider,r=nt().provider;return React.createElement(e.Fragment,null,!(null==fn||!fn.length)&&React.createElement("nav",{className:"provider-nav"},fn.map((function(e,t){return React.createElement("div",{key:"provider-".concat(t)},React.createElement("button",{onClick:function(){return n(e.toLowerCase())},className:r===e.toLowerCase()?"provider-nav--btn active":"provider-nav--btn"},rt(e),React.createElement("span",null,e),it[e.toLowerCase()].new&&React.createElement("span",{className:"provider-nav--new"},instant_img_localize.new)))}))))}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=200&&t.status<400&&JSON.parse(t.response).success||o(!1)},t.onerror=function(e){console.warn(e),o(!1)}}),[]),React.createElement(e.Fragment,null,i?null:React.createElement("div",{className:"error-messaging"},React.createElement("strong",null,instant_img_localize.error_restapi),instant_img_localize.error_restapi_desc))}const mn=window.wp.blocks,vn=window.wp.data;function gn(e,t){var n=e.id,r=void 0===n?null:n,i=e.url,o=void 0===i?null:i,a=e.caption,s=void 0===a?"":a,l=e.alt,c=void 0===l?"":l;if(o&&r){var u=(0,mn.createBlock)("core/image",{id:r,url:o,caption:s,alt:c});t?(0,vn.dispatch)("core/block-editor").replaceBlock(t,u):(0,vn.dispatch)("core/block-editor").insertBlocks(u)}}function yn(e){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yn(e)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&React.createElement("img",{className:"user-wrap--photo",src:B,alt:""}),A)),React.createElement("div",{className:"photo-options"},f&&!$?React.createElement(e.Fragment,null,React.createElement("button",{type:"button",className:"set-featured fade","data-title":instant_img_localize.set_as_featured,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)},onClick:function(e){return function(e){Ht(e),ee.current&&(re=!0,ee.current.click())}(e)}},React.createElement("i",{className:"fa fa-picture-o","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.set_as_featured)),React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)},onClick:function(e){return oe(e)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post))):null,!!s&&React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)},onClick:function(e){return oe(e)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post)),$?React.createElement("button",{onClick:function(){$&&(window.location=$)},className:"edit-photo-admin fade","data-title":instant_img_localize.edit_upload,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)}},React.createElement("i",{className:"fa fa-pencil","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_upload)):React.createElement("button",{onClick:function(e){return function(e){e.preventDefault(),Ht(e);var t=document.querySelectorAll(".edit-screen.editing");t&&t.forEach((function(e){e.classList.remove("editing")})),te.current.classList.add("editing"),setTimeout((function(){te.current.focus({preventScroll:!0})}),150)}(e)},className:"edit-photo fade","data-title":instant_img_localize.edit_details,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)}},React.createElement("i",{className:"fa fa-cog","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_details)))),React.createElement("div",{className:"photo-meta"},E?React.createElement("span",{className:"likes tooltip--above","data-title":E+" "+j,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)}},React.createElement("i",{className:"fa fa-heart heart-like","aria-hidden":"true"})," ",E):null,React.createElement("a",{className:"tooltip--above",href:m,"data-title":"".concat(instant_img_localize.open_external," ").concat(Mt(o)),onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Ht(e)},rel:"noopener noreferrer",target:"_blank"},React.createElement("i",{className:"fa fa-external-link","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},"".concat(instant_img_localize.open_external," ").concat(Mt(o)))))),React.createElement("div",{className:"edit-screen",tabIndex:"0",ref:te},React.createElement("div",{className:"edit-screen--title"},React.createElement("div",null,React.createElement("p",{className:"heading"},instant_img_localize.edit_details),S&&S.length>0&&React.createElement("p",{className:"dimensions"},S)),React.createElement("div",{className:"preview",style:{backgroundImage:"url(".concat(k,")")}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_filename,":"),React.createElement("input",{type:"text",name:"filename","data-original":p,placeholder:W.filename,value:W.filename,onChange:function(e){return le(e)}}),React.createElement("em",null,".",w)),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_title,":"),React.createElement("input",{type:"text",name:"title","data-original":v,placeholder:v,value:W.title||"",onChange:function(e){return le(e)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_alt,":"),React.createElement("input",{type:"text",name:"alt","data-original":g,value:W.alt||"",onChange:function(e){return le(e)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_caption,":"),React.createElement("textarea",{rows:"4",name:"caption","data-original":F,onChange:function(e){return le(e)},value:W.caption||"",ref:ne})),D?React.createElement("div",{className:"add-attribution-row"},React.createElement("button",{onClick:function(e){return function(e){e.preventDefault(),ne.current.value=D,U(wn(wn({},W),{},{caption:D}))}(e)},type:"button"},instant_img_localize.attribution)):null,React.createElement("div",{className:"edit-screen--controls"},React.createElement("button",{type:"button",className:"button button-secondary",onClick:function(e){return U({filename:p,title:v,alt:g,caption:F}),te.current.classList.remove("editing"),void ee.current.focus({preventScrol:!0})}},instant_img_localize.cancel)," "," ",React.createElement("button",{type:"button",className:"button button-primary",onClick:function(){return te.current.classList.remove("editing"),void ee.current.click()}},s?instant_img_localize.insert_into_post:instant_img_localize.upload_now))),React.createElement("div",{className:"photo-status"})))}function kn(t){var n=t.result.data,r=void 0===n?null:n,i=(null==r?void 0:r.url)||"",o=(null==r?void 0:r.title)||"",a=(null==r?void 0:r.description)||"",s=(null==r?void 0:r.avatar)||"",l=r.image,c=void 0===l?null:l,u=c.src,f=void 0===u?null:u,h=c.alt,d=void 0===h?null:h,p=(0,e.useRef)(),m=(0,e.useRef)();return React.createElement(e.Fragment,null,c&&i?React.createElement("article",{className:"photo feature",title:a,ref:p,onClick:function(){return m.current.click()}},React.createElement("div",{className:"photo--wrap"},React.createElement("span",{className:"flag",title:instant_img_localize.advertisement},instant_img_localize.ad),React.createElement("div",{className:"img-wrap"},React.createElement("a",{className:"loaded",href:i,target:"_blank",ref:m,rel:"noreferrer"},React.createElement("img",{src:f,alt:d}))),React.createElement("div",{className:"feature-title"},s&&React.createElement("img",{src:s,alt:o}),React.createElement("span",null,o)))):null)}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&t.splice(n,1),t.length>=10&&(t.length=10),t.unshift(e),localStorage.setItem(In,JSON.stringify(t))}else localStorage.setItem(In,JSON.stringify([e]))}(r),g(Mn())))}(e)},autoComplete:"off"},React.createElement("label",{htmlFor:"search-input",className:"offscreen"},instant_img_localize.search_label),React.createElement("div",{ref:w},React.createElement("input",{ref:n,type:"text",id:"search-input",placeholder:instant_img_localize.search,disabled:h,onChange:function(e){return c&&p(e.target.value)},onFocus:function(){return b(!0)}}),c&&((null==v?void 0:v.length)||(null==d?void 0:d.length))?React.createElement(Vn,{show:_,history:v,setHistory:g,setSearchValue:function(e){var t=null==n?void 0:n.current;t.value=e,null==E||E.current.click(),t.focus()},container:w}):null,!s&&React.createElement(qn,{show:_})),React.createElement("button",{type:"submit",disabled:h,ref:E},React.createElement("i",{className:"fa fa-search"}),React.createElement("span",{className:"offscreen"},instant_img_localize.search)),React.createElement(Gn,{show:_})))}));function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tr(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==h[0]&&h[0],!M){e.next=3;break}return e.abrupt("return",!1);case 3:if(n||""===(null==pe||null===(t=pe.current)||void 0===t?void 0:t.value)){e.next=7;break}if(!v||!y){e.next=7;break}return Oe(pe.current.value),e.abrupt("return");case 7:if(I(!0),d=void 0,(null==pe||null===(d=pe.current)||void 0===d?void 0:d.value)&&(pe.current.value=""),$(w),ee([]),Pe(),ur=1,r=kt(k,oe),i=Nt("photos",r),!(o=Jt(i))){e.next=18;break}Ae(Vt(o),!1,null),e.next=37;break;case 18:return e.next=20,fetch(i);case 20:return a=e.sent,l=a.status,Tt(a.headers),e.prev=23,e.next=26,a.json();case 26:c=e.sent,u=c.error,f=void 0===u?null:u,Ae(Vt(c),!1,f),Yt(i,c),e.next=37;break;case 32:e.prev=32,e.t0=e.catch(23),qt(s,l),I(!1),Kt(i);case 37:setTimeout((function(){I(!1)}),_);case 38:case"end":return e.stop()}var d}),e,null,[[23,32]])}))),Re.apply(this,arguments)}function xe(){return ke.apply(this,arguments)}function ke(){return(ke=or(Qn().mark((function e(){var t,n,r,i,o,a,l,c,u,f,h,d;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N&&!z&&!M&&!H){e.next=2;break}return e.abrupt("return");case 2:if(D(!0),ur=parseInt(ur)+1,t=null!=X&&X.active&&null!=X&&X.term?{term:X.term}:{},n=null!=X&&X.active?"search":"photos",r=null!=X&&X.active?le:oe,i=tr(tr(tr({},{page:ur}),t),r),o=kt(k,i),a=Nt(n,o),!(l=Jt(a))){e.next=15;break}Ae(Vt(l),!0,null),e.next=34;break;case 15:return e.next=17,fetch(a);case 17:return c=e.sent,u=c.status,Tt(c.headers),e.prev=20,e.next=23,c.json();case 23:f=e.sent,h=f.error,d=void 0===h?null:h,Ae(Vt(f),!0,d),Yt(a,f),e.next=34;break;case 29:e.prev=29,e.t0=e.catch(20),qt(s,u),D(!1),Kt(a);case 34:case"end":return e.stop()}}),e,null,[[20,29]])})))).apply(this,arguments)}function Oe(e){return Ce.apply(this,arguments)}function Ce(){return(Ce=or(Qn().mark((function e(t){var n,r,i,o,a,l,c,u,f,h,d;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I(!0),Pe(),ur=1,n="id:"===t.substring(0,3)?"id":"term",r="id"===n?{id:t.replace("id:","").replace(/\s+/,"")}:{term:t},i=tr(tr(tr({},{page:ur}),r),le),o=kt(k,i),a=Nt("search",o),!(l=Jt(a))){e.next=14;break}Ae(Vt(l),!1,null),$({active:!0,term:t,type:n,results:Gt(l)}),e.next=35;break;case 14:return e.next=16,fetch(a);case 16:return c=e.sent,u=c.status,Tt(c.headers),e.prev=19,e.next=22,c.json();case 22:f=e.sent,h=f.error,d=void 0===h?null:h,Ae(Vt(f),!1,d),$({active:!0,term:t,type:n,results:Gt(f)}),Yt(a,f),e.next=35;break;case 29:e.prev=29,e.t0=e.catch(19),W(!0),I(!1),qt(s,u),Kt(a);case 35:pe.current.classList.remove(b);case 36:case"end":return e.stop()}}),e,null,[[19,29]])})))).apply(this,arguments)}function Ae(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;e=null==t?void 0:t.length,W(0===parseInt(e)||void 0===e),R(n?function(e){return[].concat(rr(e),rr(t))}:t),V(r)}function Be(e,t){var n=tr({},oe);n[e]&&"#"===t||""===t||"all"===t?delete n[e]:n[e]=t,ae(tr({},n))}function Le(e){return Ne.apply(this,arguments)}function Ne(){return(Ne=or(Qn().mark((function e(t){var n,r;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k!==t){e.next=2;break}return e.abrupt("return");case 2:if(I(!0),V(!1),Y(!1),be.classList.remove("overflow-hidden"),!it[t].requires_key||A.includes(t)){e.next=27;break}return e.prev=7,e.next=10,fetch(jt(t));case 10:if(n=e.sent,r=n.status,Tt(n.headers),200===r){e.next=18;break}return Y(t),V(!0),be.classList.add("overflow-hidden"),e.abrupt("return");case 18:200===r&&B((function(e){return[].concat(rr(e),[t])})),e.next=27;break;case 21:return e.prev=21,e.t0=e.catch(7),Y(t),be.classList.add("overflow-hidden"),V(!0),e.abrupt("return");case 27:setTimeout((function(){re(_t[t].filters),O(t)}),_);case 28:case"end":return e.stop()}}),e,null,[[7,21]])})))).apply(this,arguments)}function je(){return(je=or(Qn().mark((function e(t){var n;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!((null==t?void 0:t.length)<3)){e.next=2;break}return e.abrupt("return");case 2:return n=instant_img_localize.root+"instant-images-extended/suggestions/?term=".concat(t),e.next=5,We.get(n).then((function(e){ee(e.data)})).catch((function(e){console.warn(e)}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){ve&&null!=de&&de.current&&(null==de||de.current.scroll({top:0,left:0,behavior:"smooth"}))}function ze(e){if("Escape"===e.key){var t=de.current.querySelectorAll(".edit-screen.editing");t&&rr(t).forEach((function(e){null==e||e.classList.remove("editing")}))}}return(0,e.useEffect)((function(){null!=X&&X.active||ce({})}),[X]),(0,e.useEffect)((function(){N&&null!=X&&X.active&&Oe(null==X?void 0:X.term)}),[le]),(0,e.useEffect)((function(){N&&Se()}),[oe]),(0,e.useEffect)((function(){re(_t[k].filters),ae({})}),[k]),(0,e.useEffect)((function(){xe()}),[he]),(0,e.useEffect)((function(){cr(de.current,(function(){ye||(me.current=new(Ge())(de.current,{itemSelector:".photo"}),de.current.querySelectorAll(".photo").forEach((function(e){e.classList.add("in-view")}))),setTimeout((function(){I(!1),D(!1),N||j(!0)}),_)}))}),[S]),(0,e.useEffect)((function(){return I(!1),Ee.classList.add("loaded"),ye&&Se(),document.addEventListener("keydown",ze,!1),function(){document.removeEventListener("keydown",ze,!1)}}),[]),React.createElement(e.Fragment,null,React.createElement(tt,{value:{provider:k,wpBlock:ve,mediaModal:_e,blockSidebar:ge,clientId:d,search:X,apiError:q,getPhotos:Se,searchHandler:function(e){e.preventDefault();var t=pe.current.value;t.length>2?(pe.current.classList.add(b),Oe(t)):pe.current.focus()},filterSearch:function(e,t){var n=tr({},le);n[e]&&"#"===t||""===t||"all"===t?delete n[e]:n[e]=t,ce(tr({},n))},suggestions:Q,getSuggestions:function(e){return je.apply(this,arguments)}}},ve?React.createElement(wt,{switchProvider:Le}):React.createElement(React.Fragment,null,React.createElement(hn,{switchProvider:Le}),React.createElement(Un,null)),React.createElement(pn,null),React.createElement("div",{className:"control-nav"},React.createElement("div",{className:qe()("control-nav--filters-wrap",q||null!=X&&X.active?"inactive":null)},ne&&null!==(i=Object.entries(ne))&&void 0!==i&&i.length?React.createElement("div",{className:"control-nav--filters"},Object.entries(ne).map((function(e,t){var n=ar(e,2),r=n[0],i=n[1];return React.createElement(ln,{key:"".concat(k,"-").concat(t,"-").concat(r),data:i,filterKey:r,handler:Be})}))):null),React.createElement(Kn,{ref:pe})),React.createElement("div",{id:"photo-listing",className:z?"loading":null},React.createElement($n,null),ve?React.createElement(jn,{ref:de,data:S,done:H,loadMorePhotos:xe}):React.createElement(Cn,{ref:de,data:S}),React.createElement(un,{total:null==X?void 0:X.results,is_search:null==X?void 0:X.active}),React.createElement(cn,{ref:fe,loadMorePhotos:xe,loading:M,done:H}),React.createElement(tn,{provider:J,callback:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&O(e),Y(!1),I(!1),V(!1),be.classList.remove("overflow-hidden")}}),React.createElement(nn,null),React.createElement(Pn,null))))}function hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/js/common/pluginProvider.js": +/*!*****************************************!*\ + !*** ./src/js/common/pluginProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PluginProvider": () => (/* binding */ PluginProvider), +/* harmony export */ "usePluginContext": () => (/* binding */ usePluginContext) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +// Create Context object. +var PluginContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(); + +// Export Provider. +function PluginProvider(props) { + var value = props.value, + children = props.children; + return /*#__PURE__*/React.createElement(PluginContext.Provider, { + value: value + }, children); +} + +// Export useContext Hook. +function usePluginContext() { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(PluginContext); +} + +/***/ }), + +/***/ "./src/js/components/APILightbox.js": +/*!******************************************!*\ + !*** ./src/js/components/APILightbox.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ APILightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/updatePluginSetting */ "./src/js/functions/updatePluginSetting.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the APILightbox component. + * Note: Component is display when switching providers and the API is invalid. + * + * @param {Object} props The component props. + * @return {JSX.Element} The APILightbox component. + */ +function APILightbox(props) { + var provider = props.provider, + callback = props.callback; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("invalid"), + _useState2 = _slicedToArray(_useState, 2), + apiStatus = _useState2[0], + setAPIStatus = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState4 = _slicedToArray(_useState3, 2), + response = _useState4[0], + setResponse = _useState4[1]; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var submitRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var api_key = instant_img_localize["".concat(provider, "_app_id")]; + var title = apiStatus === "invalid" ? instant_img_localize.api_key_invalid : ""; + + /** + * Handler for the form submission. + * + * @param {Event} e The form event. + */ + function handleSubmit(_x2) { + return _handleSubmit.apply(this, arguments); + } + /** + * Close the lightbox + */ + function _handleSubmit() { + _handleSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) { + var _inputRef$current; + var key, data, ok, status, headers; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + e.preventDefault(); + setAPIStatus("loading"); + + // Get API key value. + key = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value; // Set API key to localized variable. + instant_img_localize["".concat(provider, "_app_id")] = key; + + // Update plugin settings via REST API. + (0,_functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__["default"])("".concat(provider, "_api"), key); + _context.prev = 5; + _context.next = 8; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_2__.buildTestURL)(provider)); + case 8: + data = _context.sent; + // Handle response. + ok = data.ok, status = data.status, headers = data.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.checkRateLimit)(headers); + + // Handle response actions. + if (ok) { + // Success. + setAPIStatus("valid"); + setResponse(instant_img_localize.api_success_msg); + setTimeout(function () { + setResponse(""); + setAPIStatus("invalid"); + callback(provider); + }, 1000); + } else { + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, status); // Render console warning. + + if (status === 400 || status === 401) { + setResponse(instant_img_localize.api_invalid_msg); // Unsplash/Pixabay incorrect API key. + } + + if (status === 429) { + setResponse(instant_img_localize.api_ratelimit_msg); // Pixabay - too many requests. + } + } + _context.next = 19; + break; + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](5); + setAPIStatus("invalid"); // Error/Invalid. + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, 500); // Render console warning. + setResponse(instant_img_localize.api_invalid_500_msg); + case 19: + case "end": + return _context.stop(); + } + }, _callee, null, [[5, 14]]); + })); + return _handleSubmit.apply(this, arguments); + } + function closeLightbox() { + if (lightbox !== null && lightbox !== void 0 && lightbox.current) { + lightbox.current.classList.remove("active"); + setTimeout(function () { + callback(); + }, 150); + } + } + + /** + * Close the lightbox with a background click. + * + * @param {Event} e The form event. + */ + function bkgClick(e) { + var target = e.target; + // If clicked element is the background. + if (target === (lightbox === null || lightbox === void 0 ? void 0 : lightbox.current)) { + closeLightbox(); + } + } + + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + closeLightbox(); + } + } + + /** + * Reset the key to use Instant Images default. + */ + function getDefaultKey() { + inputRef.current.value = ""; + setTimeout(function () { + submitRef.current.click(); + }, 25); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + var _lightbox$current; + document.addEventListener("keydown", escFunction, false); + lightbox === null || lightbox === void 0 ? void 0 : (_lightbox$current = lightbox.current) === null || _lightbox$current === void 0 ? void 0 : _lightbox$current.classList.add("active"); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, [provider]); //eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, provider ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("div", { + className: "api-lightbox", + ref: lightbox, + onClick: function onClick(e) { + return bkgClick(e); + }, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", { + className: "api-lightbox--close", + onClick: function onClick() { + return closeLightbox(); + } + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.btnClose)), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--details" + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_6__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", null, instant_img_localize["".concat(provider, "_api_desc")]), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key), /*#__PURE__*/React.createElement("span", null, "|"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getDefaultKey(); + } + }, instant_img_localize.use_instant_images_key))), /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return handleSubmit(e); + } + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "key", + className: "offscreen" + }, instant_img_localize.enter_api_key), /*#__PURE__*/React.createElement("div", { + className: "api-lightbox--input-wrap" + }, /*#__PURE__*/React.createElement("span", { + className: apiStatus, + title: title && title + }, apiStatus === "invalid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-exclamation-triangle", + "aria-hidden": "true" + }), apiStatus === "valid" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-check-circle", + "aria-hidden": "true" + }), apiStatus === "loading" && /*#__PURE__*/React.createElement("i", { + className: "fa fa-spinner fa-spin", + "aria-hidden": "true" + })), /*#__PURE__*/React.createElement("input", { + type: "text", + id: "key", + ref: inputRef, + placeholder: "Enter API Key", + defaultValue: api_key + })), response && /*#__PURE__*/React.createElement("p", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--response", apiStatus) + }, response), /*#__PURE__*/React.createElement("button", { + type: "submit", + ref: submitRef + }, instant_img_localize.btnVerify))))) : null); +} + +/***/ }), + +/***/ "./src/js/components/ErrorLightbox.js": +/*!********************************************!*\ + !*** ./src/js/components/ErrorLightbox.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ErrorLightbox) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/getErrorMessage */ "./src/js/functions/getErrorMessage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + + + + +/** + * Render the ErrorLightbox component. + * Note: Component is display on initial plugin load if the default provider has an invalid API key. + * + * @return {JSX.Element} The ErrorLightbox component. + */ +function ErrorLightbox() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + apiError = _usePluginContext.apiError; + var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var status = apiError !== null && apiError !== void 0 && apiError.status ? apiError.status : null; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, apiError && status && /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox", "error-lightbox", "active"), + ref: lightbox, + tabIndex: "-1" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--details", "error-lightbox") + }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_5__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", { + className: "callout-warning" + }, status, " ", instant_img_localize.error), /*#__PURE__*/React.createElement("p", null, (0,_functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(status)), /*#__PURE__*/React.createElement("p", { + className: "more-info" + }, instant_img_localize.api_default_provider), /*#__PURE__*/React.createElement("p", { + className: "action-controls" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]); + } + }, instant_img_localize.get_api_key)))))); +} + +/***/ }), + +/***/ "./src/js/components/Filter.js": +/*!*************************************!*\ + !*** ./src/js/components/Filter.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Filter) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/** + * Render the Filter component. + * + * @param {Object} props The component props. + * @param {Object} props.data The filter data. + * @param {string} props.filterKey The filter key. + * @param {Function} props.handler The change/click handler function. + * @return {JSX.Element} The Filter component. + */ +function Filter(props) { + var _data$filters; + var data = props.data, + filterKey = props.filterKey, + handler = props.handler; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider; + var defaultValue = data === null || data === void 0 ? void 0 : data["default"]; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + expanded = _useState2[0], + setExpanded = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue), + _useState4 = _slicedToArray(_useState3, 2), + selected = _useState4[0], + setSelected = _useState4[1]; + var dropdown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var button = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var menu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var id = "".concat(provider, "-").concat(filterKey); + var isColor = filterKey === "colors" || filterKey === "color"; + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__.useArrowControls)(expanded, dropdown); + + /** + * Toggle menu open/closed. + * + * @param {Event} event The click event. + */ + function toggleMenu(event) { + event.preventDefault(); + + // If disabled, don't open menu. + var target = event.currentTarget; + if (target.disabled) { + return false; + } + if (expanded) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } else { + setExpanded(true); + document.addEventListener("click", closeMenuOutside); + } + } + + /** + * Close menu when clicking outside. + * + * @param {Event} event The click event. + */ + function closeMenuOutside(event) { + var _menu$current, _button$current; + if (!(menu !== null && menu !== void 0 && (_menu$current = menu.current) !== null && _menu$current !== void 0 && _menu$current.contains(event.target)) && !(button !== null && button !== void 0 && (_button$current = button.current) !== null && _button$current !== void 0 && _button$current.contains(event.target))) { + setExpanded(false); + document.removeEventListener("click", closeMenuOutside); + } + } + + /** + * Checks for focus outside of component. + * + * @param {Event} event The click event. + */ + function focusOutside(event) { + if (!(dropdown !== null && dropdown !== void 0 && dropdown.current.contains(event.target))) { + closeMenuOutside(event); + } + } + + /** + * Detect esc key press. + * + * @param {Event} event The click event. + */ + function escClick(event) { + if (event.key === "Escape") { + setExpanded(false); + } + } + + /** + * Click handler for the filter buttons. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function click(filter, value) { + var newValue = selected !== value ? value : defaultValue; + setSelected(newValue); + handler(filter, newValue); + setTimeout(function () { + var _button$current2; + button === null || button === void 0 ? void 0 : (_button$current2 = button.current) === null || _button$current2 === void 0 ? void 0 : _button$current2.click(); + }, 100); + } + + /** + * Convert a color to a CSS value. + * + * @see https://www.w3schools.com/colors/colors_names.asp + * + * @param {string} color The current color. + * @return {string} The color. + */ + function convertColor(color) { + if (color === "lilac") { + color = "DarkViolet"; + } + if (color === "grayscale" || color === "black_and_white") { + color = "LightGray"; + } + return color; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Initiate arrow menus. + // a11yarrows.init(dropdown?.current, { + // selector: "button", + // }); + + // Check for focus outside. + document.addEventListener("keyup", focusOutside); + document.addEventListener("keydown", escClick); + return function () { + document.removeEventListener("keyup", focusOutside); + document.removeEventListener("keydown", escClick); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement("div", { + className: "filter-dropdown", + id: id, + ref: dropdown + }, /*#__PURE__*/React.createElement("button", { + onClick: toggleMenu, + className: "filter-dropdown--button", + "aria-expanded": expanded ? "true" : "false", + ref: button + }, /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-label" + }, data === null || data === void 0 ? void 0 : data.label), /*#__PURE__*/React.createElement("span", { + className: "filter-dropdown--button-selected" + }, selected.replace(/_/g, " "), /*#__PURE__*/React.createElement("i", { + className: "fa fa-caret-down", + "aria-hidden": "true" + }))), /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--menu", expanded ? "expanded" : null), + "data-key": filterKey, + "aria-hidden": expanded ? "false" : "true", + ref: menu + }, (data === null || data === void 0 ? void 0 : (_data$filters = data.filters) === null || _data$filters === void 0 ? void 0 : _data$filters.length) && data.filters.map(function (filter, key) { + var label = filter.label, + value = filter.value; + return /*#__PURE__*/React.createElement("button", { + key: key, + disabled: selected === value, + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--item", selected === value ? "selected" : null), + onClick: function onClick() { + return click(filterKey, value); + } + }, label, value !== "all" && value !== "transparent" && isColor ? /*#__PURE__*/React.createElement("span", { + className: "_color", + style: { + color: convertColor(value) + } + }) : null); + }))); +} + +/***/ }), + +/***/ "./src/js/components/Icon.js": +/*!***********************************!*\ + !*** ./src/js/components/Icon.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "IconLogo": () => (/* binding */ IconLogo), +/* harmony export */ "IconSVG": () => (/* binding */ IconSVG), +/* harmony export */ "default": () => (/* binding */ Icon) +/* harmony export */ }); +/** + * The Icon component. + * + * @return {JSX.Element} The Icon component. + */ +function Icon() { + return /*#__PURE__*/React.createElement("span", { + className: "instant-images-sidebar-icon" + }, /*#__PURE__*/React.createElement(IconSVG, null)); +} + +/** + * The SVG icon. + * + * @return {JSX.Element} The IconSVG component. + */ +function IconSVG() { + return /*#__PURE__*/React.createElement("svg", { + viewBox: "0 0 31 58", + width: "13px", + height: "24px" + }, /*#__PURE__*/React.createElement("polygon", { + points: "20 0 20 23 31 23 11 58 11 34 0 34 20 0", + fill: "#4a7bc5" + })); +} + +/** + * The SVG Logo. + * + * @return {JSX.Element} The IconLogo component. + */ +function IconLogo() { + return /*#__PURE__*/React.createElement("svg", { + width: "80", + height: "80", + viewBox: "0 0 80 80", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("title", null, "Instant Images Icon"), /*#__PURE__*/React.createElement("path", { + d: "M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z", + fill: "#647FE8" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z", + fill: "white" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + }), /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z", + fill: "#C7D2FF" + })); +} + +/***/ }), + +/***/ "./src/js/components/InstantImages.js": +/*!********************************************!*\ + !*** ./src/js/components/InstantImages.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ InstantImages) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! masonry-layout */ "./node_modules/masonry-layout/masonry.js"); +/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(masonry_layout__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor/block/components/Header */ "./src/js/editor/block/components/Header.js"); +/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js"); +/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../functions/getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _functions_getResults__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../functions/getResults */ "./src/js/functions/getResults.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../functions/session */ "./src/js/functions/session.js"); +/* harmony import */ var _APILightbox__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./APILightbox */ "./src/js/components/APILightbox.js"); +/* harmony import */ var _ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ErrorLightbox */ "./src/js/components/ErrorLightbox.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _LoadMore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LoadMore */ "./src/js/components/LoadMore.js"); +/* harmony import */ var _NoResults__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./NoResults */ "./src/js/components/NoResults.js"); +/* harmony import */ var _ProviderNav__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ProviderNav */ "./src/js/components/ProviderNav.js"); +/* harmony import */ var _RestAPIError__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RestAPIError */ "./src/js/components/RestAPIError.js"); +/* harmony import */ var _Results__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Results */ "./src/js/components/Results.js"); +/* harmony import */ var _ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ResultsWPBlock */ "./src/js/components/ResultsWPBlock.js"); +/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Tooltip */ "./src/js/components/Tooltip.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _search_SearchForm__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./search/SearchForm */ "./src/js/components/search/SearchForm.js"); +/* harmony import */ var _search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./search/SearchHeader */ "./src/js/components/search/SearchHeader.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var imagesLoaded = __webpack_require__(/*! imagesloaded */ "./node_modules/imagesloaded/imagesloaded.js"); +var page = 1; + +/** + * Render the main InstantImages application component. + * + * @param {Object} props The component props. + * @param {string} props.editor Editor type. + * @param {string} props.provider Image provider. + * @param {Array} props.data API results. + * @param {Element} props.container Instant Images container element. + * @param {Object} props.api_error API error object. + * @param {string} props.clientId WP block client ID. + * @return {JSX.Element} InstantImages component. + */ +function InstantImages(props) { + var _instant_img_localize4, _instant_img_localize5, _Object$entries; + var _props$editor = props.editor, + editor = _props$editor === void 0 ? "classic" : _props$editor, + provider = props.provider, + data = props.data, + container = props.container, + _props$api_error = props.api_error, + api_error = _props$api_error === void 0 ? null : _props$api_error, + _props$clientId = props.clientId, + clientId = _props$clientId === void 0 ? null : _props$clientId; + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var delay = 250; + var searchClass = "searching"; + var searchDefaults = { + active: false, + term: "", + type: "", + results: 0 + }; + + // App state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(data)), + _useState2 = _slicedToArray(_useState, 2), + results = _useState2[0], + setResults = _useState2[1]; // Image results. + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(provider), + _useState4 = _slicedToArray(_useState3, 2), + activeProvider = _useState4[0], + setActiveProvider = _useState4[1]; // Current provider. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState6 = _slicedToArray(_useState5, 2), + apiTested = _useState6[0], + setAPITested = _useState6[1]; // API key test results. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState8 = _slicedToArray(_useState7, 2), + mounted = _useState8[0], + setMounted = _useState8[1]; // App mounted state. + var _useState9 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState10 = _slicedToArray(_useState9, 2), + loading = _useState10[0], + setLoading = _useState10[1]; // Loading state + var _useState11 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState12 = _slicedToArray(_useState11, 2), + loadingMore = _useState12[0], + setLoadingMore = _useState12[1]; // Load more state. + var _useState13 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState14 = _slicedToArray(_useState13, 2), + done = _useState14[0], + setDone = _useState14[1]; // Done state. + var _useState15 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(api_error), + _useState16 = _slicedToArray(_useState15, 2), + apiError = _useState16[0], + setAPIError = _useState16[1]; // API Error. + var _useState17 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState18 = _slicedToArray(_useState17, 2), + showAPILightbox = _useState18[0], + setShowAPILightbox = _useState18[1]; // Render API key lightbox. + var _useState19 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(searchDefaults), + _useState20 = _slicedToArray(_useState19, 2), + search = _useState20[0], + setSearch = _useState20[1]; + var _useState21 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState22 = _slicedToArray(_useState21, 2), + suggestions = _useState22[0], + setSuggestions = _useState22[1]; + var _useState23 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters), + _useState24 = _slicedToArray(_useState23, 2), + filterOptions = _useState24[0], + setFilterOptions = _useState24[1]; + var _useState25 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState26 = _slicedToArray(_useState25, 2), + filters = _useState26[0], + setFilters = _useState26[1]; + var _useState27 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}), + _useState28 = _slicedToArray(_useState27, 2), + searchFilters = _useState28[0], + setSearchFilters = _useState28[1]; + + // Refs. + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + var photosRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var searchInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var msnryRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // WP Editor props. + var wpBlock = editor === "block" ? true : false; + var blockSidebar = editor === "sidebar" ? true : false; + var isBlockEditor = wpBlock || blockSidebar ? true : false; + var mediaModal = editor === "media-modal" ? true : false; + var body = document.body; + var plugin = isBlockEditor ? container : container.parentNode.parentNode; + var wrapper = isBlockEditor ? container : plugin.querySelector(".instant-images-wrapper"); + + /** + * Get the initial set of photos for the current view (New/Popular/Filters/etc...). + * + * @param {boolean} reset Reset the current view. + * @since 3.0 + */ + function getPhotos() { + return _getPhotos.apply(this, arguments); + } + /** + * Load more photos in infinite scroll style. + * + * @since 3.0 + */ + function _getPhotos() { + _getPhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + var _searchInputRef$curre2; + var reset, + params, + url, + sessionData, + response, + status, + headers, + apiResults, + _apiResults$error, + error, + _args = arguments; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + reset = _args.length > 0 && _args[0] !== undefined ? _args[0] : false; + if (!loadingMore) { + _context.next = 3; + break; + } + return _context.abrupt("return", false); + case 3: + if (!(!reset && (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre2 = searchInputRef.current) === null || _searchInputRef$curre2 === void 0 ? void 0 : _searchInputRef$curre2.value) !== "")) { + _context.next = 7; + break; + } + if (!(extended_activated && extended_license)) { + _context.next = 7; + break; + } + doSearch(searchInputRef.current.value); + return _context.abrupt("return"); + case 7: + setLoading(true); // Set loading state. + clearSearch(); // Reset search results. + + resetScrollPosition(); + page = 1; + + // Build URL. + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, filters); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("photos", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context.next = 18; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + _context.next = 37; + break; + case 18: + _context.next = 20; + return fetch(url); + case 20: + response = _context.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context.prev = 23; + _context.next = 26; + return response.json(); + case 26: + apiResults = _context.sent; + _apiResults$error = apiResults.error, error = _apiResults$error === void 0 ? null : _apiResults$error; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context.next = 37; + break; + case 32: + _context.prev = 32; + _context.t0 = _context["catch"](23); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoading(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 37: + // Delay loading animatons for effect. + setTimeout(function () { + setLoading(false); + }, delay); + case 38: + case "end": + return _context.stop(); + } + }, _callee, null, [[23, 32]]); + })); + return _getPhotos.apply(this, arguments); + } + function loadMorePhotos() { + return _loadMorePhotos.apply(this, arguments); + } + /** + * Perform a photo search. + * + * @param {string} term Search term. + * @since 3.0 + */ + function _loadMorePhotos() { + _loadMorePhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { + var searchQuery, type, activeFilters, loadmoreParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error2, error; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(!mounted || loading || loadingMore || done)) { + _context2.next = 2; + break; + } + return _context2.abrupt("return"); + case 2: + setLoadingMore(true); + page = parseInt(page) + 1; + + // Get search query. + searchQuery = search !== null && search !== void 0 && search.active && search !== null && search !== void 0 && search.term ? { + term: search.term + } : {}; // Build URL. + type = search !== null && search !== void 0 && search.active ? "search" : "photos"; + activeFilters = search !== null && search !== void 0 && search.active ? searchFilters : filters; + loadmoreParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), activeFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, loadmoreParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])(type, params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context2.next = 15; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), true, null); + _context2.next = 34; + break; + case 15: + _context2.next = 17; + return fetch(url); + case 17: + response = _context2.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context2.prev = 20; + _context2.next = 23; + return response.json(); + case 23: + apiResults = _context2.sent; + _apiResults$error2 = apiResults.error, error = _apiResults$error2 === void 0 ? null : _apiResults$error2; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), true, error); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context2.next = 34; + break; + case 29: + _context2.prev = 29; + _context2.t0 = _context2["catch"](20); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + setLoadingMore(false); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 34: + case "end": + return _context2.stop(); + } + }, _callee2, null, [[20, 29]]); + })); + return _loadMorePhotos.apply(this, arguments); + } + function doSearch(_x2) { + return _doSearch.apply(this, arguments); + } + /** + * Handle the display results. + * + * @param {Array} images Image array. + * @param {boolean} append Append images to existing results display. + * @param {string|null} error Error message. + */ + function _doSearch() { + _doSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(term) { + var searchType, searchQuery, searchParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error3, error; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + setLoading(true); + resetScrollPosition(); + page = 1; // Reset current page num. + searchType = term.substring(0, 3) === "id:" ? "id" : "term"; // Get search query. + searchQuery = searchType === "id" ? { + id: term.replace("id:", "").replace(/\s+/, "") + } : { + term: term + }; // Build URL. + searchParams = _objectSpread(_objectSpread(_objectSpread({}, { + page: page + }), searchQuery), searchFilters); + params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, searchParams); + url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("search", params); // Get session storage. + sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url); + if (!sessionData) { + _context3.next = 14; + break; + } + // Display results from session. + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(sessionData) + }); + _context3.next = 35; + break; + case 14: + _context3.next = 16; + return fetch(url); + case 16: + response = _context3.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + _context3.prev = 19; + _context3.next = 22; + return response.json(); + case 22: + apiResults = _context3.sent; + _apiResults$error3 = apiResults.error, error = _apiResults$error3 === void 0 ? null : _apiResults$error3; + displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error); + setSearch({ + active: true, + term: term, + type: searchType, + results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(apiResults) + }); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults); + _context3.next = 35; + break; + case 29: + _context3.prev = 29; + _context3.t0 = _context3["catch"](19); + // Reset all search parameters. + setDone(true); + setLoading(false); + (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status); + (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url); + case 35: + searchInputRef.current.classList.remove(searchClass); + case 36: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[19, 29]]); + })); + return _doSearch.apply(this, arguments); + } + function displayResults() { + var images = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var error = arguments.length > 2 ? arguments[2] : undefined; + checkResults(images === null || images === void 0 ? void 0 : images.length); + if (append) { + setResults(function (prevState) { + return [].concat(_toConsumableArray(prevState), _toConsumableArray(images)); + }); // Load more. + } else { + setResults(images); // Standard switch. + } + + setAPIError(error); + } + + /** + * Handle the Photo Search. + * + * @param {Event} event The dispatched submit event. + * @since 3.0 + */ + function searchHandler(event) { + event.preventDefault(); + var term = searchInputRef.current.value; + if (term.length > 2) { + searchInputRef.current.classList.add(searchClass); + doSearch(term); + } else { + searchInputRef.current.focus(); + } + } + + /** + * Reset search results, settings and results view. + * + * @since 3.0 + */ + function clearSearch() { + var _searchInputRef$curre; + var term = (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.value) || ""; + if (term) { + searchInputRef.current.value = ""; + } + setSearch(searchDefaults); + setSuggestions([]); + } + + /** + * Filter the photo listing. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterPhotos(filter, value) { + var newFilters = _objectSpread({}, filters); + if (newFilters[filter] && value === "#" || value === "" || value === "all") { + delete newFilters[filter]; + } else { + newFilters[filter] = value; + } + setFilters(_objectSpread({}, newFilters)); + } + + /** + * Filter the search results. + * + * @param {string} filter The current filter key. + * @param {string} value The value to filter. + */ + function filterSearch(filter, value) { + var newSearchFilters = _objectSpread({}, searchFilters); + if (newSearchFilters[filter] && value === "#" || value === "" || value === "all") { + delete newSearchFilters[filter]; + } else { + newSearchFilters[filter] = value; + } + setSearchFilters(_objectSpread({}, newSearchFilters)); + } + + /** + * Close the API Lightbox. + * + * @param {string} target The target provider to close the lightbox for. + * @since 4.5 + */ + function closeAPILightbox() { + var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + if (target) { + setActiveProvider(target); + } + setShowAPILightbox(false); + setLoading(false); + setAPIError(false); + body.classList.remove("overflow-hidden"); + } + + /** + * Switch API providers. + * + * @param {string} newProvider The provider to switch to. + * @since 4.5 + */ + function switchProvider(_x3) { + return _switchProvider.apply(this, arguments); + } + /** + * Get autocomplete search suggestions. + * + * @param {string} term The search term. + * @return {Array} The autocomplete suggestions. + */ + function _switchProvider() { + _switchProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(newProvider) { + var response, status, headers; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!(activeProvider === newProvider)) { + _context4.next = 2; + break; + } + return _context4.abrupt("return"); + case 2: + setLoading(true); + setAPIError(false); + setShowAPILightbox(false); + body.classList.remove("overflow-hidden"); + + // API verification - check API key for provider. + if (!(_constants_API__WEBPACK_IMPORTED_MODULE_4__.API[newProvider].requires_key && !apiTested.includes(newProvider))) { + _context4.next = 27; + break; + } + _context4.prev = 7; + _context4.next = 10; + return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__.buildTestURL)(newProvider)); + case 10: + response = _context4.sent; + status = response.status, headers = response.headers; + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers); + if (!(status !== 200)) { + _context4.next = 18; + break; + } + // Catch API errors and 401s. + setShowAPILightbox(newProvider); // Show API Lightbox. + setAPIError(true); + body.classList.add("overflow-hidden"); + return _context4.abrupt("return"); + case 18: + if (status === 200) { + // Valid API key - Add to array of tested providers. + setAPITested(function (prevState) { + return [].concat(_toConsumableArray(prevState), [newProvider]); + }); + } + _context4.next = 27; + break; + case 21: + _context4.prev = 21; + _context4.t0 = _context4["catch"](7); + // Catch all other errors. + setShowAPILightbox(newProvider); // Show API Lightbox. + body.classList.add("overflow-hidden"); + setAPIError(true); + return _context4.abrupt("return"); + case 27: + // Add slight delay for loading effect. + setTimeout(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[newProvider].filters); // Update filter options. + setActiveProvider(newProvider); // Switch the provider. + }, delay); + case 28: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[7, 21]]); + })); + return _switchProvider.apply(this, arguments); + } + function getSuggestions(_x4) { + return _getSuggestions.apply(this, arguments); + } + /** + * Renders the Masonry layout. + * + * @since 3.0 + */ + function _getSuggestions() { + _getSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(term) { + var api_url; + return _regeneratorRuntime().wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (!(!term || (term === null || term === void 0 ? void 0 : term.length) < 3)) { + _context5.next = 2; + break; + } + return _context5.abrupt("return"); + case 2: + // API endpoint URL. + api_url = instant_img_localize.root + "instant-images-extended/suggestions/?term=".concat(term); // Get suggestions. + _context5.next = 5; + return axios__WEBPACK_IMPORTED_MODULE_27__["default"].get(api_url).then(function (res) { + setSuggestions(res.data); + })["catch"](function (error) { + console.warn(error); + }); + case 5: + case "end": + return _context5.stop(); + } + }, _callee5); + })); + return _getSuggestions.apply(this, arguments); + } + function renderLayout() { + imagesLoaded(photosRef.current, function () { + if (!isBlockEditor) { + msnryRef.current = new (masonry_layout__WEBPACK_IMPORTED_MODULE_2___default())(photosRef.current, { + itemSelector: ".photo" + }); + photosRef.current.querySelectorAll(".photo").forEach(function (el) { + el.classList.add("in-view"); + }); + } + setTimeout(function () { + // Delay to allow for rendering and set up. + setLoading(false); + setLoadingMore(false); + if (!mounted) { + setMounted(true); + } + }, delay); + }); + } + + /** + * Reset the scroll position for the WP block only. + */ + function resetScrollPosition() { + if (wpBlock && photosRef !== null && photosRef !== void 0 && photosRef.current) { + photosRef === null || photosRef === void 0 ? void 0 : photosRef.current.scroll({ + top: 0, + left: 0, + behavior: "smooth" + }); + } + } + + /** + * A checker to determine if there are remaining search results. + * + * @param {number} num Total search results. + * @since 3.0 + */ + function checkResults(num) { + setDone(parseInt(num) === 0 || num === undefined); + } + + /** + * Escape handler to close edit windows on photos. + * + * @param {Event} e The key event. + */ + function escFunction(e) { + var key = e.key; + if (key === "Escape") { + var editing = photosRef.current.querySelectorAll(".edit-screen.editing"); + if (editing) { + _toConsumableArray(editing).forEach(function (element) { + element === null || element === void 0 ? void 0 : element.classList.remove("editing"); + }); + } + } + } + + /* Search callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (!(search !== null && search !== void 0 && search.active)) { + // Reset search filters when search is false. + setSearchFilters({}); + } + }, [search]); // eslint-disable-line react-hooks/exhaustive-deps + + /* Search filters change callback. */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted && search !== null && search !== void 0 && search.active) { + doSearch(search === null || search === void 0 ? void 0 : search.term); + } + }, [searchFilters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Filters change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (mounted) { + getPhotos(); + } + }, [filters]); // eslint-disable-line react-hooks/exhaustive-deps + + // Provider change callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters); + setFilters({}); // Trigger filter change. + }, [activeProvider]); // eslint-disable-line react-hooks/exhaustive-deps + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // Infinite scrolling. + loadMorePhotos(); + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + // Results callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + renderLayout(); + }, [results]); // eslint-disable-line react-hooks/exhaustive-deps + + // Initial page load. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setLoading(false); + wrapper.classList.add("loaded"); + + // Block editor, get initial set of photos. + if (isBlockEditor) { + getPhotos(); + } + // Add global escape listener. + document.addEventListener("keydown", escFunction, false); + return function () { + document.removeEventListener("keydown", escFunction, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.PluginProvider, { + value: { + provider: activeProvider, + wpBlock: wpBlock, + mediaModal: mediaModal, + blockSidebar: blockSidebar, + clientId: clientId, + search: search, + apiError: apiError, + getPhotos: getPhotos, + searchHandler: searchHandler, + filterSearch: filterSearch, + suggestions: suggestions, + getSuggestions: getSuggestions + } + }, wpBlock ? /*#__PURE__*/React.createElement(_editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], { + switchProvider: switchProvider + }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_ProviderNav__WEBPACK_IMPORTED_MODULE_18__["default"], { + switchProvider: switchProvider + }), /*#__PURE__*/React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_23__.ExtendedCTA, null)), /*#__PURE__*/React.createElement(_RestAPIError__WEBPACK_IMPORTED_MODULE_19__["default"], null), /*#__PURE__*/React.createElement("div", { + className: "control-nav" + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--filters-wrap", apiError || search !== null && search !== void 0 && search.active ? "inactive" : null) + }, filterOptions && (_Object$entries = Object.entries(filterOptions)) !== null && _Object$entries !== void 0 && _Object$entries.length ? /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filterOptions).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_15__["default"], { + key: "".concat(activeProvider, "-").concat(index, "-").concat(key), + data: filter, + filterKey: key, + handler: filterPhotos + }); + })) : null), /*#__PURE__*/React.createElement(_search_SearchForm__WEBPACK_IMPORTED_MODULE_24__["default"], { + ref: searchInputRef + })), /*#__PURE__*/React.createElement("div", { + id: "photo-listing", + className: loading ? "loading" : null + }, /*#__PURE__*/React.createElement(_search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__["default"], null), wpBlock ? /*#__PURE__*/React.createElement(_ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__["default"], { + ref: photosRef, + data: results, + done: done, + loadMorePhotos: loadMorePhotos + }) : /*#__PURE__*/React.createElement(_Results__WEBPACK_IMPORTED_MODULE_20__["default"], { + ref: photosRef, + data: results + }), /*#__PURE__*/React.createElement(_NoResults__WEBPACK_IMPORTED_MODULE_17__["default"], { + total: search === null || search === void 0 ? void 0 : search.results, + is_search: search === null || search === void 0 ? void 0 : search.active + }), /*#__PURE__*/React.createElement(_LoadMore__WEBPACK_IMPORTED_MODULE_16__["default"], { + ref: loadMoreRef, + loadMorePhotos: loadMorePhotos, + loading: loadingMore, + done: done + }), /*#__PURE__*/React.createElement(_APILightbox__WEBPACK_IMPORTED_MODULE_13__["default"], { + provider: showAPILightbox, + callback: closeAPILightbox + }), /*#__PURE__*/React.createElement(_ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__["default"], null), /*#__PURE__*/React.createElement(_Tooltip__WEBPACK_IMPORTED_MODULE_22__["default"], null)))); +} + +/***/ }), + +/***/ "./src/js/components/LoadMore.js": +/*!***************************************!*\ + !*** ./src/js/components/LoadMore.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); + + + + +/** + * Render the LoadMore component. + * + * @return {JSX.Element} The LoadMore component. + */ +var LoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var loadMorePhotos = props.loadMorePhotos, + loading = props.loading, + done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("load-more-wrap", loading ? "loading" : null, done ? "done" : null), + ref: ref + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button", + onClick: function onClick() { + return loadMorePhotos(); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Load More Images", "instant-images"))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMore); + +/***/ }), + +/***/ "./src/js/components/NoResults.js": +/*!****************************************!*\ + !*** ./src/js/components/NoResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ NoResults) +/* harmony export */ }); +/** + * Render the NoResults component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The NoResults component. + */ +function NoResults(props) { + var _props$total = props.total, + total = _props$total === void 0 ? 0 : _props$total, + _props$is_search = props.is_search, + is_search = _props$is_search === void 0 ? false : _props$is_search; + if (!is_search || is_search && total >= 1) { + // Bail if not search or search total is greater than 1. + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-no-results" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, instant_img_localize.no_results, " "), /*#__PURE__*/React.createElement("p", null, instant_img_localize.no_results_desc, " "))); +} + +/***/ }), + +/***/ "./src/js/components/Photo.js": +/*!************************************!*\ + !*** ./src/js/components/Photo.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Photo) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/utils/insertImage */ "./src/js/editor/utils/insertImage.js"); +/* harmony import */ var _editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editor/utils/setFeaturedImage */ "./src/js/editor/utils/setFeaturedImage.js"); +/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../functions/providers/unsplash */ "./src/js/functions/providers/unsplash.js"); +/* harmony import */ var _functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/generateAttribution */ "./src/js/functions/generateAttribution.js"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + +/** + * Render the Photo component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Photo component. + */ +function Photo(props) { + var result = props.result, + setInactive = props.setInactive; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB, + _usePluginContext$med = _usePluginContext.mediaModal, + mediaModal = _usePluginContext$med === void 0 ? false : _usePluginContext$med, + _usePluginContext$blo = _usePluginContext.blockSidebar, + blockSidebar = _usePluginContext$blo === void 0 ? false : _usePluginContext$blo, + clientId = _usePluginContext.clientId; + var id = result.id, + filename = result.id, + permalink = result.permalink, + title = result.title, + alt = result.alt, + caption = result.caption, + attribution = result.attribution, + _result$extension = result.extension, + extension = _result$extension === void 0 ? "jpg" : _result$extension, + likes = result.likes, + dimensions = result.dimensions, + urls = result.urls, + user = result.user; + + // Deconstruct image URLs. + var thumb = urls.thumb, + full = urls.full, + download_url = urls.download_url; + + // Deconstruct user data. + var user_name = user.name, + user_photo = user.photo, + user_url = user.url; + var container = document.querySelector(".instant-img-container"); + var likeDisplay = parseInt(likes) === 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Like", "instant-images") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Likes", "instant-images"); + var _instant_img_localize = instant_img_localize, + _instant_img_localize2 = _instant_img_localize.attribution_hook, + attribution_hook = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.auto_attribution, + auto_attribution = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + + // Get the attribution text. + var imageAttribution = attribution_hook ? (0,_functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__["default"])(attribution_hook, provider, permalink, user) : attribution; + var imageCaption = auto_attribution === "1" ? imageAttribution : caption; + + // Photo state. + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }), + _useState2 = _slicedToArray(_useState, 2), + imageDetails = _useState2[0], + setImageDetails = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + inProgress = _useState4[0], + setInProgress = _useState4[1]; // inProgress state. + var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("loaded"), + _useState6 = _slicedToArray(_useState5, 2), + status = _useState6[0], + setStatus = _useState6[1]; // Status state. + var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""), + _useState8 = _slicedToArray(_useState7, 2), + editURL = _useState8[0], + setEditURL = _useState8[1]; // Edit URL state. + + // Refs. + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var upload = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var editScreen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var captionRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + + // Gutenberg. + var setAsFeaturedImage = false; + var insertIntoPost = false; + + /** + * Function to trigger the image download. + * + * @since 4.3 + */ + function download() { + if (inProgress || status === "success" || status === "uploaded") { + return false; // Exit if uploading, uploaded or success. + } + + var target = upload === null || upload === void 0 ? void 0 : upload.current; + setInProgress(true); + setStatus("uploading"); + if (wpBlock) { + setInactive(true); // Make Instant Images inactive after selecting an image. + } + + // API URL + var api = instant_img_localize.root + "instant-images/download/"; + + // Data Params + var data = { + provider: provider, + id: target.getAttribute("data-id"), + image_url: target.getAttribute("data-url"), + filename: target.getAttribute("data-id"), + extension: extension, + custom_filename: target.getAttribute("data-filename"), + title: target.getAttribute("data-title"), + alt: target.getAttribute("data-alt"), + caption: target.getAttribute("data-caption"), + parent_id: instant_img_localize.parent_id, + lang: instant_img_localize.lang + }; + + // Config Params + var config = { + credentials: "same-origin", + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_9__["default"].post(api, JSON.stringify(data), config).then(function (res) { + var response = res.data; + if (response) { + // Successful response from server + var success = response.success; + var attachment = response.attachment; + var admin_url = response.admin_url; + var msg = response.msg; + if (success) { + var edit_url = "".concat(admin_url, "post.php?post=").concat(attachment.id, "&action=edit"); // Edit URL. + setEditURL(edit_url); + uploadComplete(target, msg, attachment.id); // Success/Upload Complete + + // Trigger a download at Unsplash. + if (provider === "unsplash" && download_url) { + (0,_functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__.unsplashDownload)(download_url); + } + + /** + * Gutenberg options. + */ + + // Set Featured Image via Sidebar. + if (blockSidebar && setAsFeaturedImage) { + (0,_editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__["default"])(attachment); + setAsFeaturedImage = false; + closeMediaModal(); + } + + // Insert Image via Sidebar. + if (blockSidebar && insertIntoPost) { + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment); + }, 250); + closeMediaModal(); + insertIntoPost = false; + } + + // Insert Image via WP Block. + if (wpBlock && clientId) { + setStatus("uploaded"); + setTimeout(function () { + // Delay for effect. + (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment, clientId); + }, 350); + closeMediaModal(); + insertIntoPost = false; + } + + /** + * Media Modal. + * If is media popup, redirect user to media-upload settings. + */ + if (container.dataset.mediaPopup === "true" && !blockSidebar) { + window.location = "media-upload.php?type=image&tab=library&attachment_id=" + attachment.id; + } + } else { + // Error + uploadError(target, msg); + } + } else { + // Error + uploadError(target, instant_img_localize.error_upload); + } + })["catch"](function (error) { + console.warn(error); + }); + } + + /** + * Upload complete function. + * + * @param {Element} target Clicked item. + * @param {string} msg Success Msg. + * @param {string} imageID Attachment id. + * @since 3.0 + */ + function uploadComplete(target, msg, imageID) { + if (!(photo !== null && photo !== void 0 && photo.current)) { + return; + } + setImageTitle(target, msg); + setStatus("uploaded"); + setInProgress(false); + + // Remove uploaded status after 3.5 seconds. + setTimeout(function () { + setStatus("success"); + }, 3500); + + // Refresh Media Router/Modal. + refreshMediaModal(imageID); + } + + /** + * Handler to send user to edit photo link after upload. + * + * @since 5.2.0 + */ + function editAfterUpload() { + if (editURL) { + window.location = editURL; + } + } + + /** + * Function used to trigger a download and then set as featured image + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function setFeaturedImageClick(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + setAsFeaturedImage = true; + upload.current.click(); + } + } + + /** + * Function used to insert an image directly into the block (Gutenberg) editor. + * + * @param {Element} e The clicked element. + * @since 4.0 + */ + function insertImageIntoPost(e) { + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + if (upload.current) { + insertIntoPost = true; + upload.current.click(); + } + } + + /** + * Refresh Media Modal and select item after it's been uploaded. + * + * @param {string} modalID The media modal ID. + * @since 4.3 + */ + function refreshMediaModal(modalID) { + if (mediaModal && wp.media && wp.media.frame && wp.media.frame.el) { + var mediaModalEl = wp.media.frame.el; + var mediaTab = mediaModalEl.querySelector("#menu-item-browse"); + if (mediaTab) { + // Open the 'Media Library' tab. + mediaTab.click(); + } + + // Delay to allow for tab switching + setTimeout(function () { + if (wp.media.frame.content.get() !== null) { + // Force a refresh of the mdeia modal content. + wp.media.frame.content.get().collection._requery(true); + } + + // Select the attached that was just uploaded. + var selection = wp.media.frame.state().get("selection"); + var selected = parseInt(modalID); + selection.reset(selected ? [wp.media.attachment(selected)] : []); + }, 100); + } + } + + /** + * Function runs when error occurs on upload or resize. + * + * @param {Element} target Current clicked item. + * @param {string} msg Error Msg. + * @since 3.0 + */ + function uploadError(target, msg) { + setImageTitle(target, msg); + setInProgress(false); + setStatus("error"); + setInactive(false); + console.warn(msg); + } + + /** + * Set the title attribute of target. + * + * @param {Element} target Clicked element. + * @param {string} msg Title message from JSON. + * @since 3.0 + */ + function setImageTitle(target, msg) { + target.setAttribute("title", msg); // Remove 'Click to upload...', set new value + } + + /** + * Displays the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function showEditScreen(e) { + e.preventDefault(); + (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + + // Get all open edit screens and close them. + var openEdits = document.querySelectorAll(".edit-screen.editing"); + if (openEdits) { + openEdits.forEach(function (edit) { + edit.classList.remove("editing"); + }); + } + + // Show edit screen + editScreen.current.classList.add("editing"); + + // Set focus on edit screen + setTimeout(function () { + editScreen.current.focus({ + preventScroll: true + }); + }, 150); + } + + /** + * Handles the change event for the edit screen. + * + * @param {Element} e The target element. + * @since 3.2 + */ + function handleEditChange(e) { + var target = e.target.name; + switch (target) { + case "filename": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + filename: e.target.value + })); + break; + case "title": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + title: e.target.value + })); + break; + case "alt": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + alt: e.target.value + })); + break; + case "caption": + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: e.target.value + })); + break; + } + } + + /** + * Handles the Upload event from the edit screen. + * + * @since 3.2 + */ + function uploadNow() { + editScreen.current.classList.remove("editing"); // Hide edit screen. + upload.current.click(); // Trigger click. + } + + /** + * Cancel event for the edit screen. + * + * @since 3.2 + */ + function cancelEdit() { + // Reset image state. + setImageDetails({ + filename: filename, + title: title, + alt: alt, + caption: imageCaption + }); + + // Hide edit screen + editScreen.current.classList.remove("editing"); + + // Set focus back on photo. + upload.current.focus({ + preventScrol: true + }); + } + + /** + * Close the media modal after an action. + * + * @since 4.3 + */ + function closeMediaModal() { + var mediaModalEl = document.querySelector(".media-modal"); + if (mediaModalEl) { + var closeBtn = mediaModalEl.querySelector("button.media-modal-close"); + if (!closeBtn) { + return false; + } + closeBtn.click(); + } + } + + /** + * Handles adding attribution for images. + * + * @param {Element} e The target element. + * @since 4.5 + */ + function addAttribution(e) { + e.preventDefault(); + captionRef.current.value = imageAttribution; // Set form value. + setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, { + caption: imageAttribution + })); // Set caption state. + } + + return /*#__PURE__*/React.createElement("article", { + className: "photo", + ref: photo + }, /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("photo-wrap", "photo-".concat(status)) + }, /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("button", { + className: "photo-upload", + ref: upload, + "data-id": id, + "data-url": full, + "data-filename": imageDetails.filename, + "data-title": imageDetails.title, + "data-alt": imageDetails.alt, + "data-caption": imageDetails.caption, + title: wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload, + onClick: function onClick() { + return download(); + } + }, /*#__PURE__*/React.createElement("img", { + src: thumb, + alt: alt, + className: status + })), /*#__PURE__*/React.createElement("div", { + className: "photo-controls" + }, /*#__PURE__*/React.createElement("a", { + target: "_blank", + className: "user fade", + href: user_url, + rel: "noopener noreferrer", + title: "".concat(instant_img_localize.view_all, " @ ").concat(user_name) + }, /*#__PURE__*/React.createElement("div", { + className: "user-wrap" + }, (user_photo === null || user_photo === void 0 ? void 0 : user_photo.length) > 0 && /*#__PURE__*/React.createElement("img", { + className: "user-wrap--photo", + src: user_photo, + alt: "" + }), user_name)), /*#__PURE__*/React.createElement("div", { + className: "photo-options" + }, blockSidebar && !editURL ? /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "set-featured fade", + "data-title": instant_img_localize.set_as_featured, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return setFeaturedImageClick(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-picture-o", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.set_as_featured)), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post))) : null, !!wpBlock && /*#__PURE__*/React.createElement("button", { + type: "button", + className: "insert fade", + "data-title": instant_img_localize.insert_into_post, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + onClick: function onClick(e) { + return insertImageIntoPost(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-plus", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.insert_into_post)), editURL ? /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return editAfterUpload(); + }, + className: "edit-photo-admin fade", + "data-title": instant_img_localize.edit_upload, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-pencil", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_upload)) : /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return showEditScreen(e); + }, + className: "edit-photo fade", + "data-title": instant_img_localize.edit_details, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-cog", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.edit_details)))), /*#__PURE__*/React.createElement("div", { + className: "photo-meta" + }, likes ? /*#__PURE__*/React.createElement("span", { + className: "likes tooltip--above", + "data-title": likes + " " + likeDisplay, + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + } + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-heart heart-like", + "aria-hidden": "true" + }), " ", likes) : null, /*#__PURE__*/React.createElement("a", { + className: "tooltip--above", + href: permalink, + "data-title": "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)), + onMouseEnter: function onMouseEnter(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e); + }, + onMouseLeave: function onMouseLeave(e) { + return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e); + }, + rel: "noopener noreferrer", + target: "_blank" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-external-link", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)))))), /*#__PURE__*/React.createElement("div", { + className: "edit-screen", + tabIndex: "0", + ref: editScreen + }, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--title" + }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", { + className: "heading" + }, instant_img_localize.edit_details), dimensions && dimensions.length > 0 && /*#__PURE__*/React.createElement("p", { + className: "dimensions" + }, dimensions)), /*#__PURE__*/React.createElement("div", { + className: "preview", + style: { + backgroundImage: "url(".concat(thumb, ")") + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_filename, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "filename", + "data-original": filename, + placeholder: imageDetails.filename, + value: imageDetails.filename, + onChange: function onChange(e) { + return handleEditChange(e); + } + }), /*#__PURE__*/React.createElement("em", null, ".", extension)), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_title, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "title", + "data-original": title, + placeholder: title, + value: imageDetails.title || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_alt, ":"), /*#__PURE__*/React.createElement("input", { + type: "text", + name: "alt", + "data-original": alt, + value: imageDetails.alt || "", + onChange: function onChange(e) { + return handleEditChange(e); + } + })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_caption, ":"), /*#__PURE__*/React.createElement("textarea", { + rows: "4", + name: "caption", + "data-original": imageCaption, + onChange: function onChange(e) { + return handleEditChange(e); + }, + value: imageDetails.caption || "", + ref: captionRef + })), imageAttribution ? /*#__PURE__*/React.createElement("div", { + className: "add-attribution-row" + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick(e) { + return addAttribution(e); + }, + type: "button" + }, instant_img_localize.attribution)) : null, /*#__PURE__*/React.createElement("div", { + className: "edit-screen--controls" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick(e) { + return cancelEdit(e); + } + }, instant_img_localize.cancel), " ", "\xA0", /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-primary", + onClick: function onClick() { + return uploadNow(); + } + }, wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload_now))), /*#__PURE__*/React.createElement("div", { + className: "photo-status" + }))); +} + +/***/ }), + +/***/ "./src/js/components/ProviderIcons.js": +/*!********************************************!*\ + !*** ./src/js/components/ProviderIcons.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OpenverseIcon": () => (/* binding */ OpenverseIcon), +/* harmony export */ "PexelsIcon": () => (/* binding */ PexelsIcon), +/* harmony export */ "PixabayIcon": () => (/* binding */ PixabayIcon), +/* harmony export */ "UnsplashIcon": () => (/* binding */ UnsplashIcon), +/* harmony export */ "getProviderIcon": () => (/* binding */ getProviderIcon) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Return the provider icon. + * + * @param {string} provider The provider. + * @return {JSX.Element} The provider icon. + */ +function getProviderIcon(provider) { + if (!provider) { + return null; + } + return _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon ? _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon() : null; +} + +/** + * Unsplash Icon. + */ +function UnsplashIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z", + fill: "black" + })); +} + +/** + * Pixabay Icon. + */ +function PixabayIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("g", { + clipPath: "url(#clip0_307_143)" + }, /*#__PURE__*/React.createElement("path", { + d: "M0 0V32H32V0H0Z", + fill: "#48A947" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z", + fill: "#F9FBF9" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z", + fill: "#FAFCFA" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z", + fill: "#4AA949" + })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { + id: "clip0_307_143" + }, /*#__PURE__*/React.createElement("rect", { + width: "32", + height: "32", + fill: "white" + })))); +} + +/** + * Openverse Icon. + */ +function OpenverseIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32", + height: "32", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z", + fill: "#000000" + }), /*#__PURE__*/React.createElement("path", { + d: "M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z", + fill: "#000000" + })); +} + +/** + * Pexels Icon. + */ +function PexelsIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "32px", + height: "32px", + viewBox: "0 0 32 32", + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/React.createElement("path", { + d: "M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z", + fill: "#05A081" + }), /*#__PURE__*/React.createElement("path", { + d: "M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z", + fill: "#fff" + })); +} + +/***/ }), + +/***/ "./src/js/components/ProviderNav.js": +/*!******************************************!*\ + !*** ./src/js/components/ProviderNav.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ProviderNav) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the ProviderNav component. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The ProviderNav component. + */ +function ProviderNav(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !!(providers !== null && providers !== void 0 && providers.length) && /*#__PURE__*/React.createElement("nav", { + className: "provider-nav" + }, providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("div", { + key: "provider-".concat(index) + }, /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return switchProvider(item.toLowerCase()); + }, + className: provider === item.toLowerCase() ? "provider-nav--btn active" : "provider-nav--btn" + }, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_3__.getProviderIcon)(item), /*#__PURE__*/React.createElement("span", null, item), _constants_API__WEBPACK_IMPORTED_MODULE_2__.API[item.toLowerCase()]["new"] && /*#__PURE__*/React.createElement("span", { + className: "provider-nav--new" + }, instant_img_localize["new"]))); + }))); +} + +/***/ }), + +/***/ "./src/js/components/RestAPIError.js": +/*!*******************************************!*\ + !*** ./src/js/components/RestAPIError.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ RestAPIError) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + +/** + * Render the RestAPIError component. + * + * @return {JSX.Element} The RestAPIError component. + */ +function RestAPIError() { + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true), + _useState2 = _slicedToArray(_useState, 2), + access = _useState2[0], + setAccess = _useState2[1]; + + /** + * Test users access to the REST API endpoint. + * + * @since 3.2 + */ + function test() { + var testURL = instant_img_localize.root + "instant-images/test/"; + var restAPITest = new XMLHttpRequest(); + restAPITest.open("POST", testURL, true); + restAPITest.setRequestHeader("X-WP-Nonce", instant_img_localize.nonce); + restAPITest.setRequestHeader("Content-Type", "application/json"); + restAPITest.send(); + restAPITest.onload = function () { + if (restAPITest.status >= 200 && restAPITest.status < 400) { + var response = JSON.parse(restAPITest.response); + var success = response.success; + if (!success) { + setAccess(false); + } + } else { + setAccess(false); + } + }; + restAPITest.onerror = function (errorMsg) { + console.warn(errorMsg); + setAccess(false); + }; + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + test(); + }, []); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !access ? /*#__PURE__*/React.createElement("div", { + className: "error-messaging" + }, /*#__PURE__*/React.createElement("strong", null, instant_img_localize.error_restapi), instant_img_localize.error_restapi_desc) : null); +} + +/***/ }), + +/***/ "./src/js/components/Results.js": +/*!**************************************!*\ + !*** ./src/js/components/Results.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var Results = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + return /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_2__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_1__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Results); + +/***/ }), + +/***/ "./src/js/components/ResultsWPBlock.js": +/*!*********************************************!*\ + !*** ./src/js/components/ResultsWPBlock.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editor/block/components/Instructions */ "./src/js/editor/block/components/Instructions.js"); +/* harmony import */ var _editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/block/components/LoadMore */ "./src/js/editor/block/components/LoadMore.js"); +/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js"); +/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + +/** + * Render the Results component. + * + * @return {JSX.Element} The Results component. + */ +var ResultsWPBlock = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var data = props.data, + _props$done = props.done, + done = _props$done === void 0 ? false : _props$done, + loadMorePhotos = props.loadMorePhotos; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + _usePluginContext$wpB = _usePluginContext.wpBlock, + wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + inactive = _useState2[0], + setInactive = _useState2[1]; + var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__.useInView)({ + rootMargin: "0px 0px" + }), + _useInView2 = _slicedToArray(_useInView, 2), + loadMoreRef = _useInView2[0], + inView = _useInView2[1]; + + // Scroll in-view callback. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (wpBlock) { + loadMorePhotos(); + } + }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + id: "photos", + className: inactive ? "inactive" : null, + ref: ref + }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, { + key: "".concat(result.id, "-").concat(index) + }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_5__["default"], { + result: result + }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_4__["default"], { + result: result, + type: result === null || result === void 0 ? void 0 : result.type, + setInactive: setInactive + })); + }), /*#__PURE__*/React.createElement(_editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__["default"], { + done: done, + ref: loadMoreRef + })), /*#__PURE__*/React.createElement(_editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__["default"], { + show: data === null || data === void 0 ? void 0 : data.length + })); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResultsWPBlock); + +/***/ }), + +/***/ "./src/js/components/Sponsor.js": +/*!**************************************!*\ + !*** ./src/js/components/Sponsor.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Sponsor) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render the Sponsor component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The Sponsor component. + */ +function Sponsor(props) { + var result = props.result; + var _result$data = result.data, + data = _result$data === void 0 ? null : _result$data; + var url = (data === null || data === void 0 ? void 0 : data.url) || ""; + var title = (data === null || data === void 0 ? void 0 : data.title) || ""; + var desc = (data === null || data === void 0 ? void 0 : data.description) || ""; + var avatar = (data === null || data === void 0 ? void 0 : data.avatar) || ""; + var _data$image = data.image, + image = _data$image === void 0 ? null : _data$image; + var _image$src = image.src, + src = _image$src === void 0 ? null : _image$src, + _image$alt = image.alt, + alt = _image$alt === void 0 ? null : _image$alt; + var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + var link = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, image && url ? + /*#__PURE__*/ + // eslint-disable-next-line + React.createElement("article", { + className: "photo feature", + title: desc, + ref: photo, + onClick: function onClick() { + return link.current.click(); + } + }, /*#__PURE__*/React.createElement("div", { + className: "photo--wrap" + }, /*#__PURE__*/React.createElement("span", { + className: "flag", + title: instant_img_localize.advertisement + }, instant_img_localize.ad), /*#__PURE__*/React.createElement("div", { + className: "img-wrap" + }, /*#__PURE__*/React.createElement("a", { + className: "loaded", + href: url, + target: "_blank", + ref: link, + rel: "noreferrer" + }, /*#__PURE__*/React.createElement("img", { + src: src, + alt: alt + }))), /*#__PURE__*/React.createElement("div", { + className: "feature-title" + }, avatar && /*#__PURE__*/React.createElement("img", { + src: avatar, + alt: title + }), /*#__PURE__*/React.createElement("span", null, title)))) : null); +} + +/***/ }), + +/***/ "./src/js/components/Tooltip.js": +/*!**************************************!*\ + !*** ./src/js/components/Tooltip.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Tooltip) +/* harmony export */ }); +/** + * Render the Tooltip component. + * + * @return {JSX.Element} The Tooltip component. + */ +function Tooltip() { + return /*#__PURE__*/React.createElement("div", { + id: "tooltip" + }); +} + +/***/ }), + +/***/ "./src/js/components/cta/Extended.js": +/*!*******************************************!*\ + !*** ./src/js/components/cta/Extended.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ExtendedCTA": () => (/* binding */ ExtendedCTA), +/* harmony export */ "ExtendedSearchCTA": () => (/* binding */ ExtendedSearchCTA) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + +/* eslint-disable */ + +/** + * Generic CTA for the Extended add-on. + * + * @return {JSX.Element} The ExtendedCTA component. + */ +function ExtendedCTA() { + var _instant_img_localize3, _instant_img_localize4; + var _instant_img_localize = (_instant_img_localize3 = instant_img_localize) === null || _instant_img_localize3 === void 0 ? void 0 : (_instant_img_localize4 = _instant_img_localize3.addons) === null || _instant_img_localize4 === void 0 ? void 0 : _instant_img_localize4.extended, + _instant_img_localize2 = _instant_img_localize.activated, + activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2; + var name = "extended-cta-2024"; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) === "hide"), + _useState2 = _slicedToArray(_useState, 2), + dissmissed = _useState2[0], + setDismissed = _useState2[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setDismissed(true); + } + return /*#__PURE__*/React.createElement(React.Fragment, null, !activated && !dissmissed ? /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--standard" + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-bullhorn", + "aria-hidden": "true" + }), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, "Introducing the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), " ", "\u2192 An extension pack of premium features and functionality to enhance the Instant Images plugin."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + className: "button button-secondary", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")))) : null); +} + +/** + * CTA for the Extended add-on in the search dropdown. + * + * @param {Object} props The component props. + * @param {boolean} props.show Display the component. + * @return {JSX.Element} The ExtendedSearchCTA component. + */ +function ExtendedSearchCTA(_ref) { + var _ref$show = _ref.show, + show = _ref$show === void 0 ? false : _ref$show; + var name = "extended-cta-search-2024"; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) !== "hide"), + _useState4 = _slicedToArray(_useState3, 2), + active = _useState4[0], + setActive = _useState4[1]; // Get setting from localstorage. + + // Hide the CTA. + function remove() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide"); + setActive(false); + } + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history extended-cta", show && active ? "active" : null) + }, /*#__PURE__*/React.createElement("div", { + className: "cta-extended cta-extended--search" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "closeBtn", + onClick: function onClick() { + return remove(); + }, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images") + }, "\xD7", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", { + className: "fa fa-magic", + "aria-hidden": "true" + }), "Enable search suggestions, history, and maintain current search term while switching providers with the", " ", /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer" + }, "Extended add-on")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", { + href: "https://getinstantimages.com/add-ons/extended/", + target: "_blank", + rel: "noreferrer", + className: "button button-primary" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")))))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchForm.js": +/*!************************************************!*\ + !*** ./src/js/components/search/SearchForm.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useClickOutside */ "./src/js/hooks/useClickOutside.js"); +/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cta/Extended */ "./src/js/components/cta/Extended.js"); +/* harmony import */ var _SearchHistory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SearchHistory */ "./src/js/components/search/SearchHistory.js"); +/* harmony import */ var _SearchToolTip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SearchToolTip */ "./src/js/components/search/SearchToolTip.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } + + + + + + + + + +/** + * Render the search form as a component. + * + * @return {JSX.Element} The SearchForm component. + */ +var SearchForm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) { + var _instant_img_localize4, _instant_img_localize5; + _objectDestructuringEmpty(_ref); + var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended, + _instant_img_localize2 = _instant_img_localize.activated, + extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2, + _instant_img_localize3 = _instant_img_localize.license, + extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + searchHandler = _usePluginContext.searchHandler, + apiError = _usePluginContext.apiError, + suggestions = _usePluginContext.suggestions, + getSuggestions = _usePluginContext.getSuggestions; + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]), + _useState2 = _slicedToArray(_useState, 2), + history = _useState2[0], + setHistory = _useState2[1]; + var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + show = _useState4[0], + setShow = _useState4[1]; + var historyRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + var submitBtnRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Handle clickoutside hook. + (0,_hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__.useClickOutside)(historyRef, function () { + setShow(false); + }); + + /** + * Set the search value in the form. + * + * @param {string} value The value to set. + */ + function setSearchValue(value) { + var input = ref === null || ref === void 0 ? void 0 : ref.current; + input.value = value; + submitBtnRef === null || submitBtnRef === void 0 ? void 0 : submitBtnRef.current.click(); + + // Set focus on input. + input.focus(); + } + + /** + * Search submit handler. + * + * @param {Event} e The event object. + */ + function formSubmit(e) { + var _ref$current; + e.preventDefault(); + var term = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.value; + if (term) { + searchHandler(e); + if (extended_license) { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSearchHistory)(term); + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + } + } + } + + /** + * Should the history div be shown? + * + * @return {boolean} Show history. + */ + function showHistory() { + return (history === null || history === void 0 ? void 0 : history.length) || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length); + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)()); + }, []); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--search", apiError ? "inactive" : null) + }, /*#__PURE__*/React.createElement("form", { + onSubmit: function onSubmit(e) { + return formSubmit(e); + }, + autoComplete: "off" + }, /*#__PURE__*/React.createElement("label", { + htmlFor: "search-input", + className: "offscreen" + }, instant_img_localize.search_label), /*#__PURE__*/React.createElement("div", { + ref: historyRef + }, /*#__PURE__*/React.createElement("input", { + ref: ref, + type: "text", + id: "search-input", + placeholder: instant_img_localize.search, + disabled: apiError, + onChange: function onChange(e) { + return extended_license && getSuggestions(e.target.value); + }, + onFocus: function onFocus() { + return setShow(true); + } + }), extended_license && showHistory() ? + /*#__PURE__*/ + /* Extended: Show only with valid add-on license */ + React.createElement(_SearchHistory__WEBPACK_IMPORTED_MODULE_6__["default"], { + show: show, + history: history, + setHistory: setHistory, + setSearchValue: setSearchValue, + container: historyRef + }) : null, !extended_activated && + /*#__PURE__*/ + /* Extended: Show only when add-on not installed. */ + React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_5__.ExtendedSearchCTA, { + show: show + })), /*#__PURE__*/React.createElement("button", { + type: "submit", + disabled: apiError, + ref: submitBtnRef + }, /*#__PURE__*/React.createElement("i", { + className: "fa fa-search" + }), /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.search)), /*#__PURE__*/React.createElement(_SearchToolTip__WEBPACK_IMPORTED_MODULE_7__["default"], { + show: show + }))); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchForm); + +/***/ }), + +/***/ "./src/js/components/search/SearchHeader.js": +/*!**************************************************!*\ + !*** ./src/js/components/search/SearchHeader.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHeader) +/* harmony export */ }); +/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters */ "./src/js/constants/filters.js"); +/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Filter */ "./src/js/components/Filter.js"); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * Render the SearchHeader component. + * + * @return {JSX.Element} The SearchHeader component. + */ +function SearchHeader() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(), + provider = _usePluginContext.provider, + search = _usePluginContext.search, + getPhotos = _usePluginContext.getPhotos, + filterSearch = _usePluginContext.filterSearch; + var _search$active = search.active, + active = _search$active === void 0 ? false : _search$active, + _search$term = search.term, + term = _search$term === void 0 ? "" : _search$term, + _search$results = search.results, + total = _search$results === void 0 ? 0 : _search$results; + var filters = _constants_filters__WEBPACK_IMPORTED_MODULE_0__.FILTERS[provider].search; + if (!active) { + // Exit if search is not active. + return null; + } + return /*#__PURE__*/React.createElement("header", { + className: "search-header" + }, /*#__PURE__*/React.createElement("h2", null, term.replace("id:", "ID: ")), /*#__PURE__*/React.createElement("div", { + className: "search-header--text" + }, "".concat(total, " ").concat(instant_img_localize.search_results), " ", /*#__PURE__*/React.createElement("strong", null, "".concat(term)), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("button", { + onClick: function onClick() { + return getPhotos(); + } + }, instant_img_localize.clear_search)), filters && Object.entries(filters).length && /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters-wrap" + }, /*#__PURE__*/React.createElement("div", { + className: "control-nav--filters" + }, Object.entries(filters).map(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + filter = _ref2[1]; + return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_1__["default"], { + key: "".concat(provider, "-search-").concat(key, "-").concat(index), + filterKey: key, + provider: provider, + data: filter, + handler: filterSearch + }); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchHistory.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchHistory.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchHistory) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js"); +/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js"); + + + + + + + +/** + * The History list component. + * + * @param {Object} props The component props. + * @return {JSX.Element} The SearchHistory component. + */ +function SearchHistory(props) { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.usePluginContext)(), + suggestions = _usePluginContext.suggestions; + var show = props.show, + history = props.history, + setHistory = props.setHistory, + setSearchValue = props.setSearchValue, + container = props.container; + var dropRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + + // Use up/down arrow keys to navigate dropdown. + (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__.useArrowControls)(show, container); + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history", show ? "active" : null), + role: "listbox", + ref: dropRef + }, !!suggestions.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Suggestions", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-suggestions" + }, suggestions.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + }))), !!history.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "control-nav--search-history-title" + }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Recent Searches", "instant-images")), /*#__PURE__*/React.createElement("button", { + type: "button", + onClick: function onClick() { + (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_4__.clearSearchHistory)(); + setHistory([]); + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Clear", "instant-images"))), /*#__PURE__*/React.createElement("ul", { + role: "listbox", + className: "search-history" + }, history.map(function (item, key) { + return /*#__PURE__*/React.createElement("li", { + key: key, + role: "option" + }, /*#__PURE__*/React.createElement("button", { + type: "button", + className: "history", + onClick: function onClick() { + return setSearchValue(item); + } + }, item)); + })))); +} + +/***/ }), + +/***/ "./src/js/components/search/SearchToolTip.js": +/*!***************************************************!*\ + !*** ./src/js/components/search/SearchToolTip.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SearchToolTip) +/* harmony export */ }); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); + + + +/** + * Render the search results tooltip component. + * + * @return {JSX.Element} The SearchToolTip component. + */ +function SearchToolTip() { + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + getPhotos = _usePluginContext.getPhotos, + search = _usePluginContext.search; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_0___default()("control-nav--search-tooltip", search !== null && search !== void 0 && search.active ? null : "hide") + }, /*#__PURE__*/React.createElement("span", { + title: "".concat(search === null || search === void 0 ? void 0 : search.results, " ").concat(instant_img_localize.search_results, " ").concat(search === null || search === void 0 ? void 0 : search.term) + }, search === null || search === void 0 ? void 0 : search.results), /*#__PURE__*/React.createElement("button", { + type: "button", + title: instant_img_localize.clear_search, + onClick: function onClick() { + return getPhotos(true); + } + }, "x", /*#__PURE__*/React.createElement("span", { + className: "offscreen" + }, instant_img_localize.clear_search))); +} + +/***/ }), + +/***/ "./src/js/constants/API.js": +/*!*********************************!*\ + !*** ./src/js/constants/API.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "API": () => (/* binding */ API) +/* harmony export */ }); +/* harmony import */ var _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ProviderIcons */ "./src/js/components/ProviderIcons.js"); + +var API = { + proxy: "https://proxy.getinstantimages.com/api/" || 0, + // eslint-disable-line + testmode: false, + defaults: { + provider: "unsplash", + order: "latest", + per_page: "20", + arr_key: "results" + }, + providers: ["Unsplash", "Openverse", "Pixabay", "Pexels"], + unsplash: { + name: "Unsplash", + requires_key: true, + "new": false, + api_var: "client_id", + collections_api: "https://api.unsplash.com/collections/", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.UnsplashIcon + }, + pixabay: { + name: "Pixabay", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PixabayIcon + }, + pexels: { + name: "Pexels", + requires_key: true, + "new": false, + api_var: "key", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PexelsIcon + }, + openverse: { + name: "Openverse", + requires_key: false, + "new": false, + api_var: "key", + key: "", + icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.OpenverseIcon + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters.js": +/*!*************************************!*\ + !*** ./src/js/constants/filters.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "FILTERS": () => (/* binding */ FILTERS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _filters_openverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters/openverse */ "./src/js/constants/filters/openverse.js"); +/* harmony import */ var _filters_pexels__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/pexels */ "./src/js/constants/filters/pexels.js"); +/* harmony import */ var _filters_pixabay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filters/pixabay */ "./src/js/constants/filters/pixabay.js"); +/* harmony import */ var _filters_unsplash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filters/unsplash */ "./src/js/constants/filters/unsplash.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + + + + +var ALL = { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("All", "instant-images"), + value: "all" +}; +var FILTERS = { + openverse: { + filters: { + source: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Source", "instant-images"), + "default": "wordpress", + filters: _toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_SOURCES) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + } + }, + search: { + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photograph", "instant-images"), + value: "photograph" + }] + }, + extension: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Extension", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_EXTENSIONS)) + }, + aspect_ratio: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + }, + license: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("License", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_LICENSES)) + }, + license_type: { + label: "license_type", + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Commercial", "instant-images"), + value: "commercial" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Modification", "instant-images"), + value: "modification" + }] + } + } + }, + pexels: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "curated", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Curated", "instant-images"), + value: "curated" + }] + } + }, + search: { + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_COLORS)) + }, + size: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"), + "default": "all", + filters: [ALL, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"), + value: "large" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"), + value: "medium" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"), + value: "small" + }] + } + } + }, + unsplash: { + filters: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "latest", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Oldest", "instant-images"), + value: "oldest" + }] + } + }, + search: { + order_by: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "relevance", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Relevance", "instant-images"), + value: "relevance" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_ORIENTATIONS)) + }, + color: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_COLORS)) + } + } + }, + pixabay: { + filters: { + order: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"), + "default": "popular", + filters: [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"), + value: "popular" + }, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"), + value: "latest" + }] + }, + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + category: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Category", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_CATS)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + }, + search: { + image_type: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE)) + }, + colors: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS)) + }, + orientation: { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"), + "default": "all", + filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS)) + } + } + } +}; + +/***/ }), + +/***/ "./src/js/constants/filters/openverse.js": +/*!***********************************************!*\ + !*** ./src/js/constants/filters/openverse.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "OPENVERSE_EXTENSIONS": () => (/* binding */ OPENVERSE_EXTENSIONS), +/* harmony export */ "OPENVERSE_LICENSES": () => (/* binding */ OPENVERSE_LICENSES), +/* harmony export */ "OPENVERSE_ORIENTATIONS": () => (/* binding */ OPENVERSE_ORIENTATIONS), +/* harmony export */ "OPENVERSE_SOURCES": () => (/* binding */ OPENVERSE_SOURCES) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var OPENVERSE_SOURCES = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("WordPress", "instant-images"), + value: "wordpress" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Flickr", "instant-images"), + value: "flickr" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nasa", "instant-images"), + value: "nasa" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("SpaceX", "instant-images"), + value: "spacex" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wikimedia", "instant-images"), + value: "wikimedia" +}]; +var OPENVERSE_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "square" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Tall", "instant-images"), + value: "tall" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wide", "instant-images"), + value: "wide" +}]; +var OPENVERSE_EXTENSIONS = [{ + label: "JPG", + value: "JPG" +}, { + label: "GIF", + value: "GIF" +}, { + label: "PNG", + value: "PNG" +}, { + label: "SVG", + value: "SVG" +}]; +var OPENVERSE_LICENSES = [{ + label: "BY", + value: "BY" +}, { + label: "BY-NC", + value: "BY-NC" +}, { + label: "BY-NC-ND", + value: "BY-NC-ND" +}, { + label: "BY-NC-SA", + value: "BY-NC-SA" +}, { + label: "BY-ND", + value: "BY-ND" +}, { + label: "BY-SA", + value: "BY-SA" +}, { + label: "CC0", + value: "CC0" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pexels.js": +/*!********************************************!*\ + !*** ./src/js/constants/filters/pexels.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PEXELS_COLORS": () => (/* binding */ PEXELS_COLORS), +/* harmony export */ "PEXELS_ORIENTATIONS": () => (/* binding */ PEXELS_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PEXELS_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Violet", "instant-images"), + value: "violet" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}]; +var PEXELS_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/pixabay.js": +/*!*********************************************!*\ + !*** ./src/js/constants/filters/pixabay.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PIXABAY_CATS": () => (/* binding */ PIXABAY_CATS), +/* harmony export */ "PIXABAY_COLORS": () => (/* binding */ PIXABAY_COLORS), +/* harmony export */ "PIXABAY_IMAGE_TYPE": () => (/* binding */ PIXABAY_IMAGE_TYPE), +/* harmony export */ "PIXABAY_ORIENTATIONS": () => (/* binding */ PIXABAY_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var PIXABAY_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grayscale", "instant-images"), + value: "grayscale" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"), + value: "turquoise" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Lilac", "instant-images"), + value: "lilac" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"), + value: "pink" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"), + value: "gray" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"), + value: "brown" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transparent", "instant-images"), + value: "transparent" +}]; +var PIXABAY_CATS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Backgrounds", "instant-images"), + value: "backgrounds" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Fashion", "instant-images"), + value: "fashion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nature", "instant-images"), + value: "nature" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Science", "instant-images"), + value: "science" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Education", "instant-images"), + value: "education" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Feelings", "instant-images"), + value: "feelings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Health", "instant-images"), + value: "health" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("People", "instant-images"), + value: "people" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Religion", "instant-images"), + value: "religion" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Places", "instant-images"), + value: "places" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Animals", "instant-images"), + value: "animals" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Industry", "instant-images"), + value: "industry" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Computer", "instant-images"), + value: "computer" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sports", "instant-images"), + value: "sports" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"), + value: "food" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transportation", "instant-images"), + value: "transportation" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Travel", "instant-images"), + value: "travel" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Buildings", "instant-images"), + value: "buildings" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Business", "instant-images"), + value: "business" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Music", "instant-images"), + value: "music" +}]; +var PIXABAY_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Horizontal", "instant-images"), + value: "horizontal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vertical", "instant-images"), + value: "vertical" +}]; +var PIXABAY_IMAGE_TYPE = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photo", "instant-images"), + value: "photo" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"), + value: "illustration" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vector", "instant-images"), + value: "vector" +}]; + +/***/ }), + +/***/ "./src/js/constants/filters/unsplash.js": +/*!**********************************************!*\ + !*** ./src/js/constants/filters/unsplash.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "UNSPLASH_COLORS": () => (/* binding */ UNSPLASH_COLORS), +/* harmony export */ "UNSPLASH_ORIENTATIONS": () => (/* binding */ UNSPLASH_ORIENTATIONS) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + +var UNSPLASH_COLORS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black & White", "instant-images"), + value: "black_and_white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"), + value: "black" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"), + value: "white" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"), + value: "yellow" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"), + value: "green" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"), + value: "orange" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"), + value: "red" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Purple", "instant-images"), + value: "purple" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Magenta", "instant-images"), + value: "magenta" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Teal", "instant-images"), + value: "teal" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"), + value: "blue" +}]; +var UNSPLASH_ORIENTATIONS = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"), + value: "landscape" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"), + value: "portrait" +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"), + value: "squarish" +}]; + +/***/ }), + +/***/ "./src/js/editor/block/components/Header.js": +/*!**************************************************!*\ + !*** ./src/js/editor/block/components/Header.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockHeader) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/pluginProvider */ "./src/js/common/pluginProvider.js"); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js"); + + + + +var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers; + +/** + * Render the block header. + * + * @param {Object} props The component props. + * @param {Object} props.switchProvider The function to switch the provider. + * @return {JSX.Element} The BlockHeader component. + */ +function BlockHeader(_ref) { + var switchProvider = _ref.switchProvider; + var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(), + provider = _usePluginContext.provider; + + /** + * Switch the provider via select. + * + * @param {string} value The provider value. + */ + function providerChange(value) { + if (value) { + switchProvider(value); + } + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header" + }, /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-logo" + }, /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_3__.IconLogo, null), /*#__PURE__*/React.createElement("span", null, "Instant Images")), /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--header-nav" + }, /*#__PURE__*/React.createElement("label", { + className: "offscreen" + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images")), /*#__PURE__*/React.createElement("select", { + defaultValue: provider, + onChange: function onChange(e) { + return providerChange(e.target.value); + } + }, /*#__PURE__*/React.createElement("option", { + value: "" + }, "-- ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images"), " --"), providers.map(function (item, index) { + return /*#__PURE__*/React.createElement("option", { + key: index, + value: item.toLowerCase() + }, item); + })))); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/Instructions.js": +/*!********************************************************!*\ + !*** ./src/js/editor/block/components/Instructions.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BlockInstructions) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Render instructional text for the WP Block. + * + * @param {Object} props The component props. + * @return {JSX.Element} The BlockInstructions component. + */ +function BlockInstructions(props) { + var _props$show = props.show, + show = _props$show === void 0 ? false : _props$show; + if (!show) { + return null; + } + return /*#__PURE__*/React.createElement("div", { + className: "instant-images-block--instructions" + }, /*#__PURE__*/React.createElement("span", null, "\u2190"), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Scroll to Load Images", "instant-images"), /*#__PURE__*/React.createElement("span", null, "\u2192")); +} + +/***/ }), + +/***/ "./src/js/editor/block/components/LoadMore.js": +/*!****************************************************!*\ + !*** ./src/js/editor/block/components/LoadMore.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Render the BlockLoadMore component. + * + * @return {JSX.Element} The BlockLoadMore component. + */ +var BlockLoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + var done = props.done; + return /*#__PURE__*/React.createElement("div", { + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("instant-images-block--loader", done ? "done" : null), + ref: ref + }); +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockLoadMore); + +/***/ }), + +/***/ "./src/js/editor/plugin/components/Menu.js": +/*!*************************************************!*\ + !*** ./src/js/editor/plugin/components/Menu.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Menu) +/* harmony export */ }); +/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post"); +/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js"); + + + +/** + * The plugin menu as a component. + * + * @return {JSX.Element} The Menu component. + */ +function Menu() { + return /*#__PURE__*/React.createElement(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0__.PluginSidebarMoreMenuItem, { + icon: /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_1__["default"], { + borderless: true + }), + target: "instant-images-sidebar", + className: "instant-images-menu-item" + }, "Instant Images"); +} + +/***/ }), + +/***/ "./src/js/editor/plugin/components/Plugin.js": +/*!***************************************************!*\ + !*** ./src/js/editor/plugin/components/Plugin.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Plugin) +/* harmony export */ }); +/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post"); +/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js"); +/* harmony import */ var _Sidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar */ "./src/js/editor/plugin/components/Sidebar.js"); + + + + +/** + * The plugin sidebar as a component. + * + * @return {JSX.Element} The Plugin component. + */ +function Plugin() { + return /*#__PURE__*/React.createElement(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_0__.PluginSidebar, { + icon: /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_1__["default"], { + borderless: true + }), + name: "instant-images-sidebar", + title: "Instant Images" + }, /*#__PURE__*/React.createElement(_Sidebar__WEBPACK_IMPORTED_MODULE_2__["default"], null)); +} + +/***/ }), + +/***/ "./src/js/editor/plugin/components/Sidebar.js": +/*!****************************************************!*\ + !*** ./src/js/editor/plugin/components/Sidebar.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Sidebar) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _components_InstantImages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../components/InstantImages */ "./src/js/components/InstantImages.js"); +/* harmony import */ var _functions_getProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../functions/getProvider */ "./src/js/functions/getProvider.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +/** + * The image listing sidebar for the plugin sidebar. + * + * @return {JSX.Element} The Panel component. + */ +function Sidebar() { + var provider = (0,_functions_getProvider__WEBPACK_IMPORTED_MODULE_2__["default"])(); + var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + mounted = _useState2[0], + setMounted = _useState2[1]; + var containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + if (!mounted) { + setMounted(true); + } + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + return /*#__PURE__*/React.createElement("div", { + className: "instant-img-container", + "data-editor": "gutenberg-sidebar", + ref: containerRef + }, !!mounted && /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], { + editor: "sidebar", + data: [], + api_error: null, + provider: provider, + container: containerRef === null || containerRef === void 0 ? void 0 : containerRef.current + })); +} + +/***/ }), + +/***/ "./src/js/editor/plugin/index.js": +/*!***************************************!*\ + !*** ./src/js/editor/plugin/index.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* reexport safe */ _components_Plugin__WEBPACK_IMPORTED_MODULE_0__["default"]) +/* harmony export */ }); +/* harmony import */ var _components_Plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/Plugin */ "./src/js/editor/plugin/components/Plugin.js"); + + +/***/ }), + +/***/ "./src/js/editor/utils/insertImage.js": +/*!********************************************!*\ + !*** ./src/js/editor/utils/insertImage.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ insertImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * Insert an image block into the block editor. + * + * @param {Object} attachment The attachment object. + * @param {string} clientId The block ID. + */ +function insertImage(attachment, clientId) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id, + _attachment$url = attachment.url, + url = _attachment$url === void 0 ? null : _attachment$url, + _attachment$caption = attachment.caption, + caption = _attachment$caption === void 0 ? "" : _attachment$caption, + _attachment$alt = attachment.alt, + alt = _attachment$alt === void 0 ? "" : _attachment$alt; + if (!url || !id) { + return; + } + + // Create block. + var block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)("core/image", { + id: id, + url: url, + caption: caption, + alt: alt + }); + if (clientId) { + // Replace the Instant Images block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").replaceBlock(clientId, block); + } else { + // Insert Image block. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").insertBlocks(block); + } +} + +/***/ }), + +/***/ "./src/js/editor/utils/setFeaturedImage.js": +/*!*************************************************!*\ + !*** ./src/js/editor/utils/setFeaturedImage.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ setFeaturedImage) +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Set image as featured image in Gutenberg. + * + * @param {Object} attachment The attachment object. + */ +function setFeaturedImage(attachment) { + var _attachment$id = attachment.id, + id = _attachment$id === void 0 ? null : _attachment$id; + if (!id) { + return; + } + + // Set the featured image. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/editor").editPost({ + featured_media: id + }); + + // Open the document sidebar. + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/edit-post").openGeneralSidebar("edit-post/document"); +} + +/***/ }), + +/***/ "./src/js/functions/buildURL.js": +/*!**************************************!*\ + !*** ./src/js/functions/buildURL.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "buildTestURL": () => (/* binding */ buildTestURL), +/* harmony export */ "default": () => (/* binding */ buildURL), +/* harmony export */ "getProxyURL": () => (/* binding */ getProxyURL) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getQueryParams */ "./src/js/functions/getQueryParams.js"); +/* harmony import */ var _providers_openverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers/openverse */ "./src/js/functions/providers/openverse.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + + + +/** + * Build the API query parameters. + * + * @param {string} type The query type (search, photos, id). + * @param {Object} params The current params object. + * @return {string} The new API URL with querystring params. + */ +function buildURL(type, params) { + if (!type) { + // Bail early if API query type is missing. + return ""; + } + // Get the current provider. + var _params = params, + _params$provider = _params.provider, + provider = _params$provider === void 0 ? "unsplash" : _params$provider; + + // Provider doesn't need to be sent. + delete params.provider; + + // Set Openverse params. + params = provider === "openverse" ? (0,_providers_openverse__WEBPACK_IMPORTED_MODULE_2__.openverseParams)(type, params) : params; + + // Build the API URL. + var url = new URL(getProxyURL(provider)); + + // Add `type` to params. + url.searchParams.append("type", type); + + // Append query params. + Object.keys(params).forEach(function (key) { + url.searchParams.append(key, params[key]); + }); + + // Add `version` to params. + url.searchParams.append("version", instant_img_localize.version); + return url === null || url === void 0 ? void 0 : url.href; +} + +/** + * Get the proxy URL from ENV vars. + * + * @param {string} provider The image provider. + * @return {string} The proxy URL. + */ +function getProxyURL(provider) { + var _API$proxy = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.proxy, + proxy = _API$proxy === void 0 ? "https://proxy.getinstantimages.com/api/" : _API$proxy; + return "".concat(proxy).concat(provider); +} + +/** + * Build a API testing URL. + * + * @param {string} provider The current service provider. + * @return {string} The API URL. + */ +function buildTestURL(provider) { + var options = { + per_page: 5, + page: 1 + }; + + // Build URL. + var params = _objectSpread(_objectSpread({ + test: true + }, (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__["default"])(provider)), options); + return buildURL("photos", params); +} + +/***/ }), + +/***/ "./src/js/functions/consoleStatus.js": +/*!*******************************************!*\ + !*** ./src/js/functions/consoleStatus.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ consoleStatus) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); +/* harmony import */ var _getErrorMessage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getErrorMessage */ "./src/js/functions/getErrorMessage.js"); + + + +/** + * Display a console.warn message about API status. + * + * @param {string} provider The API service provider. + * @param {string} status The API status. + */ +function consoleStatus(provider) { + var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; + var local = instant_img_localize; + var message = (0,_getErrorMessage__WEBPACK_IMPORTED_MODULE_1__["default"])(status); + switch (status) { + case 400: + case 401: + case 500: + // Unsplash/Pixabay/Pexels incorrect API key + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message)); + break; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/generateAttribution.js": +/*!*************************************************!*\ + !*** ./src/js/functions/generateAttribution.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ generateAttribution) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + +/** + * Get the API URL for searches by ID. + * + * @param {string} text Attribution hook content. + * @param {string} provider Image provider. + * @param {string} permalink Image url. + * @param {Object} user The user data. + * @return {string} The raw attribution HTML. + */ +function generateAttribution(text, provider, permalink, user) { + if (!text || !provider || !permalink || !user) { + return text; + } + + // Get user data. + var username = user.name, + user_url = user.url; + + // Format provider data. + var provider_url = instant_img_localize["".concat(provider, "_url")]; + var provider_name = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider); + + // Generate attribution template. + var attribution = text; + attribution = attribution.replace("{username}", username); + attribution = attribution.replace("{user_url}", user_url); + attribution = attribution.replace("{image_url}", permalink); + attribution = attribution.replace("{provider_url}", provider_url); + attribution = attribution.replace("{provider}", provider_name); + return attribution; +} + +/***/ }), + +/***/ "./src/js/functions/getErrorMessage.js": +/*!*********************************************!*\ + !*** ./src/js/functions/getErrorMessage.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getErrorMessage) +/* harmony export */ }); +/** + * Get the correct error message by status code. + * + * @param {string} status The API status. + */ +function getErrorMessage() { + var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200; + var local = instant_img_localize; + switch (status) { + case 400: + case 401: + // Unsplash/Pixabay/Pexels incorrect API key. + return local.api_invalid_msg; + case 403: + return local.api_invalid_403_msg; + case 404: + return local.api_invalid_404_msg; + case 429: + /** + * Pixabay, Pexels - too many requests. + * + * @see https://www.pexels.com/api/documentation/#statistics + * @see https://pixabay.com/api/docs/#api_rate_limit + */ + return local.api_ratelimit_msg; + case 500: + case 503: + // Internal server error. + return local.api_invalid_500_msg; + case 501: + // Missing params. + return local.api_invalid_501_msg; + default: + break; + } +} + +/***/ }), + +/***/ "./src/js/functions/getProvider.js": +/*!*****************************************!*\ + !*** ./src/js/functions/getProvider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getProvider) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Get the default provider on page load. + * + * @return {string} The default service provider. + */ +function getProvider() { + return instant_img_localize && instant_img_localize.default_provider ? instant_img_localize.default_provider : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.provider; +} + +/***/ }), + +/***/ "./src/js/functions/getQueryParams.js": +/*!********************************************!*\ + !*** ./src/js/functions/getQueryParams.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getQueryParams), +/* harmony export */ "getAuth": () => (/* binding */ getAuth), +/* harmony export */ "getContentSafety": () => (/* binding */ getContentSafety) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } + + +// eslint-disable + +/** + * Build the API query parameters + * + * @param {string} provider The current service provider. + * @param {Object} queryParams Optional query parameters to append to base params. + * @return {Object} Parameters used for the fetch request. + */ +function getQueryParams(provider, queryParams) { + if (!provider) { + return {}; + } + + // Construct per page amount. + var per_page = queryParams && queryParams.id ? 1 : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.per_page; + + // Set default params. + var params = { + provider: provider, + per_page: per_page + }; + + // Append additional params. + params = getContentSafety(params, provider); + params = _objectSpread(_objectSpread({}, params), queryParams); + params = getAuth(params, provider); + + /** + * Display query params in the browser console. + * + * Global plugin hook. + */ + if (instant_img_localize.query_debug) { + console.table(params); + } + return params; +} + +/** + * Get auth keys and append to API query request. + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The auth parameter object. + */ +function getAuth(params, provider) { + var has_auth = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].requires_key; + if (!has_auth || !provider) { + return params; + } + var app_id = instant_img_localize["".concat(provider, "_app_id")]; + if (app_id) { + // Pass API keys if not using defaults. + params[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].api_var] = app_id; + } + return params; +} + +/** + * Set the photo safety for indicating that only images suitable for all ages should be returned. + * + * @see https://unsplash.com/documentation#content-safety + * @see https://pixabay.com/api/docs/ + * + * @param {Object} params The current params object. + * @param {string} provider The current service provider. + * @return {Object} The fetch parameters object. + */ +function getContentSafety(params, provider) { + switch (provider) { + case "unsplash": + if (instant_img_localize.unsplash_content_filter) { + params.content_filter = instant_img_localize.unsplash_content_filter; + } + break; + case "pixabay": + if (instant_img_localize.pixabay_safesearch) { + params.safesearch = "true"; + } + break; + case "openverse": + if (instant_img_localize.openverse_mature) { + params.mature = "true"; + } + break; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/getResults.js": +/*!****************************************!*\ + !*** ./src/js/functions/getResults.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getResults), +/* harmony export */ "getResultById": () => (/* binding */ getResultById), +/* harmony export */ "getSearchTotal": () => (/* binding */ getSearchTotal) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); + + +/** + * Pluck `results` from the API response. + * + * @param {Object} data The API results object. + * @return {Array} The results as an array. + */ +function getResults(data) { + if (!data) { + return []; + } + var results = data[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.arr_key] || []; + return results; +} + +/** + * Get the total search results. + * + * @param {Object} data The search data object. + * @return {string} The total results. + */ +function getSearchTotal(data) { + // Return 0 if undefined or null. + return data.total === undefined || data.total === null ? 0 : data.total; +} + +/** + * Get results by photo ID. + * + * @param {string} provider The current service provider. + * @param {string} key The match key to access. + * @param {Object} data The API results object. + * @return {Array} The results as an array. + * @deprecated 5.0 + */ +function getResultById(provider, key, data) { + if (!data) { + return []; + } + var result = []; + switch (provider) { + case "unsplash": + case "pexels": + result = data || []; + break; + case "pixabay": + result = data[key] && data[key][0] ? data[key][0] : []; + break; + } + return result; +} + +/***/ }), + +/***/ "./src/js/functions/helpers.js": +/*!*************************************!*\ + !*** ./src/js/functions/helpers.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "capitalizeFirstLetter": () => (/* binding */ capitalizeFirstLetter), +/* harmony export */ "checkRateLimit": () => (/* binding */ checkRateLimit), +/* harmony export */ "gotoURL": () => (/* binding */ gotoURL), +/* harmony export */ "hideTooltip": () => (/* binding */ hideTooltip), +/* harmony export */ "isObjectEmpty": () => (/* binding */ isObjectEmpty), +/* harmony export */ "md5Hash": () => (/* binding */ md5Hash), +/* harmony export */ "showTooltip": () => (/* binding */ showTooltip) +/* harmony export */ }); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js"); +/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Get the MD5 hash value of a URL. + * + * @param {string} url The API URL to hash. + * @return {string} The MD5 hash. + */ +function md5Hash(url) { + return crypto_js__WEBPACK_IMPORTED_MODULE_0___default().MD5(url).toString(); +} + +/** + * Check if an object is empty. + * + * @param {Object} obj The object to test against. + * @return {boolean} Is this an object. + */ +function isObjectEmpty(obj) { + if (obj === null || obj === undefined) { + return true; + } + return Object.keys(obj).length === 0; +} + +/** + * Check the `x-ratelimit-remaining` headers to confirm the API is available. + * + * @param {Object} headers The request headers object. + */ +function checkRateLimit(headers) { + if (!headers) { + return; + } + var limit = headers.get("X-RateLimit-Limit") || -1; + var remaining = headers.get("X-RateLimit-Remaining") || -1; + if (limit > -1 && parseInt(remaining) < 2) { + alert(instant_img_localize.api_ratelimit_msg); // eslint-disable-line + } +} + +/** + * Capitalize the first letter of a string. + * + * @param {string} str The string to format. + * @return {string} The formatted string. + */ +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +var tooltipInterval = ""; + +/** + * Show the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function showTooltip(e) { + var target = e.currentTarget; + var rect = target.getBoundingClientRect(); + var left = Math.round(rect.left); + var top = Math.round(rect.top); + var container = target.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); + if (target.classList.contains("tooltip--above")) { + tooltip.classList.add("above"); + } else { + tooltip.classList.remove("above"); + } + + // Delay Tooltip Reveal. + tooltipInterval = setInterval(function () { + clearInterval(tooltipInterval); + tooltip.innerHTML = target.dataset.title; // Tooltip content. + + // Position Tooltip. + left = left - tooltip.offsetWidth + target.offsetWidth + 5; + tooltip.style.left = "".concat(left, "px"); + tooltip.style.top = "".concat(top, "px"); + setTimeout(function () { + tooltip.classList.add("over"); + }, 25); + }, 750); +} + +/** + * Hide the tooltip. + * + * @param {Event} e The target tooltip element. + * @since 4.3.0 + */ +function hideTooltip(e) { + clearInterval(tooltipInterval); + var container = e.currentTarget.closest("#photo-listing"); + var tooltip = container.querySelector("#tooltip"); + tooltip.classList.remove("over"); +} + +/** + * Open the URL in new window. + * + * @param {string} url The destination URL. + */ +function gotoURL(url) { + if (url && window) { + window.open(url, "_blank"); + } +} + +/***/ }), + +/***/ "./src/js/functions/localStorage.js": +/*!******************************************!*\ + !*** ./src/js/functions/localStorage.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clearSearchHistory": () => (/* binding */ clearSearchHistory), +/* harmony export */ "getSearchHistory": () => (/* binding */ getSearchHistory), +/* harmony export */ "getSetting": () => (/* binding */ getSetting), +/* harmony export */ "saveSearchHistory": () => (/* binding */ saveSearchHistory), +/* harmony export */ "saveSettings": () => (/* binding */ saveSettings) +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var searchName = "instant-images-recent-searches"; +var settingsName = "instant-images-settings"; +var most = 10; + +/** + * Save search value to localstorage. + * + * @param {string} term The search term. + */ +function saveSearchHistory(term) { + var recent = getSearchHistory(); + if (!recent) { + localStorage.setItem(searchName, JSON.stringify([term])); + return; + } + + // Find duplicates. + var duplicate = recent.indexOf(term); + if (duplicate > -1) { + recent.splice(duplicate, 1); + } + + // Limit to 6 items. + if (recent.length >= most) { + recent.length = most; + } + + // Add new term to the beginning of the array. + recent.unshift(term); + localStorage.setItem(searchName, JSON.stringify(recent)); +} + +/** + * Get the search history from localstorage. + * + * @return {Array} The search history. + */ +function getSearchHistory() { + var history = localStorage.getItem(searchName); + if (!history) { + return []; + } + return JSON.parse(localStorage.getItem(searchName)); +} + +/** + * Clear search history. + */ +function clearSearchHistory() { + localStorage.removeItem(searchName); +} + +/** + * Save generic setting to localstorage as an key/value object pair. + * + * @param {string} key The object key. + * @param {value} value The object value. + */ +function saveSettings(key, value) { + var settings = localStorage.getItem(settingsName); + var setting = _defineProperty({}, key, value); + if (!settings) { + localStorage.setItem(settingsName, JSON.stringify(setting)); + } else { + var parsed = JSON.parse(settings); + parsed[key] = value; + localStorage.setItem(settingsName, JSON.stringify(parsed)); + } +} + +/** + * Get an individual setting from local storage. + * + * @param {string} key The stoarge key. + * @return {string|boolean} The storage value. + */ +function getSetting(key) { + var settings = localStorage.getItem(settingsName); + if (!settings) { + return false; + } + var parsed = JSON.parse(settings); + return parsed[key] ? parsed[key] : false; +} + +/***/ }), + +/***/ "./src/js/functions/providers/openverse.js": +/*!*************************************************!*\ + !*** ./src/js/functions/providers/openverse.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "openverseParams": () => (/* binding */ openverseParams) +/* harmony export */ }); +/* harmony import */ var _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters/openverse */ "./src/js/constants/filters/openverse.js"); + + +/** + * Format the params for Openverse. + * + * @param {string} type Query type (search, photos, id). + * @param {Object} params Query params object. + * @return {Object} Updated params. + */ +function openverseParams(type, params) { + if (type === "photos" && !params.source) { + params.source = "wordpress"; // Add `wordpress` as the default openverse `source`. + } + + if (type === "search") { + // Include these sources only. + var sources = _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__.OPENVERSE_SOURCES.map(function (source) { + return source.value; + }).toString(); // e.g. `wordpress,flickr,nasa,spacex,wikimedia` + params.source = sources; + } + return params; +} + +/***/ }), + +/***/ "./src/js/functions/providers/unsplash.js": +/*!************************************************!*\ + !*** ./src/js/functions/providers/unsplash.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "unsplashDownload": () => (/* binding */ unsplashDownload) +/* harmony export */ }); +/* harmony import */ var _buildURL__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buildURL */ "./src/js/functions/buildURL.js"); +/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getQueryParams */ "./src/js/functions/getQueryParams.js"); + + + +/** + * Function to trigger an image download at unsplash.com. + * Note: This is used to give authors download credits and nothing more. + * + * @see https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download + * + * @param {string} download_url The URL to trigger a download. + * @since 3.1 + */ +function unsplashDownload(download_url) { + var params = (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__.getAuth)({}, "unsplash"); + params.download_url = download_url; // Append download URL to query params. + var url = (0,_buildURL__WEBPACK_IMPORTED_MODULE_0__["default"])("photos", params); + fetch(url).then(function (data) { + return data.json(); + }).then(function () { + // Success, nothing else happens here + console.log("Image download successsfully triggered at Unsplash."); // eslint-disable-line no-console + })["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/functions/session.js": +/*!*************************************!*\ + !*** ./src/js/functions/session.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "deleteSession": () => (/* binding */ deleteSession), +/* harmony export */ "getSession": () => (/* binding */ getSession), +/* harmony export */ "saveSession": () => (/* binding */ saveSession) +/* harmony export */ }); +/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js"); + + + +/** + * Get results from session storage by URL. + * + * @param {string} url The API URL. + * @return {Array|boolean} Session results. + */ +function getSession(url) { + if (!url || _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.testmode) { + return false; // Exit if no URL or test mode is enabled. + } + + var session = sessionStorage.getItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); + if (!session) { + return false; // Exit if no session data. + } + + var data = JSON.parse(session); + var _data$expires = data.expires, + expires = _data$expires === void 0 ? 0 : _data$expires, + _data$error = data.error, + error = _data$error === void 0 ? null : _data$error; + if (error) { + return false; // Exit if session data has error entry. + } + + // Check if expiration time has passed. + var expired = Date.now() > expires; + + // Delete session data when expired. + if (expired) { + deleteSession(url); + } + return data && !expired ? data : false; +} + +/** + * Save API data to session storage by URL. + * + * @param {string} url Save results to session by URL. + * @param {Array} results The API results. + */ +function saveSession(url, results) { + if (!url || !results || results !== null && results !== void 0 && results.error) { + return false; + } + // Set expiration to 1 hour. + results.expires = Date.now() + 3600000; + + // Save session data. + sessionStorage.setItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url), JSON.stringify(results)); +} + +/** + * Remove/delete session storage by URL. + * + * @param {string} url The API URL. + */ +function deleteSession(url) { + if (!url) { + return false; + } + sessionStorage.removeItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url)); +} + +/***/ }), + +/***/ "./src/js/functions/updatePluginSetting.js": +/*!*************************************************!*\ + !*** ./src/js/functions/updatePluginSetting.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ updatePluginSetting) +/* harmony export */ }); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); + + +/** + * Update plugin settings by specific key/value pair. + * + * @param {string} setting The previous provider. + * @param {string} value The value to save. + */ +function updatePluginSetting(setting, value) { + var _instant_img_localize; + var api = ((_instant_img_localize = instant_img_localize) === null || _instant_img_localize === void 0 ? void 0 : _instant_img_localize.root) + "instant-images/settings/"; // eslint-disable-line no-undef + + var params = { + setting: setting, + value: value + }; + var config = { + headers: { + "X-WP-Nonce": instant_img_localize.nonce, + // eslint-disable-line no-undef + "Content-Type": "application/json" + } + }; + axios__WEBPACK_IMPORTED_MODULE_0__["default"].post(api, JSON.stringify(params), config).then(function () {})["catch"](function (error) { + console.warn(error); + }); +} + +/***/ }), + +/***/ "./src/js/hooks/useArrowControls.js": +/*!******************************************!*\ + !*** ./src/js/hooks/useArrowControls.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useArrowControls": () => (/* binding */ useArrowControls) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + +/** + * Detect up and down arrow presses. + * + * @param {boolean} active Is the element currently active. + * @param {Object} ref The container ref to select the focusable elements. + */ +function useArrowControls(active, ref) { + var focusedRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(active); + + /** + * Add event listener for arrow keys. + * + * @param {KeyboardEvent} e The event. + */ + function arrowHandler(e) { + var key = e.key; + if (focusedRef !== null && focusedRef !== void 0 && focusedRef.current && ref !== null && ref !== void 0 && ref.current) { + var focusable = ref === null || ref === void 0 ? void 0 : ref.current.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input"); + if (!(focusable !== null && focusable !== void 0 && focusable.length)) { + // Exit if no focusable elements. + return; + } + var first = focusable[0]; + var last = focusable[focusable.length - 1]; + var _active = document.activeElement; // eslint-disable-line + var activeIndex = _toConsumableArray(focusable).indexOf(_active); + + // Up arrow. + if (key === "ArrowUp") { + e.preventDefault(); + if (activeIndex === 0) { + last.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex - 1].focus({ + preventScroll: true + }); + } + } + // Down Arrow + if (key === "ArrowDown") { + e.preventDefault(); + if (activeIndex === focusable.length - 1 || activeIndex === -1) { + first.focus({ + preventScroll: true + }); + } else { + focusable[activeIndex + 1].focus({ + preventScroll: true + }); + } + } + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + focusedRef.current = active; + }, [active]); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + document.addEventListener("keydown", arrowHandler, false); + return function () { + // Dispose of events. + document.removeEventListener("keydown", arrowHandler, false); + }; + }, []); // eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./src/js/hooks/useClickOutside.js": +/*!*****************************************!*\ + !*** ./src/js/hooks/useClickOutside.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "useClickOutside": () => (/* binding */ useClickOutside) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Detect clicks outside of ref. + * + * @param {Object} ref React ref. + * @param {Function} onClickOutside Function to invoke when clicked outside. + */ +function useClickOutside(ref, onClickOutside) { + /** + * Escape handler. + * + * @param {Event} e The key press event. + */ + function escapeClick(e) { + var key = e.key; + if (key === "Escape") { + onClickOutside(); + } + } + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + /** + * Invoke Function onClick outside of element + * + * @param {Event} event The event object. + */ + function handleClickOutside(event) { + if (ref.current && !ref.current.contains(event.target)) { + onClickOutside(); + } + } + + // Bind events. + document.addEventListener("mousedown", handleClickOutside); + document.addEventListener("keyup", handleClickOutside); + document.addEventListener("keydown", escapeClick, false); + return function () { + // Dispose of events. + document.removeEventListener("mousedown", handleClickOutside); + document.removeEventListener("keyup", handleClickOutside); + document.removeEventListener("keydown", escapeClick, false); + }; + }, [ref, onClickOutside]); //eslint-disable-line react-hooks/exhaustive-deps +} + +/***/ }), + +/***/ "./node_modules/classnames/index.js": +/*!******************************************!*\ + !*** ./node_modules/classnames/index.js ***! + \******************************************/ +/***/ ((module, exports) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + var nativeCodeString = '[native code]'; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { + classes.push(arg.toString()); + continue; + } + + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + + +/***/ }), + +/***/ "./node_modules/crypto-js/aes.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/aes.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; + } + } + + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; + + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; + + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); + + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + var t; + + // Skip reset of nRounds has been set before and key did not change + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + // Shortcuts + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6; + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; + + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + + // Key schedule row counter + var ksRow = 4; + + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + + keySize: 256/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); + }()); + + + return CryptoJS.AES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/cipher-core.js": +/*!***********************************************!*\ + !*** ./node_modules/crypto-js/cipher-core.js ***! + \***********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher core components. + */ + CryptoJS.lib.Cipher || (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; + + // Set initial values + this.reset(); + }, + + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-cipher logic + this._doReset(); + }, + + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); + + // Process available blocks + return this._process(); + }, + + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } + + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + + keySize: 128/32, + + ivSize: 128/32, + + _ENC_XFORM_MODE: 1, + + _DEC_XFORM_MODE: 2, + + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); + + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); + + return finalProcessedBlocks; + }, + + blockSize: 1 + }); + + /** + * Mode namespace. + */ + var C_mode = C.mode = {}; + + /** + * Abstract base block cipher mode template. + */ + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); + + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + var block; + + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }()); + + /** + * Padding namespace. + */ + var C_pad = C.pad = {}; + + /** + * PKCS #5/7 padding strategy. + */ + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + + // Add padding + data.concat(padding); + }, + + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + /** + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) + */ + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + + reset: function () { + var modeCreator; + + // Reset cipher + Cipher.reset.call(this); + + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + modeCreator = mode.createDecryptor; + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } + + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, + + _doFinalize: function () { + var finalProcessedBlocks; + + // Shortcut + var padding = this.cfg.padding; + + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); + + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + + // Unpad data + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + + blockSize: 128/32 + }); + + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); + }, + + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + + /** + * Format namespace. + */ + var C_format = C.format = {}; + + /** + * OpenSSL formatting strategy. + */ + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + var wordArray; + + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + // Format + if (salt) { + wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + var salt; + + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); + + // Shortcut + var ciphertextWords = ciphertext.words; + + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + salt = WordArray.create(ciphertextWords.slice(2, 4)); + + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; + + /** + * A cipher wrapper that returns ciphertext as a serializable cipher params object. + */ + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + + // Shortcut + var cipherCfg = encryptor.cfg; + + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + + return plaintext; + }, + + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; + + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); + } + + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); + } + }; + + /** + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. + */ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + + // Mix in derived params + ciphertext.mixIn(derivedParams); + + return ciphertext; + }, + + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + + return plaintext; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/core.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/core.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(); + } + else {} +}(this, function () { + + /*globals window, global, require*/ + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + + var crypto; + + // Native crypto from window (Browser) + if (typeof window !== 'undefined' && window.crypto) { + crypto = window.crypto; + } + + // Native crypto in web worker (Browser) + if (typeof self !== 'undefined' && self.crypto) { + crypto = self.crypto; + } + + // Native crypto from worker + if (typeof globalThis !== 'undefined' && globalThis.crypto) { + crypto = globalThis.crypto; + } + + // Native (experimental IE 11) crypto from window (Browser) + if (!crypto && typeof window !== 'undefined' && window.msCrypto) { + crypto = window.msCrypto; + } + + // Native crypto from global (NodeJS) + if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { + crypto = __webpack_require__.g.crypto; + } + + // Native crypto import via require (NodeJS) + if (!crypto && "function" === 'function') { + try { + crypto = __webpack_require__(/*! crypto */ "?9157"); + } catch (err) {} + } + + /* + * Cryptographically secure pseudorandom number generator + * + * As Math.random() is cryptographically not safe to use + */ + var cryptoSecureRandomInt = function () { + if (crypto) { + // Use getRandomValues method (Browser) + if (typeof crypto.getRandomValues === 'function') { + try { + return crypto.getRandomValues(new Uint32Array(1))[0]; + } catch (err) {} + } + + // Use randomBytes method (NodeJS) + if (typeof crypto.randomBytes === 'function') { + try { + return crypto.randomBytes(4).readInt32LE(); + } catch (err) {} + } + } + + throw new Error('Native crypto module could not be used to get secure random number.'); + }; + + /* + * Local polyfill of Object.create + + */ + var create = Object.create || (function () { + function F() {} + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()); + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var j = 0; j < thatSigBytes; j += 4) { + thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + var processedWords; + + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/enc-base64.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + + return CryptoJS.enc.Base64; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-base64url.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/enc-base64url.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64url encoding strategy. + */ + var Base64url = C_enc.Base64url = { + /** + * Converts a word array to a Base64url string. + * + * @param {WordArray} wordArray The word array. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {string} The Base64url string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); + */ + stringify: function (wordArray, urlSafe=true) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = urlSafe ? this._safe_map : this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64url string to a word array. + * + * @param {string} base64Str The Base64url string. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64url.parse(base64String); + */ + parse: function (base64Str, urlSafe=true) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = urlSafe ? this._safe_map : this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + return CryptoJS.enc.Base64url; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/enc-utf16.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/enc-utf16.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * UTF-16 BE encoding strategy. + */ + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + /** + * UTF-16 LE encoding strategy. + */ + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + function swapEndian(word) { + return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); + } + }()); + + + return CryptoJS.enc.Utf16; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/evpkdf.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/evpkdf.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + + /** + * This key derivation function is meant to conform with EVP_BytesToKey. + * www.openssl.org/docs/crypto/EVP_BytesToKey.html + */ + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: MD5, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + var block; + + // Shortcut + var cfg = this.cfg; + + // Init hasher + var hasher = cfg.hasher.create(); + + // Initial values + var derivedKey = WordArray.create(); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + block = hasher.update(password).finalize(salt); + hasher.reset(); + + // Iterations + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.EvpKDF(password, salt); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.EvpKDF; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/format-hex.js": +/*!**********************************************!*\ + !*** ./node_modules/crypto-js/format-hex.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + + var HexFormatter = C_format.Hex = { + /** + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The hexadecimally encoded string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); + */ + stringify: function (cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + + /** + * Converts a hexadecimally encoded ciphertext string to a cipher params object. + * + * @param {string} input The hexadecimally encoded string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.Hex.parse(hexString); + */ + parse: function (input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext: ciphertext }); + } + }; + }()); + + + return CryptoJS.format.Hex; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/hmac.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/hmac.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/crypto-js/index.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./lib-typedarrays */ "./node_modules/crypto-js/lib-typedarrays.js"), __webpack_require__(/*! ./enc-utf16 */ "./node_modules/crypto-js/enc-utf16.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./enc-base64url */ "./node_modules/crypto-js/enc-base64url.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./sha224 */ "./node_modules/crypto-js/sha224.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"), __webpack_require__(/*! ./sha384 */ "./node_modules/crypto-js/sha384.js"), __webpack_require__(/*! ./sha3 */ "./node_modules/crypto-js/sha3.js"), __webpack_require__(/*! ./ripemd160 */ "./node_modules/crypto-js/ripemd160.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"), __webpack_require__(/*! ./pbkdf2 */ "./node_modules/crypto-js/pbkdf2.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"), __webpack_require__(/*! ./mode-cfb */ "./node_modules/crypto-js/mode-cfb.js"), __webpack_require__(/*! ./mode-ctr */ "./node_modules/crypto-js/mode-ctr.js"), __webpack_require__(/*! ./mode-ctr-gladman */ "./node_modules/crypto-js/mode-ctr-gladman.js"), __webpack_require__(/*! ./mode-ofb */ "./node_modules/crypto-js/mode-ofb.js"), __webpack_require__(/*! ./mode-ecb */ "./node_modules/crypto-js/mode-ecb.js"), __webpack_require__(/*! ./pad-ansix923 */ "./node_modules/crypto-js/pad-ansix923.js"), __webpack_require__(/*! ./pad-iso10126 */ "./node_modules/crypto-js/pad-iso10126.js"), __webpack_require__(/*! ./pad-iso97971 */ "./node_modules/crypto-js/pad-iso97971.js"), __webpack_require__(/*! ./pad-zeropadding */ "./node_modules/crypto-js/pad-zeropadding.js"), __webpack_require__(/*! ./pad-nopadding */ "./node_modules/crypto-js/pad-nopadding.js"), __webpack_require__(/*! ./format-hex */ "./node_modules/crypto-js/format-hex.js"), __webpack_require__(/*! ./aes */ "./node_modules/crypto-js/aes.js"), __webpack_require__(/*! ./tripledes */ "./node_modules/crypto-js/tripledes.js"), __webpack_require__(/*! ./rc4 */ "./node_modules/crypto-js/rc4.js"), __webpack_require__(/*! ./rabbit */ "./node_modules/crypto-js/rabbit.js"), __webpack_require__(/*! ./rabbit-legacy */ "./node_modules/crypto-js/rabbit-legacy.js")); + } + else {} +}(this, function (CryptoJS) { + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/lib-typedarrays.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/lib-typedarrays.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Check if typed arrays are supported + if (typeof ArrayBuffer != 'function') { + return; + } + + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + + // Reference original init + var superInit = WordArray.init; + + // Augment WordArray.init to handle typed arrays + var subInit = WordArray.init = function (typedArray) { + // Convert buffers to uint8 + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + + // Convert other array views to uint8 + if ( + typedArray instanceof Int8Array || + (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || + typedArray instanceof Int16Array || + typedArray instanceof Uint16Array || + typedArray instanceof Int32Array || + typedArray instanceof Uint32Array || + typedArray instanceof Float32Array || + typedArray instanceof Float64Array + ) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + + // Handle Uint8Array + if (typedArray instanceof Uint8Array) { + // Shortcut + var typedArrayByteLength = typedArray.byteLength; + + // Extract bytes + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + } + + // Initialize this word array + superInit.call(this, words, typedArrayByteLength); + } else { + // Else call normal init + superInit.apply(this, arguments); + } + }; + + subInit.prototype = WordArray; + }()); + + + return CryptoJS.lib.WordArray; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/md5.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/md5.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcuts + var H = this._hash.words; + + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + + // Working varialbes + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); + + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); + + + return CryptoJS.MD5; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-cfb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-cfb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Cipher Feedback block mode. + */ + CryptoJS.mode.CFB = (function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + + CFB.Encryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + CFB.Decryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var keystream; + + // Shortcut + var iv = this._iv; + + // Generate keystream + if (iv) { + keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + + return CFB; + }()); + + + return CryptoJS.mode.CFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr-gladman.js": +/*!****************************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr-gladman.js ***! + \****************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = (function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + + function incWord(word) + { + if (((word >> 24) & 0xff) === 0xff) { //overflow + var b1 = (word >> 16)&0xff; + var b2 = (word >> 8)&0xff; + var b3 = word & 0xff; + + if (b1 === 0xff) // overflow b1 + { + b1 = 0; + if (b2 === 0xff) + { + b2 = 0; + if (b3 === 0xff) + { + b3 = 0; + } + else + { + ++b3; + } + } + else + { + ++b2; + } + } + else + { + ++b1; + } + + word = 0; + word += (b1 << 16); + word += (b2 << 8); + word += b3; + } + else + { + word += (0x01 << 24); + } + return word; + } + + function incCounter(counter) + { + if ((counter[0] = incWord(counter[0])) === 0) + { + // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 + counter[1] = incWord(counter[1]); + } + return counter; + } + + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + + incCounter(counter); + + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTRGladman.Decryptor = Encryptor; + + return CTRGladman; + }()); + + + + + return CryptoJS.mode.CTRGladman; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ctr.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ctr.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Counter block mode. + */ + CryptoJS.mode.CTR = (function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Increment counter + counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTR.Decryptor = Encryptor; + + return CTR; + }()); + + + return CryptoJS.mode.CTR; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ecb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ecb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + + return ECB; + }()); + + + return CryptoJS.mode.ECB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/mode-ofb.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/mode-ofb.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Output Feedback block mode. + */ + CryptoJS.mode.OFB = (function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + + // Generate keystream + if (iv) { + keystream = this._keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + OFB.Decryptor = Encryptor; + + return OFB; + }()); + + + return CryptoJS.mode.OFB; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-ansix923.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-ansix923.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ANSI X.923 padding strategy. + */ + CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Ansix923; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso10126.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso10126.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO 10126 padding strategy. + */ + CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Iso10126; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-iso97971.js": +/*!************************************************!*\ + !*** ./node_modules/crypto-js/pad-iso97971.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * ISO/IEC 9797-1 Padding Method 2. + */ + CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); + + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } + }; + + + return CryptoJS.pad.Iso97971; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-nopadding.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/pad-nopadding.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * A noop padding strategy. + */ + CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } + }; + + + return CryptoJS.pad.NoPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pad-zeropadding.js": +/*!***************************************************!*\ + !*** ./node_modules/crypto-js/pad-zeropadding.js ***! + \***************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** + * Zero padding strategy. + */ + CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + + unpad: function (data) { + // Shortcut + var dataWords = data.words; + + // Unpad + var i = data.sigBytes - 1; + for (var i = data.sigBytes - 1; i >= 0; i--) { + if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + data.sigBytes = i + 1; + break; + } + } + } + }; + + + return CryptoJS.pad.ZeroPadding; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/pbkdf2.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/pbkdf2.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; + + /** + * Password-Based Key Derivation Function 2 algorithm. + */ + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA1 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: SHA1, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + // Shortcut + var cfg = this.cfg; + + // Init HMAC + var hmac = HMAC.create(cfg.hasher, password); + + // Initial values + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + + // Shortcuts + var blockWords = block.words; + var blockWordsLength = blockWords.length; + + // Iterations + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + + // Shortcut + var intermediateWords = intermediate.words; + + // XOR intermediate with block + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + + derivedKey.concat(block); + blockIndexWords[0]++; + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.PBKDF2(password, salt); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + }()); + + + return CryptoJS.PBKDF2; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit-legacy.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-js/rabbit-legacy.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm. + * + * This is a legacy version that neglected to convert the key to little-endian. + * This error doesn't affect the cipher's security, + * but it does affect its compatibility with other implementations. + */ + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); + */ + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + }()); + + + return CryptoJS.RabbitLegacy; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rabbit.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/rabbit.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Swap endian + for (var i = 0; i < 4; i++) { + K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | + (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); + } + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); + }()); + + + return CryptoJS.Rabbit; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/rc4.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/rc4.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + /** + * RC4 stream cipher algorithm. + */ + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + + // Init sbox + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; + } + + // Key setup + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + // Counters + this._i = this._j = 0; + }, + + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + + keySize: 256/32, + + ivSize: 0 + }); + + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; + + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } + + // Update counters + this._i = i; + this._j = j; + + return keystreamWord; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); + + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + + _doReset: function () { + RC4._doReset.call(this); + + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + }()); + + + return CryptoJS.RC4; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/ripemd160.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/ripemd160.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var _zl = WordArray.create([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); + var _zr = WordArray.create([ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); + var _sl = WordArray.create([ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); + var _sr = WordArray.create([ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); + + var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); + + /** + * RIPEMD160 hash algorithm. + */ + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, + + _doProcessBlock: function (M, offset) { + + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + // Shortcut + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 5; i++) { + // Shortcut + var H_i = H[i]; + + // Swap + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + + function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); + + } + + function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); + } + + function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); + } + + function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); + } + + function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); + + } + + function rotl(x,n) { + return (x<>>(32-n)); + } + + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.RIPEMD160('message'); + * var hash = CryptoJS.RIPEMD160(wordArray); + */ + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacRIPEMD160(message, key); + */ + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + }(Math)); + + + return CryptoJS.RIPEMD160; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha1.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha1.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + return CryptoJS.SHA1; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha224.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha224.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); + }, + + _doFinalize: function () { + var hash = SHA256._doFinalize.call(this); + + hash.sigBytes -= 4; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); + */ + C.SHA224 = SHA256._createHelper(SHA224); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); + */ + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + }()); + + + return CryptoJS.SHA224; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha256.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha256.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); + + + return CryptoJS.SHA256; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha3.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/sha3.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + + // Constants tables + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + + // Compute Constants + (function () { + // Compute rho offset constants + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; + + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + + // Compute pi index constants + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + } + } + + // Compute round constants + var LFSR = 0x01; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else /* if (bitPosition >= 32) */ { + roundConstantMsw ^= 1 << (bitPosition - 32); + } + } + + // Compute next LFSR + if (LFSR & 0x80) { + // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 + LFSR = (LFSR << 1) ^ 0x71; + } else { + LFSR <<= 1; + } + } + + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + }()); + + // Reusable objects for temporary values + var T = []; + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + }()); + + /** + * SHA-3 hash algorithm. + */ + var SHA3 = C_algo.SHA3 = Hasher.extend({ + /** + * Configuration options. + * + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 + */ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + + _doReset: function () { + var state = this._state = [] + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + + // Absorb + for (var i = 0; i < nBlockSizeLanes; i++) { + // Shortcuts + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + + // Swap endian + M2i = ( + (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | + (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) + ); + M2i1 = ( + (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | + (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) + ); + + // Absorb message into state + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + + // Rounds + for (var round = 0; round < 24; round++) { + // Theta + for (var x = 0; x < 5; x++) { + // Mix column lanes + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + + // Temporary values + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + // Shortcuts + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + + // Mix surrounding columns + var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); + var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + + // Rho Pi + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var tMsw; + var tLsw; + + // Shortcuts + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + + // Rotate lanes + if (rhoOffset < 32) { + tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); + tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); + } else /* if (rhoOffset >= 32) */ { + tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); + tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); + } + + // Transpose lanes + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + + // Rho pi at x = y = 0 + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + + // Chi + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + // Shortcuts + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[((x + 1) % 5) + 5 * y]; + var Tx2Lane = T[((x + 2) % 5) + 5 * y]; + + // Mix rows + lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); + lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); + } + } + + // Iota + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + } + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); + dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + + // Squeeze + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + // Shortcuts + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + + // Swap endian + laneMsw = ( + (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | + (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) + ); + laneLsw = ( + (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | + (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) + ); + + // Squeeze state to retrieve hash + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + // Return final computed hash + return new WordArray.init(hashWords, outputLengthBytes); + }, + + clone: function () { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA3('message'); + * var hash = CryptoJS.SHA3(wordArray); + */ + C.SHA3 = Hasher._createHelper(SHA3); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA3(message, key); + */ + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + }(Math)); + + + return CryptoJS.SHA3; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha384.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha384.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + + /** + * SHA-384 hash algorithm. + */ + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), + new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), + new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), + new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); + */ + C.SHA384 = SHA512._createHelper(SHA384); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + }()); + + + return CryptoJS.SHA384; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/sha512.js": +/*!******************************************!*\ + !*** ./node_modules/crypto-js/sha512.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; + + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); + + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), + new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), + new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), + new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; + + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + // Rounds + for (var i = 0; i < 80; i++) { + var Wil; + var Wih; + + // Shortcut + var Wi = W[i]; + + // Extend message + if (i < 16) { + Wih = Wi.high = M[offset + i * 2] | 0; + Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + + Wil = gamma0l + Wi7l; + Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + Wil = Wil + gamma1l; + Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + Wil = Wil + Wi16l; + Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + var hash = this._hash.toX32(); + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + }()); + + + return CryptoJS.SHA512; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/tripledes.js": +/*!*********************************************!*\ + !*** ./node_modules/crypto-js/tripledes.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Permuted Choice 1 constants + var PC1 = [ + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, 27, 19, 11, 3, + 60, 52, 44, 36, 63, 55, 47, 39, + 31, 23, 15, 7, 62, 54, 46, 38, + 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 + ]; + + // Permuted Choice 2 constants + var PC2 = [ + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 + ]; + + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; + + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; + + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } + + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; + + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; + + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } + + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } + + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + + keySize: 64/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); + + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + // Make sure the key length is valid (64, 128 or >= 192 bit) + if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { + throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); + } + + // Extend the key according to the keying options defined in 3DES standard + var key1 = keyWords.slice(0, 2); + var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); + var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); + + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(key1)); + this._des2 = DES.createEncryptor(WordArray.create(key2)); + this._des3 = DES.createEncryptor(WordArray.create(key3)); + }, + + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + + keySize: 192/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); + }()); + + + return CryptoJS.TripleDES; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/x64-core.js": +/*!********************************************!*\ + !*** ./node_modules/crypto-js/x64-core.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + + /** + * x64 namespace. + */ + var C_x64 = C.x64 = {}; + + /** + * A 64-bit word. + */ + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function (high, low) { + this.high = high; + this.low = low; + } + + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + + // return X64Word.create(high, low); + // } + }); + + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; + + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + + // Clone "words" array + var words = clone.words = this.words.slice(0); + + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); + }()); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/desandro-matches-selector/matches-selector.js": +/*!********************************************************************!*\ + !*** ./node_modules/desandro-matches-selector/matches-selector.js ***! + \********************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * matchesSelector v2.0.2 + * matchesSelector( element, '.selector' ) + * MIT license + */ + +/*jshint browser: true, strict: true, undef: true, unused: true */ + +( function( window, factory ) { + /*global define: false, module: false */ + 'use strict'; + // universal module definition + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory() { + 'use strict'; + + var matchesMethod = ( function() { + var ElemProto = window.Element.prototype; + // check for the standard method name first + if ( ElemProto.matches ) { + return 'matches'; + } + // check un-prefixed + if ( ElemProto.matchesSelector ) { + return 'matchesSelector'; + } + // check vendor prefixes + var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; + + for ( var i=0; i < prefixes.length; i++ ) { + var prefix = prefixes[i]; + var method = prefix + 'MatchesSelector'; + if ( ElemProto[ method ] ) { + return method; + } + } + })(); + + return function matchesSelector( elem, selector ) { + return elem[ matchesMethod ]( selector ); + }; + +})); + + +/***/ }), + +/***/ "./node_modules/ev-emitter/ev-emitter.js": +/*!***********************************************!*\ + !*** ./node_modules/ev-emitter/ev-emitter.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * EvEmitter v2.1.1 + * Lil' event emitter + * MIT License + */ + +( function( global, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS - Browserify, Webpack + module.exports = factory(); + } else { + // Browser globals + global.EvEmitter = factory(); + } + +}( typeof window != 'undefined' ? window : this, function() { + +function EvEmitter() {} + +let proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // set events hash + let events = this._events = this._events || {}; + // set listeners array + let listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( !listeners.includes( listener ) ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) return this; + + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + let onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + let index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + let listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) return this; + + // copy over to avoid interference if .off() in listener + listeners = listeners.slice( 0 ); + args = args || []; + // once stuff + let onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( let listener of listeners ) { + let isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; + return this; +}; + +return EvEmitter; + +} ) ); + + +/***/ }), + +/***/ "./node_modules/fizzy-ui-utils/utils.js": +/*!**********************************************!*\ + !*** ./node_modules/fizzy-ui-utils/utils.js ***! + \**********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Fizzy UI utils v2.0.7 + * MIT license + */ + +/*jshint browser: true, undef: true, unused: true, strict: true */ + +( function( window, factory ) { + // universal module definition + /*jshint strict: false */ /*globals define, module, require */ + + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! desandro-matches-selector/matches-selector */ "./node_modules/desandro-matches-selector/matches-selector.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) { + return factory( window, matchesSelector ); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, matchesSelector ) { + +'use strict'; + +var utils = {}; + +// ----- extend ----- // + +// extends objects +utils.extend = function( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +}; + +// ----- modulo ----- // + +utils.modulo = function( num, div ) { + return ( ( num % div ) + div ) % div; +}; + +// ----- makeArray ----- // + +var arraySlice = Array.prototype.slice; + +// turn element or nodeList into an array +utils.makeArray = function( obj ) { + if ( Array.isArray( obj ) ) { + // use object if already an array + return obj; + } + // return empty array if undefined or null. #6 + if ( obj === null || obj === undefined ) { + return []; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { + // convert nodeList to array + return arraySlice.call( obj ); + } + + // array of single index + return [ obj ]; +}; + +// ----- removeFrom ----- // + +utils.removeFrom = function( ary, obj ) { + var index = ary.indexOf( obj ); + if ( index != -1 ) { + ary.splice( index, 1 ); + } +}; + +// ----- getParent ----- // + +utils.getParent = function( elem, selector ) { + while ( elem.parentNode && elem != document.body ) { + elem = elem.parentNode; + if ( matchesSelector( elem, selector ) ) { + return elem; + } + } +}; + +// ----- getQueryElement ----- // + +// use element as selector string +utils.getQueryElement = function( elem ) { + if ( typeof elem == 'string' ) { + return document.querySelector( elem ); + } + return elem; +}; + +// ----- handleEvent ----- // + +// enable .ontype to trigger from .addEventListener( elem, 'type' ) +utils.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +// ----- filterFindElements ----- // + +utils.filterFindElements = function( elems, selector ) { + // make array of elems + elems = utils.makeArray( elems ); + var ffElems = []; + + elems.forEach( function( elem ) { + // check that elem is an actual element + if ( !( elem instanceof HTMLElement ) ) { + return; + } + // add elem if no selector + if ( !selector ) { + ffElems.push( elem ); + return; + } + // filter & find items if we have a selector + // filter + if ( matchesSelector( elem, selector ) ) { + ffElems.push( elem ); + } + // find children + var childElems = elem.querySelectorAll( selector ); + // concat childElems to filterFound array + for ( var i=0; i < childElems.length; i++ ) { + ffElems.push( childElems[i] ); + } + }); + + return ffElems; +}; + +// ----- debounceMethod ----- // + +utils.debounceMethod = function( _class, methodName, threshold ) { + threshold = threshold || 100; + // original method + var method = _class.prototype[ methodName ]; + var timeoutName = methodName + 'Timeout'; + + _class.prototype[ methodName ] = function() { + var timeout = this[ timeoutName ]; + clearTimeout( timeout ); + + var args = arguments; + var _this = this; + this[ timeoutName ] = setTimeout( function() { + method.apply( _this, args ); + delete _this[ timeoutName ]; + }, threshold ); + }; +}; + +// ----- docReady ----- // + +utils.docReady = function( callback ) { + var readyState = document.readyState; + if ( readyState == 'complete' || readyState == 'interactive' ) { + // do async to allow for other scripts to run. metafizzy/flickity#441 + setTimeout( callback ); + } else { + document.addEventListener( 'DOMContentLoaded', callback ); + } +}; + +// ----- htmlInit ----- // + +// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ +utils.toDashed = function( str ) { + return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { + return $1 + '-' + $2; + }).toLowerCase(); +}; + +var console = window.console; +/** + * allow user to initialize classes via [data-namespace] or .js-namespace class + * htmlInit( Widget, 'widgetName' ) + * options are parsed from data-namespace-options + */ +utils.htmlInit = function( WidgetClass, namespace ) { + utils.docReady( function() { + var dashedNamespace = utils.toDashed( namespace ); + var dataAttr = 'data-' + dashedNamespace; + var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); + var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); + var elems = utils.makeArray( dataAttrElems ) + .concat( utils.makeArray( jsDashElems ) ); + var dataOptionsAttr = dataAttr + '-options'; + var jQuery = window.jQuery; + + elems.forEach( function( elem ) { + var attr = elem.getAttribute( dataAttr ) || + elem.getAttribute( dataOptionsAttr ); + var options; + try { + options = attr && JSON.parse( attr ); + } catch ( error ) { + // log error, do not initialize + if ( console ) { + console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + + ': ' + error ); + } + return; + } + // initialize + var instance = new WidgetClass( elem, options ); + // make available via $().data('namespace') + if ( jQuery ) { + jQuery.data( elem, namespace, instance ); + } + }); + + }); +}; + +// ----- ----- // + +return utils; + +})); + + +/***/ }), + +/***/ "./node_modules/get-size/get-size.js": +/*!*******************************************!*\ + !*** ./node_modules/get-size/get-size.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * getSize v2.0.3 + * measure size of elements + * MIT license + */ + +/* jshint browser: true, strict: true, undef: true, unused: true */ +/* globals console: false */ + +( function( window, factory ) { + /* jshint strict: false */ /* globals define, module */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +})( window, function factory() { +'use strict'; + +// -------------------------- helpers -------------------------- // + +// get a number from a string, not a percentage +function getStyleSize( value ) { + var num = parseFloat( value ); + // not a percent like '100%', and a number + var isValid = value.indexOf('%') == -1 && !isNaN( num ); + return isValid && num; +} + +function noop() {} + +var logError = typeof console == 'undefined' ? noop : + function( message ) { + console.error( message ); + }; + +// -------------------------- measurements -------------------------- // + +var measurements = [ + 'paddingLeft', + 'paddingRight', + 'paddingTop', + 'paddingBottom', + 'marginLeft', + 'marginRight', + 'marginTop', + 'marginBottom', + 'borderLeftWidth', + 'borderRightWidth', + 'borderTopWidth', + 'borderBottomWidth' +]; + +var measurementsLength = measurements.length; + +function getZeroSize() { + var size = { + width: 0, + height: 0, + innerWidth: 0, + innerHeight: 0, + outerWidth: 0, + outerHeight: 0 + }; + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + size[ measurement ] = 0; + } + return size; +} + +// -------------------------- getStyle -------------------------- // + +/** + * getStyle, get style of element, check for Firefox bug + * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + */ +function getStyle( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + logError( 'Style returned ' + style + + '. Are you running this code in a hidden iframe on Firefox? ' + + 'See https://bit.ly/getsizebug1' ); + } + return style; +} + +// -------------------------- setup -------------------------- // + +var isSetup = false; + +var isBoxSizeOuter; + +/** + * setup + * check isBoxSizerOuter + * do on first getSize() rather than on page load for Firefox bug + */ +function setup() { + // setup once + if ( isSetup ) { + return; + } + isSetup = true; + + // -------------------------- box sizing -------------------------- // + + /** + * Chrome & Safari measure the outer-width on style.width on border-box elems + * IE11 & Firefox<29 measures the inner-width + */ + var div = document.createElement('div'); + div.style.width = '200px'; + div.style.padding = '1px 2px 3px 4px'; + div.style.borderStyle = 'solid'; + div.style.borderWidth = '1px 2px 3px 4px'; + div.style.boxSizing = 'border-box'; + + var body = document.body || document.documentElement; + body.appendChild( div ); + var style = getStyle( div ); + // round value for browser zoom. desandro/masonry#928 + isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; + getSize.isBoxSizeOuter = isBoxSizeOuter; + + body.removeChild( div ); +} + +// -------------------------- getSize -------------------------- // + +function getSize( elem ) { + setup(); + + // use querySeletor if elem is string + if ( typeof elem == 'string' ) { + elem = document.querySelector( elem ); + } + + // do not proceed on non-objects + if ( !elem || typeof elem != 'object' || !elem.nodeType ) { + return; + } + + var style = getStyle( elem ); + + // if hidden, everything is 0 + if ( style.display == 'none' ) { + return getZeroSize(); + } + + var size = {}; + size.width = elem.offsetWidth; + size.height = elem.offsetHeight; + + var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; + + // get all measurements + for ( var i=0; i < measurementsLength; i++ ) { + var measurement = measurements[i]; + var value = style[ measurement ]; + var num = parseFloat( value ); + // any 'auto', 'medium' value will be 0 + size[ measurement ] = !isNaN( num ) ? num : 0; + } + + var paddingWidth = size.paddingLeft + size.paddingRight; + var paddingHeight = size.paddingTop + size.paddingBottom; + var marginWidth = size.marginLeft + size.marginRight; + var marginHeight = size.marginTop + size.marginBottom; + var borderWidth = size.borderLeftWidth + size.borderRightWidth; + var borderHeight = size.borderTopWidth + size.borderBottomWidth; + + var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; + + // overwrite width and height if we can get it from style + var styleWidth = getStyleSize( style.width ); + if ( styleWidth !== false ) { + size.width = styleWidth + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); + } + + var styleHeight = getStyleSize( style.height ); + if ( styleHeight !== false ) { + size.height = styleHeight + + // add padding and border unless it's already including it + ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); + } + + size.innerWidth = size.width - ( paddingWidth + borderWidth ); + size.innerHeight = size.height - ( paddingHeight + borderHeight ); + + size.outerWidth = size.width + marginWidth; + size.outerHeight = size.height + marginHeight; + + return size; +} + +return getSize; + +}); + + +/***/ }), + +/***/ "./node_modules/imagesloaded/imagesloaded.js": +/*!***************************************************!*\ + !*** ./node_modules/imagesloaded/imagesloaded.js ***! + \***************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/*! + * imagesLoaded v5.0.0 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { + // universal module definition + if ( true && module.exports ) { + // CommonJS + module.exports = factory( window, __webpack_require__(/*! ev-emitter */ "./node_modules/ev-emitter/ev-emitter.js") ); + } else { + // browser global + window.imagesLoaded = factory( window, window.EvEmitter ); + } + +} )( typeof window !== 'undefined' ? window : this, + function factory( window, EvEmitter ) { + +let $ = window.jQuery; +let console = window.console; + +// -------------------------- helpers -------------------------- // + +// turn element or nodeList into an array +function makeArray( obj ) { + // use object if already an array + if ( Array.isArray( obj ) ) return obj; + + let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + // convert nodeList to array + if ( isArrayLike ) return [ ...obj ]; + + // array of single index + return [ obj ]; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {[Array, Element, NodeList, String]} elem + * @param {[Object, Function]} options - if function, use as callback + * @param {Function} onAlways - callback function + * @returns {ImagesLoaded} + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + let queryElem = elem; + if ( typeof elem == 'string' ) { + queryElem = document.querySelectorAll( elem ); + } + // bail if bad element + if ( !queryElem ) { + console.error(`Bad element for imagesLoaded ${queryElem || elem}`); + return; + } + + this.elements = makeArray( queryElem ); + this.options = {}; + // shift arguments if no options set + if ( typeof options == 'function' ) { + onAlways = options; + } else { + Object.assign( this.options, options ); + } + + if ( onAlways ) this.on( 'always', onAlways ); + + this.getImages(); + // add jQuery Deferred object + if ( $ ) this.jqDeferred = new $.Deferred(); + + // HACK check async to allow time to bind listeners + setTimeout( this.check.bind( this ) ); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +const elementNodeTypes = [ 1, 9, 11 ]; + +/** + * @param {Node} elem + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName === 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + let { nodeType } = elem; + if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return; + + let childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( let img of childImgs ) { + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + let children = elem.querySelectorAll( this.options.background ); + for ( let child of children ) { + this.addElementBackgroundImages( child ); + } + } +}; + +const reURL = /url\((['"])?(.*?)\1\)/gi; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + let style = getComputedStyle( elem ); + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + if ( !style ) return; + + // get url inside url("...") + let matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + let url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + let loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + let background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + /* eslint-disable-next-line func-style */ + let onProgress = ( image, elem, message ) => { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( () => { + this.progress( image, elem, message ); + } ); + }; + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + } ); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount === this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( `progress: ${message}`, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + let eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + // add crossOrigin attribute. #204 + if ( this.img.crossOrigin ) { + this.proxyImage.crossOrigin = this.img.crossOrigin; + } + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.currentSrc || this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + // check for non-zero, non-undefined naturalWidth + // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 + return this.img.complete && this.img.naturalWidth; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + let { parentNode } = this.img; + // emit progress with parent or self + let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img; + this.emitEvent( 'progress', [ this, elem, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + let method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + let isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) return; + + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, onAlways ) { + let instance = new ImagesLoaded( this, options, onAlways ); + return instance.jqDeferred.promise( $( this ) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +} ); + + +/***/ }), + +/***/ "./node_modules/masonry-layout/masonry.js": +/*!************************************************!*\ + !*** ./node_modules/masonry-layout/masonry.js ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Masonry v4.2.2 + * Cascading grid layout library + * https://masonry.desandro.com + * MIT License + * by David DeSandro + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /*globals define, module, require */ + if ( true ) { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! outlayer/outlayer */ "./node_modules/outlayer/outlayer.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( Outlayer, getSize ) { + +'use strict'; + +// -------------------------- masonryDefinition -------------------------- // + + // create an Outlayer layout class + var Masonry = Outlayer.create('masonry'); + // isFitWidth -> fitWidth + Masonry.compatOptions.fitWidth = 'isFitWidth'; + + var proto = Masonry.prototype; + + proto._resetLayout = function() { + this.getSize(); + this._getMeasurement( 'columnWidth', 'outerWidth' ); + this._getMeasurement( 'gutter', 'outerWidth' ); + this.measureColumns(); + + // reset column Y + this.colYs = []; + for ( var i=0; i < this.cols; i++ ) { + this.colYs.push( 0 ); + } + + this.maxY = 0; + this.horizontalColIndex = 0; + }; + + proto.measureColumns = function() { + this.getContainerWidth(); + // if columnWidth is 0, default to outerWidth of first item + if ( !this.columnWidth ) { + var firstItem = this.items[0]; + var firstItemElem = firstItem && firstItem.element; + // columnWidth fall back to item of first element + this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth || + // if first elem has no width, default to size of container + this.containerWidth; + } + + var columnWidth = this.columnWidth += this.gutter; + + // calculate columns + var containerWidth = this.containerWidth + this.gutter; + var cols = containerWidth / columnWidth; + // fix rounding errors, typically with gutters + var excess = columnWidth - containerWidth % columnWidth; + // if overshoot is less than a pixel, round up, otherwise floor it + var mathMethod = excess && excess < 1 ? 'round' : 'floor'; + cols = Math[ mathMethod ]( cols ); + this.cols = Math.max( cols, 1 ); + }; + + proto.getContainerWidth = function() { + // container is parent if fit width + var isFitWidth = this._getOption('fitWidth'); + var container = isFitWidth ? this.element.parentNode : this.element; + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var size = getSize( container ); + this.containerWidth = size && size.innerWidth; + }; + + proto._getItemLayoutPosition = function( item ) { + item.getSize(); + // how many columns does this brick span + var remainder = item.size.outerWidth % this.columnWidth; + var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; + // round if off by 1 pixel, otherwise use ceil + var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth ); + colSpan = Math.min( colSpan, this.cols ); + // use horizontal or top column position + var colPosMethod = this.options.horizontalOrder ? + '_getHorizontalColPosition' : '_getTopColPosition'; + var colPosition = this[ colPosMethod ]( colSpan, item ); + // position the brick + var position = { + x: this.columnWidth * colPosition.col, + y: colPosition.y + }; + // apply setHeight to necessary columns + var setHeight = colPosition.y + item.size.outerHeight; + var setMax = colSpan + colPosition.col; + for ( var i = colPosition.col; i < setMax; i++ ) { + this.colYs[i] = setHeight; + } + + return position; + }; + + proto._getTopColPosition = function( colSpan ) { + var colGroup = this._getTopColGroup( colSpan ); + // get the minimum Y value from the columns + var minimumY = Math.min.apply( Math, colGroup ); + + return { + col: colGroup.indexOf( minimumY ), + y: minimumY, + }; + }; + + /** + * @param {Number} colSpan - number of columns the element spans + * @returns {Array} colGroup + */ + proto._getTopColGroup = function( colSpan ) { + if ( colSpan < 2 ) { + // if brick spans only one column, use all the column Ys + return this.colYs; + } + + var colGroup = []; + // how many different places could this brick fit horizontally + var groupCount = this.cols + 1 - colSpan; + // for each group potential horizontal position + for ( var i = 0; i < groupCount; i++ ) { + colGroup[i] = this._getColGroupY( i, colSpan ); + } + return colGroup; + }; + + proto._getColGroupY = function( col, colSpan ) { + if ( colSpan < 2 ) { + return this.colYs[ col ]; + } + // make an array of colY values for that one group + var groupColYs = this.colYs.slice( col, col + colSpan ); + // and get the max value of the array + return Math.max.apply( Math, groupColYs ); + }; + + // get column position based on horizontal index. #873 + proto._getHorizontalColPosition = function( colSpan, item ) { + var col = this.horizontalColIndex % this.cols; + var isOver = colSpan > 1 && col + colSpan > this.cols; + // shift to next row if item can't fit on current row + col = isOver ? 0 : col; + // don't let zero-size items take up space + var hasSize = item.size.outerWidth && item.size.outerHeight; + this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; + + return { + col: col, + y: this._getColGroupY( col, colSpan ), + }; + }; + + proto._manageStamp = function( stamp ) { + var stampSize = getSize( stamp ); + var offset = this._getElementOffset( stamp ); + // get the columns that this stamp affects + var isOriginLeft = this._getOption('originLeft'); + var firstX = isOriginLeft ? offset.left : offset.right; + var lastX = firstX + stampSize.outerWidth; + var firstCol = Math.floor( firstX / this.columnWidth ); + firstCol = Math.max( 0, firstCol ); + var lastCol = Math.floor( lastX / this.columnWidth ); + // lastCol should not go over if multiple of columnWidth #425 + lastCol -= lastX % this.columnWidth ? 0 : 1; + lastCol = Math.min( this.cols - 1, lastCol ); + // set colYs to bottom of the stamp + + var isOriginTop = this._getOption('originTop'); + var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) + + stampSize.outerHeight; + for ( var i = firstCol; i <= lastCol; i++ ) { + this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); + } + }; + + proto._getContainerSize = function() { + this.maxY = Math.max.apply( Math, this.colYs ); + var size = { + height: this.maxY + }; + + if ( this._getOption('fitWidth') ) { + size.width = this._getContainerFitWidth(); + } + + return size; + }; + + proto._getContainerFitWidth = function() { + var unusedCols = 0; + // count unused columns + var i = this.cols; + while ( --i ) { + if ( this.colYs[i] !== 0 ) { + break; + } + unusedCols++; + } + // fit container to columns that have been used + return ( this.cols - unusedCols ) * this.columnWidth - this.gutter; + }; + + proto.needsResizeLayout = function() { + var previousWidth = this.containerWidth; + this.getContainerWidth(); + return previousWidth != this.containerWidth; + }; + + return Masonry; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/item.js": +/*!***************************************!*\ + !*** ./node_modules/outlayer/item.js ***! + \***************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Outlayer Item + */ + +( function( window, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js") + ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( EvEmitter, getSize ) { +'use strict'; + +// ----- helpers ----- // + +function isEmptyObj( obj ) { + for ( var prop in obj ) { + return false; + } + prop = null; + return true; +} + +// -------------------------- CSS3 support -------------------------- // + + +var docElemStyle = document.documentElement.style; + +var transitionProperty = typeof docElemStyle.transition == 'string' ? + 'transition' : 'WebkitTransition'; +var transformProperty = typeof docElemStyle.transform == 'string' ? + 'transform' : 'WebkitTransform'; + +var transitionEndEvent = { + WebkitTransition: 'webkitTransitionEnd', + transition: 'transitionend' +}[ transitionProperty ]; + +// cache all vendor properties that could have vendor prefix +var vendorProperties = { + transform: transformProperty, + transition: transitionProperty, + transitionDuration: transitionProperty + 'Duration', + transitionProperty: transitionProperty + 'Property', + transitionDelay: transitionProperty + 'Delay' +}; + +// -------------------------- Item -------------------------- // + +function Item( element, layout ) { + if ( !element ) { + return; + } + + this.element = element; + // parent layout class, i.e. Masonry, Isotope, or Packery + this.layout = layout; + this.position = { + x: 0, + y: 0 + }; + + this._create(); +} + +// inherit EvEmitter +var proto = Item.prototype = Object.create( EvEmitter.prototype ); +proto.constructor = Item; + +proto._create = function() { + // transition objects + this._transn = { + ingProperties: {}, + clean: {}, + onEnd: {} + }; + + this.css({ + position: 'absolute' + }); +}; + +// trigger specified handler for event type +proto.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * apply CSS styles to element + * @param {Object} style + */ +proto.css = function( style ) { + var elemStyle = this.element.style; + + for ( var prop in style ) { + // use vendor property if available + var supportedProp = vendorProperties[ prop ] || prop; + elemStyle[ supportedProp ] = style[ prop ]; + } +}; + + // measure position, and sets it +proto.getPosition = function() { + var style = getComputedStyle( this.element ); + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + var xValue = style[ isOriginLeft ? 'left' : 'right' ]; + var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; + var x = parseFloat( xValue ); + var y = parseFloat( yValue ); + // convert percent to pixels + var layoutSize = this.layout.size; + if ( xValue.indexOf('%') != -1 ) { + x = ( x / 100 ) * layoutSize.width; + } + if ( yValue.indexOf('%') != -1 ) { + y = ( y / 100 ) * layoutSize.height; + } + // clean up 'auto' or other non-integer values + x = isNaN( x ) ? 0 : x; + y = isNaN( y ) ? 0 : y; + // remove padding from measurement + x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; + y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; + + this.position.x = x; + this.position.y = y; +}; + +// set settled position, apply padding +proto.layoutPosition = function() { + var layoutSize = this.layout.size; + var style = {}; + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + + // x + var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; + var xProperty = isOriginLeft ? 'left' : 'right'; + var xResetProperty = isOriginLeft ? 'right' : 'left'; + + var x = this.position.x + layoutSize[ xPadding ]; + // set in percentage or pixels + style[ xProperty ] = this.getXValue( x ); + // reset other property + style[ xResetProperty ] = ''; + + // y + var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; + var yProperty = isOriginTop ? 'top' : 'bottom'; + var yResetProperty = isOriginTop ? 'bottom' : 'top'; + + var y = this.position.y + layoutSize[ yPadding ]; + // set in percentage or pixels + style[ yProperty ] = this.getYValue( y ); + // reset other property + style[ yResetProperty ] = ''; + + this.css( style ); + this.emitEvent( 'layout', [ this ] ); +}; + +proto.getXValue = function( x ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && !isHorizontal ? + ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px'; +}; + +proto.getYValue = function( y ) { + var isHorizontal = this.layout._getOption('horizontal'); + return this.layout.options.percentPosition && isHorizontal ? + ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px'; +}; + +proto._transitionTo = function( x, y ) { + this.getPosition(); + // get current x & y from top/left + var curX = this.position.x; + var curY = this.position.y; + + var didNotMove = x == this.position.x && y == this.position.y; + + // save end position + this.setPosition( x, y ); + + // if did not move and not transitioning, just go to layout + if ( didNotMove && !this.isTransitioning ) { + this.layoutPosition(); + return; + } + + var transX = x - curX; + var transY = y - curY; + var transitionStyle = {}; + transitionStyle.transform = this.getTranslate( transX, transY ); + + this.transition({ + to: transitionStyle, + onTransitionEnd: { + transform: this.layoutPosition + }, + isCleaning: true + }); +}; + +proto.getTranslate = function( x, y ) { + // flip cooridinates if origin on right or bottom + var isOriginLeft = this.layout._getOption('originLeft'); + var isOriginTop = this.layout._getOption('originTop'); + x = isOriginLeft ? x : -x; + y = isOriginTop ? y : -y; + return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; +}; + +// non transition + transform support +proto.goTo = function( x, y ) { + this.setPosition( x, y ); + this.layoutPosition(); +}; + +proto.moveTo = proto._transitionTo; + +proto.setPosition = function( x, y ) { + this.position.x = parseFloat( x ); + this.position.y = parseFloat( y ); +}; + +// ----- transition ----- // + +/** + * @param {Object} style - CSS + * @param {Function} onTransitionEnd + */ + +// non transition, just trigger callback +proto._nonTransition = function( args ) { + this.css( args.to ); + if ( args.isCleaning ) { + this._removeStyles( args.to ); + } + for ( var prop in args.onTransitionEnd ) { + args.onTransitionEnd[ prop ].call( this ); + } +}; + +/** + * proper transition + * @param {Object} args - arguments + * @param {Object} to - style to transition to + * @param {Object} from - style to start transition from + * @param {Boolean} isCleaning - removes transition styles after transition + * @param {Function} onTransitionEnd - callback + */ +proto.transition = function( args ) { + // redirect to nonTransition if no transition duration + if ( !parseFloat( this.layout.options.transitionDuration ) ) { + this._nonTransition( args ); + return; + } + + var _transition = this._transn; + // keep track of onTransitionEnd callback by css property + for ( var prop in args.onTransitionEnd ) { + _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ]; + } + // keep track of properties that are transitioning + for ( prop in args.to ) { + _transition.ingProperties[ prop ] = true; + // keep track of properties to clean up when transition is done + if ( args.isCleaning ) { + _transition.clean[ prop ] = true; + } + } + + // set from styles + if ( args.from ) { + this.css( args.from ); + // force redraw. http://blog.alexmaccaw.com/css-transitions + var h = this.element.offsetHeight; + // hack for JSHint to hush about unused var + h = null; + } + // enable transition + this.enableTransition( args.to ); + // set styles that are transitioning + this.css( args.to ); + + this.isTransitioning = true; + +}; + +// dash before all cap letters, including first for +// WebkitTransform => -webkit-transform +function toDashedAll( str ) { + return str.replace( /([A-Z])/g, function( $1 ) { + return '-' + $1.toLowerCase(); + }); +} + +var transitionProps = 'opacity,' + toDashedAll( transformProperty ); + +proto.enableTransition = function(/* style */) { + // HACK changing transitionProperty during a transition + // will cause transition to jump + if ( this.isTransitioning ) { + return; + } + + // make `transition: foo, bar, baz` from style object + // HACK un-comment this when enableTransition can work + // while a transition is happening + // var transitionValues = []; + // for ( var prop in style ) { + // // dash-ify camelCased properties like WebkitTransition + // prop = vendorProperties[ prop ] || prop; + // transitionValues.push( toDashedAll( prop ) ); + // } + // munge number to millisecond, to match stagger + var duration = this.layout.options.transitionDuration; + duration = typeof duration == 'number' ? duration + 'ms' : duration; + // enable transition styles + this.css({ + transitionProperty: transitionProps, + transitionDuration: duration, + transitionDelay: this.staggerDelay || 0 + }); + // listen for transition end event + this.element.addEventListener( transitionEndEvent, this, false ); +}; + +// ----- events ----- // + +proto.onwebkitTransitionEnd = function( event ) { + this.ontransitionend( event ); +}; + +proto.onotransitionend = function( event ) { + this.ontransitionend( event ); +}; + +// properties that I munge to make my life easier +var dashedVendorProperties = { + '-webkit-transform': 'transform' +}; + +proto.ontransitionend = function( event ) { + // disregard bubbled events from children + if ( event.target !== this.element ) { + return; + } + var _transition = this._transn; + // get property name of transitioned property, convert to prefix-free + var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName; + + // remove property that has completed transitioning + delete _transition.ingProperties[ propertyName ]; + // check if any properties are still transitioning + if ( isEmptyObj( _transition.ingProperties ) ) { + // all properties have completed transitioning + this.disableTransition(); + } + // clean style + if ( propertyName in _transition.clean ) { + // clean up style + this.element.style[ event.propertyName ] = ''; + delete _transition.clean[ propertyName ]; + } + // trigger onTransitionEnd callback + if ( propertyName in _transition.onEnd ) { + var onTransitionEnd = _transition.onEnd[ propertyName ]; + onTransitionEnd.call( this ); + delete _transition.onEnd[ propertyName ]; + } + + this.emitEvent( 'transitionEnd', [ this ] ); +}; + +proto.disableTransition = function() { + this.removeTransitionStyles(); + this.element.removeEventListener( transitionEndEvent, this, false ); + this.isTransitioning = false; +}; + +/** + * removes style property from element + * @param {Object} style +**/ +proto._removeStyles = function( style ) { + // clean up transition styles + var cleanStyle = {}; + for ( var prop in style ) { + cleanStyle[ prop ] = ''; + } + this.css( cleanStyle ); +}; + +var cleanTransitionStyle = { + transitionProperty: '', + transitionDuration: '', + transitionDelay: '' +}; + +proto.removeTransitionStyles = function() { + // remove transition + this.css( cleanTransitionStyle ); +}; + +// ----- stagger ----- // + +proto.stagger = function( delay ) { + delay = isNaN( delay ) ? 0 : delay; + this.staggerDelay = delay + 'ms'; +}; + +// ----- show/hide/remove ----- // + +// remove element from DOM +proto.removeElem = function() { + this.element.parentNode.removeChild( this.element ); + // remove display: none + this.css({ display: '' }); + this.emitEvent( 'remove', [ this ] ); +}; + +proto.remove = function() { + // just remove element if no transition support or no transition + if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) { + this.removeElem(); + return; + } + + // start transition + this.once( 'transitionEnd', function() { + this.removeElem(); + }); + this.hide(); +}; + +proto.reveal = function() { + delete this.isHidden; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd; + + this.transition({ + from: options.hiddenStyle, + to: options.visibleStyle, + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onRevealTransitionEnd = function() { + // check if still visible + // during transition, item may have been hidden + if ( !this.isHidden ) { + this.emitEvent('reveal'); + } +}; + +/** + * get style property use for hide/reveal transition end + * @param {String} styleProperty - hiddenStyle/visibleStyle + * @returns {String} + */ +proto.getHideRevealTransitionEndProperty = function( styleProperty ) { + var optionStyle = this.layout.options[ styleProperty ]; + // use opacity + if ( optionStyle.opacity ) { + return 'opacity'; + } + // get first property + for ( var prop in optionStyle ) { + return prop; + } +}; + +proto.hide = function() { + // set flag + this.isHidden = true; + // remove display: none + this.css({ display: '' }); + + var options = this.layout.options; + + var onTransitionEnd = {}; + var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); + onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd; + + this.transition({ + from: options.visibleStyle, + to: options.hiddenStyle, + // keep hidden stuff hidden + isCleaning: true, + onTransitionEnd: onTransitionEnd + }); +}; + +proto.onHideTransitionEnd = function() { + // check if still hidden + // during transition, item may have been un-hidden + if ( this.isHidden ) { + this.css({ display: 'none' }); + this.emitEvent('hide'); + } +}; + +proto.destroy = function() { + this.css({ + position: '', + left: '', + right: '', + top: '', + bottom: '', + transition: '', + transform: '' + }); +}; + +return Item; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js": +/*!*********************************************************************!*\ + !*** ./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js ***! + \*********************************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * EvEmitter v1.1.0 + * Lil' event emitter + * MIT License + */ + +/* jshint unused: true, undef: true, strict: true */ + +( function( global, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, window */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( typeof window != 'undefined' ? window : this, function() { + +"use strict"; + +function EvEmitter() {} + +var proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // set events hash + var events = this._events = this._events || {}; + // set listeners array + var listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( listeners.indexOf( listener ) == -1 ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + var onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + // copy over to avoid interference if .off() in listener + listeners = listeners.slice(0); + args = args || []; + // once stuff + var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( var i=0; i < listeners.length; i++ ) { + var listener = listeners[i] + var isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; +}; + +return EvEmitter; + +})); + + +/***/ }), + +/***/ "./node_modules/outlayer/outlayer.js": +/*!*******************************************!*\ + !*** ./node_modules/outlayer/outlayer.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Outlayer v2.1.1 + * the brains and guts of a layout library + * MIT license + */ + +( function( window, factory ) { + 'use strict'; + // universal module definition + /* jshint strict: false */ /* globals define, module, require */ + if ( true ) { + // AMD - RequireJS + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(/*! ev-emitter/ev-emitter */ "./node_modules/outlayer/node_modules/ev-emitter/ev-emitter.js"), + __webpack_require__(/*! get-size/get-size */ "./node_modules/get-size/get-size.js"), + __webpack_require__(/*! fizzy-ui-utils/utils */ "./node_modules/fizzy-ui-utils/utils.js"), + __webpack_require__(/*! ./item */ "./node_modules/outlayer/item.js") + ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter, getSize, utils, Item ) { + return factory( window, EvEmitter, getSize, utils, Item); + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}( window, function factory( window, EvEmitter, getSize, utils, Item ) { +'use strict'; + +// ----- vars ----- // + +var console = window.console; +var jQuery = window.jQuery; +var noop = function() {}; + +// -------------------------- Outlayer -------------------------- // + +// globally unique identifiers +var GUID = 0; +// internal store of all Outlayer intances +var instances = {}; + + +/** + * @param {Element, String} element + * @param {Object} options + * @constructor + */ +function Outlayer( element, options ) { + var queryElement = utils.getQueryElement( element ); + if ( !queryElement ) { + if ( console ) { + console.error( 'Bad element for ' + this.constructor.namespace + + ': ' + ( queryElement || element ) ); + } + return; + } + this.element = queryElement; + // add jQuery + if ( jQuery ) { + this.$element = jQuery( this.element ); + } + + // options + this.options = utils.extend( {}, this.constructor.defaults ); + this.option( options ); + + // add id for Outlayer.getFromElement + var id = ++GUID; + this.element.outlayerGUID = id; // expando + instances[ id ] = this; // associate via id + + // kick it off + this._create(); + + var isInitLayout = this._getOption('initLayout'); + if ( isInitLayout ) { + this.layout(); + } +} + +// settings are for internal use only +Outlayer.namespace = 'outlayer'; +Outlayer.Item = Item; + +// default options +Outlayer.defaults = { + containerStyle: { + position: 'relative' + }, + initLayout: true, + originLeft: true, + originTop: true, + resize: true, + resizeContainer: true, + // item options + transitionDuration: '0.4s', + hiddenStyle: { + opacity: 0, + transform: 'scale(0.001)' + }, + visibleStyle: { + opacity: 1, + transform: 'scale(1)' + } +}; + +var proto = Outlayer.prototype; +// inherit EvEmitter +utils.extend( proto, EvEmitter.prototype ); + +/** + * set options + * @param {Object} opts + */ +proto.option = function( opts ) { + utils.extend( this.options, opts ); +}; + +/** + * get backwards compatible option value, check old name + */ +proto._getOption = function( option ) { + var oldOption = this.constructor.compatOptions[ option ]; + return oldOption && this.options[ oldOption ] !== undefined ? + this.options[ oldOption ] : this.options[ option ]; +}; + +Outlayer.compatOptions = { + // currentName: oldName + initLayout: 'isInitLayout', + horizontal: 'isHorizontal', + layoutInstant: 'isLayoutInstant', + originLeft: 'isOriginLeft', + originTop: 'isOriginTop', + resize: 'isResizeBound', + resizeContainer: 'isResizingContainer' +}; + +proto._create = function() { + // get items from children + this.reloadItems(); + // elements that affect layout, but are not laid out + this.stamps = []; + this.stamp( this.options.stamp ); + // set container style + utils.extend( this.element.style, this.options.containerStyle ); + + // bind resize method + var canBindResize = this._getOption('resize'); + if ( canBindResize ) { + this.bindResize(); + } +}; + +// goes through all children again and gets bricks in proper order +proto.reloadItems = function() { + // collection of item elements + this.items = this._itemize( this.element.children ); +}; + + +/** + * turn elements into Outlayer.Items to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - collection of new Outlayer Items + */ +proto._itemize = function( elems ) { + + var itemElems = this._filterFindItemElements( elems ); + var Item = this.constructor.Item; + + // create new Outlayer Items for collection + var items = []; + for ( var i=0; i < itemElems.length; i++ ) { + var elem = itemElems[i]; + var item = new Item( elem, this ); + items.push( item ); + } + + return items; +}; + +/** + * get item elements to be used in layout + * @param {Array or NodeList or HTMLElement} elems + * @returns {Array} items - item elements + */ +proto._filterFindItemElements = function( elems ) { + return utils.filterFindElements( elems, this.options.itemSelector ); +}; + +/** + * getter method for getting item elements + * @returns {Array} elems - collection of item elements + */ +proto.getItemElements = function() { + return this.items.map( function( item ) { + return item.element; + }); +}; + +// ----- init & layout ----- // + +/** + * lays out all items + */ +proto.layout = function() { + this._resetLayout(); + this._manageStamps(); + + // don't animate first layout + var layoutInstant = this._getOption('layoutInstant'); + var isInstant = layoutInstant !== undefined ? + layoutInstant : !this._isLayoutInited; + this.layoutItems( this.items, isInstant ); + + // flag for initalized + this._isLayoutInited = true; +}; + +// _init is alias for layout +proto._init = proto.layout; + +/** + * logic before any new layout + */ +proto._resetLayout = function() { + this.getSize(); +}; + + +proto.getSize = function() { + this.size = getSize( this.element ); +}; + +/** + * get measurement from option, for columnWidth, rowHeight, gutter + * if option is String -> get element from selector string, & get size of element + * if option is Element -> get size of element + * else use option as a number + * + * @param {String} measurement + * @param {String} size - width or height + * @private + */ +proto._getMeasurement = function( measurement, size ) { + var option = this.options[ measurement ]; + var elem; + if ( !option ) { + // default to 0 + this[ measurement ] = 0; + } else { + // use option as an element + if ( typeof option == 'string' ) { + elem = this.element.querySelector( option ); + } else if ( option instanceof HTMLElement ) { + elem = option; + } + // use size of element, if element + this[ measurement ] = elem ? getSize( elem )[ size ] : option; + } +}; + +/** + * layout a collection of item elements + * @api public + */ +proto.layoutItems = function( items, isInstant ) { + items = this._getItemsForLayout( items ); + + this._layoutItems( items, isInstant ); + + this._postLayout(); +}; + +/** + * get the items to be laid out + * you may want to skip over some items + * @param {Array} items + * @returns {Array} items + */ +proto._getItemsForLayout = function( items ) { + return items.filter( function( item ) { + return !item.isIgnored; + }); +}; + +/** + * layout items + * @param {Array} items + * @param {Boolean} isInstant + */ +proto._layoutItems = function( items, isInstant ) { + this._emitCompleteOnItems( 'layout', items ); + + if ( !items || !items.length ) { + // no items, emit event with empty array + return; + } + + var queue = []; + + items.forEach( function( item ) { + // get x/y object from method + var position = this._getItemLayoutPosition( item ); + // enqueue + position.item = item; + position.isInstant = isInstant || item.isLayoutInstant; + queue.push( position ); + }, this ); + + this._processLayoutQueue( queue ); +}; + +/** + * get item layout position + * @param {Outlayer.Item} item + * @returns {Object} x and y position + */ +proto._getItemLayoutPosition = function( /* item */ ) { + return { + x: 0, + y: 0 + }; +}; + +/** + * iterate over array and position each item + * Reason being - separating this logic prevents 'layout invalidation' + * thx @paul_irish + * @param {Array} queue + */ +proto._processLayoutQueue = function( queue ) { + this.updateStagger(); + queue.forEach( function( obj, i ) { + this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i ); + }, this ); +}; + +// set stagger from option in milliseconds number +proto.updateStagger = function() { + var stagger = this.options.stagger; + if ( stagger === null || stagger === undefined ) { + this.stagger = 0; + return; + } + this.stagger = getMilliseconds( stagger ); + return this.stagger; +}; + +/** + * Sets position of item in DOM + * @param {Outlayer.Item} item + * @param {Number} x - horizontal position + * @param {Number} y - vertical position + * @param {Boolean} isInstant - disables transitions + */ +proto._positionItem = function( item, x, y, isInstant, i ) { + if ( isInstant ) { + // if not transition, just set CSS + item.goTo( x, y ); + } else { + item.stagger( i * this.stagger ); + item.moveTo( x, y ); + } +}; + +/** + * Any logic you want to do after each layout, + * i.e. size the container + */ +proto._postLayout = function() { + this.resizeContainer(); +}; + +proto.resizeContainer = function() { + var isResizingContainer = this._getOption('resizeContainer'); + if ( !isResizingContainer ) { + return; + } + var size = this._getContainerSize(); + if ( size ) { + this._setContainerMeasure( size.width, true ); + this._setContainerMeasure( size.height, false ); + } +}; + +/** + * Sets width or height of container if returned + * @returns {Object} size + * @param {Number} width + * @param {Number} height + */ +proto._getContainerSize = noop; + +/** + * @param {Number} measure - size of width or height + * @param {Boolean} isWidth + */ +proto._setContainerMeasure = function( measure, isWidth ) { + if ( measure === undefined ) { + return; + } + + var elemSize = this.size; + // add padding and border width if border box + if ( elemSize.isBorderBox ) { + measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + + elemSize.borderLeftWidth + elemSize.borderRightWidth : + elemSize.paddingBottom + elemSize.paddingTop + + elemSize.borderTopWidth + elemSize.borderBottomWidth; + } + + measure = Math.max( measure, 0 ); + this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; +}; + +/** + * emit eventComplete on a collection of items events + * @param {String} eventName + * @param {Array} items - Outlayer.Items + */ +proto._emitCompleteOnItems = function( eventName, items ) { + var _this = this; + function onComplete() { + _this.dispatchEvent( eventName + 'Complete', null, [ items ] ); + } + + var count = items.length; + if ( !items || !count ) { + onComplete(); + return; + } + + var doneCount = 0; + function tick() { + doneCount++; + if ( doneCount == count ) { + onComplete(); + } + } + + // bind callback + items.forEach( function( item ) { + item.once( eventName, tick ); + }); +}; + +/** + * emits events via EvEmitter and jQuery events + * @param {String} type - name of event + * @param {Event} event - original event + * @param {Array} args - extra arguments + */ +proto.dispatchEvent = function( type, event, args ) { + // add original event to arguments + var emitArgs = event ? [ event ].concat( args ) : args; + this.emitEvent( type, emitArgs ); + + if ( jQuery ) { + // set this.$element + this.$element = this.$element || jQuery( this.element ); + if ( event ) { + // create jQuery event + var $event = jQuery.Event( event ); + $event.type = type; + this.$element.trigger( $event, args ); + } else { + // just trigger with type if no event available + this.$element.trigger( type, args ); + } + } +}; + +// -------------------------- ignore & stamps -------------------------- // + + +/** + * keep item in collection, but do not lay it out + * ignored items do not get skipped in layout + * @param {Element} elem + */ +proto.ignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + item.isIgnored = true; + } +}; + +/** + * return item to layout collection + * @param {Element} elem + */ +proto.unignore = function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + delete item.isIgnored; + } +}; + +/** + * adds elements to stamps + * @param {NodeList, Array, Element, or String} elems + */ +proto.stamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ) { + return; + } + + this.stamps = this.stamps.concat( elems ); + // ignore + elems.forEach( this.ignore, this ); +}; + +/** + * removes elements to stamps + * @param {NodeList, Array, or Element} elems + */ +proto.unstamp = function( elems ) { + elems = this._find( elems ); + if ( !elems ){ + return; + } + + elems.forEach( function( elem ) { + // filter out removed stamp elements + utils.removeFrom( this.stamps, elem ); + this.unignore( elem ); + }, this ); +}; + +/** + * finds child elements + * @param {NodeList, Array, Element, or String} elems + * @returns {Array} elems + */ +proto._find = function( elems ) { + if ( !elems ) { + return; + } + // if string, use argument as selector string + if ( typeof elems == 'string' ) { + elems = this.element.querySelectorAll( elems ); + } + elems = utils.makeArray( elems ); + return elems; +}; + +proto._manageStamps = function() { + if ( !this.stamps || !this.stamps.length ) { + return; + } + + this._getBoundingRect(); + + this.stamps.forEach( this._manageStamp, this ); +}; + +// update boundingLeft / Top +proto._getBoundingRect = function() { + // get bounding rect for container element + var boundingRect = this.element.getBoundingClientRect(); + var size = this.size; + this._boundingRect = { + left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, + top: boundingRect.top + size.paddingTop + size.borderTopWidth, + right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), + bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) + }; +}; + +/** + * @param {Element} stamp +**/ +proto._manageStamp = noop; + +/** + * get x/y position of element relative to container element + * @param {Element} elem + * @returns {Object} offset - has left, top, right, bottom + */ +proto._getElementOffset = function( elem ) { + var boundingRect = elem.getBoundingClientRect(); + var thisRect = this._boundingRect; + var size = getSize( elem ); + var offset = { + left: boundingRect.left - thisRect.left - size.marginLeft, + top: boundingRect.top - thisRect.top - size.marginTop, + right: thisRect.right - boundingRect.right - size.marginRight, + bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom + }; + return offset; +}; + +// -------------------------- resize -------------------------- // + +// enable event handlers for listeners +// i.e. resize -> onresize +proto.handleEvent = utils.handleEvent; + +/** + * Bind layout to window resizing + */ +proto.bindResize = function() { + window.addEventListener( 'resize', this ); + this.isResizeBound = true; +}; + +/** + * Unbind layout to window resizing + */ +proto.unbindResize = function() { + window.removeEventListener( 'resize', this ); + this.isResizeBound = false; +}; + +proto.onresize = function() { + this.resize(); +}; + +utils.debounceMethod( Outlayer, 'onresize', 100 ); + +proto.resize = function() { + // don't trigger if size did not change + // or if resize was unbound. See #9 + if ( !this.isResizeBound || !this.needsResizeLayout() ) { + return; + } + + this.layout(); +}; + +/** + * check if layout is needed post layout + * @returns Boolean + */ +proto.needsResizeLayout = function() { + var size = getSize( this.element ); + // check that this.size and size are there + // IE8 triggers resize on body size change, so they might not be + var hasSizes = this.size && size; + return hasSizes && size.innerWidth !== this.size.innerWidth; +}; + +// -------------------------- methods -------------------------- // + +/** + * add items to Outlayer instance + * @param {Array or NodeList or Element} elems + * @returns {Array} items - Outlayer.Items +**/ +proto.addItems = function( elems ) { + var items = this._itemize( elems ); + // add items to collection + if ( items.length ) { + this.items = this.items.concat( items ); + } + return items; +}; + +/** + * Layout newly-appended item elements + * @param {Array or NodeList or Element} elems + */ +proto.appended = function( elems ) { + var items = this.addItems( elems ); + if ( !items.length ) { + return; + } + // layout and reveal just the new items + this.layoutItems( items, true ); + this.reveal( items ); +}; + +/** + * Layout prepended elements + * @param {Array or NodeList or Element} elems + */ +proto.prepended = function( elems ) { + var items = this._itemize( elems ); + if ( !items.length ) { + return; + } + // add items to beginning of collection + var previousItems = this.items.slice(0); + this.items = items.concat( previousItems ); + // start new layout + this._resetLayout(); + this._manageStamps(); + // layout new stuff without transition + this.layoutItems( items, true ); + this.reveal( items ); + // layout previous items + this.layoutItems( previousItems ); +}; + +/** + * reveal a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.reveal = function( items ) { + this._emitCompleteOnItems( 'reveal', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.reveal(); + }); +}; + +/** + * hide a collection of items + * @param {Array of Outlayer.Items} items + */ +proto.hide = function( items ) { + this._emitCompleteOnItems( 'hide', items ); + if ( !items || !items.length ) { + return; + } + var stagger = this.updateStagger(); + items.forEach( function( item, i ) { + item.stagger( i * stagger ); + item.hide(); + }); +}; + +/** + * reveal item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.revealItemElements = function( elems ) { + var items = this.getItems( elems ); + this.reveal( items ); +}; + +/** + * hide item elements + * @param {Array}, {Element}, {NodeList} items + */ +proto.hideItemElements = function( elems ) { + var items = this.getItems( elems ); + this.hide( items ); +}; + +/** + * get Outlayer.Item, given an Element + * @param {Element} elem + * @param {Function} callback + * @returns {Outlayer.Item} item + */ +proto.getItem = function( elem ) { + // loop through items to get the one that matches + for ( var i=0; i < this.items.length; i++ ) { + var item = this.items[i]; + if ( item.element == elem ) { + // return item + return item; + } + } +}; + +/** + * get collection of Outlayer.Items, given Elements + * @param {Array} elems + * @returns {Array} items - Outlayer.Items + */ +proto.getItems = function( elems ) { + elems = utils.makeArray( elems ); + var items = []; + elems.forEach( function( elem ) { + var item = this.getItem( elem ); + if ( item ) { + items.push( item ); + } + }, this ); + + return items; +}; + +/** + * remove element(s) from instance and DOM + * @param {Array or NodeList or Element} elems + */ +proto.remove = function( elems ) { + var removeItems = this.getItems( elems ); + + this._emitCompleteOnItems( 'remove', removeItems ); + + // bail if no items to remove + if ( !removeItems || !removeItems.length ) { + return; + } + + removeItems.forEach( function( item ) { + item.remove(); + // remove item from collection + utils.removeFrom( this.items, item ); + }, this ); +}; + +// ----- destroy ----- // + +// remove and disable Outlayer instance +proto.destroy = function() { + // clean up dynamic styles + var style = this.element.style; + style.height = ''; + style.position = ''; + style.width = ''; + // destroy items + this.items.forEach( function( item ) { + item.destroy(); + }); + + this.unbindResize(); + + var id = this.element.outlayerGUID; + delete instances[ id ]; // remove reference to instance by id + delete this.element.outlayerGUID; + // remove data for jQuery + if ( jQuery ) { + jQuery.removeData( this.element, this.constructor.namespace ); + } + +}; + +// -------------------------- data -------------------------- // + +/** + * get Outlayer instance from element + * @param {Element} elem + * @returns {Outlayer} + */ +Outlayer.data = function( elem ) { + elem = utils.getQueryElement( elem ); + var id = elem && elem.outlayerGUID; + return id && instances[ id ]; +}; + + +// -------------------------- create Outlayer class -------------------------- // + +/** + * create a layout class + * @param {String} namespace + */ +Outlayer.create = function( namespace, options ) { + // sub-class Outlayer + var Layout = subclass( Outlayer ); + // apply new options and compatOptions + Layout.defaults = utils.extend( {}, Outlayer.defaults ); + utils.extend( Layout.defaults, options ); + Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions ); + + Layout.namespace = namespace; + + Layout.data = Outlayer.data; + + // sub-class Item + Layout.Item = subclass( Item ); + + // -------------------------- declarative -------------------------- // + + utils.htmlInit( Layout, namespace ); + + // -------------------------- jQuery bridge -------------------------- // + + // make into jQuery plugin + if ( jQuery && jQuery.bridget ) { + jQuery.bridget( namespace, Layout ); + } + + return Layout; +}; + +function subclass( Parent ) { + function SubClass() { + Parent.apply( this, arguments ); + } + + SubClass.prototype = Object.create( Parent.prototype ); + SubClass.prototype.constructor = SubClass; + + return SubClass; +} + +// ----- helpers ----- // + +// how many milliseconds are in each unit +var msUnits = { + ms: 1, + s: 1000 +}; + +// munge time-like parameter into millisecond number +// '0.4s' -> 40 +function getMilliseconds( time ) { + if ( typeof time == 'number' ) { + return time; + } + var matches = time.match( /(^\d*\.?\d*)(\w*)/ ); + var num = matches && matches[1]; + var unit = matches && matches[2]; + if ( !num.length ) { + return 0; + } + num = parseFloat( num ); + var mult = msUnits[ unit ] || 1; + return num * mult; +} + +// ----- fin ----- // + +// back in global +Outlayer.Item = Item; + +return Outlayer; + +})); + + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["React"]; + +/***/ }), + +/***/ "@wordpress/blocks": +/*!********************************!*\ + !*** external ["wp","blocks"] ***! + \********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["blocks"]; + +/***/ }), + +/***/ "@wordpress/data": +/*!******************************!*\ + !*** external ["wp","data"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["data"]; + +/***/ }), + +/***/ "@wordpress/edit-post": +/*!**********************************!*\ + !*** external ["wp","editPost"] ***! + \**********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["editPost"]; + +/***/ }), + +/***/ "@wordpress/element": +/*!*********************************!*\ + !*** external ["wp","element"] ***! + \*********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["element"]; + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "@wordpress/plugins": +/*!*********************************!*\ + !*** external ["wp","plugins"] ***! + \*********************************/ +/***/ ((module) => { + +"use strict"; +module.exports = window["wp"]["plugins"]; + +/***/ }), + +/***/ "?9157": +/*!************************!*\ + !*** crypto (ignored) ***! + \************************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/adapters.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/adapters/adapters.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); +/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const knownAdapters = { + http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], + xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"] +} + +_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(knownAdapters, (fn, value) => { + if(fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + getAdapter: (adapters) => { + adapters = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if((adapter = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + break; + } + } + + if (!adapter) { + if (adapter === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( + `Adapter ${nameOrAdapter} is not supported by the environment`, + 'ERR_NOT_SUPPORT' + ); + } + + throw new Error( + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].hasOwnProp(knownAdapters, nameOrAdapter) ? + `Adapter '${nameOrAdapter}' is not available in the build` : + `Unknown adapter '${nameOrAdapter}'` + ); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFunction(adapter)) { + throw new TypeError('adapter is not a function'); + } + + return adapter; + }, + adapters: knownAdapters +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); +/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); + + + + + + + + + + + + + + + + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers).normalize(); + const responseType = config.responseType; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(requestData) && (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserWebWorkerEnv)) { + requestHeaders.setContentType(false); // Let the browser set it + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__["default"]; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv) { + // Add xsrf header + const xsrfValue = (config.withCredentials || (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath)) + && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__["default"].read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__["default"](null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__["default"])(fullPath); + + if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].protocols.indexOf(protocol) === -1) { + reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); +/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); +/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); +/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); + + + + + + + + + + + + + + + + + + + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); + const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); + + // Copy axios.prototype to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); + + // Copy context to instance + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); + +// Expose Axios class to allow class inheritance +axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + +// Expose Cancel & CancelToken +axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; +axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; +axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; +axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; +axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; + +// Expose AxiosError class +axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; + +// Expose isAxiosError +axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; + +// Expose mergeConfig +axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; + +axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; + +axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_15__["default"]; + +axios.default = axios; + +// this module should only have a default export +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); + + + + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CanceledError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { + __CANCEL__: true +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isCancel) +/* harmony export */ }); + + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); +/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); +/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); +/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); +/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); +/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + + + + + + +const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), + response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer !== undefined) { + _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + let contextHeaders; + + // Flatten headers + contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( + headers.common, + headers[config.method] + ); + + contextHeaders && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); + const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url); + return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosError.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosError.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); + + + + + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +function isValidHeaderName(str) { + return /^[-_a-zA-Z]+$/.test(str.trim()); +} + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { + return parser.call(this, value, key); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders.prototype); +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildFullPath) +/* harmony export */ }); +/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); + + + + + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { + return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); + } + return requestedURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ dispatchRequest) +/* harmony export */ }); +/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); +/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); +/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); + + + + + + + + + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); + + // Transform request data + config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + response + ); + + response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergeConfig) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + +const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { + return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); + } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ settle) +/* harmony export */ }); +/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( + 'Request failed with status code ' + response.status, + [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ transformData) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); +/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); + + + + + + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; + const context = response || config; + const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); + let data = context.data; + + _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/index.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/defaults/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); +/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); +/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); + + + + + + + + + + +const DEFAULT_CONTENT_TYPE = { + 'Content-Type': undefined +}; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); + + if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) + ) { + return data; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { + return data.buffer; + } + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); + } + + if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, + Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(DEFAULT_CONTENT_TYPE); +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults/transitional.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/defaults/transitional.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/env/data.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/env/data.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "VERSION": () => (/* binding */ VERSION) +/* harmony export */ }); +const VERSION = "1.3.4"; + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": +/*!****************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); + + + + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ bind) +/* harmony export */ }); + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ buildURL) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + + + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? + params.toString() : + new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ combineURLs) +/* harmony export */ }); + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) { + cookie.push('path=' + path); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + +// Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; + + if (isLast) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { + const obj = {}; + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAbsoluteURL) +/* harmony export */ }); + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isAxiosError) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })()); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/null.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/null.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +// eslint-disable-next-line strict +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); + + + + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ parseProtocol) +/* harmony export */ }); + + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/speedometer.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/speedometer.js ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ spread) +/* harmony export */ }); + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toFormData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toFormData.js ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); +/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); + + + + +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored + + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); +} + +const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); + } + + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || + ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { + const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( + formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": +/*!************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ toURLEncodedForm) +/* harmony export */ }); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); +/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); +/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); + + + + + + +function toURLEncodedForm(data, options) { + return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/validator.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/validator.js ***! + \*****************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); +/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); + + + + + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); + } + } +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assertOptions, + validators +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": +/*!*****************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": +/*!*********************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": +/*!****************************************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); + + +/***/ }), + +/***/ "./node_modules/axios/lib/platform/browser/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/axios/lib/platform/browser/index.js ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); +/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); +/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); + + + + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== 'undefined' && ( + (product = navigator.product) === 'ReactNative' || + product === 'NativeScript' || + product === 'NS') + ) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; +})(); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + const isStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isBrowser: true, + classes: { + URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], + FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], + Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}); + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); + + + + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + const pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + if (reducer(descriptor, name, obj) !== false) { + reducedDescriptors[name] = descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject +}); + + +/***/ }), + +/***/ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs": +/*!*****************************************************************************************!*\ + !*** ./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "InView": () => (/* binding */ InView), +/* harmony export */ "defaultFallbackInView": () => (/* binding */ defaultFallbackInView), +/* harmony export */ "observe": () => (/* binding */ observe), +/* harmony export */ "useInView": () => (/* binding */ useInView) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); + + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const observerMap = new Map(); +const RootIds = new WeakMap(); +let rootId = 0; +let unsupportedValue = undefined; +/** + * What should be the default behavior if the IntersectionObserver is unsupported? + * Ideally the polyfill has been loaded, you can have the following happen: + * - `undefined`: Throw an error + * - `true` or `false`: Set the `inView` value to this regardless of intersection state + * **/ + +function defaultFallbackInView(inView) { + unsupportedValue = inView; +} +/** + * Generate a unique ID for the root element + * @param root + */ + +function getRootId(root) { + if (!root) return '0'; + if (RootIds.has(root)) return RootIds.get(root); + rootId += 1; + RootIds.set(root, rootId.toString()); + return RootIds.get(root); +} +/** + * Convert the options to a string Id, based on the values. + * Ensures we can reuse the same observer when observing elements with the same options. + * @param options + */ + + +function optionsToId(options) { + return Object.keys(options).sort().filter(key => options[key] !== undefined).map(key => { + return `${key}_${key === 'root' ? getRootId(options.root) : options[key]}`; + }).toString(); +} + +function createObserver(options) { + // Create a unique ID for this observer instance, based on the root, root margin and threshold. + let id = optionsToId(options); + let instance = observerMap.get(id); + + if (!instance) { + // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view. + const elements = new Map(); + let thresholds; + const observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + var _elements$get; + + // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it. + // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0 + const inView = entry.isIntersecting && thresholds.some(threshold => entry.intersectionRatio >= threshold); // @ts-ignore support IntersectionObserver v2 + + if (options.trackVisibility && typeof entry.isVisible === 'undefined') { + // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. + // @ts-ignore + entry.isVisible = inView; + } + + (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(callback => { + callback(inView, entry); + }); + }); + }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options + + thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]); + instance = { + id, + observer, + elements + }; + observerMap.set(id, instance); + } + + return instance; +} +/** + * @param element - DOM Element to observe + * @param callback - Callback function to trigger when intersection status changes + * @param options - Intersection Observer options + * @param fallbackInView - Fallback inView value. + * @return Function - Cleanup function that should be triggered to unregister the observer + */ + + +function observe(element, callback, options = {}, fallbackInView = unsupportedValue) { + if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) { + const bounds = element.getBoundingClientRect(); + callback(fallbackInView, { + isIntersecting: fallbackInView, + target: element, + intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0, + time: 0, + boundingClientRect: bounds, + intersectionRect: bounds, + rootBounds: bounds + }); + return () => {// Nothing to cleanup + }; + } // An observer with the same options can be reused, so lets use this fact + + + const { + id, + observer, + elements + } = createObserver(options); // Register the callback listener for this element + + let callbacks = elements.get(element) || []; + + if (!elements.has(element)) { + elements.set(element, callbacks); + } + + callbacks.push(callback); + observer.observe(element); + return function unobserve() { + // Remove the callback from the callback list + callbacks.splice(callbacks.indexOf(callback), 1); + + if (callbacks.length === 0) { + // No more callback exists for element, so destroy it + elements.delete(element); + observer.unobserve(element); + } + + if (elements.size === 0) { + // No more elements are being observer by this instance, so destroy it + observer.disconnect(); + observerMap.delete(id); + } + }; +} + +const _excluded = ["children", "as", "triggerOnce", "threshold", "root", "rootMargin", "onChange", "skip", "trackVisibility", "delay", "initialInView", "fallbackInView"]; + +function isPlainChildren(props) { + return typeof props.children !== 'function'; +} +/** + ## Render props + + To use the `` component, you pass it a function. It will be called + whenever the state changes, with the new value of `inView`. In addition to the + `inView` prop, children also receive a `ref` that should be set on the + containing DOM element. This is the element that the IntersectionObserver will + monitor. + + If you need it, you can also access the + [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) + on `entry`, giving you access to all the details about the current intersection + state. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + + {({ inView, ref, entry }) => ( +

+

{`Header inside viewport ${inView}.`}

+
+ )} +
+ ); + + export default Component; + ``` + + ## Plain children + + You can pass any element to the ``, and it will handle creating the + wrapping DOM element. Add a handler to the `onChange` method, and control the + state in your own component. Any extra props you add to `` will be + passed to the HTML element, allowing you set the `className`, `style`, etc. + + ```jsx + import { InView } from 'react-intersection-observer'; + + const Component = () => ( + console.log('Inview:', inView)}> +

Plain children are always rendered. Use onChange to monitor state.

+
+ ); + + export default Component; + ``` + */ + + +class InView extends react__WEBPACK_IMPORTED_MODULE_0__.Component { + constructor(props) { + super(props); + this.node = null; + this._unobserveCb = null; + + this.handleNode = node => { + if (this.node) { + // Clear the old observer, before we start observing a new element + this.unobserve(); + + if (!node && !this.props.triggerOnce && !this.props.skip) { + // Reset the state if we get a new node, and we aren't ignoring updates + this.setState({ + inView: !!this.props.initialInView, + entry: undefined + }); + } + } + + this.node = node ? node : null; + this.observeNode(); + }; + + this.handleChange = (inView, entry) => { + if (inView && this.props.triggerOnce) { + // If `triggerOnce` is true, we should stop observing the element. + this.unobserve(); + } + + if (!isPlainChildren(this.props)) { + // Store the current State, so we can pass it to the children in the next render update + // There's no reason to update the state for plain children, since it's not used in the rendering. + this.setState({ + inView, + entry + }); + } + + if (this.props.onChange) { + // If the user is actively listening for onChange, always trigger it + this.props.onChange(inView, entry); + } + }; + + this.state = { + inView: !!props.initialInView, + entry: undefined + }; + } + + componentDidUpdate(prevProps) { + // If a IntersectionObserver option changed, reinit the observer + if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) { + this.unobserve(); + this.observeNode(); + } + } + + componentWillUnmount() { + this.unobserve(); + this.node = null; + } + + observeNode() { + if (!this.node || this.props.skip) return; + const { + threshold, + root, + rootMargin, + trackVisibility, + delay, + fallbackInView + } = this.props; + this._unobserveCb = observe(this.node, this.handleChange, { + threshold, + root, + rootMargin, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + } + + unobserve() { + if (this._unobserveCb) { + this._unobserveCb(); + + this._unobserveCb = null; + } + } + + render() { + if (!isPlainChildren(this.props)) { + const { + inView, + entry + } = this.state; + return this.props.children({ + inView, + entry, + ref: this.handleNode + }); + } + + const _this$props = this.props, + { + children, + as + } = _this$props, + props = _objectWithoutPropertiesLoose(_this$props, _excluded); + + return react__WEBPACK_IMPORTED_MODULE_0__.createElement(as || 'div', _extends({ + ref: this.handleNode + }, props), children); + } + +} + +/** + * React Hooks make it easy to monitor the `inView` state of your components. Call + * the `useInView` hook with the (optional) [options](#options) you need. It will + * return an array containing a `ref`, the `inView` status and the current + * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry). + * Assign the `ref` to the DOM element you want to monitor, and the hook will + * report the status. + * + * @example + * ```jsx + * import React from 'react'; + * import { useInView } from 'react-intersection-observer'; + * + * const Component = () => { + * const { ref, inView, entry } = useInView({ + * threshold: 0, + * }); + * + * return ( + *
+ *

{`Header inside viewport ${inView}.`}

+ *
+ * ); + * }; + * ``` + */ + +function useInView({ + threshold, + delay, + trackVisibility, + rootMargin, + root, + triggerOnce, + skip, + initialInView, + fallbackInView, + onChange +} = {}) { + var _state$entry; + + const [ref, setRef] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null); + const callback = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + const [state, setState] = react__WEBPACK_IMPORTED_MODULE_0__.useState({ + inView: !!initialInView, + entry: undefined + }); // Store the onChange callback in a `ref`, so we can access the latest instance + // inside the `useEffect`, but without triggering a rerender. + + callback.current = onChange; + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { + // Ensure we have node ref, and that we shouldn't skip observing + if (skip || !ref) return; + let unobserve; + unobserve = observe(ref, (inView, entry) => { + setState({ + inView, + entry + }); + if (callback.current) callback.current(inView, entry); + + if (entry.isIntersecting && triggerOnce && unobserve) { + // If it should only trigger once, unobserve the element after it's inView + unobserve(); + unobserve = undefined; + } + }, { + root, + rootMargin, + threshold, + // @ts-ignore + trackVisibility, + // @ts-ignore + delay + }, fallbackInView); + return () => { + if (unobserve) { + unobserve(); + } + }; + }, // We break the rule here, because we aren't including the actual `threshold` variable + // eslint-disable-next-line react-hooks/exhaustive-deps + [// If the threshold is an array, convert it to a string, so it won't change between renders. + // eslint-disable-next-line react-hooks/exhaustive-deps + Array.isArray(threshold) ? threshold.toString() : threshold, ref, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]); + const entryTarget = (_state$entry = state.entry) == null ? void 0 : _state$entry.target; + const previousEntryTarget = react__WEBPACK_IMPORTED_MODULE_0__.useRef(); + + if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) { + // If we don't have a node ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`) + // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView + previousEntryTarget.current = entryTarget; + setState({ + inView: !!initialInView, + entry: undefined + }); + } + + const result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values. + + result.ref = result[0]; + result.inView = result[1]; + result.entry = result[2]; + return result; +} + + +//# sourceMappingURL=react-intersection-observer.modern.mjs.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!**********************************!*\ + !*** ./src/js/plugin-sidebar.js ***! + \**********************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins"); +/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _editor_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor/plugin */ "./src/js/editor/plugin/index.js"); +/* harmony import */ var _editor_plugin_components_Menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor/plugin/components/Menu */ "./src/js/editor/plugin/components/Menu.js"); + + + + + +/** + * Instant Images as a Gutenberg Plugin Sidebar. + * + * @return {JSX.Element} The InstantImagesPlugin component. + */ +var InstantImagesPlugin = function InstantImagesPlugin() { + return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_editor_plugin_components_Menu__WEBPACK_IMPORTED_MODULE_3__["default"], null), /*#__PURE__*/React.createElement(_editor_plugin__WEBPACK_IMPORTED_MODULE_2__["default"], null)); +}; + +// Register the sidebar plugin. +(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__.registerPlugin)("instant-images", { + render: InstantImagesPlugin +}); +})(); + +/******/ })() +; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/style-instant-images.css b/build/style-instant-images.css index 3b5c463..3669e09 100644 --- a/build/style-instant-images.css +++ b/build/style-instant-images.css @@ -1,488 +1,2994 @@ +/*!********************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/scss/style.scss ***! + \********************************************************************************************************************************************************************************************************************************************/ @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css); -body.media_page_instant-images,body.settings_page_instant-images-settings{background:#fff} -body.media_page_instant-images #wpcontent,body.settings_page_instant-images-settings #wpcontent{padding-left:0;padding-bottom:40px} -@media screen and (max-width: 800px){body.media_page_instant-images #wpcontent,body.settings_page_instant-images-settings #wpcontent{padding-bottom:0}} -body.media_page_instant-images #wpbody-content,body.settings_page_instant-images-settings #wpbody-content{padding-bottom:0} -body.media_page_instant-images #wpfooter,body.settings_page_instant-images-settings #wpfooter{padding-top:0;padding-bottom:0;line-height:40px;background:#f7f7f7;border-top:1px solid #efefef;position:fixed;bottom:0;z-index:1100} -body.media_page_instant-images #wpfooter p,body.settings_page_instant-images-settings #wpfooter p{line-height:40px} -@media screen and (max-width: 800px){body.media_page_instant-images #wpfooter,body.settings_page_instant-images-settings #wpfooter{display:none}} -body.media_page_instant-images.overflow-hidden,body.settings_page_instant-images-settings.overflow-hidden{overflow:hidden} -.instant-img-container{font-size:14px;color:#6b6877;position:relative} -.instant-img-container .offscreen{position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0} -.instant-img-container *{box-sizing:border-box} -.instant-img-container a{color:#586ec6;transition:all .25s ease} -.instant-img-container a:hover{color:#5568ae;text-decoration:none} -.instant-img-container img{max-width:100%} -.instant-img-container p{display:block;color:#6b6877;width:100%;clear:both;text-transform:none;padding:0;margin:0 0 15px;font-size:14px} -.instant-img-container .error-messaging{padding:22px 22px 22px 60px;border-radius:3px;background:#da4444;color:#fff;font-size:13px;line-height:1.75;margin:15px 15px 0;display:block;position:relative;box-shadow:0 8px 16px rgba(48,63,122,.175)} -.instant-img-container .error-messaging.warning{background-color:#cfa345} -.instant-img-container .error-messaging strong{font-size:15px;display:block} -.instant-img-container .error-messaging::before{font-family:"FontAwesome";content:"";display:block;left:18px;top:18px;position:absolute;font-size:32px;opacity:.75} -.instant-img-container .instant-images-wrapper{padding:0 25px 20px;display:block;overflow:hidden;min-height:400px;background:url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center} -.instant-img-container .instant-images-wrapper.loaded{background:none} -.instant-img-container h2,.instant-img-container h3,.instant-img-container h4{margin-top:0} -.instant-img-container .save-settings p.submit{float:left;margin:0 2px 0 0;width:auto} -.instant-img-container .save-settings .loading{width:46px;height:28px;display:none;float:left;background:#fff url(images/ajax-loader.7c5ec6b9.gif) no-repeat center center} -#TB_ajaxContent{clear:both;line-height:1.4;overflow:auto;text-align:left;width:100% !important;box-sizing:border-box;padding:15px !important} -.instant-img-container h1,.instant-img-container h2,.instant-img-container h3,.instant-img-container h4{color:#434246;margin-top:0} -.instant-img-container h4+p{margin-top:-6px} -.instant-img-container p.small{font-size:12px;margin-top:-10px;opacity:.7} -.instant-img-container ul{padding:0;margin:0;list-style:none} -.instant-img-container label,.instant-img-container input,.instant-img-container select,.instant-img-container textarea{box-shadow:none} -.instant-img-container .save-settings{padding-top:5px} -.instant-img-container label{padding:5px 0 7px} -#unsplash-form-options h2,#unsplash-form-options p.desc{display:none} -.instant-img-container input[type=text],.instant-img-container input[type=number],.instant-img-container textarea{padding:10px;line-height:1;background:#f7f7f7;width:100%;border-radius:2px;height:auto} -.instant-img-container input[type=text]:focus,.instant-img-container input[type=number]:focus,.instant-img-container textarea:focus{border-color:#98979d;box-shadow:0 0 3px #ccc} -.instant-img-container .spacer{display:block;height:40px;overflow:hidden;clear:both;width:100%} -.instant-img-container .spacer.sm{height:20px} -.instant-img-container input:-webkit-autofill{box-shadow:0 0 0 1000px #fff inset} -.instant-images-settings .button.button-primary,.instant-img-container .button.button-primary{background-color:#586ec6;border-color:#586ec6;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.05);transition:all .25s ease} -.instant-images-settings .button.button-primary:hover,.instant-images-settings .button.button-primary:focus,.instant-img-container .button.button-primary:hover,.instant-img-container .button.button-primary:focus{background-color:#455cb6;border-color:#455cb6} -.instant-images-settings .button.button-primary:focus,.instant-img-container .button.button-primary:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #455cb6} -.instant-images-settings .button.button-secondary,.instant-img-container .button.button-secondary{border-color:#586ec6;color:#586ec6;box-shadow:0 1px 1px rgba(0,0,0,.05);transition:all .25s ease} -.instant-images-settings .button.button-secondary:hover,.instant-images-settings .button.button-secondary:focus,.instant-img-container .button.button-secondary:hover,.instant-img-container .button.button-secondary:focus{color:#fff !important;border-color:#455cb6;background-color:#455cb6} -.instant-images-settings .button.button-secondary:focus,.instant-img-container .button.button-secondary:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #455cb6} -.instant-img-container .load-more-wrap{margin:0;padding:0;text-align:center;position:relative;width:100%;height:100px;display:flex;align-items:center;overflow:hidden} -.instant-img-container .load-more-wrap::after{position:absolute;content:"";display:block;inset:0;background:url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center;opacity:0;transition:opacity .15s ease} -.instant-img-container .load-more-wrap.loading::after{opacity:1} -.instant-img-container .load-more-wrap.done{height:10px} -.instant-img-container .load-more-wrap.done::after{display:none !important} -.instant-img-container .load-more-wrap button{display:none;margin:20px 0;padding:15px;font-size:15px;font-weight:600;transition:all .25s ease;height:auto;line-height:1;cursor:pointer;background-image:none;background-repeat:no-repeat !important;background-position:15px center !important} -.instant-img-container .load-more-wrap button.disabled{opacity:.3;cursor:default} -.instant-img-container .control-nav{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;width:100%;margin:0 0 20px;padding:20px 0;list-style:none;border-bottom:1px solid #e1e1e1} -@media screen and (max-width: 800px){.instant-img-container .control-nav{justify-content:center}} -.instant-img-container .control-nav::after{content:"";display:table;clear:both} -.instant-img-container .control-nav--filters-wrap{flex:1;position:relative;transition:all .3s ease .15s} -@media screen and (max-width: 800px){.instant-img-container .control-nav--filters-wrap{flex:none;width:100%}} -.instant-img-container .control-nav--filters-wrap.inactive{opacity:.35;filter:blur(1px);pointer-events:none} -.instant-img-container .control-nav--filters-wrap.inactive i{opacity:.4 !important} -.instant-img-container .control-nav--filters-wrap.inactive *{cursor:not-allowed} -.instant-img-container .control-nav--filters{position:relative;display:flex;flex-wrap:wrap;align-items:center;-moz-column-gap:20px;column-gap:20px;width:100%} -.instant-img-container .control-nav--filters::before{display:block;display:none;content:"";font-family:"FontAwesome";color:#efefef;font-size:24px;margin-right:10px} -.instant-img-container .control-nav--filters label{border-left:none;display:block;min-width:125px;padding:0;margin:0} -.instant-img-container .control-nav--filters label span{display:block;text-transform:uppercase;font-size:10px;padding-bottom:1px;padding-left:1px} -.instant-img-container .control-nav--filters label:focus-within select:not[disabled]{border-color:#98979d;box-shadow:0 0 1px 5px rgba(0,0,0,.025)} -.instant-img-container .control-nav--filters select{text-transform:capitalize;width:100%;border-color:#ccc;color:#434246;background-color:#f7f7f7;min-height:36px;line-height:36px;font-size:14px;padding:0 24px 0 8px} -.instant-img-container .control-nav--filters select[disabled]{cursor:not-allowed} -.instant-img-container .control-nav--filters select:not[disabled]:hover{border-color:#98979d;box-shadow:0 0 1px 5px rgba(0,0,0,.025)} -.instant-img-container .control-nav--search{display:flex;width:30%;max-width:350px;padding:0;margin-left:20px;position:relative} -@media screen and (min-width: 1270px){.instant-img-container .control-nav--search{width:35%}} -.instant-img-container .control-nav--search.inactive{opacity:.35;filter:blur(1px);pointer-events:none} -@media screen and (max-width: 800px){.instant-img-container .control-nav--search{width:100%;display:block;position:static;text-align:left;max-width:100%;padding:10px 0;margin:0}} -.instant-img-container .control-nav--search-tooltip{position:absolute;right:100.5%;top:-1px;width:auto;height:40px;line-height:40px;padding:0 0 0 10px;background:#586ec6;border:1px solid #455cb6;border-radius:4px;z-index:9999;font-size:13px;font-weight:500;transition:all .25s ease;color:#fff;box-shadow:0 2px 3px rgba(0,0,0,.05);display:flex;align-items:center} -.instant-img-container .control-nav--search-tooltip span{cursor:help} -.instant-img-container .control-nav--search-tooltip button{cursor:pointer;color:#fff;background-color:rgba(0,0,0,0) !important;padding:0;line-height:1;width:28px;font-weight:700;opacity:.65;display:flex;align-items:center;justify-content:center;font-size:14px;height:100%;border:none !important;box-shadow:none !important} -.instant-img-container .control-nav--search-tooltip button:hover,.instant-img-container .control-nav--search-tooltip button:focus{opacity:1} -.instant-img-container .control-nav--search-tooltip::after,.instant-img-container .control-nav--search-tooltip::before{left:100%;top:50%;border:solid rgba(0,0,0,0);content:"";height:0;width:0;position:absolute;pointer-events:none;z-index:100} -.instant-img-container .control-nav--search-tooltip::after{border-color:rgba(223,225,173,0);border-left-color:#586ec6;border-width:6px;margin-top:-6px} -.instant-img-container .control-nav--search-tooltip::before{border-color:rgba(0,0,0,0);border-left-color:#455cb6;border-width:7px;margin-top:-7px} -.instant-img-container .control-nav--search-tooltip.hide{opacity:0;visibility:hidden} -@media screen and (max-width: 800px){.instant-img-container .control-nav--search-tooltip{right:0;top:0;border-radius:0 3px 3px 0}.instant-img-container .control-nav--search-tooltip::after,.instant-img-container .control-nav--search-tooltip::before{display:none}} -.instant-img-container .control-nav--search form{padding:0 1px 0 0;margin:0;position:relative;height:38px;display:block;width:100%} -.instant-img-container .control-nav--search form:hover button[type=submit]{opacity:1} -.instant-img-container .control-nav--search input{background-color:#fff;color:#434246;width:100%;padding:0 15px 0 38px;border-color:#e1e1e1;height:38px;line-height:38px;border-radius:3px;font-size:14px;background-position:right 10px center;background-repeat:no-repeat;margin:0} -.instant-img-container .control-nav--search input[disabled]{cursor:not-allowed} -.instant-img-container .control-nav--search input:focus{outline:none;border-color:#586ec6;box-shadow:0 0 0 1px #586ec6,0 0 0 4px rgba(88,110,198,.1)} -.instant-img-container .control-nav--search input.searching{background-image:url(images/ajax-loader.7c5ec6b9.gif)} -.instant-img-container .control-nav--search input[type=text]::-webkit-search-decoration,.instant-img-container .control-nav--search input[type=text]::-webkit-search-cancel-button,.instant-img-container .control-nav--search input[type=text]::-webkit-search-results-button,.instant-img-container .control-nav--search input[type=text]::-webkit-search-results-decoration{-webkit-appearance:none} -.instant-img-container .control-nav--search button[type=submit]{position:absolute;left:1px;top:0;width:38px;height:38px;line-height:38px;border-radius:3px;z-index:1;border:none !important;background:rgba(0,0,0,0) !important;cursor:pointer;color:#6b6877;box-shadow:none !important;transition:all .25s ease;margin:0;padding:0;font-size:18px} -.instant-img-container .control-nav--search button[type=submit]:hover,.instant-img-container .control-nav--search button[type=submit]:focus{color:#434246} -.instant-img-container .control-nav--search button[type=submit][disabled]{cursor:not-allowed} -.instant-img-container .control-nav--search input[type=text]::-moz-placeholder{color:#98979d;font-weight:400;font-style:normal;font-size:14px} -.instant-img-container .control-nav--search input[type=text]::placeholder{color:#98979d;font-weight:400;font-style:normal;font-size:14px} -.instant-img-container .control-nav--search-history{position:absolute;z-index:99999;top:100%;left:-1.5%;width:103%;padding:15px;margin-top:5px;background:#fff;border-radius:3px;border:1px solid #e1e1e1;box-shadow:0 1px 4px 0 rgba(0,0,0,.1019607843),0 1px 3px -1px rgba(0,0,0,.1019607843) !important;font-size:13px;opacity:0;visibility:hidden;transition:all .15s ease .1s} -.instant-img-container .control-nav--search-history.active{opacity:1;visibility:visible} -.instant-img-container .control-nav--search-history button{color:#6b6877;cursor:pointer;background-color:rgba(0,0,0,0);border:none;text-align:left} -.instant-img-container .control-nav--search-history button:hover,.instant-img-container .control-nav--search-history button:focus{color:#434246} -.instant-img-container .control-nav--search-history-title{display:flex;align-items:center;width:100%;gap:15px;border-bottom:1px solid #e1e1e1;padding-bottom:5px;margin-bottom:10px;margin-top:20px} -.instant-img-container .control-nav--search-history-title:first-of-type{margin-top:0} -.instant-img-container .control-nav--search-history-title div{font-size:12px;color:#434246;text-transform:uppercase;font-weight:500;cursor:default} -.instant-img-container .control-nav--search-history-title button{margin-left:auto;font-size:13px;padding:0 1px} -.instant-img-container .control-nav--search-history ul li{margin:0;font-size:13px} -.instant-img-container .control-nav--search-history ul.search-history{display:flex;flex-wrap:wrap;gap:6px} -.instant-img-container .control-nav--search-history ul.search-history button{padding:6px 10px;border-radius:3px;border:1px solid #e1e1e1;box-shadow:0 1px 1px rgba(0,0,0,.05)} -.instant-img-container .control-nav--search-history ul.search-history button:hover,.instant-img-container .control-nav--search-history ul.search-history button:focus{background-color:#f7f7f7} -.instant-img-container .control-nav--search-history ul.search-suggestions{display:block} -.instant-img-container .control-nav--search-history ul.search-suggestions button{background-color:rgba(0,0,0,0);border:none;padding:5px 0;width:100%} -.instant-img-container .control-nav--search-history.extended-cta{padding:0} -#photo-listing{position:relative;min-height:500px;height:100%} -#photo-listing::after{visibility:hidden;opacity:0;display:block;content:"";position:absolute;width:calc(100% + 50px);height:100%;left:-25px;top:0;background:rgba(255,255,255,.9) url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center 90px;z-index:9999;transition:all .25s ease} -#photo-listing.loading::after{visibility:visible;opacity:1} -#photos{width:100%;width:calc(100% + 10px);margin:0 0 0 -5px;padding:0;position:relative;z-index:1} -#photos.inactive{pointer-events:none} -#photos .photo{width:20%;margin:0;padding:0 3px 6px;opacity:0;transition:opacity .45s ease} -#photos .photo-wrap{position:relative;border-radius:3px;overflow:hidden} -#photos .photo-wrap.photo-uploading button.photo-upload,#photos .photo-wrap.photo-uploaded button.photo-upload,#photos .photo-wrap.photo-success button.photo-upload,#photos .photo-wrap.photo-error button.photo-upload{background-color:#111} -#photos .photo-wrap.photo-uploading button.photo-upload img,#photos .photo-wrap.photo-uploaded button.photo-upload img,#photos .photo-wrap.photo-success button.photo-upload img,#photos .photo-wrap.photo-error button.photo-upload img{transform:scale(1) !important;opacity:.5 !important} -#photos .photo-wrap.photo-uploading .photo-status,#photos .photo-wrap.photo-uploaded .photo-status,#photos .photo-wrap.photo-success .photo-status,#photos .photo-wrap.photo-error .photo-status{visibility:visible;opacity:1;transform:translate(-50%, -50%) scale(1)} -#photos .photo-wrap.photo-uploading{pointer-events:none} -#photos .photo-wrap.photo-uploading .photo-status{background:rgba(255,255,255,.95) url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center;background-size:24px 24px} -#photos .photo-wrap.photo-uploading .photo-status::before{display:none} -#photos .photo-wrap.photo-uploading .photo-meta,#photos .photo-wrap.photo-uploading .photo-controls,#photos .photo-wrap.photo-uploaded .photo-meta,#photos .photo-wrap.photo-uploaded .photo-controls{opacity:0 !important;visibility:hidden !important} -#photos .photo-wrap.photo-uploaded button.photo-upload,#photos .photo-wrap.photo-success button.photo-upload{cursor:default} -#photos .photo-wrap.photo-uploaded .photo-status,#photos .photo-wrap.photo-success .photo-status{background-color:#65c774} -#photos .photo-wrap.photo-uploaded .photo-status::before,#photos .photo-wrap.photo-success .photo-status::before{content:"";color:#fff} -#photos .photo-wrap.photo-error{cursor:help !important} -#photos .photo-wrap.photo-error .photo-status{background-color:#df3333} -#photos .photo-wrap.photo-error .photo-status::before{content:"";color:#fff;opacity:.8} -#photos .photo.in-view{opacity:1} -#photos .photo .img-wrap{display:block;overflow:hidden;position:relative} -@media screen and (min-width: 2000px){#photos .photo{width:20%}} -@media screen and (max-width: 1500px){#photos .photo{width:25%}} -@media screen and (max-width: 1270px){#photos .photo{width:33.333333%}} -@media screen and (max-width: 800px){#photos .photo{width:50%}} -@media screen and (max-width: 600px){#photos .photo{width:100%;margin:0 0 2%}} -#photos .photo:focus .fade{opacity:1;visibility:visible} -#photos .photo:focus .fade.user{opacity:.7} -#photos .photo:focus-within .photo-controls{bottom:0;opacity:1} -#photos .photo button.photo-upload{display:block;width:100%;position:relative;background-color:rgba(0,0,0,0);background-color:#111;overflow:hidden;cursor:pointer;padding:0;margin:0;border:none} -#photos .photo button.photo-upload:focus,#photos .photo button.photo-upload:active{border:none} -#photos .photo button.photo-upload img{transition:all .4s ease;width:100%;height:auto !important;padding:0;vertical-align:top;background-color:#fff} -#photos .photo:focus button.photo-upload img,#photos .photo:hover button.photo-upload img{opacity:.5;transform:scale(1.05)} -#photos .photo:focus .photo-meta,#photos .photo:hover .photo-meta{opacity:1;visibility:visible} -#photos .photo:focus .photo-meta i.heart-like,#photos .photo:hover .photo-meta i.heart-like{transform:scale(1)} -#photos .photo:focus .photo-controls,#photos .photo:hover .photo-controls{bottom:0;opacity:1} -#photos .photo .photo-status{visibility:hidden;opacity:0;transition:all .3s ease-out;width:60px;height:60px;line-height:60px;border-radius:6px;position:absolute;text-align:center;left:50%;top:50%;z-index:5;transform:translate(-50%, -50%) scale(1.2);box-shadow:0 3px 10px rgba(0,0,0,.075);background-color:rgba(255,255,255,.95);background-position:center center;background-repeat:no-repeat} -#photos .photo .photo-status::before{font-family:"FontAwesome";display:block;color:#fff;font-size:24px;opacity:.8} -#photos .photo .photo-status.active{opacity:1;visibility:visible} -#photos .photo .photo-meta{position:absolute;top:5px;right:5px;z-index:6;width:auto;display:inline-block;cursor:default !important;transition:all .25s ease;opacity:0;visibility:hidden;font-size:13px} -#photos .photo .photo-meta i{font-size:14px} -#photos .photo .photo-meta i.heart-like{color:#df3333;transition:all .25s ease;transform:scale(0.55);margin-right:2px;position:relative;top:0;font-size:14px;opacity:.85} -#photos .photo .photo-meta a,#photos .photo .photo-meta span{display:inline-block;vertical-align:top;line-height:30px;padding:0 10px;margin:0;padding-top:1px;background:rgba(255,255,255,.4);border-radius:2px;color:#23282d;transition:all .25s ease} -#photos .photo .photo-meta span{cursor:default} -#photos .photo .photo-meta span:hover,#photos .photo .photo-meta span:focus{background-color:#fff} -#photos .photo .photo-meta a{margin-left:5px} -#photos .photo .photo-meta a:hover,#photos .photo .photo-meta a:focus{background-color:#fff} -#photos .photo .photo-meta a i{position:relative;top:1px;left:1px} -#photos .photo .photo-controls{position:absolute;z-index:6;width:100%;bottom:0;left:0;padding:0;opacity:0;transition:all .25s ease;background:linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, rgba(17, 17, 17, 0.3) 100%)} -#photos .photo .photo-options{float:right;text-align:right;max-width:50%} -#photos .photo .fade{transition:all .35s ease;background:rgba(255,255,255,.75);background:rgba(0,0,0,0);border-radius:2px;height:34px;line-height:34px;font-size:18px;z-index:6;float:left;margin:1px 1px 1px 0;padding:0;color:rgba(255,255,255,.75);border:none !important;outline:none;cursor:pointer} -#photos .photo .fade.edit-photo,#photos .photo .fade.edit-photo-admin,#photos .photo .fade.set-featured,#photos .photo .fade.insert{width:34px;height:34px;display:flex;align-items:center;justify-content:center} -#photos .photo .fade.edit-photo i,#photos .photo .fade.edit-photo-admin i,#photos .photo .fade.set-featured i,#photos .photo .fade.insert i{position:relative;top:1px} -#photos .photo .fade.edit-photo:hover,#photos .photo .fade.edit-photo:focus,#photos .photo .fade.edit-photo-admin:hover,#photos .photo .fade.edit-photo-admin:focus,#photos .photo .fade.set-featured:hover,#photos .photo .fade.set-featured:focus,#photos .photo .fade.insert:hover,#photos .photo .fade.insert:focus{color:#222;background:rgba(255,255,255,.95)} -#photos .photo .fade.user{background:none;text-decoration:none;font-size:13px;max-width:48%;cursor:pointer;border:none;line-height:35px;height:36px;margin:0} -#photos .photo .fade.user:hover,#photos .photo .fade.user:focus{text-decoration:underline} -#photos .photo .fade.user .user-wrap{position:relative;padding-left:35px;display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} -#photos .photo .fade.user .user-wrap::before{content:"";display:block;z-index:0;background-color:#fff;height:20px;opacity:.25} -#photos .photo .fade.user img.user-wrap--photo,#photos .photo .fade.user .user-wrap::before{width:20px;max-width:20px;border-radius:100%;position:absolute;left:8px;top:8px} -#photos .photo .fade.user img.user-wrap--photo{z-index:1} -#photos .photo.feature{cursor:pointer} -#photos .photo.feature:hover,#photos .photo.feature:focus-within{text-decoration:underline} -#photos .photo.feature:hover .photo--wrap,#photos .photo.feature:focus-within .photo--wrap{border-color:#ccc} -#photos .photo.feature .photo--wrap{padding:5px;border:1px solid #e1e1e1;border-radius:3px;transition:border .25s ease} -#photos .photo.feature .photo--wrap .flag{position:absolute;right:3px;top:3px;font-size:11px;background-color:#ffe732;z-index:10;padding:5px;border-radius:3px;line-height:1} -#photos .photo.feature .photo--wrap .img-wrap img{display:block;border-radius:3px} -#photos .photo.feature .photo--wrap .feature-title{display:flex;align-items:center;width:100%;padding:8px 3px 3px} -#photos .photo.feature .photo--wrap .feature-title img{border-radius:100%;width:25px;height:25px;-o-object-fit:cover;object-fit:cover;margin-right:6px} -#photos .photo.feature .photo--wrap .feature-title span{flex:1;display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:25px} -#photos .edit-screen{position:absolute;left:0;top:0;width:100%;height:100%;z-index:999;background:rgba(255,255,255,.9);opacity:0;visibility:hidden;transition:all .25s ease;padding:5px;overflow-y:auto;-webkit-overflow-scrolling:touch;border:1px solid #e1e1e1;transform:scale(1.025)} -#photos .edit-screen.editing{visibility:visible;opacity:1;transform:scale(1)} -#photos .edit-screen--controls,#photos .edit-screen--title{display:flex;flex-wrap:nowrap;width:100%;background:#f7f7f7;border:1px solid #e1e1e1;padding:15px;border-radius:2px 2px 0 0} -#photos .edit-screen--controls{border-radius:0 0 3px 3px;justify-content:space-between} -#photos .edit-screen--title{border-bottom:none;border-radius:3px 3px 0 0} -#photos .edit-screen--title>div{padding:10px 15px 10px 0;flex:1} -#photos .edit-screen--title>div.preview{width:25%;padding:0;background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:3px;flex:none} -#photos .edit-screen--title p{font-size:12px;line-height:1.45;margin:0;color:#98979d} -#photos .edit-screen--title p.heading{color:#222;margin:0;font-weight:600;text-transform:uppercase} -#photos .edit-screen--title p.dimensions{font-size:11px} -#photos .edit-screen label,#photos .edit-screen .add-attribution-row{margin:0;padding:15px;display:block;background:#fff;border:1px solid #e1e1e1;border-bottom:none;position:relative} -#photos .edit-screen .add-attribution-row{padding-top:0;margin-top:-15px;border-top:none} -#photos .edit-screen .add-attribution-row button{cursor:pointer;font-size:11px;outline:none;padding:5px 0;border:none;background:none;text-decoration:underline} -#photos .edit-screen .add-attribution-row button:hover,#photos .edit-screen .add-attribution-row button:focus{text-decoration:none} -#photos .edit-screen span{display:block;font-size:11px;text-transform:uppercase;font-weight:600;margin:0 0 10px;color:#222;line-height:1} -#photos .edit-screen textarea,#photos .edit-screen input{color:#6b6877;background-color:#fff;width:100%;padding:10px;border-color:#e1e1e1;line-height:1;border-radius:3px;font-size:12px;line-height:1.35} -#photos .edit-screen textarea:focus,#photos .edit-screen input:focus{outline:none;border-color:#586ec6;box-shadow:0 0 0 1px #586ec6,0 0 0 4px rgba(88,110,198,.1)} -#photos .edit-screen textarea{resize:none} -#photos .edit-screen input{height:38px;line-height:38px;padding-top:0;padding-bottom:0} -#photos .edit-screen input[name=filename]{padding-right:45px} -#photos .edit-screen em{position:absolute;bottom:16px;right:15px;height:36px;line-height:36px;background:#efefef;border-radius:0 2px 2px 0;color:#98979d;font-style:normal;font-weight:500;font-size:11px;padding:0 10px;border-left:1px solid #e1e1e1} -.instant-img-container .onload-warning{text-align:center;max-width:600px;margin:0 auto;padding:20px} -.instant-img-container .onload-warning h3{margin-bottom:10px} -.instant-img-container .onload-warning h3 span{text-transform:uppercase} -.instant-images-settings{background-color:#f7f7f7;padding:30px;display:grid;grid-gap:30px;grid-template-columns:repeat(1, 1fr);grid-template-rows:repeat(1, 1fr)} -@media screen and (min-width: 800px){.instant-images-settings{grid-template-columns:4fr 8fr}} -@media screen and (min-width: 1270px){.instant-images-settings{grid-template-columns:3fr 9fr}} -@media screen and (min-width: 1500px){.instant-images-settings{grid-template-columns:2fr 10fr}} -@media screen and (min-width: 1270px)and (min-height: 640px){.instant-images-settings--sticky{position:sticky;top:62px;left:0}} -.instant-images-settings--header{display:block;width:100%;margin:0} -.instant-images-settings--header .plugin-version{display:none} -@media screen and (min-width: 800px){.instant-images-settings--header .plugin-version{display:block;padding:20px 11px 0;font-size:12px}} -.instant-images-settings--header nav{display:none;margin-top:20px;padding:0 0 5px;border-radius:10px;background-color:#fff;box-shadow:0 1px 4px 0 rgba(0,0,0,.1019607843),0 1px 3px -1px rgba(0,0,0,.1019607843) !important;overflow:hidden} -@media screen and (min-width: 800px){.instant-images-settings--header nav{display:block}} -.instant-images-settings--header nav h3{font-size:12px;background-color:#fff;border-bottom:1px solid #f7f7f7;margin:0 0 5px;padding:15px 15px 14px;line-height:1;text-transform:uppercase} -.instant-images-settings--header nav button{all:unset;width:100%;border:none;color:#6b6877;line-height:1;padding:10px 12px;cursor:pointer;white-space:nowrap;text-align:left;display:flex;align-items:center;flex-wrap:nowrap} -.instant-images-settings--header nav button i{width:25px;color:#e1e1e1;font-size:18px} -.instant-images-settings--header nav button:hover,.instant-images-settings--header nav button:focus{color:#434246} -.instant-images-settings--sections .settings-entry{display:flex;flex-wrap:wrap;align-items:flex-start;width:100%;margin:0 0 30px;background-color:#fff;border-radius:10px;box-shadow:0 1px 4px 0 rgba(0,0,0,.1019607843),0 1px 3px -1px rgba(0,0,0,.1019607843) !important} -@media screen and (min-width: 1270px){.instant-images-settings--sections .settings-entry{padding:30px}} -.instant-images-settings--sections .settings-entry:last-of-type{border-bottom:none} -.instant-images-settings--sections .settings-entry--title{width:100%;padding:25px;position:relative;border-bottom:1px solid #f7f7f7} -@media screen and (min-width: 1270px){.instant-images-settings--sections .settings-entry--title{width:30%;padding:27px 30px 30px 50px;border:none;position:sticky;top:62px;margin-bottom:20px}.instant-images-settings--sections .settings-entry--title::after{display:block;content:"";height:1px;width:50px;background-color:#e1e1e1;position:absolute;bottom:0}} -.instant-images-settings--sections .settings-entry--title i.fa{display:none;position:absolute;left:10px;font-size:30px;color:#e1e1e1;margin-top:-4px} -@media screen and (min-width: 1270px){.instant-images-settings--sections .settings-entry--title i.fa{display:block}} -.instant-images-settings--sections .settings-entry--title h2{font-size:18px;font-weight:600;border:none;padding:0;margin:0 0 8px;line-height:1.35} -.instant-images-settings--sections .settings-entry--title p{margin:8px 0 0} -.instant-images-settings--sections .settings-entry--action{width:100%;padding:25px;position:relative;overflow:hidden} -@media screen and (min-width: 1270px){.instant-images-settings--sections .settings-entry--action{width:70%;padding:30px}} -.instant-images-settings .save-settings{display:flex;flex-wrap:wrap;gap:10px;width:100%;align-items:center;position:relative} -.instant-images-settings .save-settings p.submit{margin:0;width:auto} -.instant-images-settings .save-settings .loading,.instant-images-settings .save-settings .saved{opacity:0;visibility:hidden;transition:all .25s ease} -.instant-images-settings .save-settings .loading.active,.instant-images-settings .save-settings .saved.active{opacity:1;visibility:visible} -.instant-images-settings .save-settings .loading{width:30px;height:30px;display:block;background:#fff url(images/ajax-loader.7c5ec6b9.gif) no-repeat center center} -.instant-images-settings .save-settings .saved{margin-left:auto;display:flex;align-items:center;justify-content:center;gap:6px;font-size:13px;padding:0} -.instant-images-settings .save-settings .saved i{color:#65c774;font-size:22px} -.instant-images-settings .scroll-section{overflow:hidden;overflow-y:auto;max-height:550px;padding-right:5px} -.instant-images-settings .whats-new ul{margin:0;padding:0;display:grid;grid-gap:10px;grid-template-columns:repeat(1, 1fr)} -@media screen and (min-width: 800px){.instant-images-settings .whats-new ul{grid-template-columns:repeat(2, 1fr)}} -.instant-images-settings .whats-new ul li{line-height:1.4;width:100%;background-color:rgba(0,0,0,0);padding:0;margin:0;position:relative;display:flex} -.instant-images-settings .whats-new ul li p{font-size:13px;position:relative;z-index:1;margin:0;padding:20px;background-color:#fff;border:1px solid #e1e1e1;border-radius:3px} -.instant-images-settings .whats-new ul li p strong{font-size:14px;color:#434246;display:block;font-weight:700;margin:0 0 5px} -.instant-images-settings .whats-new ul li code{font-size:12px;margin:0;padding:3px;background:#f7f7f7;border-radius:2px;box-shadow:0 0 0 1px #efefef} -.instant-images-settings .general-settings span.desc{font-size:11px;display:block} -.instant-images-settings .general-settings span.desc a{text-decoration:none} -.instant-images-settings .general-settings span.desc a:hover,.instant-images-settings .general-settings span.desc a:focus{text-decoration:underline} -.instant-images-settings .instant-images-settings h3,.instant-images-settings .instant-images-settings h4{margin-top:0} -.instant-images-settings .form-table{margin:0;border:none;position:relative;top:-5px} -.instant-images-settings .form-table td,.instant-images-settings .form-table p{font-size:14px} -.instant-images-settings .form-table th{display:none} -.instant-images-settings .form-table td{border-top:0;padding:0 0 25px;float:left;width:100%;margin:0} -.instant-images-settings .form-table td:empty{padding:0} -.instant-images-settings .form-table .form-msg{display:block;line-height:18px;padding:12px 12px 12px 15px;margin:15px 0 0;color:#6b6877;background-color:#fff9ea;border-left:5px solid #dfd8c2;border-radius:2px} -.instant-images-settings .form-table .form-msg span{display:block;padding:6px 0 3px} -.instant-images-settings .other-plugins .cnkt-plugin-installer{width:100% !important;position:static;display:grid;grid-template-columns:repeat(1, 1fr);grid-gap:10px;padding:0} -@media screen and (min-width: 1500px){.instant-images-settings .other-plugins .cnkt-plugin-installer{grid-template-columns:repeat(2, 1fr)}} -.instant-images-settings .other-plugins .cnkt-plugin-installer .plugin{width:100%;padding:0 !important;margin:0 !important;line-height:1.45;border-color:#e1e1e1;border-radius:3px;overflow:hidden} -.instant-images-settings .other-plugins .cnkt-plugin-installer .plugin h2{margin-bottom:5px} -.instant-images-settings .other-plugins .cnkt-plugin-installer .plugin p{padding:0;margin:0 0 5px} -.instant-images-settings .other-plugins .cnkt-plugin-installer::after{display:none} -.instant-images-settings .license-settings--item{border:1px solid #e1e1e1;padding:20px;border-radius:3px;margin:0 0 20px} -.instant-images-settings .license-settings--item:last-of-type{margin:0} -.instant-images-settings .license-settings--item p.submit{margin:0} -.instant-images-settings .license-settings--status{margin-bottom:10px} -.instant-images-settings .license-settings--status>div{position:relative} -.instant-images-settings .license-settings--status.invalid{background-color:rgba(223,51,51,.05);border-left:4px solid #df3333;padding:20px;border-radius:3px} -.instant-images-settings .license-settings--status input{padding-left:35px !important} -.instant-images-settings .license-settings--status input[disabled]{color:#98979d;cursor:not-allowed} -.instant-images-settings .license-settings--status span{width:30px;text-align:center;color:#65c774;margin-right:5px;position:absolute;top:50%;left:5px;transform:translateY(-50%)} -.instant-images-settings .license-settings--status span.dashicons-warning{color:#df3333} -.instant-images-settings .license-settings--status p{font-size:12px;padding:12px 5px 0;margin:0} -.instant-images-settings .license-settings--empty{background-color:rgba(88,110,198,.05);border-left:4px solid #abf;padding:20px;border-radius:3px} -.instant-images-settings .license-settings--empty p:last-of-type{margin:0} -.instant-images-header-wrap h1,.instant-images-header-wrap-alt h1{padding:0;margin:4px 0 0;font-weight:800;font-size:24px;max-width:70%} -@media screen and (max-width: 800px){.instant-images-header-wrap h1,.instant-images-header-wrap-alt h1{max-width:100%;width:100%;text-align:center}} -.instant-images-header-wrap h1 em,.instant-images-header-wrap-alt h1 em{font-weight:400;font-size:12px;background-color:rgba(0,0,0,.035);color:#6b6877;display:inline-block;border-radius:3px;padding:5px;position:relative;top:-2px;left:2px;font-style:normal;line-height:1} -span.instant-images-tagline{display:block;padding:0;color:#98979d;font-size:14px;line-height:1.45;font-weight:400} -.instant-images-header-wrap-alt{display:block;text-align:center;padding:0 0 20px;border-bottom:1px solid #e1e1e1} -.instant-images-header-wrap-alt h1{width:100%;height:auto;max-width:none;display:block;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTx0aXRsZT5JbnN0YW50IEltYWdlcyBJY29uPC90aXRsZT4KCTxwYXRoIGQ9Ik0wIDhDMCAzLjU4MTcyIDMuNTgxNzIgMCA4IDBINzJDNzYuNDE4MyAwIDgwIDMuNTgxNzIgODAgOFY3MkM4MCA3Ni40MTgzIDc2LjQxODMgODAgNzIgODBIOEMzLjU4MTcyIDgwIDAgNzYuNDE4MyAwIDcyVjhaIiBmaWxsPSIjNjQ3RkU4Ii8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE2SDQ0LjQzODVWMTYuMTIxNUwyNyA0NC4wNjkzSDM2LjVWNjVaIiBmaWxsPSJ3aGl0ZSIvPgoJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNi41IDY1TDUyLjUgMzYuNTgxNkg0NC40Mzg1VjE2LjEyMTVMMjcgNDQuMDY5M0gzNi41VjY1WiIgZmlsbD0id2hpdGUiLz4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzYuNSA2NUw1Mi41IDM2LjU4MTdINDQuNDM4NUwzNi41IDQ0LjA2OTNWNjVaIiBmaWxsPSIjQzdEMkZGIi8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE3SDQ0LjQzODVMMzYuNSA0NC4wNjkzVjY1WiIgZmlsbD0iI0M3RDJGRiIvPgo8L3N2Zz4K) no-repeat center 15px;background-size:50px 50px;padding:80px 5px 0;margin:0 0 15px} -.instant-images-header-wrap-alt h1 span{padding-top:10px} -.instant-images-header-wrap-alt h1+p{margin:0} -.instant-images-header-wrap{background:#f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTx0aXRsZT5JbnN0YW50IEltYWdlcyBJY29uPC90aXRsZT4KCTxwYXRoIGQ9Ik0wIDhDMCAzLjU4MTcyIDMuNTgxNzIgMCA4IDBINzJDNzYuNDE4MyAwIDgwIDMuNTgxNzIgODAgOFY3MkM4MCA3Ni40MTgzIDc2LjQxODMgODAgNzIgODBIOEMzLjU4MTcyIDgwIDAgNzYuNDE4MyAwIDcyVjhaIiBmaWxsPSIjNjQ3RkU4Ii8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE2SDQ0LjQzODVWMTYuMTIxNUwyNyA0NC4wNjkzSDM2LjVWNjVaIiBmaWxsPSJ3aGl0ZSIvPgoJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNi41IDY1TDUyLjUgMzYuNTgxNkg0NC40Mzg1VjE2LjEyMTVMMjcgNDQuMDY5M0gzNi41VjY1WiIgZmlsbD0id2hpdGUiLz4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzYuNSA2NUw1Mi41IDM2LjU4MTdINDQuNDM4NUwzNi41IDQ0LjA2OTNWNjVaIiBmaWxsPSIjQzdEMkZGIi8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE3SDQ0LjQzODVMMzYuNSA0NC4wNjkzVjY1WiIgZmlsbD0iI0M3RDJGRiIvPgo8L3N2Zz4K) no-repeat 25px 20px;background-size:48px 48px;padding:20px 25px 20px 83px;min-height:88px;overflow:hidden;border-bottom:1px solid #efefef;position:relative;box-shadow:0 2px 5px rgba(0,0,0,.045);display:flex;align-items:center;width:100%} -@media screen and (max-width: 800px){.instant-images-header-wrap{display:block;background-position:center 20px;padding:80px 25px 20px;text-align:center}} -.instant-images-header-wrap>div{margin-left:auto;display:flex;gap:10px;padding-left:10px} -@media screen and (max-width: 800px){.instant-images-header-wrap>div{width:100%;justify-content:center;padding-top:20px;padding-left:0}} -@media screen and (max-width: 800px){.instant-images-header-wrap a.button{position:static;display:inline-block}} -.instant-img-container[data-media-popup=true]{background:#fff} -.instant-img-container[data-media-popup=true] .instant-images-header-wrap{display:none} -.instant-img-container[data-media-popup=true] .instant-images-wrapper{padding:0 16px} -.instant-images-sidebar-icon,.instant-images-sidebar-icon svg{display:inline-flex;flex:0 0 auto} -.instant-images-sidebar-icon svg{height:20px;width:20px} -.instant-images-sidebar-icon svg,.instant-images-sidebar-icon svg *{stroke:#586ec6 !important;fill:#586ec6 !important} -button[aria-expanded=true] .instant-images-sidebar-icon svg,button[aria-expanded=true] .instant-images-sidebar-icon svg *{stroke:#abf !important;fill:#abf !important} -.instant-images-block #photos::after,.components-panel #photos::after{width:100%;left:0} -.instant-images-block .instant-images-no-results,.components-panel .instant-images-no-results{padding:40px} -.instant-images-block .instant-images-no-results h3,.components-panel .instant-images-no-results h3{font-size:18px} -.instant-images-block .instant-images-no-results p,.components-panel .instant-images-no-results p{font-size:13px} -.instant-images-block .search-results-text,.components-panel .search-results-text{font-size:12px;border-top:1px solid #ddd;border-color:#ddd} -.instant-images-block .search-results-text .search-results-clear,.components-panel .search-results-text .search-results-clear{display:none} -.instant-images-block .search-header,.components-panel .search-header{display:none} -.instant-images-block .provider-nav,.components-panel .provider-nav{width:100%;padding:10px 5px;margin:0;border-bottom-color:#ddd} -.instant-images-block .provider-nav button,.components-panel .provider-nav button{font-size:13px} -.instant-images-block .control-nav--filters,.components-panel .control-nav--filters{display:grid;grid-template-columns:repeat(2, 1fr);grid-template-rows:1fr;grid-column-gap:10px} -.instant-images-block .control-nav .filter-dropdown,.components-panel .control-nav .filter-dropdown{width:100%;display:none} -.instant-images-block .control-nav .filter-dropdown:nth-child(1),.instant-images-block .control-nav .filter-dropdown:nth-child(2),.components-panel .control-nav .filter-dropdown:nth-child(1),.components-panel .control-nav .filter-dropdown:nth-child(2){display:block} -.instant-images-block .control-nav .filter-dropdown button,.components-panel .control-nav .filter-dropdown button{padding:5px;font-size:13px} -.instant-images-block .control-nav .filter-dropdown button.filter-dropdown--button,.components-panel .control-nav .filter-dropdown button.filter-dropdown--button{display:block} -.instant-images-block .control-nav .filter-dropdown button.filter-dropdown--button i,.components-panel .control-nav .filter-dropdown button.filter-dropdown--button i{margin-left:auto;padding-right:5px} -.instant-images-block .control-nav .filter-dropdown--menu,.components-panel .control-nav .filter-dropdown--menu{width:100%;left:0;padding:6px} -.instant-images-block .control-nav .filter-dropdown--menu button,.components-panel .control-nav .filter-dropdown--menu button{gap:8px} -.instant-images-block .control-nav .filter-dropdown .filter-dropdown--button-label,.components-panel .control-nav .filter-dropdown .filter-dropdown--button-label{display:block;font-size:10px;text-transform:uppercase;margin:0 0 2px} -.instant-images-block .control-nav .filter-dropdown .filter-dropdown--button-selected,.components-panel .control-nav .filter-dropdown .filter-dropdown--button-selected{display:flex;align-items:center;width:100%;font-size:14px} -.instant-images-block .control-nav--search,.components-panel .control-nav--search{float:none;width:100%;padding:0;clear:both;margin:0} -.instant-images-block .control-nav--search form,.components-panel .control-nav--search form{height:auto} -.instant-images-block .control-nav--search::before,.components-panel .control-nav--search::before{display:none} -.instant-images-block .control-nav--search button[type=submit],.components-panel .control-nav--search button[type=submit]{display:none} -.instant-images-block .control-nav--search input,.components-panel .control-nav--search input{line-height:40px;height:40px;padding-right:10px;padding-left:10px;border-color:#e2e4e7;font-size:13px;border-radius:3px !important;background-position:8px center} -.instant-images-block .control-nav--search input.searching,.components-panel .control-nav--search input.searching{padding-left:30px} -.instant-images-block .control-nav--search input[type=search]::-webkit-input-placeholder,.components-panel .control-nav--search input[type=search]::-webkit-input-placeholder{font-size:13px} -.instant-images-block .control-nav--search input[type=search]:-moz-placeholder,.components-panel .control-nav--search input[type=search]:-moz-placeholder{font-size:13px} -.instant-images-block .control-nav--search input[type=search]:-ms-input-placeholder,.components-panel .control-nav--search input[type=search]:-ms-input-placeholder{font-size:13px} -.instant-images-block .control-nav--search-tooltip,.components-panel .control-nav--search-tooltip{right:3px;left:auto;top:2px;border-radius:2px;font-size:12px;height:36px;line-height:35px} -.instant-images-block .control-nav--search-tooltip::before,.instant-images-block .control-nav--search-tooltip::after,.components-panel .control-nav--search-tooltip::before,.components-panel .control-nav--search-tooltip::after{display:none} -.instant-images-block .instant-img-container{border:1px solid #e1e1e1;border-radius:3px;box-shadow:0 0 0 5px #f7f7f7;padding:0} -.instant-images-block--header{padding:15px;display:flex;align-items:center;width:100%;background-color:#f7f7f7;border-bottom:1px solid #e1e1e1;box-shadow:0 2px 5px rgba(0,0,0,.045);border-radius:3px 3px 0 0} -.instant-images-block--header-logo{display:flex;align-items:center} -.instant-images-block--header-logo svg{width:32px;height:32px;margin-right:8px} -.instant-images-block--header-logo span{font-weight:600;font-size:15px;color:#434246} -.instant-images-block--header-nav{margin-left:auto} -.instant-images-block input#search-input{border:1px solid #ddd} -.instant-images-block--loader{height:250px;width:275px;min-width:275px;background:#f7f7f7 url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center;border:1px dashed #efefef;border-radius:3px} -.instant-images-block--loader.done{display:none !important} -.instant-images-block--instructions{width:100%;background-color:#f7f7f7;border-radius:0 0 3px 3px;padding:10px;font-size:12px;display:flex;justify-content:center;color:#434246;font-weight:500;cursor:default} -.instant-images-block--instructions span{opacity:.5;margin:0 5px;font-weight:400} -.instant-images-block .load-more-wrap,.instant-images-block .loading-block{display:none !important} -.instant-images-block .control-nav{padding:15px;margin:0;display:grid;grid-template-columns:repeat(2, 1fr);grid-template-rows:1fr;grid-column-gap:10px} -.instant-images-block #photo-listing{display:block;width:100%;min-height:325px;padding:15px;overflow:hidden} -.instant-images-block #photo-listing::after{background-position:center 43%} -.instant-images-block #photo-listing #photos--wrap{display:flex} -.instant-images-block #photo-listing #photos{display:flex;flex-wrap:nowrap;overflow-x:auto;width:100%;padding:0 0 10px;margin:0} -.instant-images-block #photo-listing #photos .photo{opacity:1 !important;margin-right:10px;width:275px;min-width:275px;height:250px} -.instant-images-block #photo-listing #photos .photo-wrap,.instant-images-block #photo-listing #photos .img-wrap,.instant-images-block #photo-listing #photos button.photo-upload{width:275px;height:250px} -.instant-images-block #photo-listing #photos button.photo-upload img{-o-object-fit:cover;object-fit:cover;width:100% !important;height:100% !important} -.components-panel #photo-listing{width:100%;margin:0;padding:5px 10px;overflow:hidden} -.components-panel #photo-listing .photo{width:100%;display:block;opacity:1 !important;margin:0 0 10px;padding:0} -.components-panel .control-nav{padding:10px 5px;border-bottom:1px solid #ddd;margin:0 0 10px;display:block} -.components-panel .control-nav--filters-wrap{flex:none;width:100%;display:block;margin-bottom:10px} -.media-frame-router button#menu-item-instantimages.active{background-color:#f7f7f7} -.instant-img-container #tooltip{padding:8px 10px;background:#fff;position:fixed;left:auto;top:auto;z-index:999;display:block;opacity:0;visibility:hidden;margin-top:-37px;font-size:12px;color:rgba(67,66,70,.75);text-align:center;line-height:1;border-radius:2px;box-shadow:0 2px 3px rgba(0,0,0,.1);transition:transform .25s cubic-bezier(0.24, 0.22, 0.015, 1.56),opacity .15s ease-in-out,visibility .15s ease-in-out;transform:scale(0.8)} -.instant-img-container #tooltip::after{top:100%;right:17px;border:solid rgba(0,0,0,0);content:"";height:0;width:0;position:absolute;pointer-events:none;border-color:rgba(255,255,255,0);border-top-color:#fff;border-width:5px;margin-left:-5px} -.instant-img-container #tooltip.above{margin-top:37px} -.instant-img-container #tooltip.above::after{top:-5px;border-top:none;border-bottom-color:#fff} -.instant-img-container #tooltip.over{transform:scale(1);opacity:.9;visibility:visible} -.instant-images-no-results{display:block;padding:100px;text-align:center;position:relative} -.instant-images-no-results::before{content:"";font-family:"FontAwesome";display:block;position:absolute;z-index:0;top:50%;left:50%;font-size:125px;opacity:.1;transform:translateY(-50%) translateX(-50%)} -.instant-images-no-results>div{position:relative;z-index:10} -.instant-images-no-results h3{font-size:24px;line-height:1.2;margin:0 0 10px !important;font-weight:700} -.instant-images-no-results p{font-size:16px;margin:0} -@media screen and (max-width: 800px){.instant-images-no-results{padding:50px}} -.provider-nav{display:flex;flex-wrap:nowrap;width:calc(100% + 50px);margin-left:-25px;padding:10px 25px;border-bottom:1px solid #efefef;box-shadow:0 2px 5px rgba(0,0,0,.045);background-color:#f7f7f7;position:relative;overflow-x:auto} -.provider-nav>div{position:relative;margin:0 5px} -.provider-nav>div:first-of-type{margin-left:0} -.provider-nav>div:last-of-type{margin-left:0} -.provider-nav--btn{padding:0 10px;margin:0;height:38px;line-height:38px;border:1px solid rgba(0,0,0,0);background:rgba(0,0,0,0);cursor:pointer;position:relative;border-radius:3px;font-size:14px;color:#98979d;transition:all .2s ease;background-color:#f7f7f7;display:flex;align-items:center} -.provider-nav--btn svg{width:20px;height:20px;margin-right:8px} -.provider-nav--btn:hover,.provider-nav--btn:focus{color:#434246} -.provider-nav--btn[disabled]{opacity:.5;cursor:not-allowed;pointer-events:none} -.provider-nav--btn.active{background-color:#fff;border-color:#ccc;color:#434246;cursor:default;box-shadow:0 0 6px rgba(0,0,0,.075)} -.provider-nav--new{color:#434246;background-color:#ffe732;font-size:9px;text-transform:uppercase;display:inline;padding:3px 4px;border-radius:3px;margin-left:5px;position:relative;top:-1px;letter-spacing:-0.05rem} -.media-frame-content .instant-img-container .api-lightbox>div{top:0} -.instant-images-block .instant-img-container .api-lightbox,.instant-images-block .instant-img-container .api-lightbox.error-lightbox,.components-panel .instant-img-container .api-lightbox,.components-panel .instant-img-container .api-lightbox.error-lightbox{align-items:flex-start} -.instant-images-block .instant-img-container .api-lightbox .more-info,.instant-images-block .instant-img-container .api-lightbox.error-lightbox .more-info,.components-panel .instant-img-container .api-lightbox .more-info,.components-panel .instant-img-container .api-lightbox.error-lightbox .more-info{display:none} -.instant-images-block .instant-img-container .api-lightbox>div,.instant-images-block .instant-img-container .api-lightbox.error-lightbox>div,.components-panel .instant-img-container .api-lightbox>div,.components-panel .instant-img-container .api-lightbox.error-lightbox>div{top:0} -.instant-images-block .instant-img-container .api-lightbox:not(.error-lightbox) .action-controls,.components-panel .instant-img-container .api-lightbox:not(.error-lightbox) .action-controls{display:none} -.instant-img-container .api-lightbox{display:flex;align-items:flex-start;justify-content:center;position:absolute;z-index:99999;left:-5px;top:0;right:0;bottom:0;height:auto;border-radius:6px;padding:5%;background-color:rgba(0,0,0,0);font-size:13px;width:calc(100% + 10px)} -.instant-img-container .api-lightbox.error-lightbox{align-items:center;background-color:rgba(0,0,0,.5)} -.instant-img-container .api-lightbox.error-lightbox>div{top:0} -.instant-img-container .api-lightbox.error-lightbox .api-lightbox--details::before,.instant-img-container .api-lightbox.error-lightbox .api-lightbox--details::after{display:none !important} -.instant-img-container .api-lightbox.active>div{transform:scale(1);opacity:1} -.instant-img-container .api-lightbox>div{max-width:450px;width:100%;padding:0;background-color:#fff;border-radius:5px;box-shadow:0 3px 10px rgba(0,0,0,.15);position:relative;top:-15px;transform:scale(0.9);opacity:0;transition:all .25s ease;overflow:hidden} -.instant-img-container .api-lightbox>div>div{position:relative} -.instant-img-container .api-lightbox--details{border-bottom:1px solid #e1e1e1;padding:25px;padding-bottom:20px;position:relative} -.instant-img-container .api-lightbox--details::after,.instant-img-container .api-lightbox--details::before{top:100%;left:50px;border:solid rgba(0,0,0,0);content:"";height:0;width:0;position:absolute;pointer-events:none} -.instant-img-container .api-lightbox--details::after{border-color:rgba(255,255,255,0);border-top-color:#fff;border-width:10px;margin-left:-10px} -.instant-img-container .api-lightbox--details::before{border-color:rgba(194,225,245,0);border-top-color:#e1e1e1;border-width:11px;margin-left:-11px} -.instant-img-container .api-lightbox--details h3{font-size:16px;line-height:18px;padding:0;text-transform:uppercase;margin:0 0 15px;display:flex;width:100%;align-items:center} -.instant-img-container .api-lightbox--details h3 svg{width:20px;height:20px;margin-right:8px} -.instant-img-container .api-lightbox--details p{margin:10px 0 0;font-size:13px} -.instant-img-container .api-lightbox--details p.callout-warning{font-size:34px;font-weight:900;opacity:.35} -.instant-img-container .api-lightbox--details p.more-info{padding:10px;background-color:#fffadc;margin:15px 0;border-radius:3px;border:1px solid #efefef;width:105%;position:relative;left:-2.5%} -.instant-img-container .api-lightbox--details p.action-controls{display:flex;align-items:center;width:100%;line-height:1} -.instant-img-container .api-lightbox--details p.action-controls button{font-size:12px;font-weight:500;color:#586ec6;background-color:rgba(0,0,0,0);border:none;padding:8px 0;margin:0;cursor:pointer} -.instant-img-container .api-lightbox--details p.action-controls button:hover,.instant-img-container .api-lightbox--details p.action-controls button:focus{color:#455cb6;text-decoration:underline} -.instant-img-container .api-lightbox--details p.action-controls span{display:inline-block;opacity:.35;padding:0 8px} -.instant-img-container .api-lightbox--close{position:absolute;z-index:1;right:0;top:0;border:none;background-color:rgba(0,0,0,0);width:40px;height:40px;display:flex;align-items:center;justify-content:center;font-size:25px;cursor:pointer;opacity:.5} -.instant-img-container .api-lightbox--close:hover,.instant-img-container .api-lightbox--close:focus{opacity:1} -.instant-img-container .api-lightbox form{display:block;background-color:#f7f7f7;padding:25px} -.instant-img-container .api-lightbox label,.instant-img-container .api-lightbox button[type=submit]{font-size:12px;text-transform:uppercase;font-weight:600;display:block;padding:0;margin:0 0 5px;cursor:pointer} -.instant-img-container .api-lightbox--input-wrap{display:flex;width:100%;padding:0;margin-bottom:10px;background-color:#fff;border:1px solid #e1e1e1;border-radius:3px;transition:all .25s ease} -.instant-img-container .api-lightbox--input-wrap:focus-within{border-color:#98979d;box-shadow:0 0 1px 4px rgba(0,0,0,.065)} -.instant-img-container .api-lightbox--input-wrap span{width:40px;height:40px;display:flex;justify-content:center;align-items:center;border-radius:2px 0 0 2px;border-right:1px solid #e1e1e1;background-color:#f7f7f7} -.instant-img-container .api-lightbox--input-wrap span i{font-size:16px} -.instant-img-container .api-lightbox--input-wrap span.invalid{cursor:help} -.instant-img-container .api-lightbox--input-wrap span.invalid i{color:#cfa345} -.instant-img-container .api-lightbox--input-wrap span.valid i{color:#65c774} -.instant-img-container .api-lightbox--input-wrap span.loading i{color:#434246} -.instant-img-container .api-lightbox--input-wrap input{line-height:40px;height:40px;padding:0 10px;background-color:rgba(0,0,0,0);border:none;flex:1;font-size:12px} -.instant-img-container .api-lightbox--input-wrap input::-webkit-input-placeholder{color:#98979d;font-weight:400;font-style:italic} -.instant-img-container .api-lightbox--input-wrap input:-moz-placeholder{color:#98979d;font-weight:400;font-style:italic} -.instant-img-container .api-lightbox--input-wrap input::-moz-placeholder{color:#98979d;font-weight:400;font-style:italic} -.instant-img-container .api-lightbox--input-wrap input:-ms-input-placeholder{color:#98979d;font-weight:400;font-style:italic} -.instant-img-container .api-lightbox--input-wrap input:focus{background:rgba(0,0,0,0);outline:none;border:none;box-shadow:none} -.instant-img-container .api-lightbox button[type=submit]{width:100%;border:none;background-color:#586ec6;color:#fff;border-radius:3px;padding:0 10px;line-height:46px;height:46px;margin:0} -.instant-img-container .api-lightbox button[type=submit]:hover,.instant-img-container .api-lightbox button[type=submit]:focus{background-color:#455cb6} -.instant-img-container .api-lightbox--response{color:#df3333;margin:0;font-size:13px;font-weight:500;padding:0 2px 12px} -.instant-img-container .api-lightbox--response.valid{color:#51a75e} -.filter-dropdown{position:relative} -.filter-dropdown button{background-color:rgba(0,0,0,0);border:none;text-align:left;color:#98979d;cursor:pointer} -.filter-dropdown button[disabled]{cursor:default;pointer-events:none} -.filter-dropdown--button{display:flex;align-items:center;gap:5px;padding:10px 2px 10px 0;text-transform:capitalize;color:#98979d;width:100%;font-size:14px} -.filter-dropdown--button span.filter-dropdown--button-label{padding-right:3px} -.filter-dropdown--button span.filter-dropdown--button-selected{color:#434246;font-weight:500} -.filter-dropdown--button i{opacity:.4;margin-left:10px;font-size:14px} -.filter-dropdown--button:hover i,.filter-dropdown--button:focus i{opacity:1} -.filter-dropdown--menu{display:block;visibility:hidden;opacity:0;transform:scale(0.9);transition:transform .25s cubic-bezier(0.24, 0.22, 0.015, 1.56),opacity .15s ease-in-out,visibility .15s ease-in-out;padding:10px;background-color:#fff;border:1px solid #e1e1e1;border-radius:3px;box-shadow:0 8px 16px rgba(48,63,122,.175);z-index:9999;position:absolute;top:110%;left:-12px;width:200px;max-height:350px;overflow-y:auto} -.filter-dropdown--menu.expanded{visibility:visible;opacity:1;transform:scale(1);top:100%} -.filter-dropdown--menu button{display:flex;align-items:center;gap:8px;width:100%;text-transform:capitalize;padding:6px;transition:all .25s ease;font-size:14px} -.filter-dropdown--menu button::before{font-family:"FontAwesome";content:"";display:block;color:#ccc;opacity:.4;font-size:12px;margin-top:1px} -.filter-dropdown--menu button:hover,.filter-dropdown--menu button:focus{color:#434246} -.filter-dropdown--menu button:hover::before,.filter-dropdown--menu button:focus::before{opacity:.75} -.filter-dropdown--menu button.selected{color:#434246;cursor:default} -.filter-dropdown--menu button.selected::before{color:#434246;opacity:1} -.filter-dropdown--menu[data-key=colors] button ._color,.filter-dropdown--menu[data-key=color] button ._color{margin-left:auto;width:14px;height:14px;border-radius:50%;background-color:currentcolor;box-shadow:0 0 0 1px rgba(0,0,0,.075)} -.instant-images-settings form{display:block} -.instant-images-settings form.saving,.instant-images-settings form.submitting{pointer-events:none} -.instant-images-settings form>h2,.instant-images-settings form>p.desc{display:none} -.instant-images-settings form select,.instant-images-settings form input[type=text],.instant-images-settings form input[type=number],.instant-images-settings form textarea{color:#6b6877;background-color:#fff;width:100%;padding:10px;border-color:#e1e1e1;line-height:1;border-radius:3px} -.instant-images-settings form select[readonly],.instant-images-settings form input[type=text][readonly],.instant-images-settings form input[type=number][readonly],.instant-images-settings form textarea[readonly]{background-color:#f7f7f7;cursor:not-allowed;opacity:.5;border-color:#e1e1e1 !important} -.instant-images-settings form select:focus,.instant-images-settings form input[type=text]:focus,.instant-images-settings form input[type=number]:focus,.instant-images-settings form textarea:focus{outline:none;border-color:#586ec6;box-shadow:0 0 0 1px #586ec6,0 0 0 4px rgba(88,110,198,.1)} -.instant-images-settings form select{padding:12px 10px;max-width:none} -.instant-images-settings form select:hover{color:#6b6877} -.instant-images-settings form label,.instant-images-settings form .fake-label{color:#434246;display:block;font-weight:600;clear:both;float:none;margin:0 0 10px;padding:0} -.instant-images-settings form label.provider-label,.instant-images-settings form .fake-label.provider-label{display:flex;width:100%;align-items:center;gap:10px;justify-content:space-between} -.instant-images-settings form label.provider-label a,.instant-images-settings form .fake-label.provider-label a{font-size:12px;font-weight:400;display:block;padding:0 2px;text-decoration:none;position:relative;top:1px} -.instant-images-settings form label.provider-label a:hover,.instant-images-settings form label.provider-label a:focus,.instant-images-settings form .fake-label.provider-label a:hover,.instant-images-settings form .fake-label.provider-label a:focus{color:#455cb6} -.instant-images-settings form label>span,.instant-images-settings form .fake-label>span{opacity:.8;font-size:13px;font-style:italic} -.instant-images-settings form .api-constant{display:block;padding:10px 0 0 1px;opacity:.75;font-size:12px} -.instant-images-settings .instant-images-checkbox{padding:3px 0;margin:0;font-weight:400;color:#6b6877;position:relative} -.instant-images-settings .instant-images-checkbox--switch{display:flex;flex-wrap:nowrap;gap:8px;width:100%;position:relative} -.instant-images-settings .instant-images-checkbox--switch .toggle-switch{width:41px;height:23px;position:relative;background-color:rgba(107,104,119,.5);border-radius:9999px;transition:all .25s ease} -.instant-images-settings .instant-images-checkbox--switch .toggle-switch::before{position:absolute;content:"";height:17px;width:17px;left:3px;bottom:3px;border-radius:100%;background-color:#fff;transition:all .25s ease} -.instant-images-settings .instant-images-checkbox--switch .toggle-label{flex:1;padding-top:2px} -.instant-images-settings .instant-images-checkbox input[type=checkbox]{opacity:0;position:absolute;left:-1px} -.instant-images-settings .instant-images-checkbox input[type=checkbox]:checked+div .toggle-switch{background-color:#586ec6} -.instant-images-settings .instant-images-checkbox input[type=checkbox]:checked+div .toggle-switch::before{left:21px} -.instant-images-settings .instant-images-checkbox input[type=checkbox]:checked+div .toggle-switch::after{opacity:1} -.instant-images-settings .instant-images-checkbox input[type=checkbox]:focus+div .toggle-switch{box-shadow:0 0 0 1px #fff,0 0 0 3px #586ec6} -.cta-extended--standard{display:none} -@media screen and (min-width: 800px){.cta-extended--standard{position:relative;padding:15px;margin:25px 0 0;border:1px solid #e1e1e1;background-color:#f7f7f7;border-radius:3px;display:flex;align-items:center;width:100%;gap:10px}.cta-extended--standard i{font-size:24px;opacity:.7;transform:rotate(-5deg);color:#586ec6;margin-top:-2px}.cta-extended--standard p{margin:0;font-size:13px;width:auto}.cta-extended--standard p a{font-weight:600}.cta-extended--standard div{width:auto;margin-left:auto;display:flex;gap:10px}} -.cta-extended--search{position:relative;text-align:center;padding:25px} -.cta-extended--search button.closeBtn{position:absolute;right:0;top:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;color:#98979d;background-color:rgba(0,0,0,0);border:none;cursor:pointer} -.cta-extended--search button.closeBtn:hover,.cta-extended--search button.closeBtn:focus{color:#434246} -.cta-extended--search p{font-size:13px;margin:0 0 12px} -.cta-extended--search p a{font-weight:600} -.cta-extended--search p i{display:block;font-size:25px;opacity:.5;color:#586ec6;margin-bottom:5px} -.cta-extended--search p:last-of-type{margin-bottom:0} -.components-panel .cta-extended{margin:0;flex-direction:column;text-align:center;border-radius:0;border-width:0 0 1px 0;padding:25px 20px} -.components-panel .cta-extended span{display:block} -.components-panel .cta-extended div{width:100%;margin:0;justify-content:center} -.search-header h2{font-size:34px;line-height:1;padding:0;margin:0 0 10px;font-weight:800} -@media screen and (max-width: 800px){.search-header h2{font-size:25px}} -.search-header--text{font-size:14px;line-height:1;margin:0 0 15px;color:#98979d;display:flex;align-items:center;width:100%} -.search-header--text strong,.search-header--text span{display:inline-block} -.search-header--text strong{color:#434246;font-weight:600;margin:0 5px} -.search-header--text span{opacity:.75;margin:0 2px} -.search-header--text button{border:none;background-color:rgba(0,0,0,0);font-size:14px;line-height:1;cursor:pointer;color:#586ec6;font-weight:400;padding:0;margin:0 5px;transition:all .25s ease} -.search-header--text button:hover,.search-header--text button:focus{text-decoration:underline;color:#455cb6} -.search-header .control-nav--filters-wrap{margin:0 0 15px} -.instant-images-extended-import--elements{padding:20px;border-radius:2px 2px 0 0;border:1px solid #e1e1e1;display:grid;grid-gap:20px;grid-template-rows:repeat(1, 1fr)} -@media screen and (min-width: 1024px){.instant-images-extended-import--elements{grid-template-columns:repeat(3, 1fr)}} -.instant-images-extended-import--controls{display:flex;gap:20px;align-items:center;border-radius:0 0 2px 2px;background-color:#f7f7f7;border:1px solid #e1e1e1;border-top:0;padding:20px} -.instant-images-extended-import .import-response{display:none;flex:1;width:50%} -.instant-images-extended-import .import-response.active{display:block} -.instant-images-extended-import .import-response--progress,.instant-images-extended-import .import-response--progress-bar{width:100%;height:5px;background-color:rgba(88,110,198,.25);border-radius:9999px;overflow:hidden} -.instant-images-extended-import .import-response--progress-bar{width:0%;transition:all .5s linear;background-color:#586ec6;border-radius:0 9999px 9999px 0;box-shadow:0 8px 16px rgba(48,63,122,.175)} -.instant-images-extended-import .import-response--message{margin-top:4px;display:block;font-size:12px;color:#6b6877} -.instant-images-extended-import .import-response--message i{margin-right:3px;color:#65c774} -.instant-images-extended-import .import-response--message span{color:#434246} -.instant-images-extended-import .import-response--downloaded{padding:20px 20px 0;font-size:12px} -.wp-block{padding:0 !important} +/*!************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/scss/style.scss (1) ***! + \************************************************************************************************************************************************************************************************************************************************/ +body.media_page_instant-images, +body.settings_page_instant-images-settings { + background: #fff; +} +body.media_page_instant-images #wpcontent, +body.settings_page_instant-images-settings #wpcontent { + padding-left: 0; + padding-bottom: 40px; +} +@media screen and (max-width: 800px) { + body.media_page_instant-images #wpcontent, + body.settings_page_instant-images-settings #wpcontent { + padding-bottom: 0; + } +} +body.media_page_instant-images #wpbody-content, +body.settings_page_instant-images-settings #wpbody-content { + padding-bottom: 0; +} +body.media_page_instant-images #wpfooter, +body.settings_page_instant-images-settings #wpfooter { + padding-top: 0; + padding-bottom: 0; + line-height: 40px; + background: #f7f7f7; + border-top: 1px solid #efefef; + position: fixed; + bottom: 0; + z-index: 1100; +} +body.media_page_instant-images #wpfooter p, +body.settings_page_instant-images-settings #wpfooter p { + line-height: 40px; +} +@media screen and (max-width: 800px) { + body.media_page_instant-images #wpfooter, + body.settings_page_instant-images-settings #wpfooter { + display: none; + } +} +body.media_page_instant-images.overflow-hidden, +body.settings_page_instant-images-settings.overflow-hidden { + overflow: hidden; +} +.instant-img-container { + font-size: 14px; + color: #6b6877; + position: relative; +} +.instant-img-container .offscreen { + position: absolute; + overflow: hidden; + clip: rect(0 0 0 0); + height: 1px; + width: 1px; + margin: -1px; + padding: 0; + border: 0; +} +.instant-img-container * { + box-sizing: border-box; +} +.instant-img-container a { + color: #586ec6; + transition: all 0.25s ease; +} +.instant-img-container a:hover { + color: #5568ae; + text-decoration: none; +} +.instant-img-container img { + max-width: 100%; +} +.instant-img-container p { + display: block; + color: #6b6877; + width: 100%; + clear: both; + text-transform: none; + padding: 0; + margin: 0 0 15px; + font-size: 14px; +} +.instant-img-container .error-messaging { + padding: 22px 22px 22px 60px; + border-radius: 3px; + background: #da4444; + color: #fff; + font-size: 13px; + line-height: 1.75; + margin: 15px 15px 0; + display: block; + position: relative; + box-shadow: 0 8px 16px rgba(48, 63, 122, 0.175); +} +.instant-img-container .error-messaging.warning { + background-color: #cfa345; +} +.instant-img-container .error-messaging strong { + font-size: 15px; + display: block; +} +.instant-img-container .error-messaging::before { + font-family: "FontAwesome"; + content: "\f06a"; + display: block; + left: 18px; + top: 18px; + position: absolute; + font-size: 32px; + opacity: 0.75; +} +.instant-img-container .instant-images-wrapper { + padding: 0 25px 20px; + display: block; + overflow: hidden; + min-height: 400px; + background: url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center; +} +.instant-img-container .instant-images-wrapper.loaded { + background: none; +} +.instant-img-container h2, +.instant-img-container h3, +.instant-img-container h4 { + margin-top: 0; +} +.instant-img-container .save-settings p.submit { + float: left; + margin: 0 2px 0 0; + width: auto; +} +.instant-img-container .save-settings .loading { + width: 46px; + height: 28px; + display: none; + float: left; + background: #fff url(images/ajax-loader.7c5ec6b9.gif) no-repeat center center; +} +#TB_ajaxContent { + clear: both; + line-height: 1.4; + overflow: auto; + text-align: left; + width: 100% !important; + box-sizing: border-box; + padding: 15px !important; +} +.instant-img-container h1, +.instant-img-container h2, +.instant-img-container h3, +.instant-img-container h4 { + color: #434246; + margin-top: 0; +} +.instant-img-container h4 + p { + margin-top: -6px; +} +.instant-img-container p.small { + font-size: 12px; + margin-top: -10px; + opacity: 0.7; +} +.instant-img-container ul { + padding: 0; + margin: 0; + list-style: none; +} +.instant-img-container label, +.instant-img-container input, +.instant-img-container select, +.instant-img-container textarea { + box-shadow: none; +} +.instant-img-container .save-settings { + padding-top: 5px; +} +.instant-img-container label { + padding: 5px 0 7px; +} +#unsplash-form-options h2, +#unsplash-form-options p.desc { + display: none; +} +.instant-img-container input[type=text], +.instant-img-container input[type=number], +.instant-img-container textarea { + padding: 10px; + line-height: 1; + background: #f7f7f7; + width: 100%; + border-radius: 2px; + height: auto; +} +.instant-img-container input[type=text]:focus, +.instant-img-container input[type=number]:focus, +.instant-img-container textarea:focus { + border-color: #98979d; + box-shadow: 0 0 3px #ccc; +} +.instant-img-container .spacer { + display: block; + height: 40px; + overflow: hidden; + clear: both; + width: 100%; +} +.instant-img-container .spacer.sm { + height: 20px; +} +.instant-img-container input:-webkit-autofill { + box-shadow: 0 0 0 1000px #fff inset; +} +.instant-images-settings .button.button-primary, +.instant-img-container .button.button-primary { + background-color: #586ec6; + border-color: #586ec6; + border-radius: 3px; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + transition: all 0.25s ease; +} +.instant-images-settings .button.button-primary:hover, .instant-images-settings .button.button-primary:focus, +.instant-img-container .button.button-primary:hover, +.instant-img-container .button.button-primary:focus { + background-color: #455cb6; + border-color: #455cb6; +} +.instant-images-settings .button.button-primary:focus, +.instant-img-container .button.button-primary:focus { + box-shadow: 0 0 0 1px #fff, 0 0 0 3px #455cb6; +} +.instant-images-settings .button.button-secondary, +.instant-img-container .button.button-secondary { + border-color: #586ec6; + color: #586ec6; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + transition: all 0.25s ease; +} +.instant-images-settings .button.button-secondary:hover, .instant-images-settings .button.button-secondary:focus, +.instant-img-container .button.button-secondary:hover, +.instant-img-container .button.button-secondary:focus { + color: #fff !important; + border-color: #455cb6; + background-color: #455cb6; +} +.instant-images-settings .button.button-secondary:focus, +.instant-img-container .button.button-secondary:focus { + box-shadow: 0 0 0 1px #fff, 0 0 0 3px #455cb6; +} +.instant-img-container .load-more-wrap { + margin: 0; + padding: 0; + text-align: center; + position: relative; + width: 100%; + height: 100px; + display: flex; + align-items: center; + overflow: hidden; +} +.instant-img-container .load-more-wrap::after { + position: absolute; + content: ""; + display: block; + inset: 0; + background: url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center; + opacity: 0; + transition: opacity 0.15s ease; +} +.instant-img-container .load-more-wrap.loading::after { + opacity: 1; +} +.instant-img-container .load-more-wrap.done { + height: 10px; +} +.instant-img-container .load-more-wrap.done::after { + display: none !important; +} +.instant-img-container .load-more-wrap button { + display: none; + margin: 20px 0; + padding: 15px; + font-size: 15px; + font-weight: 600; + transition: all 0.25s ease; + height: auto; + line-height: 1; + cursor: pointer; + background-image: none; + background-repeat: no-repeat !important; + background-position: 15px center !important; +} +.instant-img-container .load-more-wrap button.disabled { + opacity: 0.3; + cursor: default; +} +.instant-img-container .control-nav { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + width: 100%; + margin: 0 0 20px; + padding: 20px 0; + list-style: none; + border-bottom: 1px solid #e1e1e1; +} +@media screen and (max-width: 800px) { + .instant-img-container .control-nav { + justify-content: center; + } +} +.instant-img-container .control-nav::after { + content: ""; + display: table; + clear: both; +} +.instant-img-container .control-nav--filters-wrap { + flex: 1; + position: relative; + transition: all 0.3s ease 0.15s; +} +@media screen and (max-width: 800px) { + .instant-img-container .control-nav--filters-wrap { + flex: none; + width: 100%; + } +} +.instant-img-container .control-nav--filters-wrap.inactive { + opacity: 0.35; + filter: blur(1px); + pointer-events: none; +} +.instant-img-container .control-nav--filters-wrap.inactive i { + opacity: 0.4 !important; +} +.instant-img-container .control-nav--filters-wrap.inactive * { + cursor: not-allowed; +} +.instant-img-container .control-nav--filters { + position: relative; + display: flex; + flex-wrap: wrap; + align-items: center; + -moz-column-gap: 20px; + column-gap: 20px; + width: 100%; +} +.instant-img-container .control-nav--filters::before { + display: block; + display: none; + content: "\f0b0"; + font-family: "FontAwesome"; + color: #efefef; + font-size: 24px; + margin-right: 10px; +} +.instant-img-container .control-nav--filters label { + border-left: none; + display: block; + min-width: 125px; + padding: 0; + margin: 0; +} +.instant-img-container .control-nav--filters label span { + display: block; + text-transform: uppercase; + font-size: 10px; + padding-bottom: 1px; + padding-left: 1px; +} +.instant-img-container .control-nav--filters label:focus-within select:not[disabled] { + border-color: #98979d; + box-shadow: 0 0 1px 5px rgba(0, 0, 0, 0.025); +} +.instant-img-container .control-nav--filters select { + text-transform: capitalize; + width: 100%; + border-color: #ccc; + color: #434246; + background-color: #f7f7f7; + min-height: 36px; + line-height: 36px; + font-size: 14px; + padding: 0 24px 0 8px; +} +.instant-img-container .control-nav--filters select[disabled] { + cursor: not-allowed; +} +.instant-img-container .control-nav--filters select:not[disabled]:hover { + border-color: #98979d; + box-shadow: 0 0 1px 5px rgba(0, 0, 0, 0.025); +} +.instant-img-container .control-nav--search { + display: flex; + width: 30%; + max-width: 350px; + padding: 0; + margin-left: 20px; + position: relative; +} +@media screen and (min-width: 1270px) { + .instant-img-container .control-nav--search { + width: 35%; + } +} +.instant-img-container .control-nav--search.inactive { + opacity: 0.35; + filter: blur(1px); + pointer-events: none; +} +@media screen and (max-width: 800px) { + .instant-img-container .control-nav--search { + width: 100%; + display: block; + position: static; + text-align: left; + max-width: 100%; + padding: 10px 0; + margin: 0; + } +} +.instant-img-container .control-nav--search-tooltip { + position: absolute; + right: 100.5%; + top: -1px; + width: auto; + height: 40px; + line-height: 40px; + padding: 0 0 0 10px; + background: #586ec6; + border: 1px solid #455cb6; + border-radius: 4px; + z-index: 9999; + font-size: 13px; + font-weight: 500; + transition: all 0.25s ease; + color: #fff; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + display: flex; + align-items: center; +} +.instant-img-container .control-nav--search-tooltip span { + cursor: help; +} +.instant-img-container .control-nav--search-tooltip button { + cursor: pointer; + color: #fff; + background-color: transparent !important; + padding: 0; + line-height: 1; + width: 28px; + font-weight: 700; + opacity: 0.65; + display: flex; + align-items: center; + justify-content: center; + font-size: 14px; + height: 100%; + border: none !important; + box-shadow: none !important; +} +.instant-img-container .control-nav--search-tooltip button:hover, .instant-img-container .control-nav--search-tooltip button:focus { + opacity: 1; +} +.instant-img-container .control-nav--search-tooltip::after, .instant-img-container .control-nav--search-tooltip::before { + left: 100%; + top: 50%; + border: solid transparent; + content: ""; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + z-index: 100; +} +.instant-img-container .control-nav--search-tooltip::after { + border-color: rgba(223, 225, 173, 0); + border-left-color: #586ec6; + border-width: 6px; + margin-top: -6px; +} +.instant-img-container .control-nav--search-tooltip::before { + border-color: rgba(0, 0, 0, 0); + border-left-color: #455cb6; + border-width: 7px; + margin-top: -7px; +} +.instant-img-container .control-nav--search-tooltip.hide { + opacity: 0; + visibility: hidden; +} +@media screen and (max-width: 800px) { + .instant-img-container .control-nav--search-tooltip { + right: 0; + top: 0; + border-radius: 0 3px 3px 0; + } + .instant-img-container .control-nav--search-tooltip::after, .instant-img-container .control-nav--search-tooltip::before { + display: none; + } +} +.instant-img-container .control-nav--search form { + padding: 0 1px 0 0; + margin: 0; + position: relative; + height: 38px; + display: block; + width: 100%; +} +.instant-img-container .control-nav--search form:hover button[type=submit] { + opacity: 1; +} +.instant-img-container .control-nav--search input { + background-color: #fff; + color: #434246; + width: 100%; + padding: 0 15px 0 38px; + border-color: #e1e1e1; + height: 38px; + line-height: 38px; + border-radius: 3px; + font-size: 14px; + background-position: right 10px center; + background-repeat: no-repeat; + margin: 0; +} +.instant-img-container .control-nav--search input[disabled] { + cursor: not-allowed; +} +.instant-img-container .control-nav--search input:focus { + outline: none; + border-color: #586ec6; + box-shadow: 0 0 0 1px #586ec6, 0 0 0 4px rgba(88, 110, 198, 0.1); +} +.instant-img-container .control-nav--search input.searching { + background-image: url(images/ajax-loader.7c5ec6b9.gif); +} +.instant-img-container .control-nav--search input[type=text]::-webkit-search-decoration, +.instant-img-container .control-nav--search input[type=text]::-webkit-search-cancel-button, +.instant-img-container .control-nav--search input[type=text]::-webkit-search-results-button, +.instant-img-container .control-nav--search input[type=text]::-webkit-search-results-decoration { + -webkit-appearance: none; +} +.instant-img-container .control-nav--search button[type=submit] { + position: absolute; + left: 1px; + top: 0; + width: 38px; + height: 38px; + line-height: 38px; + border-radius: 3px; + z-index: 1; + border: none !important; + background: transparent !important; + cursor: pointer; + color: #6b6877; + box-shadow: none !important; + transition: all 0.25s ease; + margin: 0; + padding: 0; + font-size: 18px; +} +.instant-img-container .control-nav--search button[type=submit]:hover, .instant-img-container .control-nav--search button[type=submit]:focus { + color: #434246; +} +.instant-img-container .control-nav--search button[type=submit][disabled] { + cursor: not-allowed; +} +.instant-img-container .control-nav--search input[type=text]::-moz-placeholder { + color: #98979d; + font-weight: 400; + font-style: normal; + font-size: 14px; +} +.instant-img-container .control-nav--search input[type=text]::placeholder { + color: #98979d; + font-weight: 400; + font-style: normal; + font-size: 14px; +} +.instant-img-container .control-nav--search-history { + position: absolute; + z-index: 99999; + top: 100%; + left: -1.5%; + width: 103%; + padding: 15px; + margin-top: 5px; + background: #fff; + border-radius: 3px; + border: 1px solid #e1e1e1; + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1019607843), 0 1px 3px -1px rgba(0, 0, 0, 0.1019607843) !important; + font-size: 13px; + opacity: 0; + visibility: hidden; + transition: all 0.15s ease 0.1s; +} +.instant-img-container .control-nav--search-history.active { + opacity: 1; + visibility: visible; +} +.instant-img-container .control-nav--search-history button { + color: #6b6877; + cursor: pointer; + background-color: transparent; + border: none; + text-align: left; +} +.instant-img-container .control-nav--search-history button:hover, .instant-img-container .control-nav--search-history button:focus { + color: #434246; +} +.instant-img-container .control-nav--search-history-title { + display: flex; + align-items: center; + width: 100%; + gap: 15px; + border-bottom: 1px solid #e1e1e1; + padding-bottom: 5px; + margin-bottom: 10px; + margin-top: 20px; +} +.instant-img-container .control-nav--search-history-title:first-of-type { + margin-top: 0; +} +.instant-img-container .control-nav--search-history-title div { + font-size: 12px; + color: #434246; + text-transform: uppercase; + font-weight: 500; + cursor: default; +} +.instant-img-container .control-nav--search-history-title button { + margin-left: auto; + font-size: 13px; + padding: 0 1px; +} +.instant-img-container .control-nav--search-history ul li { + margin: 0; + font-size: 13px; +} +.instant-img-container .control-nav--search-history ul.search-history { + display: flex; + flex-wrap: wrap; + gap: 6px; +} +.instant-img-container .control-nav--search-history ul.search-history button { + padding: 6px 10px; + border-radius: 3px; + border: 1px solid #e1e1e1; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.instant-img-container .control-nav--search-history ul.search-history button:hover, .instant-img-container .control-nav--search-history ul.search-history button:focus { + background-color: #f7f7f7; +} +.instant-img-container .control-nav--search-history ul.search-suggestions { + display: block; +} +.instant-img-container .control-nav--search-history ul.search-suggestions button { + background-color: transparent; + border: none; + padding: 5px 0; + width: 100%; +} +.instant-img-container .control-nav--search-history.extended-cta { + padding: 0; +} +#photo-listing { + position: relative; + min-height: 500px; + height: 100%; +} +#photo-listing::after { + visibility: hidden; + opacity: 0; + display: block; + content: ""; + position: absolute; + width: calc(100% + 50px); + height: 100%; + left: -25px; + top: 0; + background: rgba(255, 255, 255, 0.9) url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center 90px; + z-index: 9999; + transition: all 0.25s ease; +} +#photo-listing.loading::after { + visibility: visible; + opacity: 1; +} +#photos { + width: 100%; + width: calc(100% + 10px); + margin: 0 0 0 -5px; + padding: 0; + position: relative; + z-index: 1; +} +#photos.inactive { + pointer-events: none; +} +#photos .photo { + width: 20%; + margin: 0; + padding: 0 3px 6px; + opacity: 0; + transition: opacity 0.45s ease; +} +#photos .photo-wrap { + position: relative; + border-radius: 3px; + overflow: hidden; +} +#photos .photo-wrap.photo-uploading button.photo-upload, #photos .photo-wrap.photo-uploaded button.photo-upload, #photos .photo-wrap.photo-success button.photo-upload, #photos .photo-wrap.photo-error button.photo-upload { + background-color: #111; +} +#photos .photo-wrap.photo-uploading button.photo-upload img, #photos .photo-wrap.photo-uploaded button.photo-upload img, #photos .photo-wrap.photo-success button.photo-upload img, #photos .photo-wrap.photo-error button.photo-upload img { + transform: scale(1) !important; + opacity: 0.5 !important; +} +#photos .photo-wrap.photo-uploading .photo-status, #photos .photo-wrap.photo-uploaded .photo-status, #photos .photo-wrap.photo-success .photo-status, #photos .photo-wrap.photo-error .photo-status { + visibility: visible; + opacity: 1; + transform: translate(-50%, -50%) scale(1); +} +#photos .photo-wrap.photo-uploading { + pointer-events: none; +} +#photos .photo-wrap.photo-uploading .photo-status { + background: rgba(255, 255, 255, 0.95) url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center; + background-size: 24px 24px; +} +#photos .photo-wrap.photo-uploading .photo-status::before { + display: none; +} +#photos .photo-wrap.photo-uploading .photo-meta, +#photos .photo-wrap.photo-uploading .photo-controls, #photos .photo-wrap.photo-uploaded .photo-meta, +#photos .photo-wrap.photo-uploaded .photo-controls { + opacity: 0 !important; + visibility: hidden !important; +} +#photos .photo-wrap.photo-uploaded button.photo-upload, #photos .photo-wrap.photo-success button.photo-upload { + cursor: default; +} +#photos .photo-wrap.photo-uploaded .photo-status, #photos .photo-wrap.photo-success .photo-status { + background-color: #65c774; +} +#photos .photo-wrap.photo-uploaded .photo-status::before, #photos .photo-wrap.photo-success .photo-status::before { + content: "\f00c"; + color: #fff; +} +#photos .photo-wrap.photo-error { + cursor: help !important; +} +#photos .photo-wrap.photo-error .photo-status { + background-color: #df3333; +} +#photos .photo-wrap.photo-error .photo-status::before { + content: "\f12a"; + color: #fff; + opacity: 0.8; +} +#photos .photo.in-view { + opacity: 1; +} +#photos .photo .img-wrap { + display: block; + overflow: hidden; + position: relative; +} +@media screen and (min-width: 2000px) { + #photos .photo { + width: 20%; + } +} +@media screen and (max-width: 1500px) { + #photos .photo { + width: 25%; + } +} +@media screen and (max-width: 1270px) { + #photos .photo { + width: 33.333333%; + } +} +@media screen and (max-width: 800px) { + #photos .photo { + width: 50%; + } +} +@media screen and (max-width: 600px) { + #photos .photo { + width: 100%; + margin: 0 0 2%; + } +} +#photos .photo:focus .fade { + opacity: 1; + visibility: visible; +} +#photos .photo:focus .fade.user { + opacity: 0.7; +} +#photos .photo:focus-within .photo-controls { + bottom: 0; + opacity: 1; +} +#photos .photo button.photo-upload { + display: block; + width: 100%; + position: relative; + background-color: transparent; + background-color: #111; + overflow: hidden; + cursor: pointer; + padding: 0; + margin: 0; + border: none; +} +#photos .photo button.photo-upload:focus, #photos .photo button.photo-upload:active { + border: none; +} +#photos .photo button.photo-upload img { + transition: all 0.4s ease; + width: 100%; + height: auto !important; + padding: 0; + vertical-align: top; + background-color: #fff; +} +#photos .photo:focus button.photo-upload img, #photos .photo:hover button.photo-upload img { + opacity: 0.5; + transform: scale(1.05); +} +#photos .photo:focus .photo-meta, #photos .photo:hover .photo-meta { + opacity: 1; + visibility: visible; +} +#photos .photo:focus .photo-meta i.heart-like, #photos .photo:hover .photo-meta i.heart-like { + transform: scale(1); +} +#photos .photo:focus .photo-controls, #photos .photo:hover .photo-controls { + bottom: 0; + opacity: 1; +} +#photos .photo .photo-status { + visibility: hidden; + opacity: 0; + transition: all 0.3s ease-out; + width: 60px; + height: 60px; + line-height: 60px; + border-radius: 6px; + position: absolute; + text-align: center; + left: 50%; + top: 50%; + z-index: 5; + transform: translate(-50%, -50%) scale(1.2); + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.075); + background-color: rgba(255, 255, 255, 0.95); + background-position: center center; + background-repeat: no-repeat; +} +#photos .photo .photo-status::before { + font-family: "FontAwesome"; + display: block; + color: #fff; + font-size: 24px; + opacity: 0.8; +} +#photos .photo .photo-status.active { + opacity: 1; + visibility: visible; +} +#photos .photo .photo-meta { + position: absolute; + top: 5px; + right: 5px; + z-index: 6; + width: auto; + display: inline-block; + cursor: default !important; + transition: all 0.25s ease; + opacity: 0; + visibility: hidden; + font-size: 13px; +} +#photos .photo .photo-meta i { + font-size: 14px; +} +#photos .photo .photo-meta i.heart-like { + color: #df3333; + transition: all 0.25s ease; + transform: scale(0.55); + margin-right: 2px; + position: relative; + top: 0; + font-size: 14px; + opacity: 0.85; +} +#photos .photo .photo-meta a, +#photos .photo .photo-meta span { + display: inline-block; + vertical-align: top; + line-height: 30px; + padding: 0 10px; + margin: 0; + padding-top: 1px; + background: rgba(255, 255, 255, 0.4); + border-radius: 2px; + color: #23282d; + transition: all 0.25s ease; +} +#photos .photo .photo-meta span { + cursor: default; +} +#photos .photo .photo-meta span:hover, #photos .photo .photo-meta span:focus { + background-color: #fff; +} +#photos .photo .photo-meta a { + margin-left: 5px; +} +#photos .photo .photo-meta a:hover, #photos .photo .photo-meta a:focus { + background-color: #fff; +} +#photos .photo .photo-meta a i { + position: relative; + top: 1px; + left: 1px; +} +#photos .photo .photo-controls { + position: absolute; + z-index: 6; + width: 100%; + bottom: 0; + left: 0; + padding: 0; + opacity: 0; + transition: all 0.25s ease; + background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, rgba(17, 17, 17, 0.3) 100%); +} +#photos .photo .photo-options { + float: right; + text-align: right; + max-width: 50%; +} +#photos .photo .fade { + transition: all 0.35s ease; + background: rgba(255, 255, 255, 0.75); + background: transparent; + border-radius: 2px; + height: 34px; + line-height: 34px; + font-size: 18px; + z-index: 6; + float: left; + margin: 1px 1px 1px 0; + padding: 0; + color: rgba(255, 255, 255, 0.75); + border: none !important; + outline: none; + cursor: pointer; +} +#photos .photo .fade.edit-photo, #photos .photo .fade.edit-photo-admin, #photos .photo .fade.set-featured, #photos .photo .fade.insert { + width: 34px; + height: 34px; + display: flex; + align-items: center; + justify-content: center; +} +#photos .photo .fade.edit-photo i, #photos .photo .fade.edit-photo-admin i, #photos .photo .fade.set-featured i, #photos .photo .fade.insert i { + position: relative; + top: 1px; +} +#photos .photo .fade.edit-photo:hover, #photos .photo .fade.edit-photo:focus, #photos .photo .fade.edit-photo-admin:hover, #photos .photo .fade.edit-photo-admin:focus, #photos .photo .fade.set-featured:hover, #photos .photo .fade.set-featured:focus, #photos .photo .fade.insert:hover, #photos .photo .fade.insert:focus { + color: #222; + background: rgba(255, 255, 255, 0.95); +} +#photos .photo .fade.user { + background: none; + text-decoration: none; + font-size: 13px; + max-width: 48%; + cursor: pointer; + border: none; + line-height: 35px; + height: 36px; + margin: 0; +} +#photos .photo .fade.user:hover, #photos .photo .fade.user:focus { + text-decoration: underline; +} +#photos .photo .fade.user .user-wrap { + position: relative; + padding-left: 35px; + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +#photos .photo .fade.user .user-wrap::before { + content: ""; + display: block; + z-index: 0; + background-color: #fff; + height: 20px; + opacity: 0.25; +} +#photos .photo .fade.user img.user-wrap--photo, +#photos .photo .fade.user .user-wrap::before { + width: 20px; + max-width: 20px; + border-radius: 100%; + position: absolute; + left: 8px; + top: 8px; +} +#photos .photo .fade.user img.user-wrap--photo { + z-index: 1; +} +#photos .photo.feature { + cursor: pointer; +} +#photos .photo.feature:hover, #photos .photo.feature:focus-within { + text-decoration: underline; +} +#photos .photo.feature:hover .photo--wrap, #photos .photo.feature:focus-within .photo--wrap { + border-color: #ccc; +} +#photos .photo.feature .photo--wrap { + padding: 5px; + border: 1px solid #e1e1e1; + border-radius: 3px; + transition: border 0.25s ease; +} +#photos .photo.feature .photo--wrap .flag { + position: absolute; + right: 3px; + top: 3px; + font-size: 11px; + background-color: #ffe732; + z-index: 10; + padding: 5px; + border-radius: 3px; + line-height: 1; +} +#photos .photo.feature .photo--wrap .img-wrap img { + display: block; + border-radius: 3px; +} +#photos .photo.feature .photo--wrap .feature-title { + display: flex; + align-items: center; + width: 100%; + padding: 8px 3px 3px; +} +#photos .photo.feature .photo--wrap .feature-title img { + border-radius: 100%; + width: 25px; + height: 25px; + -o-object-fit: cover; + object-fit: cover; + margin-right: 6px; +} +#photos .photo.feature .photo--wrap .feature-title span { + flex: 1; + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 13px; + font-weight: 600; + line-height: 25px; +} +#photos .edit-screen { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 999; + background: rgba(255, 255, 255, 0.9); + opacity: 0; + visibility: hidden; + transition: all 0.25s ease; + padding: 5px; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + border: 1px solid #e1e1e1; + transform: scale(1.025); +} +#photos .edit-screen.editing { + visibility: visible; + opacity: 1; + transform: scale(1); +} +#photos .edit-screen--controls, #photos .edit-screen--title { + display: flex; + flex-wrap: nowrap; + width: 100%; + background: #f7f7f7; + border: 1px solid #e1e1e1; + padding: 15px; + border-radius: 2px 2px 0 0; +} +#photos .edit-screen--controls { + border-radius: 0 0 3px 3px; + justify-content: space-between; +} +#photos .edit-screen--title { + border-bottom: none; + border-radius: 3px 3px 0 0; +} +#photos .edit-screen--title > div { + padding: 10px 15px 10px 0; + flex: 1; +} +#photos .edit-screen--title > div.preview { + width: 25%; + padding: 0; + background-size: cover; + background-position: center; + background-repeat: no-repeat; + border-radius: 3px; + flex: none; +} +#photos .edit-screen--title p { + font-size: 12px; + line-height: 1.45; + margin: 0; + color: #98979d; +} +#photos .edit-screen--title p.heading { + color: #222; + margin: 0; + font-weight: 600; + text-transform: uppercase; +} +#photos .edit-screen--title p.dimensions { + font-size: 11px; +} +#photos .edit-screen label, +#photos .edit-screen .add-attribution-row { + margin: 0; + padding: 15px; + display: block; + background: #fff; + border: 1px solid #e1e1e1; + border-bottom: none; + position: relative; +} +#photos .edit-screen .add-attribution-row { + padding-top: 0; + margin-top: -15px; + border-top: none; +} +#photos .edit-screen .add-attribution-row button { + cursor: pointer; + font-size: 11px; + outline: none; + padding: 5px 0; + border: none; + background: none; + text-decoration: underline; +} +#photos .edit-screen .add-attribution-row button:hover, #photos .edit-screen .add-attribution-row button:focus { + text-decoration: none; +} +#photos .edit-screen span { + display: block; + font-size: 11px; + text-transform: uppercase; + font-weight: 600; + margin: 0 0 10px; + color: #222; + line-height: 1; +} +#photos .edit-screen textarea, +#photos .edit-screen input { + color: #6b6877; + background-color: #fff; + width: 100%; + padding: 10px; + border-color: #e1e1e1; + line-height: 1; + border-radius: 3px; + font-size: 12px; + line-height: 1.35; +} +#photos .edit-screen textarea:focus, +#photos .edit-screen input:focus { + outline: none; + border-color: #586ec6; + box-shadow: 0 0 0 1px #586ec6, 0 0 0 4px rgba(88, 110, 198, 0.1); +} +#photos .edit-screen textarea { + resize: none; +} +#photos .edit-screen input { + height: 38px; + line-height: 38px; + padding-top: 0; + padding-bottom: 0; +} +#photos .edit-screen input[name=filename] { + padding-right: 45px; +} +#photos .edit-screen em { + position: absolute; + bottom: 16px; + right: 15px; + height: 36px; + line-height: 36px; + background: #efefef; + border-radius: 0 2px 2px 0; + color: #98979d; + font-style: normal; + font-weight: 500; + font-size: 11px; + padding: 0 10px; + border-left: 1px solid #e1e1e1; +} +.instant-img-container .onload-warning { + text-align: center; + max-width: 600px; + margin: 0 auto; + padding: 20px; +} +.instant-img-container .onload-warning h3 { + margin-bottom: 10px; +} +.instant-img-container .onload-warning h3 span { + text-transform: uppercase; +} +.instant-images-settings { + background-color: #f7f7f7; + padding: 30px; + display: grid; + grid-gap: 30px; + grid-template-columns: repeat(1, 1fr); + grid-template-rows: repeat(1, 1fr); +} +@media screen and (min-width: 800px) { + .instant-images-settings { + grid-template-columns: 4fr 8fr; + } +} +@media screen and (min-width: 1270px) { + .instant-images-settings { + grid-template-columns: 3fr 9fr; + } +} +@media screen and (min-width: 1500px) { + .instant-images-settings { + grid-template-columns: 2fr 10fr; + } +} +@media screen and (min-width: 1270px) and (min-height: 640px) { + .instant-images-settings--sticky { + position: sticky; + top: 62px; + left: 0; + } +} +.instant-images-settings--header { + display: block; + width: 100%; + margin: 0; +} +.instant-images-settings--header .plugin-version { + display: none; +} +@media screen and (min-width: 800px) { + .instant-images-settings--header .plugin-version { + display: block; + padding: 20px 11px 0; + font-size: 12px; + } +} +.instant-images-settings--header nav { + display: none; + margin-top: 20px; + padding: 0 0 5px; + border-radius: 10px; + background-color: #fff; + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1019607843), 0 1px 3px -1px rgba(0, 0, 0, 0.1019607843) !important; + overflow: hidden; +} +@media screen and (min-width: 800px) { + .instant-images-settings--header nav { + display: block; + } +} +.instant-images-settings--header nav h3 { + font-size: 12px; + background-color: #fff; + border-bottom: 1px solid #f7f7f7; + margin: 0 0 5px; + padding: 15px 15px 14px; + line-height: 1; + text-transform: uppercase; +} +.instant-images-settings--header nav button { + all: unset; + width: 100%; + border: none; + color: #6b6877; + line-height: 1; + padding: 10px 12px; + cursor: pointer; + white-space: nowrap; + text-align: left; + display: flex; + align-items: center; + flex-wrap: nowrap; +} +.instant-images-settings--header nav button i { + width: 25px; + color: #e1e1e1; + font-size: 18px; +} +.instant-images-settings--header nav button:hover, .instant-images-settings--header nav button:focus { + color: #434246; +} +.instant-images-settings--sections .settings-entry { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + width: 100%; + margin: 0 0 30px; + background-color: #fff; + border-radius: 10px; + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1019607843), 0 1px 3px -1px rgba(0, 0, 0, 0.1019607843) !important; +} +@media screen and (min-width: 1270px) { + .instant-images-settings--sections .settings-entry { + padding: 30px; + } +} +.instant-images-settings--sections .settings-entry:last-of-type { + border-bottom: none; +} +.instant-images-settings--sections .settings-entry--title { + width: 100%; + padding: 25px; + position: relative; + border-bottom: 1px solid #f7f7f7; +} +@media screen and (min-width: 1270px) { + .instant-images-settings--sections .settings-entry--title { + width: 30%; + padding: 27px 30px 30px 50px; + border: none; + position: sticky; + top: 62px; + margin-bottom: 20px; + } + .instant-images-settings--sections .settings-entry--title::after { + display: block; + content: ""; + height: 1px; + width: 50px; + background-color: #e1e1e1; + position: absolute; + bottom: 0; + } +} +.instant-images-settings--sections .settings-entry--title i.fa { + display: none; + position: absolute; + left: 10px; + font-size: 30px; + color: #e1e1e1; + margin-top: -4px; +} +@media screen and (min-width: 1270px) { + .instant-images-settings--sections .settings-entry--title i.fa { + display: block; + } +} +.instant-images-settings--sections .settings-entry--title h2 { + font-size: 18px; + font-weight: 600; + border: none; + padding: 0; + margin: 0 0 8px; + line-height: 1.35; +} +.instant-images-settings--sections .settings-entry--title p { + margin: 8px 0 0; +} +.instant-images-settings--sections .settings-entry--action { + width: 100%; + padding: 25px; + position: relative; + overflow: hidden; +} +@media screen and (min-width: 1270px) { + .instant-images-settings--sections .settings-entry--action { + width: 70%; + padding: 30px; + } +} +.instant-images-settings .save-settings { + display: flex; + flex-wrap: wrap; + gap: 10px; + width: 100%; + align-items: center; + position: relative; +} +.instant-images-settings .save-settings p.submit { + margin: 0; + width: auto; +} +.instant-images-settings .save-settings .loading, +.instant-images-settings .save-settings .saved { + opacity: 0; + visibility: hidden; + transition: all 0.25s ease; +} +.instant-images-settings .save-settings .loading.active, +.instant-images-settings .save-settings .saved.active { + opacity: 1; + visibility: visible; +} +.instant-images-settings .save-settings .loading { + width: 30px; + height: 30px; + display: block; + background: #fff url(images/ajax-loader.7c5ec6b9.gif) no-repeat center center; +} +.instant-images-settings .save-settings .saved { + margin-left: auto; + display: flex; + align-items: center; + justify-content: center; + gap: 6px; + font-size: 13px; + padding: 0; +} +.instant-images-settings .save-settings .saved i { + color: #65c774; + font-size: 22px; +} +.instant-images-settings .scroll-section { + overflow: hidden; + overflow-y: auto; + max-height: 550px; + padding-right: 5px; +} +.instant-images-settings .whats-new ul { + margin: 0; + padding: 0; + display: grid; + grid-gap: 10px; + grid-template-columns: repeat(1, 1fr); +} +@media screen and (min-width: 800px) { + .instant-images-settings .whats-new ul { + grid-template-columns: repeat(2, 1fr); + } +} +.instant-images-settings .whats-new ul li { + line-height: 1.4; + width: 100%; + background-color: transparent; + padding: 0; + margin: 0; + position: relative; + display: flex; +} +.instant-images-settings .whats-new ul li p { + font-size: 13px; + position: relative; + z-index: 1; + margin: 0; + padding: 20px; + background-color: #fff; + border: 1px solid #e1e1e1; + border-radius: 3px; +} +.instant-images-settings .whats-new ul li p strong { + font-size: 14px; + color: #434246; + display: block; + font-weight: 700; + margin: 0 0 5px; +} +.instant-images-settings .whats-new ul li code { + font-size: 12px; + margin: 0; + padding: 3px; + background: #f7f7f7; + border-radius: 2px; + box-shadow: 0 0 0 1px #efefef; +} +.instant-images-settings .general-settings span.desc { + font-size: 11px; + display: block; +} +.instant-images-settings .general-settings span.desc a { + text-decoration: none; +} +.instant-images-settings .general-settings span.desc a:hover, .instant-images-settings .general-settings span.desc a:focus { + text-decoration: underline; +} +.instant-images-settings .instant-images-settings h3, +.instant-images-settings .instant-images-settings h4 { + margin-top: 0; +} +.instant-images-settings .form-table { + margin: 0; + border: none; + position: relative; + top: -5px; +} +.instant-images-settings .form-table td, +.instant-images-settings .form-table p { + font-size: 14px; +} +.instant-images-settings .form-table th { + display: none; +} +.instant-images-settings .form-table td { + border-top: 0; + padding: 0 0 25px; + float: left; + width: 100%; + margin: 0; +} +.instant-images-settings .form-table td:empty { + padding: 0; +} +.instant-images-settings .form-table .form-msg { + display: block; + line-height: 18px; + padding: 12px 12px 12px 15px; + margin: 15px 0 0; + color: #6b6877; + background-color: #fff9ea; + border-left: 5px solid #dfd8c2; + border-radius: 2px; +} +.instant-images-settings .form-table .form-msg span { + display: block; + padding: 6px 0 3px; +} +.instant-images-settings .other-plugins .cnkt-plugin-installer { + width: 100% !important; + position: static; + display: grid; + grid-template-columns: repeat(1, 1fr); + grid-gap: 10px; + padding: 0; +} +@media screen and (min-width: 1500px) { + .instant-images-settings .other-plugins .cnkt-plugin-installer { + grid-template-columns: repeat(2, 1fr); + } +} +.instant-images-settings .other-plugins .cnkt-plugin-installer .plugin { + width: 100%; + padding: 0 !important; + margin: 0 !important; + line-height: 1.45; + border-color: #e1e1e1; + border-radius: 3px; + overflow: hidden; +} +.instant-images-settings .other-plugins .cnkt-plugin-installer .plugin h2 { + margin-bottom: 5px; +} +.instant-images-settings .other-plugins .cnkt-plugin-installer .plugin p { + padding: 0; + margin: 0 0 5px; +} +.instant-images-settings .other-plugins .cnkt-plugin-installer::after { + display: none; +} +.instant-images-settings .license-settings--item { + border: 1px solid #e1e1e1; + padding: 20px; + border-radius: 3px; + margin: 0 0 20px; +} +.instant-images-settings .license-settings--item:last-of-type { + margin: 0; +} +.instant-images-settings .license-settings--item p.submit { + margin: 0; +} +.instant-images-settings .license-settings--status { + margin-bottom: 10px; +} +.instant-images-settings .license-settings--status > div { + position: relative; +} +.instant-images-settings .license-settings--status.invalid { + background-color: rgba(223, 51, 51, 0.05); + border-left: 4px solid #df3333; + padding: 20px; + border-radius: 3px; +} +.instant-images-settings .license-settings--status input { + padding-left: 35px !important; +} +.instant-images-settings .license-settings--status input[disabled] { + color: #98979d; + cursor: not-allowed; +} +.instant-images-settings .license-settings--status span { + width: 30px; + text-align: center; + color: #65c774; + margin-right: 5px; + position: absolute; + top: 50%; + left: 5px; + transform: translateY(-50%); +} +.instant-images-settings .license-settings--status span.dashicons-warning { + color: #df3333; +} +.instant-images-settings .license-settings--status p { + font-size: 12px; + padding: 12px 5px 0; + margin: 0; +} +.instant-images-settings .license-settings--empty { + background-color: rgba(88, 110, 198, 0.05); + border-left: 4px solid #aabbff; + padding: 20px; + border-radius: 3px; +} +.instant-images-settings .license-settings--empty p:last-of-type { + margin: 0; +} +.instant-images-header-wrap h1, +.instant-images-header-wrap-alt h1 { + padding: 0; + margin: 4px 0 0; + font-weight: 800; + font-size: 24px; + max-width: 70%; +} +@media screen and (max-width: 800px) { + .instant-images-header-wrap h1, + .instant-images-header-wrap-alt h1 { + max-width: 100%; + width: 100%; + text-align: center; + } +} +.instant-images-header-wrap h1 em, +.instant-images-header-wrap-alt h1 em { + font-weight: 400; + font-size: 12px; + background-color: rgba(0, 0, 0, 0.035); + color: #6b6877; + display: inline-block; + border-radius: 3px; + padding: 5px; + position: relative; + top: -2px; + left: 2px; + font-style: normal; + line-height: 1; +} +span.instant-images-tagline { + display: block; + padding: 0; + color: #98979d; + font-size: 14px; + line-height: 1.45; + font-weight: 400; +} +.instant-images-header-wrap-alt { + display: block; + text-align: center; + padding: 0 0 20px; + border-bottom: 1px solid #e1e1e1; +} +.instant-images-header-wrap-alt h1 { + width: 100%; + height: auto; + max-width: none; + display: block; + background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTx0aXRsZT5JbnN0YW50IEltYWdlcyBJY29uPC90aXRsZT4KCTxwYXRoIGQ9Ik0wIDhDMCAzLjU4MTcyIDMuNTgxNzIgMCA4IDBINzJDNzYuNDE4MyAwIDgwIDMuNTgxNzIgODAgOFY3MkM4MCA3Ni40MTgzIDc2LjQxODMgODAgNzIgODBIOEMzLjU4MTcyIDgwIDAgNzYuNDE4MyAwIDcyVjhaIiBmaWxsPSIjNjQ3RkU4Ii8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE2SDQ0LjQzODVWMTYuMTIxNUwyNyA0NC4wNjkzSDM2LjVWNjVaIiBmaWxsPSJ3aGl0ZSIvPgoJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNi41IDY1TDUyLjUgMzYuNTgxNkg0NC40Mzg1VjE2LjEyMTVMMjcgNDQuMDY5M0gzNi41VjY1WiIgZmlsbD0id2hpdGUiLz4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzYuNSA2NUw1Mi41IDM2LjU4MTdINDQuNDM4NUwzNi41IDQ0LjA2OTNWNjVaIiBmaWxsPSIjQzdEMkZGIi8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE3SDQ0LjQzODVMMzYuNSA0NC4wNjkzVjY1WiIgZmlsbD0iI0M3RDJGRiIvPgo8L3N2Zz4K) no-repeat center 15px; + background-size: 50px 50px; + padding: 80px 5px 0; + margin: 0 0 15px; +} +.instant-images-header-wrap-alt h1 span { + padding-top: 10px; +} +.instant-images-header-wrap-alt h1 + p { + margin: 0; +} +.instant-images-header-wrap { + background: #f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTx0aXRsZT5JbnN0YW50IEltYWdlcyBJY29uPC90aXRsZT4KCTxwYXRoIGQ9Ik0wIDhDMCAzLjU4MTcyIDMuNTgxNzIgMCA4IDBINzJDNzYuNDE4MyAwIDgwIDMuNTgxNzIgODAgOFY3MkM4MCA3Ni40MTgzIDc2LjQxODMgODAgNzIgODBIOEMzLjU4MTcyIDgwIDAgNzYuNDE4MyAwIDcyVjhaIiBmaWxsPSIjNjQ3RkU4Ii8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE2SDQ0LjQzODVWMTYuMTIxNUwyNyA0NC4wNjkzSDM2LjVWNjVaIiBmaWxsPSJ3aGl0ZSIvPgoJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNi41IDY1TDUyLjUgMzYuNTgxNkg0NC40Mzg1VjE2LjEyMTVMMjcgNDQuMDY5M0gzNi41VjY1WiIgZmlsbD0id2hpdGUiLz4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzYuNSA2NUw1Mi41IDM2LjU4MTdINDQuNDM4NUwzNi41IDQ0LjA2OTNWNjVaIiBmaWxsPSIjQzdEMkZGIi8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTM2LjUgNjVMNTIuNSAzNi41ODE3SDQ0LjQzODVMMzYuNSA0NC4wNjkzVjY1WiIgZmlsbD0iI0M3RDJGRiIvPgo8L3N2Zz4K) no-repeat 25px 20px; + background-size: 48px 48px; + padding: 20px 25px 20px 83px; + min-height: 88px; + overflow: hidden; + border-bottom: 1px solid #efefef; + position: relative; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.045); + display: flex; + align-items: center; + width: 100%; +} +@media screen and (max-width: 800px) { + .instant-images-header-wrap { + display: block; + background-position: center 20px; + padding: 80px 25px 20px; + text-align: center; + } +} +.instant-images-header-wrap > div { + margin-left: auto; + display: flex; + gap: 10px; + padding-left: 10px; +} +@media screen and (max-width: 800px) { + .instant-images-header-wrap > div { + width: 100%; + justify-content: center; + padding-top: 20px; + padding-left: 0; + } +} +@media screen and (max-width: 800px) { + .instant-images-header-wrap a.button { + position: static; + display: inline-block; + } +} +.instant-img-container[data-media-popup=true] { + background: #fff; +} +.instant-img-container[data-media-popup=true] .instant-images-header-wrap { + display: none; +} +.instant-img-container[data-media-popup=true] .instant-images-wrapper { + padding: 0 16px; +} +.instant-images-sidebar-icon, +.instant-images-sidebar-icon svg { + display: inline-flex; + flex: 0 0 auto; +} +.instant-images-sidebar-icon svg { + height: 20px; + width: 20px; +} +.instant-images-sidebar-icon svg, +.instant-images-sidebar-icon svg * { + stroke: #586ec6 !important; + fill: #586ec6 !important; +} +button[aria-expanded=true] .instant-images-sidebar-icon svg, +button[aria-expanded=true] .instant-images-sidebar-icon svg * { + stroke: #aabbff !important; + fill: #aabbff !important; +} +.instant-images-block #photos::after, +.components-panel #photos::after { + width: 100%; + left: 0; +} +.instant-images-block .instant-images-no-results, +.components-panel .instant-images-no-results { + padding: 40px; +} +.instant-images-block .instant-images-no-results h3, +.components-panel .instant-images-no-results h3 { + font-size: 18px; +} +.instant-images-block .instant-images-no-results p, +.components-panel .instant-images-no-results p { + font-size: 13px; +} +.instant-images-block .search-results-text, +.components-panel .search-results-text { + font-size: 12px; + border-top: 1px solid #ddd; + border-color: #ddd; +} +.instant-images-block .search-results-text .search-results-clear, +.components-panel .search-results-text .search-results-clear { + display: none; +} +.instant-images-block .search-header, +.components-panel .search-header { + display: none; +} +.instant-images-block .provider-nav, +.components-panel .provider-nav { + width: 100%; + padding: 10px 5px; + margin: 0; + border-bottom-color: #ddd; +} +.instant-images-block .provider-nav button, +.components-panel .provider-nav button { + font-size: 13px; +} +.instant-images-block .control-nav--filters, +.components-panel .control-nav--filters { + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-template-rows: 1fr; + grid-column-gap: 10px; +} +.instant-images-block .control-nav .filter-dropdown, +.components-panel .control-nav .filter-dropdown { + width: 100%; + display: none; +} +.instant-images-block .control-nav .filter-dropdown:nth-child(1), .instant-images-block .control-nav .filter-dropdown:nth-child(2), +.components-panel .control-nav .filter-dropdown:nth-child(1), +.components-panel .control-nav .filter-dropdown:nth-child(2) { + display: block; +} +.instant-images-block .control-nav .filter-dropdown button, +.components-panel .control-nav .filter-dropdown button { + padding: 5px; + font-size: 13px; +} +.instant-images-block .control-nav .filter-dropdown button.filter-dropdown--button, +.components-panel .control-nav .filter-dropdown button.filter-dropdown--button { + display: block; +} +.instant-images-block .control-nav .filter-dropdown button.filter-dropdown--button i, +.components-panel .control-nav .filter-dropdown button.filter-dropdown--button i { + margin-left: auto; + padding-right: 5px; +} +.instant-images-block .control-nav .filter-dropdown--menu, +.components-panel .control-nav .filter-dropdown--menu { + width: 100%; + left: 0; + padding: 6px; +} +.instant-images-block .control-nav .filter-dropdown--menu button, +.components-panel .control-nav .filter-dropdown--menu button { + gap: 8px; +} +.instant-images-block .control-nav .filter-dropdown .filter-dropdown--button-label, +.components-panel .control-nav .filter-dropdown .filter-dropdown--button-label { + display: block; + font-size: 10px; + text-transform: uppercase; + margin: 0 0 2px; +} +.instant-images-block .control-nav .filter-dropdown .filter-dropdown--button-selected, +.components-panel .control-nav .filter-dropdown .filter-dropdown--button-selected { + display: flex; + align-items: center; + width: 100%; + font-size: 14px; +} +.instant-images-block .control-nav--search, +.components-panel .control-nav--search { + float: none; + width: 100%; + padding: 0; + clear: both; + margin: 0; +} +.instant-images-block .control-nav--search form, +.components-panel .control-nav--search form { + height: auto; +} +.instant-images-block .control-nav--search::before, +.components-panel .control-nav--search::before { + display: none; +} +.instant-images-block .control-nav--search button[type=submit], +.components-panel .control-nav--search button[type=submit] { + display: none; +} +.instant-images-block .control-nav--search input, +.components-panel .control-nav--search input { + line-height: 40px; + height: 40px; + padding-right: 10px; + padding-left: 10px; + border-color: #e2e4e7; + font-size: 13px; + border-radius: 3px !important; + background-position: 8px center; +} +.instant-images-block .control-nav--search input.searching, +.components-panel .control-nav--search input.searching { + padding-left: 30px; +} +.instant-images-block .control-nav--search input[type=search]::-webkit-input-placeholder, +.components-panel .control-nav--search input[type=search]::-webkit-input-placeholder { + font-size: 13px; +} +.instant-images-block .control-nav--search input[type=search]:-moz-placeholder, +.components-panel .control-nav--search input[type=search]:-moz-placeholder { + font-size: 13px; +} +.instant-images-block .control-nav--search input[type=search]:-ms-input-placeholder, +.components-panel .control-nav--search input[type=search]:-ms-input-placeholder { + font-size: 13px; +} +.instant-images-block .control-nav--search-tooltip, +.components-panel .control-nav--search-tooltip { + right: 3px; + left: auto; + top: 2px; + border-radius: 2px; + font-size: 12px; + height: 36px; + line-height: 35px; +} +.instant-images-block .control-nav--search-tooltip::before, .instant-images-block .control-nav--search-tooltip::after, +.components-panel .control-nav--search-tooltip::before, +.components-panel .control-nav--search-tooltip::after { + display: none; +} +.instant-images-block .instant-img-container { + border: 1px solid #e1e1e1; + border-radius: 3px; + box-shadow: 0 0 0 5px #f7f7f7; + padding: 0; +} +.instant-images-block--header { + padding: 15px; + display: flex; + align-items: center; + width: 100%; + background-color: #f7f7f7; + border-bottom: 1px solid #e1e1e1; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.045); + border-radius: 3px 3px 0 0; +} +.instant-images-block--header-logo { + display: flex; + align-items: center; +} +.instant-images-block--header-logo svg { + width: 32px; + height: 32px; + margin-right: 8px; +} +.instant-images-block--header-logo span { + font-weight: 600; + font-size: 15px; + color: #434246; +} +.instant-images-block--header-nav { + margin-left: auto; +} +.instant-images-block input#search-input { + border: 1px solid #ddd; +} +.instant-images-block--loader { + height: 250px; + width: 275px; + min-width: 275px; + background: #f7f7f7 url(images/ajax-loader-lg.808ea7f8.gif) no-repeat center center; + border: 1px dashed #efefef; + border-radius: 3px; +} +.instant-images-block--loader.done { + display: none !important; +} +.instant-images-block--instructions { + width: 100%; + background-color: #f7f7f7; + border-radius: 0 0 3px 3px; + padding: 10px; + font-size: 12px; + display: flex; + justify-content: center; + color: #434246; + font-weight: 500; + cursor: default; +} +.instant-images-block--instructions span { + opacity: 0.5; + margin: 0 5px; + font-weight: 400; +} +.instant-images-block .load-more-wrap, +.instant-images-block .loading-block { + display: none !important; +} +.instant-images-block .control-nav { + padding: 15px; + margin: 0; + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-template-rows: 1fr; + grid-column-gap: 10px; +} +.instant-images-block #photo-listing { + display: block; + width: 100%; + min-height: 325px; + padding: 15px; + overflow: hidden; +} +.instant-images-block #photo-listing::after { + background-position: center 43%; +} +.instant-images-block #photo-listing #photos--wrap { + display: flex; +} +.instant-images-block #photo-listing #photos { + display: flex; + flex-wrap: nowrap; + overflow-x: auto; + width: 100%; + padding: 0 0 10px; + margin: 0; +} +.instant-images-block #photo-listing #photos .photo { + opacity: 1 !important; + margin-right: 10px; + width: 275px; + min-width: 275px; + height: 250px; +} +.instant-images-block #photo-listing #photos .photo-wrap, +.instant-images-block #photo-listing #photos .img-wrap, +.instant-images-block #photo-listing #photos button.photo-upload { + width: 275px; + height: 250px; +} +.instant-images-block #photo-listing #photos button.photo-upload img { + -o-object-fit: cover; + object-fit: cover; + width: 100% !important; + height: 100% !important; +} +.components-panel #photo-listing { + width: 100%; + margin: 0; + padding: 5px 10px; + overflow: hidden; +} +.components-panel #photo-listing .photo { + width: 100%; + display: block; + opacity: 1 !important; + margin: 0 0 10px; + padding: 0; +} +.components-panel .control-nav { + padding: 10px 5px; + border-bottom: 1px solid #ddd; + margin: 0 0 10px; + display: block; +} +.components-panel .control-nav--filters-wrap { + flex: none; + width: 100%; + display: block; + margin-bottom: 10px; +} +.media-frame-router button#menu-item-instantimages.active { + background-color: #f7f7f7; +} +.instant-img-container #tooltip { + padding: 8px 10px; + background: #fff; + position: fixed; + left: auto; + top: auto; + z-index: 999; + display: block; + opacity: 0; + visibility: hidden; + margin-top: -37px; + font-size: 12px; + color: rgba(67, 66, 70, 0.75); + text-align: center; + line-height: 1; + border-radius: 2px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); + transition: transform 0.25s cubic-bezier(0.24, 0.22, 0.015, 1.56), opacity 0.15s ease-in-out, visibility 0.15s ease-in-out; + transform: scale(0.8); +} +.instant-img-container #tooltip::after { + top: 100%; + right: 17px; + border: solid transparent; + content: ""; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: rgba(255, 255, 255, 0); + border-top-color: #fff; + border-width: 5px; + margin-left: -5px; +} +.instant-img-container #tooltip.above { + margin-top: 37px; +} +.instant-img-container #tooltip.above::after { + top: -5px; + border-top: none; + border-bottom-color: #fff; +} +.instant-img-container #tooltip.over { + transform: scale(1); + opacity: 0.9; + visibility: visible; +} +.instant-images-no-results { + display: block; + padding: 100px; + text-align: center; + position: relative; +} +.instant-images-no-results::before { + content: "\f002"; + font-family: "FontAwesome"; + display: block; + position: absolute; + z-index: 0; + top: 50%; + left: 50%; + font-size: 125px; + opacity: 0.1; + transform: translateY(-50%) translateX(-50%); +} +.instant-images-no-results > div { + position: relative; + z-index: 10; +} +.instant-images-no-results h3 { + font-size: 24px; + line-height: 1.2; + margin: 0 0 10px !important; + font-weight: 700; +} +.instant-images-no-results p { + font-size: 16px; + margin: 0; +} +@media screen and (max-width: 800px) { + .instant-images-no-results { + padding: 50px; + } +} +.provider-nav { + display: flex; + flex-wrap: nowrap; + width: calc(100% + 50px); + margin-left: -25px; + padding: 10px 25px; + border-bottom: 1px solid #efefef; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.045); + background-color: #f7f7f7; + position: relative; + overflow-x: auto; +} +.provider-nav > div { + position: relative; + margin: 0 5px; +} +.provider-nav > div:first-of-type { + margin-left: 0; +} +.provider-nav > div:last-of-type { + margin-left: 0; +} +.provider-nav--btn { + padding: 0 10px; + margin: 0; + height: 38px; + line-height: 38px; + border: 1px solid transparent; + background: transparent; + cursor: pointer; + position: relative; + border-radius: 3px; + font-size: 14px; + color: #98979d; + transition: all 0.2s ease; + background-color: #f7f7f7; + display: flex; + align-items: center; +} +.provider-nav--btn svg { + width: 20px; + height: 20px; + margin-right: 8px; +} +.provider-nav--btn:hover, .provider-nav--btn:focus { + color: #434246; +} +.provider-nav--btn[disabled] { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; +} +.provider-nav--btn.active { + background-color: #fff; + border-color: #ccc; + color: #434246; + cursor: default; + box-shadow: 0 0 6px rgba(0, 0, 0, 0.075); +} +.provider-nav--new { + color: #434246; + background-color: #ffe732; + font-size: 9px; + text-transform: uppercase; + display: inline; + padding: 3px 4px; + border-radius: 3px; + margin-left: 5px; + position: relative; + top: -1px; + letter-spacing: -0.05rem; +} +.media-frame-content .instant-img-container .api-lightbox > div { + top: 0; +} +.instant-images-block .instant-img-container .api-lightbox, +.instant-images-block .instant-img-container .api-lightbox.error-lightbox, +.components-panel .instant-img-container .api-lightbox, +.components-panel .instant-img-container .api-lightbox.error-lightbox { + align-items: flex-start; +} +.instant-images-block .instant-img-container .api-lightbox .more-info, +.instant-images-block .instant-img-container .api-lightbox.error-lightbox .more-info, +.components-panel .instant-img-container .api-lightbox .more-info, +.components-panel .instant-img-container .api-lightbox.error-lightbox .more-info { + display: none; +} +.instant-images-block .instant-img-container .api-lightbox > div, +.instant-images-block .instant-img-container .api-lightbox.error-lightbox > div, +.components-panel .instant-img-container .api-lightbox > div, +.components-panel .instant-img-container .api-lightbox.error-lightbox > div { + top: 0; +} +.instant-images-block .instant-img-container .api-lightbox:not(.error-lightbox) .action-controls, +.components-panel .instant-img-container .api-lightbox:not(.error-lightbox) .action-controls { + display: none; +} +.instant-img-container .api-lightbox { + display: flex; + align-items: flex-start; + justify-content: center; + position: absolute; + z-index: 99999; + left: -5px; + top: 0; + right: 0; + bottom: 0; + height: auto; + border-radius: 6px; + padding: 5%; + background-color: transparent; + font-size: 13px; + width: calc(100% + 10px); +} +.instant-img-container .api-lightbox.error-lightbox { + align-items: center; + background-color: rgba(0, 0, 0, 0.5); +} +.instant-img-container .api-lightbox.error-lightbox > div { + top: 0; +} +.instant-img-container .api-lightbox.error-lightbox .api-lightbox--details::before, .instant-img-container .api-lightbox.error-lightbox .api-lightbox--details::after { + display: none !important; +} +.instant-img-container .api-lightbox.active > div { + transform: scale(1); + opacity: 1; +} +.instant-img-container .api-lightbox > div { + max-width: 450px; + width: 100%; + padding: 0; + background-color: #fff; + border-radius: 5px; + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); + position: relative; + top: -15px; + transform: scale(0.9); + opacity: 0; + transition: all 0.25s ease; + overflow: hidden; +} +.instant-img-container .api-lightbox > div > div { + position: relative; +} +.instant-img-container .api-lightbox--details { + border-bottom: 1px solid #e1e1e1; + padding: 25px; + padding-bottom: 20px; + position: relative; +} +.instant-img-container .api-lightbox--details::after, .instant-img-container .api-lightbox--details::before { + top: 100%; + left: 50px; + border: solid transparent; + content: ""; + height: 0; + width: 0; + position: absolute; + pointer-events: none; +} +.instant-img-container .api-lightbox--details::after { + border-color: rgba(255, 255, 255, 0); + border-top-color: #ffffff; + border-width: 10px; + margin-left: -10px; +} +.instant-img-container .api-lightbox--details::before { + border-color: rgba(194, 225, 245, 0); + border-top-color: #e1e1e1; + border-width: 11px; + margin-left: -11px; +} +.instant-img-container .api-lightbox--details h3 { + font-size: 16px; + line-height: 18px; + padding: 0; + text-transform: uppercase; + margin: 0 0 15px; + display: flex; + width: 100%; + align-items: center; +} +.instant-img-container .api-lightbox--details h3 svg { + width: 20px; + height: 20px; + margin-right: 8px; +} +.instant-img-container .api-lightbox--details p { + margin: 10px 0 0; + font-size: 13px; +} +.instant-img-container .api-lightbox--details p.callout-warning { + font-size: 34px; + font-weight: 900; + opacity: 0.35; +} +.instant-img-container .api-lightbox--details p.more-info { + padding: 10px; + background-color: #fffadc; + margin: 15px 0; + border-radius: 3px; + border: 1px solid #efefef; + width: 105%; + position: relative; + left: -2.5%; +} +.instant-img-container .api-lightbox--details p.action-controls { + display: flex; + align-items: center; + width: 100%; + line-height: 1; +} +.instant-img-container .api-lightbox--details p.action-controls button { + font-size: 12px; + font-weight: 500; + color: #586ec6; + background-color: transparent; + border: none; + padding: 8px 0; + margin: 0; + cursor: pointer; +} +.instant-img-container .api-lightbox--details p.action-controls button:hover, .instant-img-container .api-lightbox--details p.action-controls button:focus { + color: #455cb6; + text-decoration: underline; +} +.instant-img-container .api-lightbox--details p.action-controls span { + display: inline-block; + opacity: 0.35; + padding: 0 8px; +} +.instant-img-container .api-lightbox--close { + position: absolute; + z-index: 1; + right: 0; + top: 0; + border: none; + background-color: transparent; + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + font-size: 25px; + cursor: pointer; + opacity: 0.5; +} +.instant-img-container .api-lightbox--close:hover, .instant-img-container .api-lightbox--close:focus { + opacity: 1; +} +.instant-img-container .api-lightbox form { + display: block; + background-color: #f7f7f7; + padding: 25px; +} +.instant-img-container .api-lightbox label, +.instant-img-container .api-lightbox button[type=submit] { + font-size: 12px; + text-transform: uppercase; + font-weight: 600; + display: block; + padding: 0; + margin: 0 0 5px; + cursor: pointer; +} +.instant-img-container .api-lightbox--input-wrap { + display: flex; + width: 100%; + padding: 0; + margin-bottom: 10px; + background-color: #fff; + border: 1px solid #e1e1e1; + border-radius: 3px; + transition: all 0.25s ease; +} +.instant-img-container .api-lightbox--input-wrap:focus-within { + border-color: #98979d; + box-shadow: 0 0 1px 4px rgba(0, 0, 0, 0.065); +} +.instant-img-container .api-lightbox--input-wrap span { + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + border-radius: 2px 0 0 2px; + border-right: 1px solid #e1e1e1; + background-color: #f7f7f7; +} +.instant-img-container .api-lightbox--input-wrap span i { + font-size: 16px; +} +.instant-img-container .api-lightbox--input-wrap span.invalid { + cursor: help; +} +.instant-img-container .api-lightbox--input-wrap span.invalid i { + color: #cfa345; +} +.instant-img-container .api-lightbox--input-wrap span.valid i { + color: #65c774; +} +.instant-img-container .api-lightbox--input-wrap span.loading i { + color: #434246; +} +.instant-img-container .api-lightbox--input-wrap input { + line-height: 40px; + height: 40px; + padding: 0 10px; + background-color: transparent; + border: none; + flex: 1; + font-size: 12px; +} +.instant-img-container .api-lightbox--input-wrap input::-webkit-input-placeholder { + color: #98979d; + font-weight: 400; + font-style: italic; +} +.instant-img-container .api-lightbox--input-wrap input:-moz-placeholder { + color: #98979d; + font-weight: 400; + font-style: italic; +} +.instant-img-container .api-lightbox--input-wrap input::-moz-placeholder { + color: #98979d; + font-weight: 400; + font-style: italic; +} +.instant-img-container .api-lightbox--input-wrap input:-ms-input-placeholder { + color: #98979d; + font-weight: 400; + font-style: italic; +} +.instant-img-container .api-lightbox--input-wrap input:focus { + background: transparent; + outline: none; + border: none; + box-shadow: none; +} +.instant-img-container .api-lightbox button[type=submit] { + width: 100%; + border: none; + background-color: #586ec6; + color: #fff; + border-radius: 3px; + padding: 0 10px; + line-height: 46px; + height: 46px; + margin: 0; +} +.instant-img-container .api-lightbox button[type=submit]:hover, .instant-img-container .api-lightbox button[type=submit]:focus { + background-color: #455cb6; +} +.instant-img-container .api-lightbox--response { + color: #df3333; + margin: 0; + font-size: 13px; + font-weight: 500; + padding: 0 2px 12px; +} +.instant-img-container .api-lightbox--response.valid { + color: #51a75e; +} +.filter-dropdown { + position: relative; +} +.filter-dropdown button { + background-color: transparent; + border: none; + text-align: left; + color: #98979d; + cursor: pointer; +} +.filter-dropdown button[disabled] { + cursor: default; + pointer-events: none; +} +.filter-dropdown--button { + display: flex; + align-items: center; + gap: 5px; + padding: 10px 2px 10px 0; + text-transform: capitalize; + color: #98979d; + width: 100%; + font-size: 14px; +} +.filter-dropdown--button span.filter-dropdown--button-label { + padding-right: 3px; +} +.filter-dropdown--button span.filter-dropdown--button-selected { + color: #434246; + font-weight: 500; +} +.filter-dropdown--button i { + opacity: 0.4; + margin-left: 10px; + font-size: 14px; +} +.filter-dropdown--button:hover i, .filter-dropdown--button:focus i { + opacity: 1; +} +.filter-dropdown--menu { + display: block; + visibility: hidden; + opacity: 0; + transform: scale(0.9); + transition: transform 0.25s cubic-bezier(0.24, 0.22, 0.015, 1.56), opacity 0.15s ease-in-out, visibility 0.15s ease-in-out; + padding: 10px; + background-color: #fff; + border: 1px solid #e1e1e1; + border-radius: 3px; + box-shadow: 0 8px 16px rgba(48, 63, 122, 0.175); + z-index: 9999; + position: absolute; + top: 110%; + left: -12px; + width: 200px; + max-height: 350px; + overflow-y: auto; +} +.filter-dropdown--menu.expanded { + visibility: visible; + opacity: 1; + transform: scale(1); + top: 100%; +} +.filter-dropdown--menu button { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + text-transform: capitalize; + padding: 6px; + transition: all 0.25s ease; + font-size: 14px; +} +.filter-dropdown--menu button::before { + font-family: "FontAwesome"; + content: "\f00c"; + display: block; + color: #ccc; + opacity: 0.4; + font-size: 12px; + margin-top: 1px; +} +.filter-dropdown--menu button:hover, .filter-dropdown--menu button:focus { + color: #434246; +} +.filter-dropdown--menu button:hover::before, .filter-dropdown--menu button:focus::before { + opacity: 0.75; +} +.filter-dropdown--menu button.selected { + color: #434246; + cursor: default; +} +.filter-dropdown--menu button.selected::before { + color: #434246; + opacity: 1; +} +.filter-dropdown--menu[data-key=colors] button ._color, .filter-dropdown--menu[data-key=color] button ._color { + margin-left: auto; + width: 14px; + height: 14px; + border-radius: 50%; + background-color: currentcolor; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.075); +} +.instant-images-settings form { + display: block; +} +.instant-images-settings form.saving, .instant-images-settings form.submitting { + pointer-events: none; +} +.instant-images-settings form > h2, +.instant-images-settings form > p.desc { + display: none; +} +.instant-images-settings form select, +.instant-images-settings form input[type=text], +.instant-images-settings form input[type=number], +.instant-images-settings form textarea { + color: #6b6877; + background-color: #fff; + width: 100%; + padding: 10px; + border-color: #e1e1e1; + line-height: 1; + border-radius: 3px; +} +.instant-images-settings form select[readonly], +.instant-images-settings form input[type=text][readonly], +.instant-images-settings form input[type=number][readonly], +.instant-images-settings form textarea[readonly] { + background-color: #f7f7f7; + cursor: not-allowed; + opacity: 0.5; + border-color: #e1e1e1 !important; +} +.instant-images-settings form select:focus, +.instant-images-settings form input[type=text]:focus, +.instant-images-settings form input[type=number]:focus, +.instant-images-settings form textarea:focus { + outline: none; + border-color: #586ec6; + box-shadow: 0 0 0 1px #586ec6, 0 0 0 4px rgba(88, 110, 198, 0.1); +} +.instant-images-settings form select { + padding: 12px 10px; + max-width: none; +} +.instant-images-settings form select:hover { + color: #6b6877; +} +.instant-images-settings form label, +.instant-images-settings form .fake-label { + color: #434246; + display: block; + font-weight: 600; + clear: both; + float: none; + margin: 0 0 10px; + padding: 0; +} +.instant-images-settings form label.provider-label, +.instant-images-settings form .fake-label.provider-label { + display: flex; + width: 100%; + align-items: center; + gap: 10px; + justify-content: space-between; +} +.instant-images-settings form label.provider-label a, +.instant-images-settings form .fake-label.provider-label a { + font-size: 12px; + font-weight: 400; + display: block; + padding: 0 2px; + text-decoration: none; + position: relative; + top: 1px; +} +.instant-images-settings form label.provider-label a:hover, .instant-images-settings form label.provider-label a:focus, +.instant-images-settings form .fake-label.provider-label a:hover, +.instant-images-settings form .fake-label.provider-label a:focus { + color: #455cb6; +} +.instant-images-settings form label > span, +.instant-images-settings form .fake-label > span { + opacity: 0.8; + font-size: 13px; + font-style: italic; +} +.instant-images-settings form .api-constant { + display: block; + padding: 10px 0 0 1px; + opacity: 0.75; + font-size: 12px; +} +.instant-images-settings .instant-images-checkbox { + padding: 3px 0; + margin: 0; + font-weight: 400; + color: #6b6877; + position: relative; +} +.instant-images-settings .instant-images-checkbox--switch { + display: flex; + flex-wrap: nowrap; + gap: 8px; + width: 100%; + position: relative; +} +.instant-images-settings .instant-images-checkbox--switch .toggle-switch { + width: 41px; + height: 23px; + position: relative; + background-color: rgba(107, 104, 119, 0.5); + border-radius: 9999px; + transition: all 0.25s ease; +} +.instant-images-settings .instant-images-checkbox--switch .toggle-switch::before { + position: absolute; + content: ""; + height: 17px; + width: 17px; + left: 3px; + bottom: 3px; + border-radius: 100%; + background-color: #fff; + transition: all 0.25s ease; +} +.instant-images-settings .instant-images-checkbox--switch .toggle-label { + flex: 1; + padding-top: 2px; +} +.instant-images-settings .instant-images-checkbox input[type=checkbox] { + opacity: 0; + position: absolute; + left: -1px; +} +.instant-images-settings .instant-images-checkbox input[type=checkbox]:checked + div .toggle-switch { + background-color: #586ec6; +} +.instant-images-settings .instant-images-checkbox input[type=checkbox]:checked + div .toggle-switch::before { + left: 21px; +} +.instant-images-settings .instant-images-checkbox input[type=checkbox]:checked + div .toggle-switch::after { + opacity: 1; +} +.instant-images-settings .instant-images-checkbox input[type=checkbox]:focus + div .toggle-switch { + box-shadow: 0 0 0 1px rgb(255, 255, 255), 0 0 0 3px #586ec6; +} +.cta-extended--standard { + display: none; +} +@media screen and (min-width: 800px) { + .cta-extended--standard { + position: relative; + padding: 15px; + margin: 25px 0 0; + border: 1px solid #e1e1e1; + background-color: #f7f7f7; + border-radius: 3px; + display: flex; + align-items: center; + width: 100%; + gap: 10px; + } + .cta-extended--standard i { + font-size: 24px; + opacity: 0.7; + transform: rotate(-5deg); + color: #586ec6; + margin-top: -2px; + } + .cta-extended--standard p { + margin: 0; + font-size: 13px; + width: auto; + } + .cta-extended--standard p a { + font-weight: 600; + } + .cta-extended--standard div { + width: auto; + margin-left: auto; + display: flex; + gap: 10px; + } +} +.cta-extended--search { + position: relative; + text-align: center; + padding: 25px; +} +.cta-extended--search button.closeBtn { + position: absolute; + right: 0; + top: 0; + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + font-weight: 700; + color: #98979d; + background-color: transparent; + border: none; + cursor: pointer; +} +.cta-extended--search button.closeBtn:hover, .cta-extended--search button.closeBtn:focus { + color: #434246; +} +.cta-extended--search p { + font-size: 13px; + margin: 0 0 12px; +} +.cta-extended--search p a { + font-weight: 600; +} +.cta-extended--search p i { + display: block; + font-size: 25px; + opacity: 0.5; + color: #586ec6; + margin-bottom: 5px; +} +.cta-extended--search p:last-of-type { + margin-bottom: 0; +} +.components-panel .cta-extended { + margin: 0; + flex-direction: column; + text-align: center; + border-radius: 0; + border-width: 0 0 1px 0; + padding: 25px 20px; +} +.components-panel .cta-extended span { + display: block; +} +.components-panel .cta-extended div { + width: 100%; + margin: 0; + justify-content: center; +} +.search-header h2 { + font-size: 34px; + line-height: 1; + padding: 0; + margin: 0 0 10px; + font-weight: 800; +} +@media screen and (max-width: 800px) { + .search-header h2 { + font-size: 25px; + } +} +.search-header--text { + font-size: 14px; + line-height: 1; + margin: 0 0 15px; + color: #98979d; + display: flex; + align-items: center; + width: 100%; +} +.search-header--text strong, +.search-header--text span { + display: inline-block; +} +.search-header--text strong { + color: #434246; + font-weight: 600; + margin: 0 5px; +} +.search-header--text span { + opacity: 0.75; + margin: 0 2px; +} +.search-header--text button { + border: none; + background-color: transparent; + font-size: 14px; + line-height: 1; + cursor: pointer; + color: #586ec6; + font-weight: 400; + padding: 0; + margin: 0 5px; + transition: all 0.25s ease; +} +.search-header--text button:hover, .search-header--text button:focus { + text-decoration: underline; + color: #455cb6; +} +.search-header .control-nav--filters-wrap { + margin: 0 0 15px; +} +.instant-images-extended-import--elements { + padding: 20px; + border-radius: 2px 2px 0 0; + border: 1px solid #e1e1e1; + display: grid; + grid-gap: 20px; + grid-template-rows: repeat(1, 1fr); +} +@media screen and (min-width: 1024px) { + .instant-images-extended-import--elements { + grid-template-columns: repeat(3, 1fr); + } +} +.instant-images-extended-import--controls { + display: flex; + gap: 20px; + align-items: center; + border-radius: 0 0 2px 2px; + background-color: #f7f7f7; + border: 1px solid #e1e1e1; + border-top: 0; + padding: 20px; +} +.instant-images-extended-import .import-response { + display: none; + flex: 1; + width: 50%; +} +.instant-images-extended-import .import-response.active { + display: block; +} +.instant-images-extended-import .import-response--progress, .instant-images-extended-import .import-response--progress-bar { + width: 100%; + height: 5px; + background-color: rgba(88, 110, 198, 0.25); + border-radius: 9999px; + overflow: hidden; +} +.instant-images-extended-import .import-response--progress-bar { + width: 0%; + transition: all 0.5s linear; + background-color: #586ec6; + border-radius: 0 9999px 9999px 0; + box-shadow: 0 8px 16px rgba(48, 63, 122, 0.175); +} +.instant-images-extended-import .import-response--message { + margin-top: 4px; + display: block; + font-size: 12px; + color: #6b6877; +} +.instant-images-extended-import .import-response--message i { + margin-right: 3px; + color: #65c774; +} +.instant-images-extended-import .import-response--message span { + color: #434246; +} +.instant-images-extended-import .import-response--downloaded { + padding: 20px 20px 0; + font-size: 12px; +} +.wp-block.instant-images-block { + margin-bottom: 0; +} + +/*# sourceMappingURL=style-instant-images.css.map*/ \ No newline at end of file diff --git a/instant-images.php b/instant-images.php index 97c503d..98cec10 100755 --- a/instant-images.php +++ b/instant-images.php @@ -18,8 +18,8 @@ exit; } -define( 'INSTANT_IMAGES_VERSION', '6.2.1' ); -define( 'INSTANT_IMAGES_RELEASE', 'November 7, 2024' ); +define( 'INSTANT_IMAGES_VERSION', '6.2.2' ); +define( 'INSTANT_IMAGES_RELEASE', 'November 8, 2024' ); define( 'INSTANT_IMAGES_STORE_URL', 'https://getinstantimages.com' ); /** diff --git a/src/scss/style.scss b/src/scss/style.scss index 94b9797..2172a3d 100755 --- a/src/scss/style.scss +++ b/src/scss/style.scss @@ -20,7 +20,6 @@ @import "partials/search-header"; @import "partials/add-ons/import"; - -.wp-block { - padding: 0 !important; +.wp-block.instant-images-block { + margin-bottom: 0; }