UNPKG

@data-forge-services/react-core

Version:

Core React component library for Data Forge services including location, timezone, and more.

6 lines 293 kB
(function(z,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],y):(z=typeof globalThis<"u"?globalThis:z||self,y(z.DataForgeReactComponents={},z.React,z.React))})(this,function(z,y,v){"use strict";function bt(e,t){return function(){return e.apply(t,arguments)}}const{toString:id}=Object.prototype,{getPrototypeOf:Ge}=Object,{iterator:be,toStringTag:At}=Symbol,Ae=(e=>t=>{const d=id.call(t);return e[d]||(e[d]=d.slice(8,-1).toLowerCase())})(Object.create(null)),H=e=>(e=e.toLowerCase(),t=>Ae(t)===e),Ce=e=>t=>typeof t===e,{isArray:ae}=Array,le=Ce("undefined");function od(e){return e!==null&&!le(e)&&e.constructor!==null&&!le(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ct=H("ArrayBuffer");function sd(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ct(e.buffer),t}const ud=Ce("string"),k=Ce("function"),Nt=Ce("number"),Ne=e=>e!==null&&typeof e=="object",ld=e=>e===!0||e===!1,ve=e=>{if(Ae(e)!=="object")return!1;const t=Ge(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(At in e)&&!(be in e)},cd=H("Date"),fd=H("File"),$d=H("Blob"),hd=H("FileList"),md=e=>Ne(e)&&k(e.pipe),pd=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||k(e.append)&&((t=Ae(e))==="formdata"||t==="object"&&k(e.toString)&&e.toString()==="[object FormData]"))},gd=H("URLSearchParams"),[yd,bd,Ad,Cd]=["ReadableStream","Request","Response","Headers"].map(H),Nd=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ce(e,t,{allOwnKeys:d=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),ae(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const a=d?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let o;for(n=0;n<i;n++)o=a[n],t.call(null,e[o],o,e)}}function vt(e,t){t=t.toLowerCase();const d=Object.keys(e);let n=d.length,r;for(;n-- >0;)if(r=d[n],t===r.toLowerCase())return r;return null}const Q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pt=e=>!le(e)&&e!==Q;function We(){const{caseless:e}=Pt(this)&&this||{},t={},d=(n,r)=>{const a=e&&vt(t,r)||r;ve(t[a])&&ve(n)?t[a]=We(t[a],n):ve(n)?t[a]=We({},n):ae(n)?t[a]=n.slice():t[a]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&ce(arguments[n],d);return t}const vd=(e,t,d,{allOwnKeys:n}={})=>(ce(t,(r,a)=>{d&&k(r)?e[a]=bt(r,d):e[a]=r},{allOwnKeys:n}),e),Pd=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Sd=(e,t,d,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),d&&Object.assign(e.prototype,d)},Ed=(e,t,d,n)=>{let r,a,i;const o={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),a=r.length;a-- >0;)i=r[a],(!n||n(i,e,t))&&!o[i]&&(t[i]=e[i],o[i]=!0);e=d!==!1&&Ge(e)}while(e&&(!d||d(e,t))&&e!==Object.prototype);return t},wd=(e,t,d)=>{e=String(e),(d===void 0||d>e.length)&&(d=e.length),d-=t.length;const n=e.indexOf(t,d);return n!==-1&&n===d},xd=e=>{if(!e)return null;if(ae(e))return e;let t=e.length;if(!Nt(t))return null;const d=new Array(t);for(;t-- >0;)d[t]=e[t];return d},Td=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ge(Uint8Array)),Od=(e,t)=>{const n=(e&&e[be]).call(e);let r;for(;(r=n.next())&&!r.done;){const a=r.value;t.call(e,a[0],a[1])}},_d=(e,t)=>{let d;const n=[];for(;(d=e.exec(t))!==null;)n.push(d);return n},Fd=H("HTMLFormElement"),Id=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(d,n,r){return n.toUpperCase()+r}),St=(({hasOwnProperty:e})=>(t,d)=>e.call(t,d))(Object.prototype),zd=H("RegExp"),Et=(e,t)=>{const d=Object.getOwnPropertyDescriptors(e),n={};ce(d,(r,a)=>{let i;(i=t(r,a,e))!==!1&&(n[a]=i||r)}),Object.defineProperties(e,n)},Rd=e=>{Et(e,(t,d)=>{if(k(e)&&["arguments","caller","callee"].indexOf(d)!==-1)return!1;const n=e[d];if(k(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+d+"'")})}})},Md=(e,t)=>{const d={},n=r=>{r.forEach(a=>{d[a]=!0})};return ae(e)?n(e):n(String(e).split(t)),d},Dd=()=>{},Ld=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function kd(e){return!!(e&&k(e.append)&&e[At]==="FormData"&&e[be])}const Bd=e=>{const t=new Array(10),d=(n,r)=>{if(Ne(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const a=ae(n)?[]:{};return ce(n,(i,o)=>{const s=d(i,r+1);!le(s)&&(a[o]=s)}),t[r]=void 0,a}}return n};return d(e,0)},Ud=H("AsyncFunction"),jd=e=>e&&(Ne(e)||k(e))&&k(e.then)&&k(e.catch),wt=((e,t)=>e?setImmediate:t?((d,n)=>(Q.addEventListener("message",({source:r,data:a})=>{r===Q&&a===d&&n.length&&n.shift()()},!1),r=>{n.push(r),Q.postMessage(d,"*")}))(`axios@${Math.random()}`,[]):d=>setTimeout(d))(typeof setImmediate=="function",k(Q.postMessage)),Gd=typeof queueMicrotask<"u"?queueMicrotask.bind(Q):typeof process<"u"&&process.nextTick||wt,c={isArray:ae,isArrayBuffer:Ct,isBuffer:od,isFormData:pd,isArrayBufferView:sd,isString:ud,isNumber:Nt,isBoolean:ld,isObject:Ne,isPlainObject:ve,isReadableStream:yd,isRequest:bd,isResponse:Ad,isHeaders:Cd,isUndefined:le,isDate:cd,isFile:fd,isBlob:$d,isRegExp:zd,isFunction:k,isStream:md,isURLSearchParams:gd,isTypedArray:Td,isFileList:hd,forEach:ce,merge:We,extend:vd,trim:Nd,stripBOM:Pd,inherits:Sd,toFlatObject:Ed,kindOf:Ae,kindOfTest:H,endsWith:wd,toArray:xd,forEachEntry:Od,matchAll:_d,isHTMLForm:Fd,hasOwnProperty:St,hasOwnProp:St,reduceDescriptors:Et,freezeMethods:Rd,toObjectSet:Md,toCamelCase:Id,noop:Dd,toFiniteNumber:Ld,findKey:vt,global:Q,isContextDefined:Pt,isSpecCompliantForm:kd,toJSONObject:Bd,isAsyncFn:Ud,isThenable:jd,setImmediate:wt,asap:Gd,isIterable:e=>e!=null&&k(e[be])};function E(e,t,d,n,r){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),d&&(this.config=d),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}c.inherits(E,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:c.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=E.prototype,Tt={};["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=>{Tt[e]={value:e}}),Object.defineProperties(E,Tt),Object.defineProperty(xt,"isAxiosError",{value:!0}),E.from=(e,t,d,n,r,a)=>{const i=Object.create(xt);return c.toFlatObject(e,i,function(s){return s!==Error.prototype},o=>o!=="isAxiosError"),E.call(i,e.message,t,d,n,r),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};const Wd=null;function He(e){return c.isPlainObject(e)||c.isArray(e)}function Ot(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function _t(e,t,d){return e?e.concat(t).map(function(r,a){return r=Ot(r),!d&&a?"["+r+"]":r}).join(d?".":""):t}function Hd(e){return c.isArray(e)&&!e.some(He)}const Vd=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Pe(e,t,d){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,d=c.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,f){return!c.isUndefined(f[b])});const n=d.metaTokens,r=d.visitor||l,a=d.dots,i=d.indexes,s=(d.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(c.isBoolean(h))return h.toString();if(!s&&c.isBlob(h))throw new E("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?s&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,b,f){let C=h;if(h&&!f&&typeof h=="object"){if(c.endsWith(b,"{}"))b=n?b:b.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&Hd(h)||(c.isFileList(h)||c.endsWith(b,"[]"))&&(C=c.toArray(h)))return b=Ot(b),C.forEach(function(A,S){!(c.isUndefined(A)||A===null)&&t.append(i===!0?_t([b],S,a):i===null?b:b+"[]",u(A))}),!1}return He(h)?!0:(t.append(_t(f,b,a),u(h)),!1)}const $=[],p=Object.assign(Vd,{defaultVisitor:l,convertValue:u,isVisitable:He});function m(h,b){if(!c.isUndefined(h)){if($.indexOf(h)!==-1)throw Error("Circular reference detected in "+b.join("."));$.push(h),c.forEach(h,function(C,N){(!(c.isUndefined(C)||C===null)&&r.call(t,C,c.isString(N)?N.trim():N,b,p))===!0&&m(C,b?b.concat(N):[N])}),$.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return m(e),t}function Ft(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Ve(e,t){this._pairs=[],e&&Pe(e,this,t)}const It=Ve.prototype;It.append=function(t,d){this._pairs.push([t,d])},It.toString=function(t){const d=t?function(n){return t.call(this,n,Ft)}:Ft;return this._pairs.map(function(r){return d(r[0])+"="+d(r[1])},"").join("&")};function Kd(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function zt(e,t,d){if(!t)return e;const n=d&&d.encode||Kd;c.isFunction(d)&&(d={serialize:d});const r=d&&d.serialize;let a;if(r?a=r(t,d):a=c.isURLSearchParams(t)?t.toString():new Ve(t,d).toString(n),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Rt{constructor(){this.handlers=[]}use(t,d,n){return this.handlers.push({fulfilled:t,rejected:d,synchronous:n?n.synchronous:!1,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){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ve,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ke=typeof window<"u"&&typeof document<"u",qe=typeof navigator=="object"&&navigator||void 0,Jd=Ke&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),Yd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Xd=Ke&&window.location.href||"http://localhost",M={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ke,hasStandardBrowserEnv:Jd,hasStandardBrowserWebWorkerEnv:Yd,navigator:qe,origin:Xd},Symbol.toStringTag,{value:"Module"})),...qd};function Zd(e,t){return Pe(e,new M.classes.URLSearchParams,Object.assign({visitor:function(d,n,r,a){return M.isNode&&c.isBuffer(d)?(this.append(n,d.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Qd(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function en(e){const t={},d=Object.keys(e);let n;const r=d.length;let a;for(n=0;n<r;n++)a=d[n],t[a]=e[a];return t}function Dt(e){function t(d,n,r,a){let i=d[a++];if(i==="__proto__")return!0;const o=Number.isFinite(+i),s=a>=d.length;return i=!i&&c.isArray(r)?r.length:i,s?(c.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!o):((!r[i]||!c.isObject(r[i]))&&(r[i]=[]),t(d,n,r[i],a)&&c.isArray(r[i])&&(r[i]=en(r[i])),!o)}if(c.isFormData(e)&&c.isFunction(e.entries)){const d={};return c.forEachEntry(e,(n,r)=>{t(Qd(n),r,d,0)}),d}return null}function tn(e,t,d){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(d||JSON.stringify)(e)}const fe={transitional:Mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,d){const n=d.getContentType()||"",r=n.indexOf("application/json")>-1,a=c.isObject(t);if(a&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return r?JSON.stringify(Dt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return d.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Zd(t,this.formSerializer).toString();if((o=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return Pe(o?{"files[]":t}:t,s&&new s,this.formSerializer)}}return a||r?(d.setContentType("application/json",!1),tn(t)):t}],transformResponse:[function(t){const d=this.transitional||fe.transitional,n=d&&d.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||r)){const i=!(d&&d.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(o){if(i)throw o.name==="SyntaxError"?E.from(o,E.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:M.classes.FormData,Blob:M.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{fe.headers[e]={}});const dn=c.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"]),nn=e=>{const t={};let d,n,r;return e&&e.split(` `).forEach(function(i){r=i.indexOf(":"),d=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+1).trim(),!(!d||t[d]&&dn[d])&&(d==="set-cookie"?t[d]?t[d].push(n):t[d]=[n]:t[d]=t[d]?t[d]+", "+n:n)}),t},Lt=Symbol("internals");function $e(e){return e&&String(e).trim().toLowerCase()}function Se(e){return e===!1||e==null?e:c.isArray(e)?e.map(Se):String(e)}function rn(e){const t=Object.create(null),d=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=d.exec(e);)t[n[1]]=n[2];return t}const an=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Je(e,t,d,n,r){if(c.isFunction(n))return n.call(this,t,d);if(r&&(t=d),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function on(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,d,n)=>d.toUpperCase()+n)}function sn(e,t){const d=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+d,{value:function(r,a,i){return this[n].call(this,t,r,a,i)},configurable:!0})})}let B=class{constructor(t){t&&this.set(t)}set(t,d,n){const r=this;function a(o,s,u){const l=$e(s);if(!l)throw new Error("header name must be a non-empty string");const $=c.findKey(r,l);(!$||r[$]===void 0||u===!0||u===void 0&&r[$]!==!1)&&(r[$||s]=Se(o))}const i=(o,s)=>c.forEach(o,(u,l)=>a(u,l,s));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,d);else if(c.isString(t)&&(t=t.trim())&&!an(t))i(nn(t),d);else if(c.isObject(t)&&c.isIterable(t)){let o={},s,u;for(const l of t){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");o[u=l[0]]=(s=o[u])?c.isArray(s)?[...s,l[1]]:[s,l[1]]:l[1]}i(o,d)}else t!=null&&a(d,t,n);return this}get(t,d){if(t=$e(t),t){const n=c.findKey(this,t);if(n){const r=this[n];if(!d)return r;if(d===!0)return rn(r);if(c.isFunction(d))return d.call(this,r,n);if(c.isRegExp(d))return d.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,d){if(t=$e(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!d||Je(this,this[n],n,d)))}return!1}delete(t,d){const n=this;let r=!1;function a(i){if(i=$e(i),i){const o=c.findKey(n,i);o&&(!d||Je(n,n[o],o,d))&&(delete n[o],r=!0)}}return c.isArray(t)?t.forEach(a):a(t),r}clear(t){const d=Object.keys(this);let n=d.length,r=!1;for(;n--;){const a=d[n];(!t||Je(this,this[a],a,t,!0))&&(delete this[a],r=!0)}return r}normalize(t){const d=this,n={};return c.forEach(this,(r,a)=>{const i=c.findKey(n,a);if(i){d[i]=Se(r),delete d[a];return}const o=t?on(a):String(a).trim();o!==a&&delete d[a],d[o]=Se(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const d=Object.create(null);return c.forEach(this,(n,r)=>{n!=null&&n!==!1&&(d[r]=t&&c.isArray(n)?n.join(", "):n)}),d}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,d])=>t+": "+d).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...d){const n=new this(t);return d.forEach(r=>n.set(r)),n}static accessor(t){const n=(this[Lt]=this[Lt]={accessors:{}}).accessors,r=this.prototype;function a(i){const o=$e(i);n[o]||(sn(r,i),n[o]=!0)}return c.isArray(t)?t.forEach(a):a(t),this}};B.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(B.prototype,({value:e},t)=>{let d=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[d]=n}}}),c.freezeMethods(B);function Ye(e,t){const d=this||fe,n=t||d,r=B.from(n.headers);let a=n.data;return c.forEach(e,function(o){a=o.call(d,a,r.normalize(),t?t.status:void 0)}),r.normalize(),a}function kt(e){return!!(e&&e.__CANCEL__)}function ie(e,t,d){E.call(this,e??"canceled",E.ERR_CANCELED,t,d),this.name="CanceledError"}c.inherits(ie,E,{__CANCEL__:!0});function Bt(e,t,d){const n=d.config.validateStatus;!d.status||!n||n(d.status)?e(d):t(new E("Request failed with status code "+d.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(d.status/100)-4],d.config,d.request,d))}function un(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ln(e,t){e=e||10;const d=new Array(e),n=new Array(e);let r=0,a=0,i;return t=t!==void 0?t:1e3,function(s){const u=Date.now(),l=n[a];i||(i=u),d[r]=s,n[r]=u;let $=a,p=0;for(;$!==r;)p+=d[$++],$=$%e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),u-i<t)return;const m=l&&u-l;return m?Math.round(p*1e3/m):void 0}}function cn(e,t){let d=0,n=1e3/t,r,a;const i=(u,l=Date.now())=>{d=l,r=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const l=Date.now(),$=l-d;$>=n?i(u,l):(r=u,a||(a=setTimeout(()=>{a=null,i(r)},n-$)))},()=>r&&i(r)]}const Ee=(e,t,d=3)=>{let n=0;const r=ln(50,250);return cn(a=>{const i=a.loaded,o=a.lengthComputable?a.total:void 0,s=i-n,u=r(s),l=i<=o;n=i;const $={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&l?(o-i)/u:void 0,event:a,lengthComputable:o!=null,[t?"download":"upload"]:!0};e($)},d)},Ut=(e,t)=>{const d=e!=null;return[n=>t[0]({lengthComputable:d,total:e,loaded:n}),t[1]]},jt=e=>(...t)=>c.asap(()=>e(...t)),fn=M.hasStandardBrowserEnv?((e,t)=>d=>(d=new URL(d,M.origin),e.protocol===d.protocol&&e.host===d.host&&(t||e.port===d.port)))(new URL(M.origin),M.navigator&&/(msie|trident)/i.test(M.navigator.userAgent)):()=>!0,$n=M.hasStandardBrowserEnv?{write(e,t,d,n,r,a){const i=[e+"="+encodeURIComponent(t)];c.isNumber(d)&&i.push("expires="+new Date(d).toGMTString()),c.isString(n)&&i.push("path="+n),c.isString(r)&&i.push("domain="+r),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Gt(e,t,d){let n=!hn(t);return e&&(n||d==!1)?mn(e,t):t}const Wt=e=>e instanceof B?{...e}:e;function ee(e,t){t=t||{};const d={};function n(u,l,$,p){return c.isPlainObject(u)&&c.isPlainObject(l)?c.merge.call({caseless:p},u,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function r(u,l,$,p){if(c.isUndefined(l)){if(!c.isUndefined(u))return n(void 0,u,$,p)}else return n(u,l,$,p)}function a(u,l){if(!c.isUndefined(l))return n(void 0,l)}function i(u,l){if(c.isUndefined(l)){if(!c.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function o(u,l,$){if($ in t)return n(u,l);if($ in e)return n(void 0,u)}const s={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(u,l,$)=>r(Wt(u),Wt(l),$,!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(l){const $=s[l]||r,p=$(e[l],t[l],l);c.isUndefined(p)&&$!==o||(d[l]=p)}),d}const Ht=e=>{const t=ee({},e);let{data:d,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:a,headers:i,auth:o}=t;t.headers=i=B.from(i),t.url=zt(Gt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&i.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let s;if(c.isFormData(d)){if(M.hasStandardBrowserEnv||M.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((s=i.getContentType())!==!1){const[u,...l]=s?s.split(";").map($=>$.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(M.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&fn(t.url))){const u=r&&a&&$n.read(a);u&&i.set(r,u)}return t},pn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(d,n){const r=Ht(e);let a=r.data;const i=B.from(r.headers).normalize();let{responseType:o,onUploadProgress:s,onDownloadProgress:u}=r,l,$,p,m,h;function b(){m&&m(),h&&h(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let f=new XMLHttpRequest;f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout;function C(){if(!f)return;const A=B.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),P={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:A,config:e,request:f};Bt(function(x){d(x),b()},function(x){n(x),b()},P),f=null}"onloadend"in f?f.onloadend=C:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(C)},f.onabort=function(){f&&(n(new E("Request aborted",E.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new E("Network Error",E.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let S=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const P=r.transitional||Mt;r.timeoutErrorMessage&&(S=r.timeoutErrorMessage),n(new E(S,P.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,f)),f=null},a===void 0&&i.setContentType(null),"setRequestHeader"in f&&c.forEach(i.toJSON(),function(S,P){f.setRequestHeader(P,S)}),c.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),o&&o!=="json"&&(f.responseType=r.responseType),u&&([p,h]=Ee(u,!0),f.addEventListener("progress",p)),s&&f.upload&&([$,m]=Ee(s),f.upload.addEventListener("progress",$),f.upload.addEventListener("loadend",m)),(r.cancelToken||r.signal)&&(l=A=>{f&&(n(!A||A.type?new ie(null,e,f):A),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const N=un(r.url);if(N&&M.protocols.indexOf(N)===-1){n(new E("Unsupported protocol "+N+":",E.ERR_BAD_REQUEST,e));return}f.send(a||null)})},gn=(e,t)=>{const{length:d}=e=e?e.filter(Boolean):[];if(t||d){let n=new AbortController,r;const a=function(u){if(!r){r=!0,o();const l=u instanceof Error?u:this.reason;n.abort(l instanceof E?l:new ie(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,a(new E(`timeout ${t} of ms exceeded`,E.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:s}=n;return s.unsubscribe=()=>c.asap(o),s}},yn=function*(e,t){let d=e.byteLength;if(d<t){yield e;return}let n=0,r;for(;n<d;)r=n+t,yield e.slice(n,r),n=r},bn=async function*(e,t){for await(const d of An(e))yield*yn(d,t)},An=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:d,value:n}=await t.read();if(d)break;yield n}}finally{await t.cancel()}},Vt=(e,t,d,n)=>{const r=bn(e,t);let a=0,i,o=s=>{i||(i=!0,n&&n(s))};return new ReadableStream({async pull(s){try{const{done:u,value:l}=await r.next();if(u){o(),s.close();return}let $=l.byteLength;if(d){let p=a+=$;d(p)}s.enqueue(new Uint8Array(l))}catch(u){throw o(u),u}},cancel(s){return o(s),r.return()}},{highWaterMark:2})},we=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Kt=we&&typeof ReadableStream=="function",Cn=we&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),qt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Nn=Kt&&qt(()=>{let e=!1;const t=new Request(M.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Jt=64*1024,Xe=Kt&&qt(()=>c.isReadableStream(new Response("").body)),xe={stream:Xe&&(e=>e.body)};we&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!xe[t]&&(xe[t]=c.isFunction(e[t])?d=>d[t]():(d,n)=>{throw new E(`Response type '${t}' is not supported`,E.ERR_NOT_SUPPORT,n)})})})(new Response);const vn=async e=>{if(e==null)return 0;if(c.isBlob(e))return e.size;if(c.isSpecCompliantForm(e))return(await new Request(M.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(c.isArrayBufferView(e)||c.isArrayBuffer(e))return e.byteLength;if(c.isURLSearchParams(e)&&(e=e+""),c.isString(e))return(await Cn(e)).byteLength},Pn=async(e,t)=>{const d=c.toFiniteNumber(e.getContentLength());return d??vn(t)},Ze={http:Wd,xhr:pn,fetch:we&&(async e=>{let{url:t,method:d,data:n,signal:r,cancelToken:a,timeout:i,onDownloadProgress:o,onUploadProgress:s,responseType:u,headers:l,withCredentials:$="same-origin",fetchOptions:p}=Ht(e);u=u?(u+"").toLowerCase():"text";let m=gn([r,a&&a.toAbortSignal()],i),h;const b=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let f;try{if(s&&Nn&&d!=="get"&&d!=="head"&&(f=await Pn(l,n))!==0){let P=new Request(t,{method:"POST",body:n,duplex:"half"}),O;if(c.isFormData(n)&&(O=P.headers.get("content-type"))&&l.setContentType(O),P.body){const[x,R]=Ut(f,Ee(jt(s)));n=Vt(P.body,Jt,x,R)}}c.isString($)||($=$?"include":"omit");const C="credentials"in Request.prototype;h=new Request(t,{...p,signal:m,method:d.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:C?$:void 0});let N=await fetch(h,p);const A=Xe&&(u==="stream"||u==="response");if(Xe&&(o||A&&b)){const P={};["status","statusText","headers"].forEach(U=>{P[U]=N[U]});const O=c.toFiniteNumber(N.headers.get("content-length")),[x,R]=o&&Ut(O,Ee(jt(o),!0))||[];N=new Response(Vt(N.body,Jt,x,()=>{R&&R(),b&&b()}),P)}u=u||"text";let S=await xe[c.findKey(xe,u)||"text"](N,e);return!A&&b&&b(),await new Promise((P,O)=>{Bt(P,O,{data:S,headers:B.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:h})})}catch(C){throw b&&b(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,e,h),{cause:C.cause||C}):E.from(C,C&&C.code,e,h)}})};c.forEach(Ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Yt=e=>`- ${e}`,Sn=e=>c.isFunction(e)||e===null||e===!1,Xt={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let d,n;const r={};for(let a=0;a<t;a++){d=e[a];let i;if(n=d,!Sn(d)&&(n=Ze[(i=String(d)).toLowerCase()],n===void 0))throw new E(`Unknown adapter '${i}'`);if(n)break;r[i||"#"+a]=n}if(!n){const a=Object.entries(r).map(([o,s])=>`adapter ${o} `+(s===!1?"is not supported by the environment":"is not available in the build"));let i=t?a.length>1?`since : `+a.map(Yt).join(` `):" "+Yt(a[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:Ze};function Qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ie(null,e)}function Zt(e){return Qe(e),e.headers=B.from(e.headers),e.data=Ye.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xt.getAdapter(e.adapter||fe.adapter)(e).then(function(n){return Qe(e),n.data=Ye.call(e,e.transformResponse,n),n.headers=B.from(n.headers),n},function(n){return kt(n)||(Qe(e),n&&n.response&&(n.response.data=Ye.call(e,e.transformResponse,n.response),n.response.headers=B.from(n.response.headers))),Promise.reject(n)})}const Qt="1.10.0",Te={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Te[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const e0={};Te.transitional=function(t,d,n){function r(a,i){return"[Axios v"+Qt+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,o)=>{if(t===!1)throw new E(r(i," has been removed"+(d?" in "+d:"")),E.ERR_DEPRECATED);return d&&!e0[i]&&(e0[i]=!0,console.warn(r(i," has been deprecated since v"+d+" and will be removed in the near future"))),t?t(a,i,o):!0}},Te.spelling=function(t){return(d,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function En(e,t,d){if(typeof e!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const a=n[r],i=t[a];if(i){const o=e[a],s=o===void 0||i(o,a,e);if(s!==!0)throw new E("option "+a+" must be "+s,E.ERR_BAD_OPTION_VALUE);continue}if(d!==!0)throw new E("Unknown option "+a,E.ERR_BAD_OPTION)}}const Oe={assertOptions:En,validators:Te},q=Oe.validators;let te=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Rt,response:new Rt}}async request(t,d){try{return await this._request(t,d)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const a=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+a):n.stack=a}catch{}}throw n}}_request(t,d){typeof t=="string"?(d=d||{},d.url=t):d=t||{},d=ee(this.defaults,d);const{transitional:n,paramsSerializer:r,headers:a}=d;n!==void 0&&Oe.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),r!=null&&(c.isFunction(r)?d.paramsSerializer={serialize:r}:Oe.assertOptions(r,{encode:q.function,serialize:q.function},!0)),d.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?d.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:d.allowAbsoluteUrls=!0),Oe.assertOptions(d,{baseUrl:q.spelling("baseURL"),withXsrfToken:q.spelling("withXSRFToken")},!0),d.method=(d.method||this.defaults.method||"get").toLowerCase();let i=a&&c.merge(a.common,a[d.method]);a&&c.forEach(["delete","get","head","post","put","patch","common"],h=>{delete a[h]}),d.headers=B.concat(i,a);const o=[];let s=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(d)===!1||(s=s&&b.synchronous,o.unshift(b.fulfilled,b.rejected))});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let l,$=0,p;if(!s){const h=[Zt.bind(this),void 0];for(h.unshift.apply(h,o),h.push.apply(h,u),p=h.length,l=Promise.resolve(d);$<p;)l=l.then(h[$++],h[$++]);return l}p=o.length;let m=d;for($=0;$<p;){const h=o[$++],b=o[$++];try{m=h(m)}catch(f){b.call(this,f);break}}try{l=Zt.call(this,m)}catch(h){return Promise.reject(h)}for($=0,p=u.length;$<p;)l=l.then(u[$++],u[$++]);return l}getUri(t){t=ee(this.defaults,t);const d=Gt(t.baseURL,t.url,t.allowAbsoluteUrls);return zt(d,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(d,n){return this.request(ee(n||{},{method:t,url:d,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function d(n){return function(a,i,o){return this.request(ee(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}te.prototype[t]=d(),te.prototype[t+"Form"]=d(!0)});let wn=class ad{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let d;this.promise=new Promise(function(a){d=a});const n=this;this.promise.then(r=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](r);n._listeners=null}),this.promise.then=r=>{let a;const i=new Promise(o=>{n.subscribe(o),a=o}).then(r);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,o){n.reason||(n.reason=new ie(a,i,o),d(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const d=this._listeners.indexOf(t);d!==-1&&this._listeners.splice(d,1)}toAbortSignal(){const t=new AbortController,d=n=>{t.abort(n)};return this.subscribe(d),t.signal.unsubscribe=()=>this.unsubscribe(d),t.signal}static source(){let t;return{token:new ad(function(r){t=r}),cancel:t}}};function xn(e){return function(d){return e.apply(null,d)}}function Tn(e){return c.isObject(e)&&e.isAxiosError===!0}const et={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(et).forEach(([e,t])=>{et[t]=e});function t0(e){const t=new te(e),d=bt(te.prototype.request,t);return c.extend(d,te.prototype,t,{allOwnKeys:!0}),c.extend(d,t,null,{allOwnKeys:!0}),d.create=function(r){return t0(ee(e,r))},d}const F=t0(fe);F.Axios=te,F.CanceledError=ie,F.CancelToken=wn,F.isCancel=kt,F.VERSION=Qt,F.toFormData=Pe,F.AxiosError=E,F.Cancel=F.CanceledError,F.all=function(t){return Promise.all(t)},F.spread=xn,F.isAxiosError=Tn,F.mergeConfig=ee,F.AxiosHeaders=B,F.formToJSON=e=>Dt(c.isHTMLForm(e)?new FormData(e):e),F.getAdapter=Xt.getAdapter,F.HttpStatusCode=et,F.default=F;const{Axios:K2,AxiosError:q2,CanceledError:J2,isCancel:Y2,CancelToken:X2,VERSION:Z2,all:Q2,Cancel:ea,isAxiosError:ta,spread:da,toFormData:na,AxiosHeaders:ra,HttpStatusCode:aa,formToJSON:ia,getAdapter:oa,mergeConfig:sa}=F,de={locationSelector:{token:"81|27zzgQxv1LxM2hbjchyxzwzOybJdH3qVvNtrlz6m165f0c7d",endpoint:"https://api.data-forge.tech"}},he=F.create();console.log("DataForgeReactComponents: Configuring Axios instance for API calls.",de),de&&de.locationSelector&&de.locationSelector.token&&de.locationSelector.endpoint?(he.defaults.baseURL=de.locationSelector.endpoint,he.defaults.headers.common.Authorization=`Bearer ${de.locationSelector.token}`):console.error("DataForgeReactComponents: API configuration is missing or incomplete. The postinstall script (setup.mjs) might have failed to fetch the API token, or the src/location-selector/services.config.js file is not correctly populated. Components relying on API calls may not function correctly.");const On=()=>y.jsxs("svg",{className:"h-5 w-5 animate-spin text-blue-500",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"20px",height:"20px",animation:"spin 1s linear infinite"},children:[y.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),y.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),ne=({value:e,onChange:t,label:d,required:n=!1,triggerClass:r,dropdownClass:a,labelClass:i,disabled:o=!1,searchable:s=!1,placeholder:u="-- Select an option --",options:l=null,apiEndpoint:$,apiQueryParamName:p,apiQueryParamValue:m,loadOnMount:h=!0,apiQueryString:b,onLoaded:f})=>{const[C,N]=v.useState(!1),[A,S]=v.useState(""),[P,O]=v.useState(!1),[x,R]=v.useState([]),U=v.useRef(null),ue=v.useRef(null),g=v.useRef(!1),w=v.useMemo(()=>(l||x).find(G=>G.id===e)||null,[e,l,x]),T=v.useMemo(()=>w?w.name:"",[w]),D=v.useMemo(()=>{if(!s||!A)return l||x;const _=l||x,G=A.toLowerCase();return _.filter(ge=>ge.name.toLowerCase().includes(G))},[s,A,l,x]),J=v.useRef(!1),j=v.useRef("");v.useEffect(()=>{if(l)return;const _=`${h?"load":"noload"}-${p||"none"}-${m||"empty"}`;if(j.current===_||g.current)return;if(!(h||p&&m)){R([]),j.current=_;return}j.current=_,J.current=!0,g.current=!0,N(!0),R([]);let ge=$;b?ge+=`?${b}`:p&&m&&(ge+=`?${p}=${m}`),he.get(ge).then(ye=>{g.current&&(R(ye.data),console.log(`Loaded ${ye.data.length} options`),f&&f(ye.data))}).catch(ye=>{g.current&&(console.error("Failed to load options:",ye),R([]),f&&f([]))}).finally(()=>{N(!1),g.current=!1})},[l?"has":"none",h?"load":"noload",m||"",p||""]);const Z=v.useCallback(async()=>{if(o||C)return;const _=!P;O(_),_&&s&&setTimeout(()=>{var G;(G=ue.current)==null||G.focus()},0)},[o,C,P,s]),yt=v.useCallback(_=>{t(_.id),O(!1),S("")},[t]);return v.useEffect(()=>{const _=G=>{U.current&&!U.current.contains(G.target)&&(O(!1),S(""))};return document.addEventListener("click",_),()=>{document.removeEventListener("click",_)}},[]),y.jsxs("div",{children:[d&&y.jsxs("label",{className:i||"fallback-label",children:[d,n&&y.jsx("span",{className:"fallback-required",children:"*"})]}),y.jsxs("div",{className:"base-select-container",ref:U,style:{position:"relative",display:"inline-block",width:"100%"},children:[y.jsxs("div",{className:`base-select-trigger ${r||"fallback-select-trigger"} ${o||C?"disabled":""} ${P?"active":""}`,onClick:Z,style:{display:"flex",alignItems:"center",padding:"8px 12px",border:"1px solid #ccc",borderRadius:"4px",backgroundColor:"#fff",cursor:o||C?"not-allowed":"pointer",userSelect:"none",minHeight:"38px",boxSizing:"border-box"},children:[y.jsx("span",{style:{flexGrow:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},dangerouslySetInnerHTML:{__html:T||u}}),C&&y.jsx(On,{style:{width:"16px",height:"16px",marginLeft:"8px",marginRight:"8px"}}),y.jsx("span",{style:{fontSize:"10px",marginLeft:"auto",transition:"transform 0.2s ease",transform:P?"rotate(180deg)":"rotate(0deg)"},children:P?"▲":"▼"})]}),P&&y.jsxs("div",{className:`base-select-dropdown ${a||"fallback-select-dropdown"}`,style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"#fff",border:"1px solid #ccc",borderTop:"none",borderRadius:"0 0 4px 4px",maxHeight:"200px",overflow:"hidden",zIndex:10,boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[s&&y.jsx("input",{ref:ue,type:"text",value:A,onChange:_=>S(_.target.value),placeholder:"Search...",onClick:_=>_.stopPropagation(),style:{width:"100%",padding:"8px 12px",border:"none",borderBottom:"1px solid #eee",boxSizing:"border-box",fontSize:"14px",outline:"none",flexShrink:0}}),y.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,overflowY:"auto",flexGrow:1},children:D.map(_=>y.jsx("li",{onClick:()=>yt(_),className:_.id===e?"selected-option":"",style:{padding:"8px 12px",cursor:"pointer",fontSize:"14px",backgroundColor:_.id===e?"#e0e0e0":"transparent",fontWeight:_.id===e?"bold":"normal"},onMouseEnter:G=>G.target.style.backgroundColor="#f0f0f0",onMouseLeave:G=>G.target.style.backgroundColor=_.id===e?"#e0e0e0":"transparent",children:y.jsx("span",{dangerouslySetInnerHTML:{__html:_.name}})},_.id))})]})]})]})},_n=({value:e,onChange:t,label:d,required:n,selectClass:r,labelClass:a,searchable:i,defaultValue:o})=>y.jsx(ne,{value:e||o,onChange:t,label:d,required:n,triggerClass:r,labelClass:a,placeholder:"-- Select Region --",apiEndpoint:"/api/all/Location:regions",loadOnMount:!0,searchable:i}),Fn=({region:e,value:t,onChange:d,label:n,required:r,selectClass:a,labelClass:i,disabled:o,searchable:s,defaultValue:u})=>y.jsx(ne,{value:t||u,onChange:d,label:n,required:r,triggerClass:a,labelClass:i,disabled:o||!e,searchable:s,placeholder:"-- Select Sub-Region --",apiEndpoint:"/api/all/Location:subregions",apiQueryParamName:"region",apiQueryParamValue:e,loadOnMount:!1}),In=({subregion:e,region:t,value:d,onChange:n,onSelected:r,label:a,required:i,selectClass:o,labelClass:s,disabled:u,searchable:l,defaultValue:$})=>{const[p,m]=v.useState([]),h=v.useMemo(()=>{if(e)return"subregion";if(t)return"region"},[e,t]),b=v.useMemo(()=>e||t,[e,t]),f=v.useMemo(()=>{if(!t&&!e)return"all=1"},[t,e]),C=v.useMemo(()=>!t&&!e,[t,e]),N=P=>{n(P),S(P)},A=P=>{m(P),d&&P.length>0&&S(d)},S=P=>{const O=p.find(x=>x.id===P);O?r==null||r(O):r==null||r(null)};return v.useEffect(()=>{p.length>0&&S(d)},[d,p,r]),y.jsx(ne,{value:d||$,onChange:N,onLoaded:A,label:a,required:i,triggerClass:o,labelClass:s,disabled:u,searchable:l,placeholder:"-- Select Country --",apiEndpoint:"/api/all/Location:countries",apiQueryParamName:h,apiQueryParamValue:b,apiQueryString:f,loadOnMount:C})},d0=v.memo(In),n0=({country:e,value:t,onChange:d,label:n,required:r,selectClass:a,labelClass:i,disabled:o,searchable:s,defaultValue:u})=>y.jsx(ne,{value:t||u,onChange:d,label:n,required:r,triggerClass:a,labelClass:i,disabled:o||!e,searchable:s,placeholder:"-- Select State --",apiEndpoint:"/api/all/Location:states",apiQueryParamName:"country",apiQueryParamValue:e,loadOnMount:!1}),r0=({state:e,value:t,onChange:d,label:n,required:r,selectClass:a,labelClass:i,disabled:o,searchable:s,defaultValue:u})=>y.jsx(ne,{value:t||u,onChange:d,label:n,required:r,triggerClass:a,labelClass:i,disabled:o||!e,searchable:s,placeholder:"-- Select City --",apiEndpoint:"/api/all/Location:cities",apiQueryParamName:"state",apiQueryParamValue:e,loadOnMount:!1}),a0={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6],0,0,0,0,0,0,0,[["6[2-467]\\d{3}",[5]],["4\\d{4}",[5]],0,0,0,0,["(?:0[1-9]|[1589]\\d)\\d{4}",[6]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[["[78]\\d{5}",[6]],["690\\d{6}|[356]\\d{5}",[6,9]],["180[02]\\d{4}",[8]],["[19]\\d{5}",[6]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["[2-4679][2-8]\\d{6}",[8]],["5[024-68]\\d{7}",[9]],["400\\d{6}|800\\d{2,9}"],["900[02]\\d{5}",[9]],0,0,["600[25]\\d{5}",[9]],0,0,["700[05]\\d{5}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}"],["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268",[["268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}"],["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["26840[69]\\d{4}"],["26848[01]\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264",[["264(?:292|4(?:6[12]|9[78]))\\d{4}"],["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["264724\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[["4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",[8]],["6(?:[78][2-9]|9\\d)\\d{6}",[9]],["800\\d{4}",[7]],["900[1-9]\\d\\d",[6]],["700[2-9]\\d{4}",[8]],0,0,0,0,["808[1-9]\\d\\d",[6]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}"],["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"],["800\\d{5}"],["90[016]\\d{5}"],0,0,0,0,["60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}"],["80[1-4]\\d{5}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[["2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}"],["9[1-79]\\d{7}"]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-