apisearch
Version:
Javascript client for Apisearch.
2 lines • 109 kB
JavaScript
/*! For license information please see apisearch.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apisearch=e():t.apisearch=e()}(self,(()=>(()=>{var t={9669:(t,e,r)=>{t.exports=r(1609)},5448:(t,e,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),s=r(5327),a=r(4097),u=r(4109),c=r(7985),l=r(7874),p=r(2648),d=r(644),f=r(205);t.exports=function(t){return new Promise((function(e,r){var h,_=t.data,g=t.headers,y=t.responseType;function E(){t.cancelToken&&t.cancelToken.unsubscribe(h),t.signal&&t.signal.removeEventListener("abort",h)}n.isFormData(_)&&n.isStandardBrowserEnv()&&delete g["Content-Type"];var m=new XMLHttpRequest;if(t.auth){var v=t.auth.username||"",T=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";g.Authorization="Basic "+btoa(v+":"+T)}var A=a(t.baseURL,t.url);function I(){if(m){var n="getAllResponseHeaders"in m?u(m.getAllResponseHeaders()):null,o={data:y&&"text"!==y&&"json"!==y?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:t,request:m};i((function(t){e(t),E()}),(function(t){r(t),E()}),o),m=null}}if(m.open(t.method.toUpperCase(),s(A,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,"onloadend"in m?m.onloadend=I:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(I)},m.onabort=function(){m&&(r(new p("Request aborted",p.ECONNABORTED,t,m)),m=null)},m.onerror=function(){r(new p("Network Error",p.ERR_NETWORK,t,m,m)),m=null},m.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||l;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new p(e,n.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,t,m)),m=null},n.isStandardBrowserEnv()){var S=(t.withCredentials||c(A))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;S&&(g[t.xsrfHeaderName]=S)}"setRequestHeader"in m&&n.forEach(g,(function(t,e){void 0===_&&"content-type"===e.toLowerCase()?delete g[e]:m.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(m.withCredentials=!!t.withCredentials),y&&"json"!==y&&(m.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(h=function(t){m&&(r(!t||t&&t.type?new d:t),m.abort(),m=null)},t.cancelToken&&t.cancelToken.subscribe(h),t.signal&&(t.signal.aborted?h():t.signal.addEventListener("abort",h))),_||(_=null);var b=f(A);b&&-1===["http","https","file"].indexOf(b)?r(new p("Unsupported protocol "+b+":",p.ERR_BAD_REQUEST,t)):m.send(_)}))}},1609:(t,e,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),s=r(7185),a=function t(e){var r=new o(e),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return t(s(e,r))},a}(r(5546));a.Axios=o,a.CanceledError=r(644),a.CancelToken=r(4972),a.isCancel=r(6502),a.VERSION=r(7288).version,a.toFormData=r(7675),a.AxiosError=r(2648),a.Cancel=a.CanceledError,a.all=function(t){return Promise.all(t)},a.spread=r(8713),a.isAxiosError=r(6268),t.exports=a,t.exports.default=a},4972:(t,e,r)=>{"use strict";var n=r(644);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},i.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},644:(t,e,r)=>{"use strict";var n=r(2648);function i(t){n.call(this,null==t?"canceled":t,n.ERR_CANCELED),this.name="CanceledError"}r(4867).inherits(i,n,{__CANCEL__:!0}),t.exports=i},6502:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:(t,e,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),s=r(3572),a=r(7185),u=r(4097),c=r(4875),l=c.validators;function p(t){this.defaults=t,this.interceptors={request:new o,response:new o}}p.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var p=[s,void 0];for(Array.prototype.unshift.apply(p,n),p=p.concat(u),o=Promise.resolve(e);p.length;)o=o.then(p.shift(),p.shift());return o}for(var d=e;n.length;){var f=n.shift(),h=n.shift();try{d=f(d)}catch(t){h(t);break}}try{o=s(d)}catch(t){return Promise.reject(t)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},p.prototype.getUri=function(t){t=a(this.defaults,t);var e=u(t.baseURL,t.url);return i(e,t.params,t.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(t){p.prototype[t]=function(e,r){return this.request(a(r||{},{method:t,url:e,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,i){return this.request(a(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}p.prototype[t]=e(),p.prototype[t+"Form"]=e(!0)})),t.exports=p},2648:(t,e,r)=>{"use strict";var n=r(4867);function i(t,e,r,n,i){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,s={};["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"].forEach((function(t){s[t]={value:t}})),Object.defineProperties(i,s),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(t,e,r,s,a,u){var c=Object.create(o);return n.toFlatObject(t,c,(function(t){return t!==Error.prototype})),i.call(c,t.message,e,r,s,a),c.name=t.name,u&&Object.assign(c,u),c},t.exports=i},782:(t,e,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},4097:(t,e,r)=>{"use strict";var n=r(1793),i=r(7303);t.exports=function(t,e){return t&&!n(e)?i(t,e):e}},3572:(t,e,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),s=r(5546),a=r(644);function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return u(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},7185:(t,e,r)=>{"use strict";var n=r(4867);t.exports=function(t,e){e=e||{};var r={};function i(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function o(r){return n.isUndefined(e[r])?n.isUndefined(t[r])?void 0:i(void 0,t[r]):i(t[r],e[r])}function s(t){if(!n.isUndefined(e[t]))return i(void 0,e[t])}function a(r){return n.isUndefined(e[r])?n.isUndefined(t[r])?void 0:i(void 0,t[r]):i(void 0,e[r])}function u(r){return r in e?i(t[r],e[r]):r in t?i(void 0,t[r]):void 0}var c={url:s,method:s,data:s,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:u};return n.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||o,i=e(t);n.isUndefined(i)&&e!==u||(r[t]=i)})),r}},6026:(t,e,r)=>{"use strict";var n=r(2648);t.exports=function(t,e,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?e(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}},8527:(t,e,r)=>{"use strict";var n=r(4867),i=r(5546);t.exports=function(t,e,r){var o=this||i;return n.forEach(r,(function(r){t=r.call(o,t,e)})),t}},5546:(t,e,r)=>{"use strict";var n=r(4867),i=r(6016),o=r(2648),s=r(7874),a=r(7675),u={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var l,p={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(l=r(5448)),l),transformRequest:[function(t,e){if(i(e,"Accept"),i(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t))return t;if(n.isArrayBufferView(t))return t.buffer;if(n.isURLSearchParams(t))return c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,o=n.isObject(t),s=e&&e["Content-Type"];if((r=n.isFileList(t))||o&&"multipart/form-data"===s){var u=this.env&&this.env.FormData;return a(r?{"files[]":t}:t,u&&new u)}return o||"application/json"===s?(c(e,"application/json"),function(t,e,r){if(n.isString(t))try{return(0,JSON.parse)(t),n.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||p.transitional,r=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw o.from(t,o.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:r(1623)},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){p.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){p.headers[t]=n.merge(u)})),t.exports=p},7874:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:t=>{t.exports={version:"0.27.2"}},1849:t=>{"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},5327:(t,e,r)=>{"use strict";var n=r(4867);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var o;if(r)o=r(e);else if(n.isURLSearchParams(e))o=e.toString();else{var s=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))})))})),o=s.join("&")}if(o){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},7303:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},4372:(t,e,r)=>{"use strict";var n=r(4867);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var 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(){}}},1793:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},6268:(t,e,r)=>{"use strict";var n=r(4867);t.exports=function(t){return n.isObject(t)&&!0===t.isAxiosError}},7985:(t,e,r)=>{"use strict";var n=r(4867);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},6016:(t,e,r)=>{"use strict";var n=r(4867);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},1623:t=>{t.exports=null},4109:(t,e,r)=>{"use strict";var n=r(4867),i=["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"];t.exports=function(t){var e,r,o,s={};return t?(n.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=n.trim(t.substr(0,o)).toLowerCase(),r=n.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s}},205:t=>{"use strict";t.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},8713:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},7675:(t,e,r)=>{"use strict";var n=r(4867);t.exports=function(t,e){e=e||new FormData;var r=[];function i(t){return null===t?"":n.isDate(t)?t.toISOString():n.isArrayBuffer(t)||n.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(o,s){if(n.isPlainObject(o)||n.isArray(o)){if(-1!==r.indexOf(o))throw Error("Circular reference detected in "+s);r.push(o),n.forEach(o,(function(r,o){if(!n.isUndefined(r)){var a,u=s?s+"."+o:o;if(r&&!s&&"object"==typeof r)if(n.endsWith(o,"{}"))r=JSON.stringify(r);else if(n.endsWith(o,"[]")&&(a=n.toArray(r)))return void a.forEach((function(t){!n.isUndefined(t)&&e.append(u,i(t))}));t(r,u)}})),r.pop()}else e.append(s,i(o))}(t),e}},4875:(t,e,r)=>{"use strict";var n=r(7288).version,i=r(2648),o={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){o[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var s={};o.transitional=function(t,e,r){function o(t,e){return"[Axios v"+n+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,n,a){if(!1===t)throw new i(o(n," has been removed"+(e?" in "+e:"")),i.ERR_DEPRECATED);return e&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,n,a)}},t.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),o=n.length;o-- >0;){var s=n[o],a=e[s];if(a){var u=t[s],c=void 0===u||a(u,s,t);if(!0!==c)throw new i("option "+s+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},4867:(t,e,r)=>{"use strict";var n,i=r(1849),o=Object.prototype.toString,s=(n=Object.create(null),function(t){var e=o.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return s(e)===t}}function u(t){return Array.isArray(t)}function c(t){return void 0===t}var l=a("ArrayBuffer");function p(t){return null!==t&&"object"==typeof t}function d(t){if("object"!==s(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var f=a("Date"),h=a("File"),_=a("Blob"),g=a("FileList");function y(t){return"[object Function]"===o.call(t)}var E=a("URLSearchParams");function m(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),u(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}var v,T=(v="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return v&&t instanceof v});t.exports={isArray:u,isArrayBuffer:l,isBuffer:function(t){return null!==t&&!c(t)&&null!==t.constructor&&!c(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||o.call(t)===e||y(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&l(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:p,isPlainObject:d,isUndefined:c,isDate:f,isFile:h,isBlob:_,isFunction:y,isStream:function(t){return p(t)&&y(t.pipe)},isURLSearchParams:E,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:m,merge:function t(){var e={};function r(r,n){d(e[n])&&d(r)?e[n]=t(e[n],r):d(r)?e[n]=t({},r):u(r)?e[n]=r.slice():e[n]=r}for(var n=0,i=arguments.length;n<i;n++)m(arguments[n],r);return e},extend:function(t,e,r){return m(e,(function(e,n){t[n]=r&&"function"==typeof e?i(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,r,n){t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,e,r){var n,i,o,s={};e=e||{};do{for(i=(n=Object.getOwnPropertyNames(t)).length;i-- >0;)s[o=n[i]]||(e[o]=t[o],s[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:a,endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;var n=t.indexOf(e,r);return-1!==n&&n===r},toArray:function(t){if(!t)return null;var e=t.length;if(c(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r},isTypedArray:T,isFileList:g}},697:(t,e,r)=>{"use strict";e.__esModule=!0;var n=r(655),i=r(2430),o=r(4481),s=r(4481),a=r(4481),u=r(41),c=r(4637),l=r(734),p=r(9915),d=r(4283),f=r(5006),h=function(){function t(){}return t.createRepository=function(e){t.ensureRepositoryConfigIsValid(e),e.options=n.__assign({api_version:"v1",override_queries:!0,timeout:3e3},e.options);var r=void 0!==e.options.http_client?e.options.http_client:new i.AxiosClient(e.options.endpoint,e.options.api_version,e.options.timeout,e.options.override_queries);return e.options.use_cache&&(r=new f.CacheClient(r)),new c.HttpRepository(r,e.app_id,e.index_id,e.token,new d.Transformer)},t.ensureRepositoryConfigIsValid=function(e){t.ensureIsDefined(e.app_id,"app_id"),t.ensureIsDefined(e.index_id,"index_id"),t.ensureIsDefined(e.token,"token"),t.ensureIsDefined(e.options.endpoint,"options.endpoint")},t.ensureIsDefined=function(t,e){if(void 0===t)throw new TypeError(e+" parameter must be defined.")},t.createQueryLocated=function(t,e,r,n){return void 0===r&&(r=o.QUERY_DEFAULT_PAGE),void 0===n&&(n=s.QUERY_DEFAULT_SIZE),a.Query.createLocated(t,e,r,n)},t.createQuery=function(t,e,r){return void 0===e&&(e=o.QUERY_DEFAULT_PAGE),void 0===r&&(r=s.QUERY_DEFAULT_SIZE),a.Query.create(t,e,r)},t.createQueryMatchAll=function(){return a.Query.createMatchAll()},t.createQueryByUUID=function(t){return a.Query.createByUUID(t)},t.createQueryByUUIDs=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a.Query.createByUUIDs.apply(a.Query,t)},t.createEmptyResult=function(){return l.Result.create("",0,0,new p.ResultAggregations(0),[],[])},t.createEmptySortBy=function(){return u.SortBy.create()},t.createEmptyScoreStrategy=function(){return u.SortBy.create()},t}();e.default=h},4289:(t,e,r)=>{"use strict";e.__esModule=!0,e.Config=e.DEFAULT_REPLICAS=e.DEFAULT_SHARDS=void 0;var n=r(9653);e.DEFAULT_SHARDS=1,e.DEFAULT_REPLICAS=0;var i=function(){function t(t,r,n,i){void 0===t&&(t=null),void 0===r&&(r=!0),void 0===n&&(n=e.DEFAULT_SHARDS),void 0===i&&(i=e.DEFAULT_REPLICAS),this.synonyms=[],this.language=t,this.storeSearchableMetadata=r,this.shards=n,this.replicas=i}return t.prototype.getLanguage=function(){return this.language},t.prototype.shouldSearchableMetadataBeStored=function(){return this.storeSearchableMetadata},t.prototype.addSynonym=function(t){this.synonyms.push(t)},t.prototype.getSynonyms=function(){return this.synonyms},t.prototype.getShards=function(){return this.shards},t.prototype.getReplicas=function(){return this.replicas},t.prototype.toArray=function(){return{language:this.language,store_searchable_metadata:this.storeSearchableMetadata,synonyms:this.synonyms.map((function(t){return t.toArray()})),shards:this.shards,replicas:this.replicas}},t.createFromArray=function(r){var i=new t(r.language?r.language:null,"boolean"!=typeof r.store_searchable_metadata||r.store_searchable_metadata);return r.synonyms instanceof Array&&r.synonyms.length>0&&(i.synonyms=r.synonyms.map((function(t){return n.Synonym.createFromArray(t)}))),i.shards="number"==typeof r.shards?r.shards:e.DEFAULT_SHARDS,i.replicas="number"==typeof r.replicas?r.replicas:e.DEFAULT_REPLICAS,i},t}();e.Config=i},9653:(t,e)=>{"use strict";e.__esModule=!0,e.Synonym=void 0;var r=function(){function t(t){this.words=t}return t.prototype.getWords=function(){return this.words},t.createbyWords=function(e){return new t(e)},t.prototype.toArray=function(){return{words:this.words}},t.createFromArray=function(e){return new t(e.words instanceof Object?e.words:[])},t.prototype.expand=function(){return this.words.join(",")},t}();e.Synonym=r},6017:(t,e,r)=>{"use strict";e.__esModule=!0,e.ConnectionError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 500},e}(r(3138).ErrorWithMessage);e.ConnectionError=i},3138:(t,e)=>{"use strict";e.__esModule=!0,e.ErrorWithMessage=void 0;e.ErrorWithMessage=function(t){this.message=t}},7380:(t,e,r)=>{"use strict";e.__esModule=!0,e.EventError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.throwEndpointNotAvailable=function(){return new e("Endpoint not available")},e}(r(3138).ErrorWithMessage);e.EventError=i},175:(t,e,r)=>{"use strict";e.__esModule=!0,e.ForbiddenError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 403},e.createAppIdIsRequiredException=function(){return new e("AppId query parameter MUST be defined with a valid value")},e.createIndexIsRequiredException=function(){return new e("Index query parameter MUST be defined with a valid value")},e.createTokenIsRequiredException=function(){return new e("Token query parameter MUST be defined with a valid value")},e}(r(3138).ErrorWithMessage);e.ForbiddenError=i},9081:(t,e,r)=>{"use strict";e.__esModule=!0,e.InvalidFormatError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 400},e.itemRepresentationNotValid=function(){return new e("Item representation not valid. Expecting Item array serialized but found malformed data")},e.itemUUIDRepresentationNotValid=function(){return new e("Item UUID representation not valid. Expecting UUID array serialized but found malformed data")},e.composedItemUUIDNotValid=function(){return new e("A composed UUID should always follow this format: {id}~{type}.")},e.querySortedByDistanceWithoutCoordinate=function(){return new e("In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()")},e.queryFormatNotValid=function(){return new e("Query Format not valid. Expecting a Query serialized but found malformed data")},e.coordinateFormatNotValid=function(){return new e("A Coordinate should always contain a lat (Latitude) and a lon (Longitude)")},e.configFormatNotValid=function(){return new e("Config Format not valid. Expecting a Config serialized but found malformed data")},e.tokenFormatNotValid=function(){return new e("Token Format not valid. Expecting a Token serialized but found malformed data")},e.indexFormatNotValid=function(){return new e("Index Format not valid. Expecting an Index serialized but found malformed data")},e.indexUUIDFormatNotValid=function(){return new e("IndexUUID Format not valid. Expecting an IndexUUID serialized but found malformed data")},e.appUUIDFormatNotValid=function(){return new e("AppUUID Format not valid. Expecting an AppUUID serialized but found malformed data")},e.campaignFormatNotValid=function(){return new e("Campaign Format not valid. Expecting a Campaign serialized but found malformed data")},e.changesFormatNotValid=function(){return new e("Changes Format not valid. Expecting a Changes serialized but found malformed data")},e.boostClauseFormatNotValid=function(){return new e("Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data")},e.tokenUUIDFormatNotValid=function(){return new e("Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data")},e.userFormatNotValid=function(){return new e("User Format not valid. Expecting a User serialized but found malformed data")},e}(r(3138).ErrorWithMessage);e.InvalidFormatError=i},9134:(t,e,r)=>{"use strict";e.__esModule=!0,e.InvalidTokenError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 401},e.createInvalidTokenPermissions=function(t){return new e("Token "+t+"not valid")},e.createInvalidTokenMaxHitsPerQuery=function(t,r){return new e("Token "+t+"not valid. Max "+r+" hits allowed")},e}(r(3138).ErrorWithMessage);e.InvalidTokenError=i},8257:(t,e,r)=>{"use strict";e.__esModule=!0,e.ResourceExistsError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 409},e.indexAvailable=function(){return new e("Index exists and cannot be created again")},e.eventsIndexAvailable=function(){return new e("Events index exists and cannot be created again")},e.logsIndexAvailable=function(){return new e("Logs index exists and cannot be created again")},e}(r(3138).ErrorWithMessage);e.ResourceExistsError=i},273:(t,e,r)=>{"use strict";e.__esModule=!0,e.ResourceNotAvailableError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 404},e.indexNotAvailable=function(t){return new e("Index not available - "+t)},e.eventsIndexNotAvailable=function(t){return new e("Events not available - "+t)},e.logsIndexNotAvailable=function(t){return new e("Logs not available - "+t)},e.engineNotAvailable=function(t){return new e("Engine not available - "+t)},e}(r(3138).ErrorWithMessage);e.ResourceNotAvailableError=i},4587:(t,e,r)=>{"use strict";e.__esModule=!0,e.UnknownError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.createUnknownError=function(){return new this("Unknown error.")},e}(r(3138).ErrorWithMessage);e.UnknownError=i},52:(t,e,r)=>{"use strict";e.__esModule=!0,e.UnsupportedContentTypeError=void 0;var n=r(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 415},e.createUnsupportedContentTypeException=function(){return new e("This content type is not accepted. Please use application/json")},e}(r(3138).ErrorWithMessage);e.UnsupportedContentTypeError=i},9878:(t,e,r)=>{"use strict";e.__esModule=!0,e.Square=e.Polygon=e.CoordinateAndDistance=e.LocationRange=void 0;var n=r(655),i=r(5343),o=function(){function t(){}return t.fromFilterObject=function(t){throw TypeError("Method not valid")},t.prototype.toArray=function(){return{type:this.getName(),data:this.toFilterObject()}},t.createFromArray=function(t){return"CoordinateAndDistance"==t.type?s.fromFilterObject(t.data):"Polygon"==t.type?a.fromFilterObject(t.data):"Square"==t.type?u.fromFilterObject(t.data):void 0},t}();e.LocationRange=o;var s=function(t){function e(e,r){var n=t.call(this)||this;return n.coordinate=e,n.distance=r,n}return n.__extends(e,t),e.prototype.toFilterObject=function(){return{coordinate:this.coordinate.toArray(),distance:this.distance}},e.prototype.getName=function(){return"CoordinateAndDistance"},e.fromFilterObject=function(t){return new e(i.Coordinate.createFromArray(t.coordinate),t.distance)},e}(o);e.CoordinateAndDistance=s;var a=function(t){function e(e){var r=t.call(this)||this;if(e.length<3)throw new Error("A polygon needs more than two coordinates.");return r.coordinates=e,r}return n.__extends(e,t),e.prototype.toFilterObject=function(){var t=[];for(var e in this.coordinates)t.push(this.coordinates[e].toArray());return{coordinates:t}},e.prototype.getName=function(){return"Polygon"},e.fromFilterObject=function(t){var r=[];for(var n in t.coordinates)r.push(i.Coordinate.createFromArray(t.coordinates[n]));return new e(r)},e}(o);e.Polygon=a;var u=function(t){function e(e,r){var n=t.call(this)||this;return n.topLeftCoordinate=e,n.bottomRightCoordinate=r,n}return n.__extends(e,t),e.prototype.toFilterObject=function(){return{top_left:this.topLeftCoordinate.toArray(),bottom_right:this.bottomRightCoordinate.toArray()}},e.prototype.getName=function(){return"Square"},e.fromFilterObject=function(t){return new e(i.Coordinate.createFromArray(t.top_left),i.Coordinate.createFromArray(t.bottom_right))},e}(o);e.Square=u},2430:(t,e,r)=>{"use strict";e.__esModule=!0,e.AxiosClient=void 0;var n=r(655),i=r(9669),o=r(3607),s=r(6563),a=r(9313),u=function(t){function e(e,r,n,i){var o=t.call(this,r)||this;return o.host=e,o.timeout=n,o.overrideQueries=i,o.abortControllers={},o}return n.__extends(e,t),e.prototype.get=function(t,e,r,i,u){return void 0===i&&(i={}),void 0===u&&(u={}),n.__awaiter(this,void 0,void 0,(function(){var c,l,p,d;return n.__generator(this,(function(f){switch(f.label){case 0:t=t.replace(/^\/*|\/*$/g,""),t="/"+(this.version+"/"+t).replace(/^\/*|\/*$/g,""),"get"===(e=e.toLowerCase())&&this.overrideQueries&&this.abort(t,!0),c="get"===e?{}:{"Content-Encoding":"gzip","Content-Type":"application/json"},l={baseURL:this.host.replace(/\/*$/g,""),data:u,headers:c,method:e,timeout:this.timeout,transformRequest:[function(t){return JSON.stringify(t)}],url:t+"?"+s.Client.objectToUrlParameters(n.__assign(n.__assign({},i),{token:r.token})).replace(/#/g,"%23")},void 0!==this.abortControllers[t]&&(l.signal=this.abortControllers[t].signal),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this.fetch(t,l,3)];case 2:return p=f.sent(),[2,new a.Response(p.status,p.data)];case 3:throw(d=f.sent()).response?new a.Response(d.response.status,d.response.data):new a.Response(o.ConnectionError.getTransportableHTTPError(),{message:d.message});case 4:return[2]}}))}))},e.prototype.abort=function(t,e){e||(t=t.replace(/^\/*|\/*$/g,""),t="/"+(this.version+"/"+t).replace(/^\/*|\/*$/g,"")),void 0!==this.abortControllers[t]&&this.abortControllers[t].abort(),this.generateAbortController(t)},e.prototype.generateAbortController=function(t){this.abortControllers[t]=new AbortController},e.prototype.fetch=function(t,e,r){return n.__awaiter(this,void 0,void 0,(function(){var o=this;return n.__generator(this,(function(n){switch(n.label){case 0:return[4,i.default.request(e).then((function(t){return{data:t.data,status:t.status}})).catch((function(n){var i=n.response;if(void 0!==n.code&&"ECONNREFUSED"!==n.code&&"ECONNABORTED"!==n.code&&"ERR_BAD_REQUEST"!==n.code&&"Network Error"!==n.message)return{data:i.data,status:i.status};if(r<=0)throw n;return r-=1,o.fetch(t,e,r)}))];case 1:return[2,n.sent()]}}))}))},e}(s.Client);e.AxiosClient=u},5006:(t,e,r)=>{"use strict";e.__esModule=!0,e.CacheClient=void 0;var n=r(655),i=r(4758),o=function(){function t(t){this.cache={},this.hits=0,this.httpClient=t}return t.prototype.flushCache=function(){this.cache={}},t.prototype.size=function(){return Object.keys(this.cache).length},t.prototype.getNumberOfHits=function(){return this.hits},t.prototype.get=function(t,e,r,o,s){return void 0===o&&(o={}),void 0===s&&(s={}),n.__awaiter(this,void 0,void 0,(function(){var a,u,c;return n.__generator(this,(function(n){switch(n.label){case 0:return"get"!==e?[2,this.httpClient.get(t,e,r,o,s)]:(a=i.Md5.hashStr(JSON.stringify({u:t,c:r,p:o,d:s})).toString(),this.cache[a]?[3,2]:(u=this.cache,c=a,[4,this.httpClient.get(t,e,r,o,s)]));case 1:return u[c]=n.sent(),[3,3];case 2:this.httpClient.abort(t,!1),this.hits++,n.label=3;case 3:return[2,this.cache[a]]}}))}))},t.prototype.abort=function(t,e){},t}();e.CacheClient=o},6563:(t,e)=>{"use strict";e.__esModule=!0,e.Client=void 0;var r=function(){function t(t){this.version=t.replace(/^\/*|\/*$/g,"")}return t.objectToUrlParameters=function(t){var e=[];for(var r in t)e.push(r+"="+t[r]);return e.join("&")},t}();e.Client=r},4885:(t,e)=>{"use strict";e.__esModule=!0,e.HttpClient=void 0;e.HttpClient=function(){}},9313:(t,e)=>{"use strict";e.__esModule=!0,e.Response=void 0;var r=function(){function t(t,e){this.code=t,this.body=e}return t.prototype.getCode=function(){return this.code},t.prototype.getBody=function(){return this.body},t}();e.Response=r},1382:(t,e,r)=>{"use strict";e.__esModule=!0,e.AppUUID=void 0;var n=r(9081),i=function(){function t(t){if(t.indexOf("_")>=0)throw n.InvalidFormatError.appUUIDFormatNotValid();this.id=t}return t.createById=function(e){return new t(e)},t.prototype.getId=function(){return this.id},t.prototype.toArray=function(){return{id:this.id}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id)},t.prototype.composedUUID=function(){return this.id},t}();e.AppUUID=i},4026:(t,e)=>{"use strict";e.__esModule=!0,e.Changes=e.TYPE_ARRAY=e.TYPE_ARRAY_EXPECTS_ELEMENT=e.TYPE_ARRAY_ELEMENT_DELETE=e.TYPE_ARRAY_ELEMENT_ADD=e.TYPE_ARRAY_ELEMENT_UPDATE=e.TYPE_LITERAL=e.TYPE_VALUE=void 0,e.TYPE_VALUE=1,e.TYPE_LITERAL=4,e.TYPE_ARRAY_ELEMENT_UPDATE=8,e.TYPE_ARRAY_ELEMENT_ADD=16,e.TYPE_ARRAY_ELEMENT_DELETE=32,e.TYPE_ARRAY_EXPECTS_ELEMENT=24,e.TYPE_ARRAY=56;var r=function(){function t(){this.changes=[]}return t.prototype.addChange=function(t,r,n){void 0===n&&(n=e.TYPE_VALUE),this.changes.push({field:t,type:n,value:r})},t.prototype.updateElementFromList=function(t,r,n,i){this.changes.push({field:t,type:i|e.TYPE_ARRAY_ELEMENT_UPDATE,condition:r,value:n})},t.prototype.addElementInList=function(t,r,n){this.changes.push({field:t,type:n|e.TYPE_ARRAY_ELEMENT_ADD,value:r})},t.prototype.deleteElementFromList=function(t,r){this.changes.push({field:t,type:e.TYPE_ARRAY_ELEMENT_DELETE,condition:r})},t.prototype.getChanges=function(){return this.changes},t.create=function(){return new t},t.prototype.toArray=function(){return JSON.parse(JSON.stringify(this.changes))},t.createFromArray=function(e){e=JSON.parse(JSON.stringify(e));var r=t.create();return r.changes=e,r},t}();e.Changes=r},5343:(t,e,r)=>{"use strict";e.__esModule=!0,e.Coordinate=void 0;var n=r(9081),i=function(){function t(t,e){this.lat=t,this.lon=e}return t.prototype.getLatitude=function(){return this.lat},t.prototype.getLongitude=function(){return this.lon},t.prototype.toArray=function(){return{lat:this.lat,lon:this.lon}},t.createFromArray=function(e){if(void 0===e.lat||void 0===e.lon)throw n.InvalidFormatError.coordinateFormatNotValid();return new t(e.lat,e.lon)},t}();e.Coordinate=i},4855:(t,e,r)=>{"use strict";e.__esModule=!0,e.Index=void 0;var n=r(9081),i=r(2312),o=r(1382),s=function(){function t(t,e,r,n,i){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===i&&(i="0kb"),this.uuid=t,this.appUUID=e,this.isOK=r,this.docCount=n,this.size=i}return t.prototype.getUUID=function(){return this.uuid},t.prototype.getAppUUID=function(){return this.appUUID},t.prototype.isOk=function(){return this.isOK},t.prototype.getDocCount=function(){return this.docCount},t.prototype.getSize=function(){return this.size},t.prototype.toArray=function(){return{uuid:this.uuid.toArray(),app_id:this.appUUID.toArray(),is_ok:this.isOK,doc_count:this.docCount,size:this.size}},t.createFromArray=function(e){if(void 0===e.uuid||void 0===e.app_id)throw n.InvalidFormatError.indexFormatNotValid();return new t(i.IndexUUID.createFromArray(e.uuid),o.AppUUID.createFromArray(e.app_id),void 0!==e.is_ok&&e.is_ok,void 0===e.doc_count?0:e.doc_count,void 0===e.size?"0kb":e.size)},t}();e.Index=s},2312:(t,e,r)=>{"use strict";e.__esModule=!0,e.IndexUUID=void 0;var n=r(9081),i=function(){function t(t){if(t.indexOf("_")>=0)throw n.InvalidFormatError.indexUUIDFormatNotValid();this.id=t}return t.createById=function(e){return new t(e)},t.prototype.getId=function(){return this.id},t.prototype.toArray=function(){return{id:this.id}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id)},t.prototype.composedUUID=function(){return this.id},t}();e.IndexUUID=i},4232:(t,e,r)=>{"use strict";e.__esModule=!0,e.Item=void 0;var n=r(655),i=r(9081),o=r(5343),s=r(3683),a=r(1382),u=r(2312),c=function(){function t(t,e,r,n,i,o,s){this.metadata={},this.indexedMetadata={},this.searchableMetadata={},this.exactMatchingMetadata=[],this.suggest=[],this.highlights={},this.promoted=!1,this.uuid=t,this.coordinate=e,this.metadata=r,this.indexedMetadata=n,this.searchableMetadata=i,this.exactMatchingMetadata=o,this.suggest=s}return t.create=function(e,r,n,i,o,s){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o=[]),void 0===s&&(s=[]),new t(e,null,r,n,i,o,s)},t.createLocated=function(e,r,n,i,o,s,a){return void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o={}),void 0===s&&(s=[]),void 0===a&&(a=[]),new t(e,r,n,i,o,s,a)},t.prototype.getUUID=function(){return this.uuid},t.prototype.getId=function(){return this.uuid.getId()},t.prototype.getType=function(){return this.uuid.getType()},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.getDistance=function(){return this.distance},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(t){this.metadata=t},t.prototype.addMetadata=function(t,e){this.metadata[t]=e},t.prototype.getIndexedMetadata=function(){return this.indexedMetadata},t.prototype.setIndexedMetadata=function(t){this.indexedMetadata=t},t.prototype.addIndexedMetadata=function(t,e){this.indexedMetadata[t]=e},t.prototype.getSearchableMetadata=function(){return this.searchableMetadata},t.prototype.setSearchableMetadata=function(t){this.searchableMetadata=t},t.prototype.addSearchableMetadata=function(t,e){this.searchableMetadata[t]=e},t.prototype.getExactMatchingMetadata=function(){return this.exactMatchingMetadata},t.prototype.setExactMatchingMetadata=function(t){this.exactMatchingMetadata=t},t.prototype.addExactMatchingMetadata=function(t){this.exactMatchingMetadata.push(t)},t.prototype.getAllMetadata=function(){return n.__assign(n.__assign({},this.metadata),this.indexedMetadata)},t.prototype.get=function(t){var e=this.getAllMetadata();return void 0!==e[t]?e[t]:null},t.prototype.getSuggest=function(){return this.suggest},t.prototype.getHighlights=function(){return this.highlights},t.prototype.getHighlight=function(t){return void 0!==this.highlights[t]?this.highlights[t]:null},t.prototype.isPromoted=function(){return this.promoted},t.prototype.setScore=function(t){return this.score=t,this},t.prototype.getScore=function(){return this.score},t.prototype.getAppUUID=function(){return this.appUUID},t.prototype.getIndexUUID=function(){return this.indexUUID},t.prototype.toArray=function(){var t={uuid:this.uuid.toArray()};return this.coordinate instanceof o.Coordinate&&(t.coordinate=this.coordinate.toArray()),Object.keys(this.metadata).length>0&&(t.metadata=this.metadata),Object.keys(this.indexedMetadata).length>0&&(t.indexed_metadata=this.indexedMetadata),Object.keys(this.searchableMetadata).length>0&&(t.searchable_metadata=this.searchableMetadata),this.exactMatchingMetadata.length>0&&(t.exact_matching_metadata=this.exactMatchingMetadata),this.suggest.length>0&&(t.suggest=this.suggest),Object.keys(this.highlights).length>0&&(t.highlights=this.highlights),this.isPromoted()&&(t.is_promoted=!0),void 0!==this.distance&&(t.distance=this.distance),void 0!==this.score&&(t.score=this.score),void 0!==this.appUUID&&(t.app_uuid=this.appUUID.toArray()),void 0!==this.indexUUID&&(t.index_uuid=this.indexUUID.toArray()),t},t.createFromArray=function(e){if("object"!=typeof(e=JSON.parse(JSON.stringify(e))).uuid)throw i.InvalidFormatError.itemUUIDRepresentationNotValid();if(void 0!==e.coordinate&&"object"!=typeof e.coordinate)throw i.InvalidFormatError.coordinateFormatNotValid();var r="object"==typeof e.coordinate&&null!=e.coordinate?t.createLocated(s.ItemUUID.createFromArray(e.uuid),o.Coordinate.createFromArray(e.coordinate),void 0===e.metadata?{}:e.metadata,void 0===e.indexed_metadata?{}:e.indexed_metadata,void 0===e.searchable_metadata?{}:e.searchable_metadata,void 0===e.exact_matching_metadata?[]:e.exact_matching_metadata,void 0===e.suggest?[]:e.suggest):t.create(s.ItemUUID.createFromArray(e.uuid),void 0===e.metadata?{}:e.metadata,void 0===e.indexed_metadata?{}:e.indexed_metadata,void 0===e.searchable_metadata?{}:e.searchable_metadata,void 0===e.exact_matching_metadata?[]:e.exact_matching_metadata,void 0===e.suggest?[]:e.suggest);return void 0!==e.distance&&null!=e.distance&&(r.distance=e.distance),"object"==typeof e.highlights&&null!=e.highlights&&(r.highlights=e.highlights),void 0!==e.is_promoted&&null!=e.is_promoted&&(r.promoted=e.is_promoted),void 0!==e.score&&null!=e.score&&(r.score=e.score),void 0!==e.app_uuid&&null!=e.app_uuid&&(r.appUUID=a.AppUUID.createFromArray(e.app_uuid)),void 0!==e.index_uuid&&null!=e.index_uuid&&(r.indexUUID=u.IndexUUID.createFromArray(e.index_uuid)),r},t.prototype.composeUUID=function(){return this.uuid.composedUUID()},t.getPathByField=function(t){return["id","type"].indexOf(t)>-1?"uuid."+t:"indexed_metadata."+t},t}();e.Item=c},3683:(t,e,r)=>{"use strict";e.__esModule=!0,e.ItemUUID=void 0;var n=r(9081),i=function(){function t(t,e){this.id=t,this.type=e}return t.createByComposedUUID=function(e){var r=e.split("~");if(2!=r.length)throw n.InvalidFormatError.composedItemUUIDNotValid();return new t(r[0],r[1])},t.prototype.getId=function(){return this.id},t.prototype.getType=function(){return this.type},t.prototype.toArray=function(){return{id:this.id,type:this.type}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id,e.type)},t.prototype.composedUUID=function(){return this.id+"~"+this.type},t}();e.ItemUUID=i},7031:(t,e)=>{"use strict";e.__esModule=!0,e.Metadata=void 0;var r=function(){function t(){}return t.toMetadata=function(t){t=JSON.parse(JSON.stringify(t));var e=[];for(var r in t)e.push(r+"##"+t[r]);return e.join("~~")},t.fromMetadata=function(t){var e={},r=t.split("~~"),n=0,i=0,o=null;for(var s in r){var a=r[s],u=a.split("##");u.length>1?(o=u[1],e[u[0]]=o):(o=a,e[n++]=o),i++}return 1==i&&(e={id:o,name:o}),void 0===e.id?null:e},t}();e.Metadata=r},559:(t,e,r)=>{"use strict";e.__esModule=!0,e.User=void 0;var n=r(9081),i=function(){function t(t,e){void 0===e&&(e={}),this.id=t,this.attributes=e}return t.prototype.getId=function(){return this.id},t.prototype.getAttributes=function(){return this.attributes},t.prototype.toArray=function(){var t={id:this.id};return Object.keys(this.attributes).length>0&&(t.attributes=this.attributes),t},t.createFromArray=function(e){if(null==e||void 0===e.id||null==e.id)throw n.InvalidFormatError.userFormatNotValid();var r=typeof e.attributes==typeof{}?e.attributes:{};return new t(e.id,r)},t}();e.User=i},1341:(t,e,r)=>{"use strict";e.__esModule=!0,e.Aggregation=e.AGGREGATION_NO_LIMIT=e.AGGREGATION_SORT_BY_NAME_DESC=e.AGGREGATION_SORT_BY_NAME_ASC=e.AGGREGATION_SORT_BY_COUNT_DESC=e.AGGREGATION_SORT_BY_COUNT_ASC=void 0;var n=r(5908);e.AGGREGATION_SORT_BY_COUNT_ASC=["_count","asc"],e.AGGREGATION_SORT_BY_COUNT_DESC=["_count","desc"],e.AGGREGATION_SORT_BY_NAME_ASC=["_term","asc"],e.AGGREGATION_SORT_BY_NAME_DESC=["_term","desc"],e.AGGREGATION_NO_LIMIT=0;var i=function(){function t(t,e,r,n,i,o,s,a){this.subgroup=[],this.name=t,this.field=e,this.applicationType=r,this.filterType=n,this.subgroup=i,this.sort=o,this.limit=s,this.promoted=a}return t.prototype.getName=function(){return this.name},t.prototype.getField=function(){return this.field},t.prototype.getApplicationType=function(){return this.applicationType},t.prototype.getFilterType=function(){return this.filterType},t.prototype.getSubgroup=function(){return this.subgroup},t.prototype.getSort=function(){return this.sort},t.prototype.getLimit=function(){return this.limit},t.prototype.getPromoted=function(){return this.promoted},t.create=function(r,n,i,o,s,a,u,c){return void 0===s&&(s=[]),void 0===a&&(a=e.AGGREGATION_SORT_BY_COUNT_DESC),void 0===u&&(u=e.AGGREGATION_NO_LIMIT),void 0===c&&(c=[]),new t(r,n,i,o,s,a,u,c)},t.prototype.toArray=function(){var t={name:this.name};return"uuid.type"!==this.field&&(t.field=this.field),this.applicationType!==n.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.filterType!==n.FILTER_TYPE_FIELD&&(t.filter_type=this.filterType),this.subgroup.length>0&&(t.subgroup=this.subgroup),JSON.stringify(this.sort)!==JSON.stringify(e.AGGREGATION_SORT_BY_COUNT_DESC)&&(t.sort=this.sort),this.limit!==e.AGGREGATION_NO_LIMIT&&(t.limit=this.limit),this.promoted.length>0&&(t.promoted=this.promoted),t},t.createFromArray=function(r){return void 0===(r=JSON.parse(JSON.stringify(r))).field&&(r.field="uuid.type"),void 0===r.application_type&&(r.application_type=n.FILTER_AT_LEAST_ONE),void 0===r.filter_type&&(r.filter_type=n.FILTER_TYPE_FIELD),void 0===r.subgroup&&(r.subgroup=[]),void 0===r.sort&&(r.sort=e.AGGREGATION_SORT_BY_COUNT_DESC),void 0===r.limit&&(r.limit=e.AGGREGATION_NO_LIMIT),void 0===r.promoted&&(r.promoted=[]),t.create(r.name,r.field,r.application_type,r.filter_type,r.subgroup,r.sort,r.limit,r.promoted)},t}();e.Aggregation=i},5908:(t,e)=>{"use strict";e.__esModule=!0,e.Filter=e.FILTER_TYPE_QUERY=e.FILTER_TYPE_GEO=e.FILTER_TYPE_DATE_RANGE=e.FILTER_TYPE_RANGE=e.FILTER_TYPE_FIELD=e.FILTER_PROMOTE=e.FILTER_EXCLUDE=e.FILTER_AT_LEAST_ONE=e.FILTER_MUST_ALL_WITH_LEVELS=e.FILTER_MUST_ALL=void 0,e.FILTER_MUST_ALL=4,e.FILTER_MUST_ALL_WITH_LEVELS=5,e.FILTER_AT_LEAST_ONE=8,e.FILTER_EXCLUDE=16,e.FILTER_PROMOTE=32,e.FILTER_TYPE_FIELD="field",e.FILTER_TYPE_RANGE="range",e.FILTER_TYPE_DATE_RANGE="date_range",e.FILTER_TYPE_GEO="geo",e.FILTER_TYPE_QUERY="query";var r=function(){function t(t,e,r,n,i){this.field=t,this.values=e,this.applicationType=r,this.filterType=n,this.filterTerms=i}return t.prototype.getField=function(){return this.field},t.prototype.getValues=function(){return this.values},t.prototype.hasValue=function(t){return void 0===this.values[t]},t.prototype.getApplicationType=function(){return this.applicationType},t.prototype.getFilterType=function(){return this.filterType},t.prototype.getFilterTerms=function(){return this.filterTerms},t.create=function(e,r,n,i,o){return void 0===o&&(o=[]),new t(e,r,n,i,o)},t.prototype.toArray=function(){var t={};return"uuid.type"!=this.field&&(t.field=this.field),(this.values.length>0||Object.keys(this.values).length>0)&&(t.values=this.values),this.applicationType!=e.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.filterType!=e.FILTER_TYPE_FIELD&&(t.filter_type=this.filterType),this.filterTerms.length>0&&(t.filter_terms=this.filterTerms),t},t.createFromArray=function(r){return void 0===(r=JSON.parse(JSON.stringify(r))).field&&(r.field="uuid.type"),void 0===r.values&&(r.values=[]),void 0===r.application_type&&(r.application_type=e.FILTER_AT_LEAST_ONE),void 0===r.filter_type&&(r.filter_type=e.FILTER_TYPE_FIELD),void 0===r.filter_terms&&(r.filter_terms=[]),t.create(r.field,r.values,r.application_type,r.filter_type,r.filter_terms)},t}();e.Filter=r},4481:(t,e,r)=>{"use strict";e.__esModule=!0,e.Query=e.NO_MIN_SCORE=e.QU