dccxx-s3-explorer 1.0.41 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@
24
24
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[al]=this[al]={accessors:{}}).accessors,o=this.prototype;function i(a){const s=nr(a);r[s]||(xm(o,a),r[s]=!0)}return L.isArray(t)?t.forEach(i):i(t),this}}Ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(Ye.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),L.freezeMethods(Ye);function Ci(e,t){const n=this||tr,r=t||n,o=Ye.from(r.headers);let i=r.data;return L.forEach(e,function(s){i=s.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function sl(e){return!!(e&&e.__CANCEL__)}function Sn(e,t,n){ve.call(this,e??"canceled",ve.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(Sn,ve,{__CANCEL__:!0});function ll(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ve("Request failed with status code "+n.status,[ve.ERR_BAD_REQUEST,ve.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function wm(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bm(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),d=r[i];a||(a=c),n[o]=u,r[o]=c;let g=i,h=0;for(;g!==o;)h+=n[g++],g=g%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const p=d&&c-d;return p?Math.round(h*1e3/p):void 0}}function Sm(e,t){let n=0,r=1e3/t,o,i;const a=(c,d=Date.now())=>{n=d,o=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const d=Date.now(),g=d-n;g>=r?a(c,d):(o=c,i||(i=setTimeout(()=>{i=null,a(o)},r-g)))},()=>o&&a(o)]}const jr=(e,t,n=3)=>{let r=0;const o=bm(50,250);return Sm(i=>{const a=i.loaded,s=i.lengthComputable?i.total:void 0,u=a-r,c=o(u),d=a<=s;r=a;const g={loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s&&d?(s-a)/c:void 0,event:i,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(g)},n)},cl=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ul=e=>(...t)=>L.asap(()=>e(...t)),Cm=Be.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Be.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Be.origin),Be.navigator&&/(msie|trident)/i.test(Be.navigator.userAgent)):()=>!0,Em=Be.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];L.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),L.isString(r)&&a.push("path="+r),L.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.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 Tm(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function _m(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dl(e,t){return e&&!Tm(t)?_m(e,t):t}const fl=e=>e instanceof Ye?{...e}:e;function cn(e,t){t=t||{};const n={};function r(c,d,g,h){return L.isPlainObject(c)&&L.isPlainObject(d)?L.merge.call({caseless:h},c,d):L.isPlainObject(d)?L.merge({},d):L.isArray(d)?d.slice():d}function o(c,d,g,h){if(L.isUndefined(d)){if(!L.isUndefined(c))return r(void 0,c,g,h)}else return r(c,d,g,h)}function i(c,d){if(!L.isUndefined(d))return r(void 0,d)}function a(c,d){if(L.isUndefined(d)){if(!L.isUndefined(c))return r(void 0,c)}else return r(void 0,d)}function s(c,d,g){if(g in t)return r(c,d);if(g in e)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(c,d,g)=>o(fl(c),fl(d),g,!0)};return L.forEach(Object.keys(Object.assign({},e,t)),function(d){const g=u[d]||o,h=g(e[d],t[d],d);L.isUndefined(h)&&g!==s||(n[d]=h)}),n}const pl=e=>{const t=cn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;t.headers=a=Ye.from(a),t.url=nl(dl(t.baseURL,t.url),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let u;if(L.isFormData(n)){if(Be.hasStandardBrowserEnv||Be.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[c,...d]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...d].join("; "))}}if(Be.hasStandardBrowserEnv&&(r&&L.isFunction(r)&&(r=r(t)),r||r!==!1&&Cm(t.url))){const c=o&&i&&Em.read(i);c&&a.set(o,c)}return t},Am=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=pl(e);let i=o.data;const a=Ye.from(o.headers).normalize();let{responseType:s,onUploadProgress:u,onDownloadProgress:c}=o,d,g,h,p,v;function m(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const S=Ye.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};ll(function(M){n(M),m()},function(M){r(M),m()},x),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new ve("Request aborted",ve.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new ve("Network Error",ve.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||ol;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new ve(E,x.clarifyTimeoutError?ve.ETIMEDOUT:ve.ECONNABORTED,e,y)),y=null},i===void 0&&a.setContentType(null),"setRequestHeader"in y&&L.forEach(a.toJSON(),function(E,x){y.setRequestHeader(x,E)}),L.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),s&&s!=="json"&&(y.responseType=o.responseType),c&&([h,v]=jr(c,!0),y.addEventListener("progress",h)),u&&y.upload&&([g,p]=jr(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(d=S=>{y&&(r(!S||S.type?new Sn(null,e,y):S),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const b=wm(o.url);if(b&&Be.protocols.indexOf(b)===-1){r(new ve("Unsupported protocol "+b+":",ve.ERR_BAD_REQUEST,e));return}y.send(i||null)})},Pm=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(c){if(!o){o=!0,s();const d=c instanceof Error?c:this.reason;r.abort(d instanceof ve?d:new Sn(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new ve(`timeout ${t} of ms exceeded`,ve.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>L.asap(s),u}},Nm=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Om=async function*(e,t){for await(const n of Fm(e))yield*Nm(n,t)},Fm=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},gl=(e,t,n,r)=>{const o=Om(e,t);let i=0,a,s=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:d}=await o.next();if(c){s(),u.close();return}let g=d.byteLength;if(n){let h=i+=g;n(h)}u.enqueue(new Uint8Array(d))}catch(c){throw s(c),c}},cancel(u){return s(u),o.return()}},{highWaterMark:2})},zr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ml=zr&&typeof ReadableStream=="function",km=zr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),hl=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Dm=ml&&hl(()=>{let e=!1;const t=new Request(Be.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),vl=64*1024,Ei=ml&&hl(()=>L.isReadableStream(new Response("").body)),Br={stream:Ei&&(e=>e.body)};zr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Br[t]&&(Br[t]=L.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ve(`Response type '${t}' is not supported`,ve.ERR_NOT_SUPPORT,r)})})})(new Response);const Mm=async e=>{if(e==null)return 0;if(L.isBlob(e))return e.size;if(L.isSpecCompliantForm(e))return(await new Request(Be.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(L.isArrayBufferView(e)||L.isArrayBuffer(e))return e.byteLength;if(L.isURLSearchParams(e)&&(e=e+""),L.isString(e))return(await km(e)).byteLength},$m=async(e,t)=>{const n=L.toFiniteNumber(e.getContentLength());return n??Mm(t)},Ti={http:nm,xhr:Am,fetch:zr&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:u,responseType:c,headers:d,withCredentials:g="same-origin",fetchOptions:h}=pl(e);c=c?(c+"").toLowerCase():"text";let p=Pm([o,i&&i.toAbortSignal()],a),v;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Dm&&n!=="get"&&n!=="head"&&(y=await $m(d,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(L.isFormData(r)&&(O=x.headers.get("content-type"))&&d.setContentType(O),x.body){const[M,I]=cl(y,jr(ul(u)));r=gl(x.body,vl,M,I)}}L.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...h,signal:p,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let b=await fetch(v);const S=Ei&&(c==="stream"||c==="response");if(Ei&&(s||S&&m)){const x={};["status","statusText","headers"].forEach(H=>{x[H]=b[H]});const O=L.toFiniteNumber(b.headers.get("content-length")),[M,I]=s&&cl(O,jr(ul(s),!0))||[];b=new Response(gl(b.body,vl,M,()=>{I&&I(),m&&m()}),x)}c=c||"text";let E=await Br[L.findKey(Br,c)||"text"](b,e);return!S&&m&&m(),await new Promise((x,O)=>{ll(x,O,{data:E,headers:Ye.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(w){throw m&&m(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new ve("Network Error",ve.ERR_NETWORK,e,v),{cause:w.cause||w}):ve.from(w,w&&w.code,e,v)}})};L.forEach(Ti,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yl=e=>`- ${e}`,Im=e=>L.isFunction(e)||e===null||e===!1,xl={getAdapter:e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!Im(n)&&(r=Ti[(a=String(n)).toLowerCase()],r===void 0))throw new ve(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([s,u])=>`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
25
25
  `+i.map(yl).join(`
26
26
  `):" "+yl(i[0]):"as no adapter specified";throw new ve("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ti};function _i(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sn(null,e)}function wl(e){return _i(e),e.headers=Ye.from(e.headers),e.data=Ci.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xl.getAdapter(e.adapter||tr.adapter)(e).then(function(r){return _i(e),r.data=Ci.call(e,e.transformResponse,r),r.headers=Ye.from(r.headers),r},function(r){return sl(r)||(_i(e),r&&r.response&&(r.response.data=Ci.call(e,e.transformResponse,r.response),r.response.headers=Ye.from(r.response.headers))),Promise.reject(r)})}const bl="1.7.9",Hr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Sl={};Hr.transitional=function(t,n,r){function o(i,a){return"[Axios v"+bl+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,s)=>{if(t===!1)throw new ve(o(a," has been removed"+(n?" in "+n:"")),ve.ERR_DEPRECATED);return n&&!Sl[a]&&(Sl[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,s):!0}},Hr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Lm(e,t,n){if(typeof e!="object")throw new ve("options must be an object",ve.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const s=e[i],u=s===void 0||a(s,i,e);if(u!==!0)throw new ve("option "+i+" must be "+u,ve.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ve("Unknown option "+i,ve.ERR_BAD_OPTION)}}const Ur={assertOptions:Lm,validators:Hr},wt=Ur.validators;class un{constructor(t){this.defaults=t,this.interceptors={request:new rl,response:new rl}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
27
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=cn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Ur.assertOptions(r,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),o!=null&&(L.isFunction(o)?n.paramsSerializer={serialize:o}:Ur.assertOptions(o,{encode:wt.function,serialize:wt.function},!0)),Ur.assertOptions(n,{baseUrl:wt.spelling("baseURL"),withXsrfToken:wt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&L.merge(i.common,i[n.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=Ye.concat(a,i);const s=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let d,g=0,h;if(!u){const v=[wl.bind(this),void 0];for(v.unshift.apply(v,s),v.push.apply(v,c),h=v.length,d=Promise.resolve(n);g<h;)d=d.then(v[g++],v[g++]);return d}h=s.length;let p=n;for(g=0;g<h;){const v=s[g++],m=s[g++];try{p=v(p)}catch(y){m.call(this,y);break}}try{d=wl.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,h=c.length;g<h;)d=d.then(c[g++],c[g++]);return d}getUri(t){t=cn(this.defaults,t);const n=dl(t.baseURL,t.url);return nl(n,t.params,t.paramsSerializer)}}L.forEach(["delete","get","head","options"],function(t){un.prototype[t]=function(n,r){return this.request(cn(r||{},{method:t,url:n,data:(r||{}).data}))}}),L.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,s){return this.request(cn(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}un.prototype[t]=n(),un.prototype[t+"Form"]=n(!0)});class Ai{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{r.subscribe(s),i=s}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,s){r.reason||(r.reason=new Sn(i,a,s),n(r.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 n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ai(function(o){t=o}),cancel:t}}}function Rm(e){return function(n){return e.apply(null,n)}}function Vm(e){return L.isObject(e)&&e.isAxiosError===!0}const Pi={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(Pi).forEach(([e,t])=>{Pi[t]=e});function Cl(e){const t=new un(e),n=js(un.prototype.request,t);return L.extend(n,un.prototype,t,{allOwnKeys:!0}),L.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Cl(cn(e,o))},n}const he=Cl(tr);he.Axios=un,he.CanceledError=Sn,he.CancelToken=Ai,he.isCancel=sl,he.VERSION=bl,he.toFormData=Rr,he.AxiosError=ve,he.Cancel=he.CanceledError,he.all=function(t){return Promise.all(t)},he.spread=Rm,he.isAxiosError=Vm,he.mergeConfig=cn,he.AxiosHeaders=Ye,he.formToJSON=e=>il(L.isHTMLForm(e)?new FormData(e):e),he.getAdapter=xl.getAdapter,he.HttpStatusCode=Pi,he.default=he;var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const jm=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var zm=e=>!jm.has(e&&e.code);const Bm=Wr(zm),Ni="axios-retry";function El(e){const t=["ERR_CANCELED","ECONNABORTED"];return e.response||!e.code||t.includes(e.code)?!1:Bm(e)}const Tl=["get","head","options"],Hm=Tl.concat(["put","delete"]);function Oi(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function Um(e){var t;return(t=e.config)!=null&&t.method?Oi(e)&&Tl.indexOf(e.config.method)!==-1:!1}function _l(e){var t;return(t=e.config)!=null&&t.method?Oi(e)&&Hm.indexOf(e.config.method)!==-1:!1}function Al(e){return El(e)||_l(e)}function Fi(e=void 0){var r;const t=(r=e==null?void 0:e.response)==null?void 0:r.headers["retry-after"];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function Wm(e=0,t=void 0){return Math.max(0,Fi(t))}function qm(e=0,t=void 0,n=100){const r=2**e*n,o=Math.max(r,Fi(t)),i=o*.2*Math.random();return o+i}function Gm(e=100){return(t=0,n=void 0)=>{const r=t*e;return Math.max(r,Fi(n))}}const Km={retries:3,retryCondition:Al,retryDelay:Wm,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function Ym(e,t){return{...Km,...t,...e[Ni]}}function Pl(e,t,n=!1){const r=Ym(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[Ni]=r,r}function Xm(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function Jm(e,t){const{retries:n,retryCondition:r}=e,o=(e.retryCount||0)<n&&r(t);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function Zm(e,t,n,r){var u;t.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:a}=t,s=o(t.retryCount,n);if(Xm(e,r),!i&&r.timeout&&t.lastRequestTime){const c=Date.now()-t.lastRequestTime,d=r.timeout-c-s;if(d<=0)return Promise.reject(n);r.timeout=d}return r.transformRequest=[c=>c],await a(t.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(e(r)):new Promise(c=>{var h;const d=()=>{clearTimeout(g),c(e(r))},g=setTimeout(()=>{var p;c(e(r)),(p=r.signal)!=null&&p.removeEventListener&&r.signal.removeEventListener("abort",d)},s);(h=r.signal)!=null&&h.addEventListener&&r.signal.addEventListener("abort",d,{once:!0})})}async function Qm(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}const Kt=(e,t)=>{const n=e.interceptors.request.use(o=>{var i;return Pl(o,t,!0),(i=o[Ni])!=null&&i.validateResponse&&(o.validateStatus=()=>!1),o}),r=e.interceptors.response.use(null,async o=>{var s;const{config:i}=o;if(!i)return Promise.reject(o);const a=Pl(i,t);return o.response&&((s=a.validateResponse)!=null&&s.call(a,o.response))?o.response:await Jm(a,o)?Zm(e,a,o,i):(await Qm(a,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Kt.isNetworkError=El,Kt.isSafeRequestError=Um,Kt.isIdempotentRequestError=_l,Kt.isNetworkOrIdempotentRequestError=Al,Kt.exponentialDelay=qm,Kt.linearDelay=Gm,Kt.isRetryableError=Oi;var Nl={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(rr,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",a="second",s="minute",u="hour",c="day",d="week",g="month",h="quarter",p="year",v="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var $=["th","st","nd","rd"],F=P%100;return"["+P+($[(F-20)%10]||$[F]||$[0])+"]"}},S=function(P,$,F){var W=String(P);return!W||W.length>=$?P:""+Array($+1-W.length).join(F)+P},E={s:S,z:function(P){var $=-P.utcOffset(),F=Math.abs($),W=Math.floor(F/60),N=F%60;return($<=0?"+":"-")+S(W,2,"0")+":"+S(N,2,"0")},m:function P($,F){if($.date()<F.date())return-P(F,$);var W=12*(F.year()-$.year())+(F.month()-$.month()),N=$.clone().add(W,g),V=F-N<0,_=$.clone().add(W+(V?-1:1),g);return+(-(W+(F-N)/(V?N-_:_-N))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:g,y:p,w:d,d:c,D:v,h:u,m:s,s:a,ms:i,Q:h}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},x="en",O={};O[x]=b;var M="$isDayjsObject",I=function(P){return P instanceof U||!(!P||!P[M])},H=function P($,F,W){var N;if(!$)return x;if(typeof $=="string"){var V=$.toLowerCase();O[V]&&(N=V),F&&(O[V]=F,N=V);var _=$.split("-");if(!N&&_.length>1)return P(_[0])}else{var B=$.name;O[B]=$,N=B}return!W&&N&&(x=N),N||!W&&x},k=function(P,$){if(I(P))return P.clone();var F=typeof $=="object"?$:{};return F.date=P,F.args=arguments,new U(F)},G=E;G.l=H,G.i=I,G.w=function(P,$){return k(P,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var U=function(){function P(F){this.$L=H(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[M]=!0}var $=P.prototype;return $.parse=function(F){this.$d=function(W){var N=W.date,V=W.utc;if(N===null)return new Date(NaN);if(G.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var _=N.match(y);if(_){var B=_[2]-1||0,Q=(_[7]||"0").substring(0,3);return V?new Date(Date.UTC(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,Q)):new Date(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,Q)}}return new Date(N)}(F),this.init()},$.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},$.$utils=function(){return G},$.isValid=function(){return this.$d.toString()!==m},$.isSame=function(F,W){var N=k(F);return this.startOf(W)<=N&&N<=this.endOf(W)},$.isAfter=function(F,W){return k(F)<this.startOf(W)},$.isBefore=function(F,W){return this.endOf(W)<k(F)},$.$g=function(F,W,N){return G.u(F)?this[W]:this.set(N,F)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(F,W){var N=this,V=!!G.u(W)||W,_=G.p(F),B=function(ue,le){var Se=G.w(N.$u?Date.UTC(N.$y,le,ue):new Date(N.$y,le,ue),N);return V?Se:Se.endOf(c)},Q=function(ue,le){return G.w(N.toDate()[ue].apply(N.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(le)),N)},ne=this.$W,ee=this.$M,ce=this.$D,oe="set"+(this.$u?"UTC":"");switch(_){case p:return V?B(1,0):B(31,11);case g:return V?B(1,ee):B(0,ee+1);case d:var ie=this.$locale().weekStart||0,de=(ne<ie?ne+7:ne)-ie;return B(V?ce-de:ce+(6-de),ee);case c:case v:return Q(oe+"Hours",0);case u:return Q(oe+"Minutes",1);case s:return Q(oe+"Seconds",2);case a:return Q(oe+"Milliseconds",3);default:return this.clone()}},$.endOf=function(F){return this.startOf(F,!1)},$.$set=function(F,W){var N,V=G.p(F),_="set"+(this.$u?"UTC":""),B=(N={},N[c]=_+"Date",N[v]=_+"Date",N[g]=_+"Month",N[p]=_+"FullYear",N[u]=_+"Hours",N[s]=_+"Minutes",N[a]=_+"Seconds",N[i]=_+"Milliseconds",N)[V],Q=V===c?this.$D+(W-this.$W):W;if(V===g||V===p){var ne=this.clone().set(v,1);ne.$d[B](Q),ne.init(),this.$d=ne.set(v,Math.min(this.$D,ne.daysInMonth())).$d}else B&&this.$d[B](Q);return this.init(),this},$.set=function(F,W){return this.clone().$set(F,W)},$.get=function(F){return this[G.p(F)]()},$.add=function(F,W){var N,V=this;F=Number(F);var _=G.p(W),B=function(ee){var ce=k(V);return G.w(ce.date(ce.date()+Math.round(ee*F)),V)};if(_===g)return this.set(g,this.$M+F);if(_===p)return this.set(p,this.$y+F);if(_===c)return B(1);if(_===d)return B(7);var Q=(N={},N[s]=r,N[u]=o,N[a]=n,N)[_]||1,ne=this.$d.getTime()+F*Q;return G.w(ne,this)},$.subtract=function(F,W){return this.add(-1*F,W)},$.format=function(F){var W=this,N=this.$locale();if(!this.isValid())return N.invalidDate||m;var V=F||"YYYY-MM-DDTHH:mm:ssZ",_=G.z(this),B=this.$H,Q=this.$m,ne=this.$M,ee=N.weekdays,ce=N.months,oe=N.meridiem,ie=function(le,Se,K,Ee){return le&&(le[Se]||le(W,V))||K[Se].slice(0,Ee)},de=function(le){return G.s(B%12||12,le,"0")},ue=oe||function(le,Se,K){var Ee=le<12?"AM":"PM";return K?Ee.toLowerCase():Ee};return V.replace(w,function(le,Se){return Se||function(K){switch(K){case"YY":return String(W.$y).slice(-2);case"YYYY":return G.s(W.$y,4,"0");case"M":return ne+1;case"MM":return G.s(ne+1,2,"0");case"MMM":return ie(N.monthsShort,ne,ce,3);case"MMMM":return ie(ce,ne);case"D":return W.$D;case"DD":return G.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return ie(N.weekdaysMin,W.$W,ee,2);case"ddd":return ie(N.weekdaysShort,W.$W,ee,3);case"dddd":return ee[W.$W];case"H":return String(B);case"HH":return G.s(B,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return ue(B,Q,!0);case"A":return ue(B,Q,!1);case"m":return String(Q);case"mm":return G.s(Q,2,"0");case"s":return String(W.$s);case"ss":return G.s(W.$s,2,"0");case"SSS":return G.s(W.$ms,3,"0");case"Z":return _}return null}(le)||_.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(F,W,N){var V,_=this,B=G.p(W),Q=k(F),ne=(Q.utcOffset()-this.utcOffset())*r,ee=this-Q,ce=function(){return G.m(_,Q)};switch(B){case p:V=ce()/12;break;case g:V=ce();break;case h:V=ce()/3;break;case d:V=(ee-ne)/6048e5;break;case c:V=(ee-ne)/864e5;break;case u:V=ee/o;break;case s:V=ee/r;break;case a:V=ee/n;break;default:V=ee}return N?V:G.a(V)},$.daysInMonth=function(){return this.endOf(g).$D},$.$locale=function(){return O[this.$L]},$.locale=function(F,W){if(!F)return this.$L;var N=this.clone(),V=H(F,W,!0);return V&&(N.$L=V),N},$.clone=function(){return G.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},P}(),Z=U.prototype;return k.prototype=Z,[["$ms",i],["$s",a],["$m",s],["$H",u],["$W",c],["$M",g],["$y",p],["$D",v]].forEach(function(P){Z[P[1]]=function($){return this.$g($,P[0],P[1])}}),k.extend=function(P,$){return P.$i||(P($,U,k),P.$i=!0),k},k.locale=H,k.isDayjs=I,k.unix=function(P){return k(1e3*P)},k.en=O[x],k.Ls=O,k.p={},k})})(Nl);var eh=Nl.exports;const Ol=Wr(eh);/**
27
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=cn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Ur.assertOptions(r,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),o!=null&&(L.isFunction(o)?n.paramsSerializer={serialize:o}:Ur.assertOptions(o,{encode:wt.function,serialize:wt.function},!0)),Ur.assertOptions(n,{baseUrl:wt.spelling("baseURL"),withXsrfToken:wt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&L.merge(i.common,i[n.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=Ye.concat(a,i);const s=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let d,g=0,h;if(!u){const v=[wl.bind(this),void 0];for(v.unshift.apply(v,s),v.push.apply(v,c),h=v.length,d=Promise.resolve(n);g<h;)d=d.then(v[g++],v[g++]);return d}h=s.length;let p=n;for(g=0;g<h;){const v=s[g++],m=s[g++];try{p=v(p)}catch(y){m.call(this,y);break}}try{d=wl.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,h=c.length;g<h;)d=d.then(c[g++],c[g++]);return d}getUri(t){t=cn(this.defaults,t);const n=dl(t.baseURL,t.url);return nl(n,t.params,t.paramsSerializer)}}L.forEach(["delete","get","head","options"],function(t){un.prototype[t]=function(n,r){return this.request(cn(r||{},{method:t,url:n,data:(r||{}).data}))}}),L.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,s){return this.request(cn(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}un.prototype[t]=n(),un.prototype[t+"Form"]=n(!0)});class Ai{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{r.subscribe(s),i=s}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,s){r.reason||(r.reason=new Sn(i,a,s),n(r.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 n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ai(function(o){t=o}),cancel:t}}}function Rm(e){return function(n){return e.apply(null,n)}}function Vm(e){return L.isObject(e)&&e.isAxiosError===!0}const Pi={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(Pi).forEach(([e,t])=>{Pi[t]=e});function Cl(e){const t=new un(e),n=js(un.prototype.request,t);return L.extend(n,un.prototype,t,{allOwnKeys:!0}),L.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Cl(cn(e,o))},n}const he=Cl(tr);he.Axios=un,he.CanceledError=Sn,he.CancelToken=Ai,he.isCancel=sl,he.VERSION=bl,he.toFormData=Rr,he.AxiosError=ve,he.Cancel=he.CanceledError,he.all=function(t){return Promise.all(t)},he.spread=Rm,he.isAxiosError=Vm,he.mergeConfig=cn,he.AxiosHeaders=Ye,he.formToJSON=e=>il(L.isHTMLForm(e)?new FormData(e):e),he.getAdapter=xl.getAdapter,he.HttpStatusCode=Pi,he.default=he;var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const jm=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var zm=e=>!jm.has(e&&e.code);const Bm=Wr(zm),Ni="axios-retry";function El(e){const t=["ERR_CANCELED","ECONNABORTED"];return e.response||!e.code||t.includes(e.code)?!1:Bm(e)}const Tl=["get","head","options"],Hm=Tl.concat(["put","delete"]);function Oi(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function Um(e){var t;return(t=e.config)!=null&&t.method?Oi(e)&&Tl.indexOf(e.config.method)!==-1:!1}function _l(e){var t;return(t=e.config)!=null&&t.method?Oi(e)&&Hm.indexOf(e.config.method)!==-1:!1}function Al(e){return El(e)||_l(e)}function Fi(e=void 0){var r;const t=(r=e==null?void 0:e.response)==null?void 0:r.headers["retry-after"];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function Wm(e=0,t=void 0){return Math.max(0,Fi(t))}function qm(e=0,t=void 0,n=100){const r=2**e*n,o=Math.max(r,Fi(t)),i=o*.2*Math.random();return o+i}function Gm(e=100){return(t=0,n=void 0)=>{const r=t*e;return Math.max(r,Fi(n))}}const Km={retries:3,retryCondition:Al,retryDelay:Wm,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function Ym(e,t){return{...Km,...t,...e[Ni]}}function Pl(e,t,n=!1){const r=Ym(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[Ni]=r,r}function Xm(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function Jm(e,t){const{retries:n,retryCondition:r}=e,o=(e.retryCount||0)<n&&r(t);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function Zm(e,t,n,r){var u;t.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:a}=t,s=o(t.retryCount,n);if(Xm(e,r),!i&&r.timeout&&t.lastRequestTime){const c=Date.now()-t.lastRequestTime,d=r.timeout-c-s;if(d<=0)return Promise.reject(n);r.timeout=d}return r.transformRequest=[c=>c],await a(t.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(e(r)):new Promise(c=>{var h;const d=()=>{clearTimeout(g),c(e(r))},g=setTimeout(()=>{var p;c(e(r)),(p=r.signal)!=null&&p.removeEventListener&&r.signal.removeEventListener("abort",d)},s);(h=r.signal)!=null&&h.addEventListener&&r.signal.addEventListener("abort",d,{once:!0})})}async function Qm(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}const Kt=(e,t)=>{const n=e.interceptors.request.use(o=>{var i;return Pl(o,t,!0),(i=o[Ni])!=null&&i.validateResponse&&(o.validateStatus=()=>!1),o}),r=e.interceptors.response.use(null,async o=>{var s;const{config:i}=o;if(!i)return Promise.reject(o);const a=Pl(i,t);return o.response&&((s=a.validateResponse)!=null&&s.call(a,o.response))?o.response:await Jm(a,o)?Zm(e,a,o,i):(await Qm(a,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Kt.isNetworkError=El,Kt.isSafeRequestError=Um,Kt.isIdempotentRequestError=_l,Kt.isNetworkOrIdempotentRequestError=Al,Kt.exponentialDelay=qm,Kt.linearDelay=Gm,Kt.isRetryableError=Oi;var Nl={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(rr,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",a="second",s="minute",u="hour",c="day",d="week",g="month",h="quarter",p="year",v="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var $=["th","st","nd","rd"],F=P%100;return"["+P+($[(F-20)%10]||$[F]||$[0])+"]"}},S=function(P,$,F){var W=String(P);return!W||W.length>=$?P:""+Array($+1-W.length).join(F)+P},E={s:S,z:function(P){var $=-P.utcOffset(),F=Math.abs($),W=Math.floor(F/60),N=F%60;return($<=0?"+":"-")+S(W,2,"0")+":"+S(N,2,"0")},m:function P($,F){if($.date()<F.date())return-P(F,$);var W=12*(F.year()-$.year())+(F.month()-$.month()),N=$.clone().add(W,g),V=F-N<0,_=$.clone().add(W+(V?-1:1),g);return+(-(W+(F-N)/(V?N-_:_-N))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:g,y:p,w:d,d:c,D:v,h:u,m:s,s:a,ms:i,Q:h}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},x="en",O={};O[x]=b;var M="$isDayjsObject",I=function(P){return P instanceof U||!(!P||!P[M])},H=function P($,F,W){var N;if(!$)return x;if(typeof $=="string"){var V=$.toLowerCase();O[V]&&(N=V),F&&(O[V]=F,N=V);var _=$.split("-");if(!N&&_.length>1)return P(_[0])}else{var B=$.name;O[B]=$,N=B}return!W&&N&&(x=N),N||!W&&x},k=function(P,$){if(I(P))return P.clone();var F=typeof $=="object"?$:{};return F.date=P,F.args=arguments,new U(F)},G=E;G.l=H,G.i=I,G.w=function(P,$){return k(P,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var U=function(){function P(F){this.$L=H(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[M]=!0}var $=P.prototype;return $.parse=function(F){this.$d=function(W){var N=W.date,V=W.utc;if(N===null)return new Date(NaN);if(G.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var _=N.match(y);if(_){var B=_[2]-1||0,Q=(_[7]||"0").substring(0,3);return V?new Date(Date.UTC(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,Q)):new Date(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,Q)}}return new Date(N)}(F),this.init()},$.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},$.$utils=function(){return G},$.isValid=function(){return this.$d.toString()!==m},$.isSame=function(F,W){var N=k(F);return this.startOf(W)<=N&&N<=this.endOf(W)},$.isAfter=function(F,W){return k(F)<this.startOf(W)},$.isBefore=function(F,W){return this.endOf(W)<k(F)},$.$g=function(F,W,N){return G.u(F)?this[W]:this.set(N,F)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(F,W){var N=this,V=!!G.u(W)||W,_=G.p(F),B=function(ue,le){var Se=G.w(N.$u?Date.UTC(N.$y,le,ue):new Date(N.$y,le,ue),N);return V?Se:Se.endOf(c)},Q=function(ue,le){return G.w(N.toDate()[ue].apply(N.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(le)),N)},re=this.$W,ee=this.$M,ce=this.$D,oe="set"+(this.$u?"UTC":"");switch(_){case p:return V?B(1,0):B(31,11);case g:return V?B(1,ee):B(0,ee+1);case d:var ie=this.$locale().weekStart||0,de=(re<ie?re+7:re)-ie;return B(V?ce-de:ce+(6-de),ee);case c:case v:return Q(oe+"Hours",0);case u:return Q(oe+"Minutes",1);case s:return Q(oe+"Seconds",2);case a:return Q(oe+"Milliseconds",3);default:return this.clone()}},$.endOf=function(F){return this.startOf(F,!1)},$.$set=function(F,W){var N,V=G.p(F),_="set"+(this.$u?"UTC":""),B=(N={},N[c]=_+"Date",N[v]=_+"Date",N[g]=_+"Month",N[p]=_+"FullYear",N[u]=_+"Hours",N[s]=_+"Minutes",N[a]=_+"Seconds",N[i]=_+"Milliseconds",N)[V],Q=V===c?this.$D+(W-this.$W):W;if(V===g||V===p){var re=this.clone().set(v,1);re.$d[B](Q),re.init(),this.$d=re.set(v,Math.min(this.$D,re.daysInMonth())).$d}else B&&this.$d[B](Q);return this.init(),this},$.set=function(F,W){return this.clone().$set(F,W)},$.get=function(F){return this[G.p(F)]()},$.add=function(F,W){var N,V=this;F=Number(F);var _=G.p(W),B=function(ee){var ce=k(V);return G.w(ce.date(ce.date()+Math.round(ee*F)),V)};if(_===g)return this.set(g,this.$M+F);if(_===p)return this.set(p,this.$y+F);if(_===c)return B(1);if(_===d)return B(7);var Q=(N={},N[s]=r,N[u]=o,N[a]=n,N)[_]||1,re=this.$d.getTime()+F*Q;return G.w(re,this)},$.subtract=function(F,W){return this.add(-1*F,W)},$.format=function(F){var W=this,N=this.$locale();if(!this.isValid())return N.invalidDate||m;var V=F||"YYYY-MM-DDTHH:mm:ssZ",_=G.z(this),B=this.$H,Q=this.$m,re=this.$M,ee=N.weekdays,ce=N.months,oe=N.meridiem,ie=function(le,Se,K,Ee){return le&&(le[Se]||le(W,V))||K[Se].slice(0,Ee)},de=function(le){return G.s(B%12||12,le,"0")},ue=oe||function(le,Se,K){var Ee=le<12?"AM":"PM";return K?Ee.toLowerCase():Ee};return V.replace(w,function(le,Se){return Se||function(K){switch(K){case"YY":return String(W.$y).slice(-2);case"YYYY":return G.s(W.$y,4,"0");case"M":return re+1;case"MM":return G.s(re+1,2,"0");case"MMM":return ie(N.monthsShort,re,ce,3);case"MMMM":return ie(ce,re);case"D":return W.$D;case"DD":return G.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return ie(N.weekdaysMin,W.$W,ee,2);case"ddd":return ie(N.weekdaysShort,W.$W,ee,3);case"dddd":return ee[W.$W];case"H":return String(B);case"HH":return G.s(B,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return ue(B,Q,!0);case"A":return ue(B,Q,!1);case"m":return String(Q);case"mm":return G.s(Q,2,"0");case"s":return String(W.$s);case"ss":return G.s(W.$s,2,"0");case"SSS":return G.s(W.$ms,3,"0");case"Z":return _}return null}(le)||_.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(F,W,N){var V,_=this,B=G.p(W),Q=k(F),re=(Q.utcOffset()-this.utcOffset())*r,ee=this-Q,ce=function(){return G.m(_,Q)};switch(B){case p:V=ce()/12;break;case g:V=ce();break;case h:V=ce()/3;break;case d:V=(ee-re)/6048e5;break;case c:V=(ee-re)/864e5;break;case u:V=ee/o;break;case s:V=ee/r;break;case a:V=ee/n;break;default:V=ee}return N?V:G.a(V)},$.daysInMonth=function(){return this.endOf(g).$D},$.$locale=function(){return O[this.$L]},$.locale=function(F,W){if(!F)return this.$L;var N=this.clone(),V=H(F,W,!0);return V&&(N.$L=V),N},$.clone=function(){return G.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},P}(),Z=U.prototype;return k.prototype=Z,[["$ms",i],["$s",a],["$m",s],["$H",u],["$W",c],["$M",g],["$y",p],["$D",v]].forEach(function(P){Z[P[1]]=function($){return this.$g($,P[0],P[1])}}),k.extend=function(P,$){return P.$i||(P($,U,k),P.$i=!0),k},k.locale=H,k.isDayjs=I,k.unix=function(P){return k(1e3*P)},k.en=O[x],k.Ls=O,k.p={},k})})(Nl);var eh=Nl.exports;const Ol=Wr(eh);/**
28
28
  * @license lucide-react v0.468.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
@@ -148,7 +148,7 @@
148
148
 
149
149
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
150
150
 
151
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ny="DialogDescriptionWarning",Oy=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yc(Ny).contentName}}.`;return f.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Fy=$c,ky=Lc,Dy=Vc,Xc=jc,Jc=zc,Zc=Hc,Qc=Wc,My=Gc;const Rt=Fy,no=ky,$y=Dy,eu=f.forwardRef(({className:e,...t},n)=>l.jsx(Xc,{ref:n,className:ge("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));eu.displayName=Xc.displayName;const St=f.forwardRef(({className:e,children:t,...n},r)=>l.jsxs($y,{children:[l.jsx(eu,{}),l.jsxs(Jc,{ref:r,className:ge("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(My,{className:ge("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(Di,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));St.displayName=Jc.displayName;const Ct=({className:e,...t})=>l.jsx("div",{className:ge("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ct.displayName="DialogHeader";const pn=({className:e,...t})=>l.jsx("div",{className:ge("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pn.displayName="DialogFooter";const Et=f.forwardRef(({className:e,...t},n)=>l.jsx(Zc,{ref:n,className:ge("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Et.displayName=Zc.displayName;const Dn=f.forwardRef(({className:e,...t},n)=>l.jsx(Qc,{ref:n,className:ge("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));Dn.displayName=Qc.displayName;const en=f.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ge("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));en.displayName="Input";var Iy="Label",tu=f.forwardRef((e,t)=>l.jsx(Le.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tu.displayName=Iy;var nu=tu;const Ly=zi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),gn=f.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(nu,{ref:o,className:ge(Ly({variant:t,size:n}),e),...r}));gn.displayName=nu.displayName;const ro=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:ge("mx-auto flex w-full justify-center",e),...t});ro.displayName="Pagination";const oo=f.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:ge("flex flex-row items-center gap-1",e),...t}));oo.displayName="PaginationContent";const mt=f.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ge("",e),...t}));mt.displayName="PaginationItem";const Mn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:ge(Yl({variant:t?"outline":"ghost",size:n}),e),...r});Mn.displayName="PaginationLink";const io=({className:e,...t})=>l.jsxs(Mn,{"aria-label":"Go to previous page",size:"default",className:ge("gap-1 pl-2.5",e),...t,children:[l.jsx(ah,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});io.displayName="PaginationPrevious";const ao=({className:e,...t})=>l.jsxs(Mn,{"aria-label":"Go to next page",size:"default",className:ge("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(kl,{className:"h-4 w-4"})]});ao.displayName="PaginationNext";const so=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:ge("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(sh,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});so.displayName="PaginationEllipsis";const lo=f.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:ge("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:ge("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));lo.displayName="Table";const co=f.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ge("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));co.displayName="TableHeader";const uo=f.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ge("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));uo.displayName="TableBody";const Ry=f.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Ry.displayName="TableFooter";const ht=f.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));ht.displayName="TableRow";const Tt=f.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ge("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));Tt.displayName="TableHead";const Xe=f.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:ge("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Xe.displayName="TableCell";const Vy=f.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ge("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));Vy.displayName="TableCaption";function sa(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function $n(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ru(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function la(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ru(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ru(e[o],null)}}}}function ca(...e){return f.useCallback(la(...e),e)}var ua=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(zy);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(da,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(da,{...r,ref:t,children:n})});ua.displayName="Slot";var da=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Hy(n);return f.cloneElement(n,{...By(r,n.props),ref:t?la(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});da.displayName="SlotClone";var jy=({children:e})=>l.jsx(l.Fragment,{children:e});function zy(e){return f.isValidElement(e)&&e.type===jy}function By(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Hy(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Uy(e){const t=e+"CollectionProvider",[n,r]=Jt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:m}=p,y=T.useRef(null),w=T.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};a.displayName=t;const s=e+"CollectionSlot",u=T.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=i(s,m),b=ca(v,w.collectionRef);return l.jsx(ua,{ref:b,children:y})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",g=T.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,b=T.useRef(null),S=ca(v,b),E=i(c,m);return T.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(ua,{[d]:"",ref:S,children:y})});g.displayName=c;function h(p){const v=i(e+"CollectionConsumer",p);return T.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:g},h,r]}var ou=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(qy);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(fa,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(fa,{...r,ref:t,children:n})});ou.displayName="Slot";var fa=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Ky(n);return f.cloneElement(n,{...Gy(r,n.props),ref:t?la(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});fa.displayName="SlotClone";var Wy=({children:e})=>l.jsx(l.Fragment,{children:e});function qy(e){return f.isValidElement(e)&&e.type===Wy}function Gy(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ky(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],iu=Yy.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?ou:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xy=f.createContext(void 0);function au(e){const t=f.useContext(Xy);return e||t||"ltr"}var pa="rovingFocusGroup.onEntryFocus",Jy={bubbles:!1,cancelable:!0},fo="RovingFocusGroup",[ga,su,Zy]=Uy(fo),[Qy,lu]=Jt(fo,[Zy]),[ex,tx]=Qy(fo),cu=f.forwardRef((e,t)=>l.jsx(ga.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ga.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(nx,{...e,ref:t})})}));cu.displayName=fo;var nx=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...g}=e,h=f.useRef(null),p=ca(t,h),v=au(i),[m=null,y]=_n({prop:a,defaultProp:s,onChange:u}),[w,b]=f.useState(!1),S=We(c),E=su(n),x=f.useRef(!1),[O,M]=f.useState(0);return f.useEffect(()=>{const I=h.current;if(I)return I.addEventListener(pa,S),()=>I.removeEventListener(pa,S)},[S]),l.jsx(ex,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(I=>y(I),[y]),onItemShiftTab:f.useCallback(()=>b(!0),[]),onFocusableItemAdd:f.useCallback(()=>M(I=>I+1),[]),onFocusableItemRemove:f.useCallback(()=>M(I=>I-1),[]),children:l.jsx(iu.div,{tabIndex:w||O===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:$n(e.onMouseDown,()=>{x.current=!0}),onFocus:$n(e.onFocus,I=>{const H=!x.current;if(I.target===I.currentTarget&&H&&!w){const k=new CustomEvent(pa,Jy);if(I.currentTarget.dispatchEvent(k),!k.defaultPrevented){const G=E().filter(F=>F.focusable),U=G.find(F=>F.active),Z=G.find(F=>F.id===m),$=[U,Z,...G].filter(Boolean).map(F=>F.ref.current);fu($,d)}}x.current=!1}),onBlur:$n(e.onBlur,()=>b(!1))})})}),uu="RovingFocusGroupItem",du=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=Pn(),u=i||s,c=tx(uu,n),d=c.currentTabStopId===u,g=su(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return f.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),l.jsx(ga.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(iu.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:$n(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:$n(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:$n(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=ix(v,c.orientation,c.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?ax(w,b+1):w.slice(b+1)}setTimeout(()=>fu(w))}})})})});du.displayName=uu;var rx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ox(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ix(e,t,n){const r=ox(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rx[r]}function fu(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ax(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sx=cu,lx=du;function pu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cx(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pu(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():pu(e[o],null)}}}}function ux(...e){return f.useCallback(cx(...e),e)}function dx(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var gu=e=>{const{present:t,children:n}=e,r=fx(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=ux(r.ref,px(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};gu.displayName="Presence";function fx(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[s,u]=dx(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=po(r.current);i.current=s==="mounted"?c:"none"},[s]),et(()=>{const c=r.current,d=o.current;if(d!==e){const h=i.current,p=po(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),et(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,g=p=>{const m=po(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=po(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function po(e){return(e==null?void 0:e.animationName)||"none"}function px(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gx(...e){return t=>{let n=!1;const r=e.map(o=>{const i=mu(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():mu(e[o],null)}}}}var hu=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(hx);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(ma,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(ma,{...r,ref:t,children:n})});hu.displayName="Slot";var ma=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=yx(n);return f.cloneElement(n,{...vx(r,n.props),ref:t?gx(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});ma.displayName="SlotClone";var mx=({children:e})=>l.jsx(l.Fragment,{children:e});function hx(e){return f.isValidElement(e)&&e.type===mx}function vx(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function yx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],go=xx.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?hu:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ha="Tabs",[wx,bE]=Jt(ha,[lu]),vu=lu(),[bx,va]=wx(ha),yu=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:u="automatic",...c}=e,d=au(s),[g,h]=_n({prop:r,onChange:o,defaultProp:i});return l.jsx(bx,{scope:n,baseId:Pn(),value:g,onValueChange:h,orientation:a,dir:d,activationMode:u,children:l.jsx(go.div,{dir:d,"data-orientation":a,...c,ref:t})})});yu.displayName=ha;var xu="TabsList",wu=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=va(xu,n),a=vu(n);return l.jsx(sx,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:l.jsx(go.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});wu.displayName=xu;var bu="TabsTrigger",Su=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=va(bu,n),s=vu(n),u=Tu(a.baseId,r),c=_u(a.baseId,r),d=r===a.value;return l.jsx(lx,{asChild:!0,...s,focusable:!o,active:d,children:l.jsx(go.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:sa(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?a.onValueChange(r):g.preventDefault()}),onKeyDown:sa(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&a.onValueChange(r)}),onFocus:sa(e.onFocus,()=>{const g=a.activationMode!=="manual";!d&&!o&&g&&a.onValueChange(r)})})})});Su.displayName=bu;var Cu="TabsContent",Eu=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=va(Cu,n),u=Tu(s.baseId,r),c=_u(s.baseId,r),d=r===s.value,g=f.useRef(d);return f.useEffect(()=>{const h=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(gu,{present:o||d,children:({present:h})=>l.jsx(go.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:h&&i})})});Eu.displayName=Cu;function Tu(e,t){return`${e}-trigger-${t}`}function _u(e,t){return`${e}-content-${t}`}var Sx=yu,Au=wu,Pu=Su,Nu=Eu;const Cx=Sx,Ou=f.forwardRef(({className:e,...t},n)=>l.jsx(Au,{ref:n,className:ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ou.displayName=Au.displayName;const mo=f.forwardRef(({className:e,...t},n)=>l.jsx(Pu,{ref:n,className:ge("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));mo.displayName=Pu.displayName;const ho=f.forwardRef(({className:e,...t},n)=>l.jsx(Nu,{ref:n,className:ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ho.displayName=Nu.displayName;const ar=f.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ge("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));ar.displayName="Textarea";function Ex(e,t=[]){let n=[];function r(i,a){const s=f.createContext(a),u=n.length;n=[...n,a];function c(g){const{scope:h,children:p,...v}=g,m=(h==null?void 0:h[e][u])||s,y=f.useMemo(()=>v,Object.values(v));return l.jsx(m.Provider,{value:y,children:p})}function d(g,h){const p=(h==null?void 0:h[e][u])||s,v=f.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}const o=()=>{const i=n.map(a=>f.createContext(a));return function(s){const u=(s==null?void 0:s[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,Tx(o,...t)]}function Tx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:u,scopeName:c})=>{const g=u(i)[`__scope${c}`];return{...s,...g}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var ya=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(Ax);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(xa,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(xa,{...r,ref:t,children:n})});ya.displayName="Slot";var xa=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Nx(n);return f.cloneElement(n,{...Px(r,n.props),ref:t?qr(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});xa.displayName="SlotClone";var _x=({children:e})=>l.jsx(l.Fragment,{children:e});function Ax(e){return f.isValidElement(e)&&e.type===_x}function Px(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ox(e){const t=e+"CollectionProvider",[n,r]=Ex(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:m}=p,y=T.useRef(null),w=T.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};a.displayName=t;const s=e+"CollectionSlot",u=T.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=i(s,m),b=st(v,w.collectionRef);return l.jsx(ya,{ref:b,children:y})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",g=T.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,b=T.useRef(null),S=st(v,b),E=i(c,m);return T.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(ya,{[d]:"",ref:S,children:y})});g.displayName=c;function h(p){const v=i(e+"CollectionConsumer",p);return T.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:g},h,r]}var Fx="VisuallyHidden",wa=f.forwardRef((e,t)=>l.jsx(Le.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));wa.displayName=Fx;var ba="ToastProvider",[Sa,kx,Dx]=Ox("Toast"),[Fu,SE]=Jt("Toast",[Dx]),[Mx,vo]=Fu(ba),ku=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=e,[s,u]=f.useState(null),[c,d]=f.useState(0),g=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ba}\`. Expected non-empty \`string\`.`),l.jsx(Sa.Provider,{scope:t,children:l.jsx(Mx,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:c,viewport:s,onViewportChange:u,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:h,children:a})})};ku.displayName=ba;var Du="ToastViewport",$x=["F8"],Ca="toast.viewportPause",Ea="toast.viewportResume",Mu=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=$x,label:o="Notifications ({hotkey})",...i}=e,a=vo(Du,n),s=kx(n),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),g=f.useRef(null),h=st(t,g,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=a.toastCount>0;f.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),f.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const b=()=>{if(!a.isClosePausedRef.current){const O=new CustomEvent(Ca);w.dispatchEvent(O),a.isClosePausedRef.current=!0}},S=()=>{if(a.isClosePausedRef.current){const O=new CustomEvent(Ea);w.dispatchEvent(O),a.isClosePausedRef.current=!1}},E=O=>{!y.contains(O.relatedTarget)&&S()},x=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",x),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",x),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,a.isClosePausedRef]);const m=f.useCallback(({tabbingDirection:y})=>{const b=s().map(S=>{const E=S.ref.current,x=[E,...Kx(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[s]);return f.useEffect(()=>{const y=g.current;if(y){const w=b=>{var x,O,M;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const I=document.activeElement,H=b.shiftKey;if(b.target===y&&H){(x=c.current)==null||x.focus();return}const U=m({tabbingDirection:H?"backwards":"forwards"}),Z=U.findIndex(P=>P===I);Aa(U.slice(Z+1))?b.preventDefault():H?(O=c.current)==null||O.focus():(M=d.current)==null||M.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[s,m]),l.jsxs(Ev,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ta,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});Aa(y)}}),l.jsx(Sa.Slot,{scope:n,children:l.jsx(Le.ol,{tabIndex:-1,...i,ref:h})}),v&&l.jsx(Ta,{ref:d,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});Aa(y)}})]})});Mu.displayName=Du;var $u="ToastFocusProxy",Ta=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=vo($u,n);return l.jsx(wa,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=i.viewport)!=null&&c.contains(s))&&r()}})});Ta.displayName=$u;var yo="Toast",Ix="toast.swipeStart",Lx="toast.swipeMove",Rx="toast.swipeCancel",Vx="toast.swipeEnd",Iu=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=e,[s=!0,u]=_n({prop:r,defaultProp:o,onChange:i});return l.jsx(An,{present:n||s,children:l.jsx(Bx,{open:s,...a,ref:t,onClose:()=>u(!1),onPause:We(e.onPause),onResume:We(e.onResume),onSwipeStart:Ie(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ie(e.onSwipeMove,c=>{const{x:d,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ie(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ie(e.onSwipeEnd,c=>{const{x:d,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});Iu.displayName=yo;var[jx,zx]=Fu(yo,{onClose(){}}),Bx=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:s,onPause:u,onResume:c,onSwipeStart:d,onSwipeMove:g,onSwipeCancel:h,onSwipeEnd:p,...v}=e,m=vo(yo,n),[y,w]=f.useState(null),b=st(t,P=>w(P)),S=f.useRef(null),E=f.useRef(null),x=o||m.duration,O=f.useRef(0),M=f.useRef(x),I=f.useRef(0),{onToastAdd:H,onToastRemove:k}=m,G=We(()=>{var $;(y==null?void 0:y.contains(document.activeElement))&&(($=m.viewport)==null||$.focus()),a()}),U=f.useCallback(P=>{!P||P===1/0||(window.clearTimeout(I.current),O.current=new Date().getTime(),I.current=window.setTimeout(G,P))},[G]);f.useEffect(()=>{const P=m.viewport;if(P){const $=()=>{U(M.current),c==null||c()},F=()=>{const W=new Date().getTime()-O.current;M.current=M.current-W,window.clearTimeout(I.current),u==null||u()};return P.addEventListener(Ca,F),P.addEventListener(Ea,$),()=>{P.removeEventListener(Ca,F),P.removeEventListener(Ea,$)}}},[m.viewport,x,u,c,U]),f.useEffect(()=>{i&&!m.isClosePausedRef.current&&U(x)},[i,x,m.isClosePausedRef,U]),f.useEffect(()=>(H(),()=>k()),[H,k]);const Z=f.useMemo(()=>y?Hu(y):null,[y]);return m.viewport?l.jsxs(l.Fragment,{children:[Z&&l.jsx(Hx,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:Z}),l.jsx(jx,{scope:n,onClose:G,children:Pr.createPortal(l.jsx(Sa.ItemSlot,{scope:n,children:l.jsx(Cv,{asChild:!0,onEscapeKeyDown:Ie(s,()=>{m.isFocusedToastEscapeKeyDownRef.current||G(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Le.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ie(e.onKeyDown,P=>{P.key==="Escape"&&(s==null||s(P.nativeEvent),P.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Ie(e.onPointerDown,P=>{P.button===0&&(S.current={x:P.clientX,y:P.clientY})}),onPointerMove:Ie(e.onPointerMove,P=>{if(!S.current)return;const $=P.clientX-S.current.x,F=P.clientY-S.current.y,W=!!E.current,N=["left","right"].includes(m.swipeDirection),V=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,_=N?V(0,$):0,B=N?0:V(0,F),Q=P.pointerType==="touch"?10:2,ne={x:_,y:B},ee={originalEvent:P,delta:ne};W?(E.current=ne,xo(Lx,g,ee,{discrete:!1})):Uu(ne,m.swipeDirection,Q)?(E.current=ne,xo(Ix,d,ee,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs($)>Q||Math.abs(F)>Q)&&(S.current=null)}),onPointerUp:Ie(e.onPointerUp,P=>{const $=E.current,F=P.target;if(F.hasPointerCapture(P.pointerId)&&F.releasePointerCapture(P.pointerId),E.current=null,S.current=null,$){const W=P.currentTarget,N={originalEvent:P,delta:$};Uu($,m.swipeDirection,m.swipeThreshold)?xo(Vx,p,N,{discrete:!0}):xo(Rx,h,N,{discrete:!0}),W.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Hx=e=>{const{__scopeToast:t,children:n,...r}=e,o=vo(yo,t),[i,a]=f.useState(!1),[s,u]=f.useState(!1);return qx(()=>a(!0)),f.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:l.jsx(Yi,{asChild:!0,children:l.jsx(wa,{...r,children:i&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Ux="ToastTitle",Lu=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(Le.div,{...r,ref:t})});Lu.displayName=Ux;var Wx="ToastDescription",Ru=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(Le.div,{...r,ref:t})});Ru.displayName=Wx;var Vu="ToastAction",ju=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Bu,{altText:n,asChild:!0,children:l.jsx(_a,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Vu}\`. Expected non-empty \`string\`.`),null)});ju.displayName=Vu;var zu="ToastClose",_a=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=zx(zu,n);return l.jsx(Bu,{asChild:!0,children:l.jsx(Le.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,o.onClose)})})});_a.displayName=zu;var Bu=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(Le.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Hu(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Gx(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Hu(r))}}),t}function xo(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Zl(o,i):o.dispatchEvent(i)}var Uu=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function qx(e=()=>{}){const t=We(e);et(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Gx(e){return e.nodeType===e.ELEMENT_NODE}function Kx(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Aa(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Yx=ku,Wu=Mu,qu=Iu,Gu=Lu,Ku=Ru,Yu=ju,Xu=_a;const Xx=Yx,Ju=f.forwardRef(({className:e,...t},n)=>l.jsx(Wu,{ref:n,className:ge("s3-explr-ui-toast-viewport fixed top-0 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px] z-[10000]",e),...t}));Ju.displayName=Wu.displayName;const Jx=zi("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Zu=f.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(qu,{ref:r,className:ge(Jx({variant:t}),e),...n}));Zu.displayName=qu.displayName;const Zx=f.forwardRef(({className:e,...t},n)=>l.jsx(Yu,{ref:n,className:ge("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Zx.displayName=Yu.displayName;const Qu=f.forwardRef(({className:e,...t},n)=>l.jsx(Xu,{ref:n,className:ge("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 font-bold",e),"toast-close":"",...t,children:l.jsx(Di,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Qu.displayName=Xu.displayName;const ed=f.forwardRef(({className:e,...t},n)=>l.jsx(Gu,{ref:n,className:ge("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));ed.displayName=Gu.displayName;const td=f.forwardRef(({className:e,...t},n)=>l.jsx(Ku,{ref:n,className:ge("text-sm opacity-90 font-bold",e),...t}));td.displayName=Ku.displayName;const Qx=1,ew=1e6;let Pa=0;function tw(){return Pa=(Pa+1)%Number.MAX_SAFE_INTEGER,Pa.toString()}const Na=new Map,nd=e=>{if(Na.has(e))return;const t=setTimeout(()=>{Na.delete(e),sr({type:"REMOVE_TOAST",toastId:e})},ew);Na.set(e,t)},nw=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Qx)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?nd(n):e.toasts.forEach(r=>{nd(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},wo=[];let bo={toasts:[]};function sr(e){bo=nw(bo,e),wo.forEach(t=>{t(bo)})}function rw({...e}){const t=tw(),n=o=>sr({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>sr({type:"DISMISS_TOAST",toastId:t});return sr({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function So(){const[e,t]=f.useState(bo);return f.useEffect(()=>(wo.push(t),()=>{const n=wo.indexOf(t);n>-1&&wo.splice(n,1)}),[e]),{...e,toast:rw,dismiss:n=>sr({type:"DISMISS_TOAST",toastId:n})}}function rd(){const{toasts:e}=So();return l.jsxs(Xx,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return l.jsxs(Zu,{...i,className:`s3-explr-ui-toast ${i.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(ed,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(td,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Qu,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Ju,{className:"s3-explr-ui-toast-viewport"})]})}function Vt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function od(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ow(...e){return t=>{let n=!1;const r=e.map(o=>{const i=od(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():od(e[o],null)}}}}function lr(...e){return f.useCallback(ow(...e),e)}var iw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],cr=iw.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Cn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function aw(e,t){e&&Pr.flushSync(()=>e.dispatchEvent(t))}var sw="DismissableLayer",Oa="dismissableLayer.update",lw="dismissableLayer.pointerDownOutside",cw="dismissableLayer.focusOutside",id,ad=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sd=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...u}=e,c=f.useContext(ad),[d,g]=f.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),v=lr(t,M=>g(M)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),b=d?m.indexOf(d):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=fw(M=>{const I=M.target,H=[...c.branches].some(k=>k.contains(I));!E||H||(o==null||o(M),a==null||a(M),M.defaultPrevented||s==null||s())},h),O=pw(M=>{const I=M.target;[...c.branches].some(k=>k.contains(I))||(i==null||i(M),a==null||a(M),M.defaultPrevented||s==null||s())},h);return oc(M=>{b===c.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&s&&(M.preventDefault(),s()))},h),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(id=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),ld(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=id)}},[d,h,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),ld())},[d,c]),f.useEffect(()=>{const M=()=>p({});return document.addEventListener(Oa,M),()=>document.removeEventListener(Oa,M)},[]),l.jsx(cr.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Vt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Vt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Vt(e.onPointerDownCapture,x.onPointerDownCapture)})});sd.displayName=sw;var uw="DismissableLayerBranch",dw=f.forwardRef((e,t)=>{const n=f.useContext(ad),r=f.useRef(null),o=lr(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),l.jsx(cr.div,{...e,ref:o})});dw.displayName=uw;function fw(e,t=globalThis==null?void 0:globalThis.document){const n=We(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){cd(lw,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pw(e,t=globalThis==null?void 0:globalThis.document){const n=We(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&cd(cw,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ld(){const e=new CustomEvent(Oa);document.dispatchEvent(e)}function cd(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?aw(o,i):o.dispatchEvent(i)}const gw=["top","right","bottom","left"],tn=Math.min,tt=Math.max,Co=Math.round,Eo=Math.floor,_t=e=>({x:e,y:e}),mw={left:"right",right:"left",bottom:"top",top:"bottom"},hw={start:"end",end:"start"};function Fa(e,t,n){return tt(e,tn(t,n))}function jt(e,t){return typeof e=="function"?e(t):e}function zt(e){return e.split("-")[0]}function In(e){return e.split("-")[1]}function ka(e){return e==="x"?"y":"x"}function Da(e){return e==="y"?"height":"width"}function nn(e){return["top","bottom"].includes(zt(e))?"y":"x"}function Ma(e){return ka(nn(e))}function vw(e,t,n){n===void 0&&(n=!1);const r=In(e),o=Ma(e),i=Da(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=To(a)),[a,To(a)]}function yw(e){const t=To(e);return[$a(e),t,$a(t)]}function $a(e){return e.replace(/start|end/g,t=>hw[t])}function xw(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function ww(e,t,n,r){const o=In(e);let i=xw(zt(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map($a)))),i}function To(e){return e.replace(/left|right|bottom|top/g,t=>mw[t])}function bw(e){return{top:0,right:0,bottom:0,left:0,...e}}function ud(e){return typeof e!="number"?bw(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function dd(e,t,n){let{reference:r,floating:o}=e;const i=nn(t),a=Ma(t),s=Da(a),u=zt(t),c=i==="y",d=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(u){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(In(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const Sw=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:g}=dd(c,r,u),h=r,p={},v=0;for(let m=0;m<s.length;m++){const{name:y,fn:w}=s[m],{x:b,y:S,data:E,reset:x}=await w({x:d,y:g,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=b??d,g=S??g,p={...p,[y]:{...p[y],...E}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(c=x.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:d,y:g}=dd(c,h,u)),m=-1)}return{x:d,y:g,placement:h,strategy:o,middlewareData:p}};async function ur(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:g="floating",altBoundary:h=!1,padding:p=0}=jt(t,e),v=ud(p),y=s[h?g==="floating"?"reference":"floating":g],w=_o(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),b=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),E=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},x=_o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-x.top+v.top)/E.y,bottom:(x.bottom-w.bottom+v.bottom)/E.y,left:(w.left-x.left+v.left)/E.x,right:(x.right-w.right+v.right)/E.x}}const Cw=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:c,padding:d=0}=jt(e,t)||{};if(c==null)return{};const g=ud(d),h={x:n,y:r},p=Ma(o),v=Da(p),m=await a.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=i.reference[v]+i.reference[p]-h[p]-i.floating[v],x=h[p]-i.reference[p],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=O?O[S]:0;(!M||!await(a.isElement==null?void 0:a.isElement(O)))&&(M=s.floating[S]||i.floating[v]);const I=E/2-x/2,H=M/2-m[v]/2-1,k=tn(g[w],H),G=tn(g[b],H),U=k,Z=M-m[v]-G,P=M/2-m[v]/2+I,$=Fa(U,P,Z),F=!u.arrow&&In(o)!=null&&P!==$&&i.reference[v]/2-(P<U?k:G)-m[v]/2<0,W=F?P<U?P-U:P-Z:0;return{[p]:h[p]+W,data:{[p]:$,centerOffset:P-$-W,...F&&{alignmentOffset:W}},reset:F}}}),Ew=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...y}=jt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=zt(o),b=nn(s),S=zt(s)===s,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=h||(S||!m?[To(s)]:yw(s)),O=v!=="none";!h&&O&&x.push(...ww(s,m,v,E));const M=[s,...x],I=await ur(t,y),H=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&H.push(I[w]),g){const P=vw(o,a,E);H.push(I[P[0]],I[P[1]])}if(k=[...k,{placement:o,overflows:H}],!H.every(P=>P<=0)){var G,U;const P=(((G=i.flip)==null?void 0:G.index)||0)+1,$=M[P];if($)return{data:{index:P,overflows:k},reset:{placement:$}};let F=(U=k.filter(W=>W.overflows[0]<=0).sort((W,N)=>W.overflows[1]-N.overflows[1])[0])==null?void 0:U.placement;if(!F)switch(p){case"bestFit":{var Z;const W=(Z=k.filter(N=>{if(O){const V=nn(N.placement);return V===b||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,_)=>V+_,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:Z[0];W&&(F=W);break}case"initialPlacement":F=s;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function fd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pd(e){return gw.some(t=>e[t]>=0)}const Tw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=jt(e,t);switch(r){case"referenceHidden":{const i=await ur(t,{...o,elementContext:"reference"}),a=fd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:pd(a)}}}case"escaped":{const i=await ur(t,{...o,altBoundary:!0}),a=fd(i,n.floating);return{data:{escapedOffsets:a,escaped:pd(a)}}}default:return{}}}}};async function _w(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=zt(n),s=In(n),u=nn(n)==="y",c=["left","top"].includes(a)?-1:1,d=i&&u?-1:1,g=jt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return s&&typeof v=="number"&&(p=s==="end"?v*-1:v),u?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const Aw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await _w(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},Pw=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:w,y:b}=y;return{x:w,y:b}}},...u}=jt(e,t),c={x:n,y:r},d=await ur(t,u),g=nn(zt(o)),h=ka(g);let p=c[h],v=c[g];if(i){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=p+d[y],S=p-d[w];p=Fa(b,p,S)}if(a){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+d[y],S=v-d[w];v=Fa(b,v,S)}const m=s.fn({...t,[h]:p,[g]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[g]:a}}}}}},Nw=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=jt(e,t),d={x:n,y:r},g=nn(o),h=ka(g);let p=d[h],v=d[g];const m=jt(s,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const S=h==="y"?"height":"width",E=i.reference[h]-i.floating[S]+y.mainAxis,x=i.reference[h]+i.reference[S]-y.mainAxis;p<E?p=E:p>x&&(p=x)}if(c){var w,b;const S=h==="y"?"width":"height",E=["top","left"].includes(zt(o)),x=i.reference[g]-i.floating[S]+(E&&((w=a.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),O=i.reference[g]+i.reference[S]+(E?0:((b=a.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<x?v=x:v>O&&(v=O)}return{[h]:p,[g]:v}}}},Ow=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...c}=jt(e,t),d=await ur(t,c),g=zt(o),h=In(o),p=nn(o)==="y",{width:v,height:m}=i.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=g,y=h==="end"?"top":"bottom");const b=m-d.top-d.bottom,S=v-d.left-d.right,E=tn(m-d[y],b),x=tn(v-d[w],S),O=!t.middlewareData.shift;let M=E,I=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=b),O&&!h){const k=tt(d.left,0),G=tt(d.right,0),U=tt(d.top,0),Z=tt(d.bottom,0);p?I=v-2*(k!==0||G!==0?k+G:tt(d.left,d.right)):M=m-2*(U!==0||Z!==0?U+Z:tt(d.top,d.bottom))}await u({...t,availableWidth:I,availableHeight:M});const H=await a.getDimensions(s.floating);return v!==H.width||m!==H.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<"u"}function Ln(e){return gd(e)?(e.nodeName||"").toLowerCase():"#document"}function nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(gd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gd(e){return Ao()?e instanceof Node||e instanceof nt(e).Node:!1}function vt(e){return Ao()?e instanceof Element||e instanceof nt(e).Element:!1}function Pt(e){return Ao()?e instanceof HTMLElement||e instanceof nt(e).HTMLElement:!1}function md(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nt(e).ShadowRoot}function dr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Fw(e){return["table","td","th"].includes(Ln(e))}function Po(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ia(e){const t=La(),n=vt(e)?yt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function kw(e){let t=rn(e);for(;Pt(t)&&!Rn(t);){if(Ia(t))return t;if(Po(t))return null;t=rn(t)}return null}function La(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rn(e){return["html","body","#document"].includes(Ln(e))}function yt(e){return nt(e).getComputedStyle(e)}function No(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rn(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||md(e)&&e.host||At(e);return md(t)?t.host:t}function hd(e){const t=rn(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&dr(t)?t:hd(t)}function fr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=hd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=nt(o);if(i){const s=Ra(a);return t.concat(a,a.visualViewport||[],dr(o)?o:[],s&&n?fr(s):[])}return t.concat(o,fr(o,[],n))}function Ra(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vd(e){const t=yt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pt(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Co(n)!==i||Co(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Va(e){return vt(e)?e:e.contextElement}function Vn(e){const t=Va(e);if(!Pt(t))return _t(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=vd(t);let a=(i?Co(n.width):n.width)/r,s=(i?Co(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Dw=_t(0);function yd(e){const t=nt(e);return!La()||!t.visualViewport?Dw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nt(e)?!1:t}function mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Va(e);let a=_t(1);t&&(r?vt(r)&&(a=Vn(r)):a=Vn(e));const s=Mw(i,n,r)?yd(i):_t(0);let u=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,g=o.height/a.y;if(i){const h=nt(i),p=r&&vt(r)?nt(r):r;let v=h,m=Ra(v);for(;m&&r&&p!==v;){const y=Vn(m),w=m.getBoundingClientRect(),b=yt(m),S=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,d*=y.x,g*=y.y,u+=S,c+=E,v=nt(m),m=Ra(v)}}return _o({width:d,height:g,x:u,y:c})}function ja(e,t){const n=No(e).scrollLeft;return t?t.left+n:mn(At(e)).left+n}function xd(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ja(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function $w(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=At(r),s=t?Po(t.floating):!1;if(r===a||s&&i)return n;let u={scrollLeft:0,scrollTop:0},c=_t(1);const d=_t(0),g=Pt(r);if((g||!g&&!i)&&((Ln(r)!=="body"||dr(a))&&(u=No(r)),Pt(r))){const p=mn(r);c=Vn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=a&&!g&&!i?xd(a,u,!0):_t(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-u.scrollTop*c.y+d.y+h.y}}function Iw(e){return Array.from(e.getClientRects())}function Lw(e){const t=At(e),n=No(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ja(e);const s=-n.scrollTop;return yt(r).direction==="rtl"&&(a+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Rw(e,t){const n=nt(e),r=At(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const c=La();(!c||c&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s,y:u}}function Vw(e,t){const n=mn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pt(e)?Vn(e):_t(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,c=r*i.y;return{width:a,height:s,x:u,y:c}}function wd(e,t,n){let r;if(t==="viewport")r=Rw(e,n);else if(t==="document")r=Lw(At(e));else if(vt(t))r=Vw(t,n);else{const o=yd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _o(r)}function bd(e,t){const n=rn(e);return n===t||!vt(n)||Rn(n)?!1:yt(n).position==="fixed"||bd(n,t)}function jw(e,t){const n=t.get(e);if(n)return n;let r=fr(e,[],!1).filter(s=>vt(s)&&Ln(s)!=="body"),o=null;const i=yt(e).position==="fixed";let a=i?rn(e):e;for(;vt(a)&&!Rn(a);){const s=yt(a),u=Ia(a);!u&&s.position==="fixed"&&(o=null),(i?!u&&!o:!u&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||dr(a)&&!u&&bd(e,a))?r=r.filter(d=>d!==a):o=s,a=rn(a)}return t.set(e,r),r}function zw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Po(t)?[]:jw(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((c,d)=>{const g=wd(t,d,o);return c.top=tt(g.top,c.top),c.right=tn(g.right,c.right),c.bottom=tn(g.bottom,c.bottom),c.left=tt(g.left,c.left),c},wd(t,s,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Bw(e){const{width:t,height:n}=vd(e);return{width:t,height:n}}function Hw(e,t,n){const r=Pt(t),o=At(t),i=n==="fixed",a=mn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=_t(0);if(r||!r&&!i)if((Ln(t)!=="body"||dr(o))&&(s=No(t)),r){const h=mn(t,!0,i,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&(u.x=ja(o));const c=o&&!r&&!i?xd(o,s):_t(0),d=a.left+s.scrollLeft-u.x-c.x,g=a.top+s.scrollTop-u.y-c.y;return{x:d,y:g,width:a.width,height:a.height}}function za(e){return yt(e).position==="static"}function Sd(e,t){if(!Pt(e)||yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function Cd(e,t){const n=nt(e);if(Po(e))return n;if(!Pt(e)){let o=rn(e);for(;o&&!Rn(o);){if(vt(o)&&!za(o))return o;o=rn(o)}return n}let r=Sd(e,t);for(;r&&Fw(r)&&za(r);)r=Sd(r,t);return r&&Rn(r)&&za(r)&&!Ia(r)?n:r||kw(e)||n}const Uw=async function(e){const t=this.getOffsetParent||Cd,n=this.getDimensions,r=await n(e.floating);return{reference:Hw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ww(e){return yt(e).direction==="rtl"}const qw={convertOffsetParentRelativeRectToViewportRelativeRect:$w,getDocumentElement:At,getClippingRect:zw,getOffsetParent:Cd,getElementRects:Uw,getClientRects:Iw,getDimensions:Bw,getScale:Vn,isElement:vt,isRTL:Ww};function Gw(e,t){let n=null,r;const o=At(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),i();const{left:c,top:d,width:g,height:h}=e.getBoundingClientRect();if(s||t(),!g||!h)return;const p=Eo(d),v=Eo(o.clientWidth-(c+g)),m=Eo(o.clientHeight-(d+h)),y=Eo(c),b={rootMargin:-p+"px "+-v+"px "+-m+"px "+-y+"px",threshold:tt(0,tn(1,u))||1};let S=!0;function E(x){const O=x[0].intersectionRatio;if(O!==u){if(!S)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return a(!0),i}function Kw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Va(e),d=o||i?[...c?fr(c):[],...fr(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const g=c&&s?Gw(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,m=u?mn(e):null;u&&y();function y(){const w=mn(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&n(),m=w,v=requestAnimationFrame(y)}return n(),()=>{var w;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Yw=Aw,Xw=Pw,Jw=Ew,Zw=Ow,Qw=Tw,Ed=Cw,eb=Nw,tb=(e,t,n)=>{const r=new Map,o={platform:qw,...n},i={...o.platform,_c:r};return Sw(e,t,{...o,platform:i})};var Oo=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Fo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Fo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Td(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){const n=Td(e);return Math.round(t*n)/n}function Ba(e){const t=f.useRef(e);return Oo(()=>{t.current=e}),t}function nb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[d,g]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);Fo(h,r)||p(r);const[v,m]=f.useState(null),[y,w]=f.useState(null),b=f.useCallback(N=>{N!==O.current&&(O.current=N,m(N))},[]),S=f.useCallback(N=>{N!==M.current&&(M.current=N,w(N))},[]),E=i||v,x=a||y,O=f.useRef(null),M=f.useRef(null),I=f.useRef(d),H=u!=null,k=Ba(u),G=Ba(o),U=Ba(c),Z=f.useCallback(()=>{if(!O.current||!M.current)return;const N={placement:t,strategy:n,middleware:h};G.current&&(N.platform=G.current),tb(O.current,M.current,N).then(V=>{const _={...V,isPositioned:U.current!==!1};P.current&&!Fo(I.current,_)&&(I.current=_,Pr.flushSync(()=>{g(_)}))})},[h,t,n,G,U]);Oo(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(N=>({...N,isPositioned:!1})))},[c]);const P=f.useRef(!1);Oo(()=>(P.current=!0,()=>{P.current=!1}),[]),Oo(()=>{if(E&&(O.current=E),x&&(M.current=x),E&&x){if(k.current)return k.current(E,x,Z);Z()}},[E,x,Z,k,H]);const $=f.useMemo(()=>({reference:O,floating:M,setReference:b,setFloating:S}),[b,S]),F=f.useMemo(()=>({reference:E,floating:x}),[E,x]),W=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!F.floating)return N;const V=_d(F.floating,d.x),_=_d(F.floating,d.y);return s?{...N,transform:"translate("+V+"px, "+_+"px)",...Td(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:_}},[n,s,F.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:Z,refs:$,elements:F,floatingStyles:W}),[d,Z,$,F,W])}const rb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ed({element:r.current,padding:o}).fn(n):{}:r?Ed({element:r,padding:o}).fn(n):{}}}},ob=(e,t)=>({...Yw(e),options:[e,t]}),ib=(e,t)=>({...Xw(e),options:[e,t]}),ab=(e,t)=>({...eb(e),options:[e,t]}),sb=(e,t)=>({...Jw(e),options:[e,t]}),lb=(e,t)=>({...Zw(e),options:[e,t]}),cb=(e,t)=>({...Qw(e),options:[e,t]}),ub=(e,t)=>({...rb(e),options:[e,t]});var db=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fb=db.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Cn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),pb="Arrow",Ad=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return l.jsx(fb.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ad.displayName=pb;var gb=Ad;function Pd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mb(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Pd(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Pd(e[o],null)}}}}function Nd(...e){return f.useCallback(mb(...e),e)}var hb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Od=hb.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Cn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ha="Popper",[Fd,kd]=Jt(Ha),[vb,Dd]=Fd(Ha),Md=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return l.jsx(vb,{scope:t,anchor:r,onAnchorChange:o,children:n})};Md.displayName=Ha;var $d="PopperAnchor",Id=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Dd($d,n),a=f.useRef(null),s=Nd(t,a);return f.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:l.jsx(Od.div,{...o,ref:s})});Id.displayName=$d;var Ua="PopperContent",[yb,xb]=Fd(Ua),Ld=f.forwardRef((e,t)=>{var ie,de,ue,le,Se,K;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:g="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,y=Dd(Ua,n),[w,b]=f.useState(null),S=Nd(t,Ee=>b(Ee)),[E,x]=f.useState(null),O=Xl(E),M=(O==null?void 0:O.width)??0,I=(O==null?void 0:O.height)??0,H=r+(i!=="center"?"-"+i:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},G=Array.isArray(c)?c:[c],U=G.length>0,Z={padding:k,boundary:G.filter(bb),altBoundary:U},{refs:P,floatingStyles:$,placement:F,isPositioned:W,middlewareData:N}=nb({strategy:"fixed",placement:H,whileElementsMounted:(...Ee)=>Kw(...Ee,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[ob({mainAxis:o+I,alignmentAxis:a}),u&&ib({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?ab():void 0,...Z}),u&&sb({...Z}),lb({...Z,apply:({elements:Ee,rects:He,availableWidth:Ue,availableHeight:Dt})=>{const{width:ot,height:C}=He.reference,A=Ee.floating.style;A.setProperty("--radix-popper-available-width",`${Ue}px`),A.setProperty("--radix-popper-available-height",`${Dt}px`),A.setProperty("--radix-popper-anchor-width",`${ot}px`),A.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&ub({element:E,padding:s}),Sb({arrowWidth:M,arrowHeight:I}),h&&cb({strategy:"referenceHidden",...Z})]}),[V,_]=jd(F),B=We(v);et(()=>{W&&(B==null||B())},[W,B]);const Q=(ie=N.arrow)==null?void 0:ie.x,ne=(de=N.arrow)==null?void 0:de.y,ee=((ue=N.arrow)==null?void 0:ue.centerOffset)!==0,[ce,oe]=f.useState();return et(()=>{w&&oe(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:W?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(le=N.transformOrigin)==null?void 0:le.x,(Se=N.transformOrigin)==null?void 0:Se.y].join(" "),...((K=N.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(yb,{scope:n,placedSide:V,onArrowChange:x,arrowX:Q,arrowY:ne,shouldHideArrow:ee,children:l.jsx(Od.div,{"data-side":V,"data-align":_,...m,ref:S,style:{...m.style,animation:W?void 0:"none"}})})})});Ld.displayName=Ua;var Rd="PopperArrow",wb={top:"bottom",right:"left",bottom:"top",left:"right"},Vd=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=xb(Rd,r),a=wb[i.placedSide];return l.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:l.jsx(gb,{...o,ref:n,style:{...o.style,display:"block"}})})});Vd.displayName=Rd;function bb(e){return e!==null}var Sb=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;const{placement:n,rects:r,middlewareData:o}=t,a=((y=o.arrow)==null?void 0:y.centerOffset)!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[c,d]=jd(n),g={start:"0%",center:"50%",end:"100%"}[d],h=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,p=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",m="";return c==="bottom"?(v=a?g:`${h}px`,m=`${-u}px`):c==="top"?(v=a?g:`${h}px`,m=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,m=a?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,m=a?g:`${p}px`),{data:{x:v,y:m}}}});function jd(e){const[t,n="center"]=e.split("-");return[t,n]}var Cb=Md,Eb=Id,Tb=Ld,_b=Vd,Ab="Portal",zd=f.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=f.useState(!1);et(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Jo.createPortal(l.jsx(cr.div,{...r,ref:t}),a):null});zd.displayName=Ab;function Pb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Wa=e=>{const{present:t,children:n}=e,r=Nb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=lr(r.ref,Ob(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Wa.displayName="Presence";function Nb(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Pb(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=ko(r.current);i.current=s==="mounted"?c:"none"},[s]),et(()=>{const c=r.current,d=o.current;if(d!==e){const h=i.current,p=ko(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),et(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,g=p=>{const m=ko(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=ko(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ko(e){return(e==null?void 0:e.animationName)||"none"}function Ob(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fb="VisuallyHidden",Bd=f.forwardRef((e,t)=>l.jsx(cr.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Bd.displayName=Fb;var kb=Bd,[Do,CE]=Jt("Tooltip",[kd]),Mo=kd(),Hd="TooltipProvider",Db=700,qa="tooltip.open",[Mb,Ga]=Do(Hd),Ud=e=>{const{__scopeTooltip:t,delayDuration:n=Db,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=f.useState(!0),u=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),l.jsx(Mb,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(d=>{u.current=d},[]),disableHoverableContent:o,children:i})};Ud.displayName=Hd;var $o="Tooltip",[$b,pr]=Do($o),Wd=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,u=Ga($o,e.__scopeTooltip),c=Mo(t),[d,g]=f.useState(null),h=Pn(),p=f.useRef(0),v=a??u.disableHoverableContent,m=s??u.delayDuration,y=f.useRef(!1),[w=!1,b]=_n({prop:r,defaultProp:o,onChange:M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(qa))):u.onClose(),i==null||i(M)}}),S=f.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),x=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),O=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},m)},[m,b]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(Cb,{...c,children:l.jsx($b,{scope:t,contentId:h,open:w,stateAttribute:S,trigger:d,onTriggerChange:g,onTriggerEnter:f.useCallback(()=>{u.isOpenDelayed?O():E()},[u.isOpenDelayed,O,E]),onTriggerLeave:f.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Wd.displayName=$o;var Ka="TooltipTrigger",qd=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=pr(Ka,n),i=Ga(Ka,n),a=Mo(n),s=f.useRef(null),u=lr(t,s,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),g=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(Eb,{asChild:!0,...a,children:l.jsx(cr.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Vt(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:Vt(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:Vt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Vt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Vt(e.onBlur,o.onClose),onClick:Vt(e.onClick,o.onClose)})})});qd.displayName=Ka;var Ya="TooltipPortal",[Ib,Lb]=Do(Ya,{forceMount:void 0}),Gd=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=pr(Ya,t);return l.jsx(Ib,{scope:t,forceMount:n,children:l.jsx(Wa,{present:n||i.open,children:l.jsx(zd,{asChild:!0,container:o,children:r})})})};Gd.displayName=Ya;var jn="TooltipContent",Kd=f.forwardRef((e,t)=>{const n=Lb(jn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=pr(jn,e.__scopeTooltip);return l.jsx(Wa,{present:r||a.open,children:a.disableHoverableContent?l.jsx(Yd,{side:o,...i,ref:t}):l.jsx(Rb,{side:o,...i,ref:t})})}),Rb=f.forwardRef((e,t)=>{const n=pr(jn,e.__scopeTooltip),r=Ga(jn,e.__scopeTooltip),o=f.useRef(null),i=lr(t,o),[a,s]=f.useState(null),{trigger:u,onClose:c}=n,d=o.current,{onPointerInTransitChange:g}=r,h=f.useCallback(()=>{s(null),g(!1)},[g]),p=f.useCallback((v,m)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},b=Bb(w,y.getBoundingClientRect()),S=Hb(w,b),E=Ub(m.getBoundingClientRect()),x=qb([...S,...E]);s(x),g(!0)},[g]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(u&&d){const v=y=>p(y,d),m=y=>p(y,u);return u.addEventListener("pointerleave",v),d.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",m)}}},[u,d,p,h]),f.useEffect(()=>{if(a){const v=m=>{const y=m.target,w={x:m.clientX,y:m.clientY},b=(u==null?void 0:u.contains(y))||(d==null?void 0:d.contains(y)),S=!Wb(w,a);b?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,d,a,c,h]),l.jsx(Yd,{...e,ref:i})}),[Vb,jb]=Do($o,{isInside:!1}),Yd=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,u=pr(jn,n),c=Mo(n),{onClose:d}=u;return f.useEffect(()=>(document.addEventListener(qa,d),()=>document.removeEventListener(qa,d)),[d]),f.useEffect(()=>{if(u.trigger){const g=h=>{const p=h.target;p!=null&&p.contains(u.trigger)&&d()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,d]),l.jsx(sd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:g=>g.preventDefault(),onDismiss:d,children:l.jsxs(Tb,{"data-state":u.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ml,{children:r}),l.jsx(Vb,{scope:n,isInside:!0,children:l.jsx(kb,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Kd.displayName=jn;var Xd="TooltipArrow",zb=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Mo(n);return jb(Xd,n).isInside?null:l.jsx(_b,{...o,...r,ref:t})});zb.displayName=Xd;function Bb(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Hb(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ub(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Wb(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,u=t[i].y,c=t[a].x,d=t[a].y;u>r!=d>r&&n<(c-s)*(r-u)/(d-u)+s&&(o=!o)}return o}function qb(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gb(t)}function Gb(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Kb=Ud,Yb=Wd,Xb=qd,Jb=Gd,Jd=Kd;const zn=Kb,Bn=Yb,Hn=Xb,hn=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Jb,{children:l.jsx(Jd,{ref:r,sideOffset:t,className:ge("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));hn.displayName=Jd.displayName;function Zb({title:e,titleId:t,...n},r){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?f.createElement("title",{id:t},e):null,f.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Qb=f.forwardRef(Zb);var e0=function(e){return function(t,n){var r=T.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Zd=function(e){return typeof e=="function"},Qd=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const t0=e0(T.useEffect);function ef(e){var t=T.useRef(e);return t.current=e,t}var n0=function(e){Qd&&(Zd(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=ef(e);T.useEffect(function(){return function(){t.current()}},[])};function r0(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var tf=r0,o0=typeof rr=="object"&&rr&&rr.Object===Object&&rr,i0=o0,a0=i0,s0=typeof self=="object"&&self&&self.Object===Object&&self,l0=a0||s0||Function("return this")(),nf=l0,c0=nf,u0=function(){return c0.Date.now()},d0=u0,f0=/\s/;function p0(e){for(var t=e.length;t--&&f0.test(e.charAt(t)););return t}var g0=p0,m0=g0,h0=/^\s+/;function v0(e){return e&&e.slice(0,m0(e)+1).replace(h0,"")}var y0=v0,x0=nf,w0=x0.Symbol,rf=w0,of=rf,af=Object.prototype,b0=af.hasOwnProperty,S0=af.toString,gr=of?of.toStringTag:void 0;function C0(e){var t=b0.call(e,gr),n=e[gr];try{e[gr]=void 0;var r=!0}catch{}var o=S0.call(e);return r&&(t?e[gr]=n:delete e[gr]),o}var E0=C0,T0=Object.prototype,_0=T0.toString;function A0(e){return _0.call(e)}var P0=A0,sf=rf,N0=E0,O0=P0,F0="[object Null]",k0="[object Undefined]",lf=sf?sf.toStringTag:void 0;function D0(e){return e==null?e===void 0?k0:F0:lf&&lf in Object(e)?N0(e):O0(e)}var M0=D0;function $0(e){return e!=null&&typeof e=="object"}var I0=$0,L0=M0,R0=I0,V0="[object Symbol]";function j0(e){return typeof e=="symbol"||R0(e)&&L0(e)==V0}var z0=j0,B0=y0,cf=tf,H0=z0,uf=NaN,U0=/^[-+]0x[0-9a-f]+$/i,W0=/^0b[01]+$/i,q0=/^0o[0-7]+$/i,G0=parseInt;function K0(e){if(typeof e=="number")return e;if(H0(e))return uf;if(cf(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=cf(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=B0(e);var n=W0.test(e);return n||q0.test(e)?G0(e.slice(2),n?2:8):U0.test(e)?uf:+e}var Y0=K0,X0=tf,Xa=d0,df=Y0,J0="Expected a function",Z0=Math.max,Q0=Math.min;function eS(e,t,n){var r,o,i,a,s,u,c=0,d=!1,g=!1,h=!0;if(typeof e!="function")throw new TypeError(J0);t=df(t)||0,X0(n)&&(d=!!n.leading,g="maxWait"in n,i=g?Z0(df(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function p(O){var M=r,I=o;return r=o=void 0,c=O,a=e.apply(I,M),a}function v(O){return c=O,s=setTimeout(w,t),d?p(O):a}function m(O){var M=O-u,I=O-c,H=t-M;return g?Q0(H,i-I):H}function y(O){var M=O-u,I=O-c;return u===void 0||M>=t||M<0||g&&I>=i}function w(){var O=Xa();if(y(O))return b(O);s=setTimeout(w,m(O))}function b(O){return s=void 0,h&&r?p(O):(r=o=void 0,a)}function S(){s!==void 0&&clearTimeout(s),c=0,r=u=o=s=void 0}function E(){return s===void 0?a:b(Xa())}function x(){var O=Xa(),M=y(O);if(r=arguments,o=this,u=O,M){if(s===void 0)return v(u);if(g)return clearTimeout(s),s=setTimeout(w,t),p(u)}return s===void 0&&(s=setTimeout(w,t)),a}return x.cancel=S,x.flush=E,x}var tS=eS;const nS=Wr(tS);function rS(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}rS()||(global.Date=Date);function oS(e,t){var n;Qd&&(Zd(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=ef(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,i=T.useMemo(function(){return nS(function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return r.current.apply(r,xc([],yc(a),!1))},o,t)},[]);return n0(function(){i.cancel()}),{run:i,cancel:i.cancel,flush:i.flush}}function iS(e,t,n){var r=yc(T.useState({}),2),o=r[0],i=r[1],a=oS(function(){i({})},n).run;T.useEffect(function(){return a()},t),t0(e,[o])}const aS=T.forwardRef(({onChange:e},t)=>{const n=T.useRef(null),[r,o]=T.useState("");return T.useImperativeHandle(t,()=>({setValue:i=>{var a;o(i),(a=n.current)==null||a.focus()}})),iS(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(en,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:i=>o(i.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var i;o(""),(i=n.current)==null||i.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(Qb,{className:"h-5 w-5"})})]})});var Ja={exports:{}},Io={exports:{}},_e={};/** @license React v16.13.1
151
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ny="DialogDescriptionWarning",Oy=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yc(Ny).contentName}}.`;return f.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Fy=$c,ky=Lc,Dy=Vc,Xc=jc,Jc=zc,Zc=Hc,Qc=Wc,My=Gc;const Rt=Fy,no=ky,$y=Dy,eu=f.forwardRef(({className:e,...t},n)=>l.jsx(Xc,{ref:n,className:ge("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));eu.displayName=Xc.displayName;const St=f.forwardRef(({className:e,children:t,...n},r)=>l.jsxs($y,{children:[l.jsx(eu,{}),l.jsxs(Jc,{ref:r,className:ge("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(My,{className:ge("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(Di,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));St.displayName=Jc.displayName;const Ct=({className:e,...t})=>l.jsx("div",{className:ge("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ct.displayName="DialogHeader";const pn=({className:e,...t})=>l.jsx("div",{className:ge("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pn.displayName="DialogFooter";const Et=f.forwardRef(({className:e,...t},n)=>l.jsx(Zc,{ref:n,className:ge("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Et.displayName=Zc.displayName;const Dn=f.forwardRef(({className:e,...t},n)=>l.jsx(Qc,{ref:n,className:ge("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));Dn.displayName=Qc.displayName;const en=f.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ge("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));en.displayName="Input";var Iy="Label",tu=f.forwardRef((e,t)=>l.jsx(Le.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tu.displayName=Iy;var nu=tu;const Ly=zi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),gn=f.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(nu,{ref:o,className:ge(Ly({variant:t,size:n}),e),...r}));gn.displayName=nu.displayName;const ro=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:ge("mx-auto flex w-full justify-center",e),...t});ro.displayName="Pagination";const oo=f.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:ge("flex flex-row items-center gap-1",e),...t}));oo.displayName="PaginationContent";const mt=f.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ge("",e),...t}));mt.displayName="PaginationItem";const Mn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:ge(Yl({variant:t?"outline":"ghost",size:n}),e),...r});Mn.displayName="PaginationLink";const io=({className:e,...t})=>l.jsxs(Mn,{"aria-label":"Go to previous page",size:"default",className:ge("gap-1 pl-2.5",e),...t,children:[l.jsx(ah,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});io.displayName="PaginationPrevious";const ao=({className:e,...t})=>l.jsxs(Mn,{"aria-label":"Go to next page",size:"default",className:ge("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(kl,{className:"h-4 w-4"})]});ao.displayName="PaginationNext";const so=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:ge("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(sh,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});so.displayName="PaginationEllipsis";const lo=f.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:ge("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:ge("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));lo.displayName="Table";const co=f.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ge("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));co.displayName="TableHeader";const uo=f.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ge("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));uo.displayName="TableBody";const Ry=f.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Ry.displayName="TableFooter";const ht=f.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));ht.displayName="TableRow";const Tt=f.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ge("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));Tt.displayName="TableHead";const Xe=f.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:ge("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Xe.displayName="TableCell";const Vy=f.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ge("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));Vy.displayName="TableCaption";function sa(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function $n(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ru(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function la(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ru(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ru(e[o],null)}}}}function ca(...e){return f.useCallback(la(...e),e)}var ua=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(zy);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(da,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(da,{...r,ref:t,children:n})});ua.displayName="Slot";var da=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Hy(n);return f.cloneElement(n,{...By(r,n.props),ref:t?la(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});da.displayName="SlotClone";var jy=({children:e})=>l.jsx(l.Fragment,{children:e});function zy(e){return f.isValidElement(e)&&e.type===jy}function By(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Hy(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Uy(e){const t=e+"CollectionProvider",[n,r]=Jt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:m}=p,y=T.useRef(null),w=T.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};a.displayName=t;const s=e+"CollectionSlot",u=T.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=i(s,m),b=ca(v,w.collectionRef);return l.jsx(ua,{ref:b,children:y})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",g=T.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,b=T.useRef(null),S=ca(v,b),E=i(c,m);return T.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(ua,{[d]:"",ref:S,children:y})});g.displayName=c;function h(p){const v=i(e+"CollectionConsumer",p);return T.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:g},h,r]}var ou=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(qy);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(fa,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(fa,{...r,ref:t,children:n})});ou.displayName="Slot";var fa=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Ky(n);return f.cloneElement(n,{...Gy(r,n.props),ref:t?la(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});fa.displayName="SlotClone";var Wy=({children:e})=>l.jsx(l.Fragment,{children:e});function qy(e){return f.isValidElement(e)&&e.type===Wy}function Gy(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ky(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],iu=Yy.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?ou:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xy=f.createContext(void 0);function au(e){const t=f.useContext(Xy);return e||t||"ltr"}var pa="rovingFocusGroup.onEntryFocus",Jy={bubbles:!1,cancelable:!0},fo="RovingFocusGroup",[ga,su,Zy]=Uy(fo),[Qy,lu]=Jt(fo,[Zy]),[ex,tx]=Qy(fo),cu=f.forwardRef((e,t)=>l.jsx(ga.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ga.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(nx,{...e,ref:t})})}));cu.displayName=fo;var nx=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...g}=e,h=f.useRef(null),p=ca(t,h),v=au(i),[m=null,y]=_n({prop:a,defaultProp:s,onChange:u}),[w,b]=f.useState(!1),S=We(c),E=su(n),x=f.useRef(!1),[O,M]=f.useState(0);return f.useEffect(()=>{const I=h.current;if(I)return I.addEventListener(pa,S),()=>I.removeEventListener(pa,S)},[S]),l.jsx(ex,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(I=>y(I),[y]),onItemShiftTab:f.useCallback(()=>b(!0),[]),onFocusableItemAdd:f.useCallback(()=>M(I=>I+1),[]),onFocusableItemRemove:f.useCallback(()=>M(I=>I-1),[]),children:l.jsx(iu.div,{tabIndex:w||O===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:$n(e.onMouseDown,()=>{x.current=!0}),onFocus:$n(e.onFocus,I=>{const H=!x.current;if(I.target===I.currentTarget&&H&&!w){const k=new CustomEvent(pa,Jy);if(I.currentTarget.dispatchEvent(k),!k.defaultPrevented){const G=E().filter(F=>F.focusable),U=G.find(F=>F.active),Z=G.find(F=>F.id===m),$=[U,Z,...G].filter(Boolean).map(F=>F.ref.current);fu($,d)}}x.current=!1}),onBlur:$n(e.onBlur,()=>b(!1))})})}),uu="RovingFocusGroupItem",du=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=Pn(),u=i||s,c=tx(uu,n),d=c.currentTabStopId===u,g=su(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return f.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),l.jsx(ga.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(iu.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:$n(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:$n(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:$n(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=ix(v,c.orientation,c.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?ax(w,b+1):w.slice(b+1)}setTimeout(()=>fu(w))}})})})});du.displayName=uu;var rx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ox(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ix(e,t,n){const r=ox(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rx[r]}function fu(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ax(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sx=cu,lx=du;function pu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cx(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pu(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():pu(e[o],null)}}}}function ux(...e){return f.useCallback(cx(...e),e)}function dx(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var gu=e=>{const{present:t,children:n}=e,r=fx(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=ux(r.ref,px(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};gu.displayName="Presence";function fx(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[s,u]=dx(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=po(r.current);i.current=s==="mounted"?c:"none"},[s]),et(()=>{const c=r.current,d=o.current;if(d!==e){const h=i.current,p=po(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),et(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,g=p=>{const m=po(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=po(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function po(e){return(e==null?void 0:e.animationName)||"none"}function px(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gx(...e){return t=>{let n=!1;const r=e.map(o=>{const i=mu(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():mu(e[o],null)}}}}var hu=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(hx);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(ma,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(ma,{...r,ref:t,children:n})});hu.displayName="Slot";var ma=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=yx(n);return f.cloneElement(n,{...vx(r,n.props),ref:t?gx(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});ma.displayName="SlotClone";var mx=({children:e})=>l.jsx(l.Fragment,{children:e});function hx(e){return f.isValidElement(e)&&e.type===mx}function vx(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function yx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],go=xx.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?hu:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ha="Tabs",[wx,bE]=Jt(ha,[lu]),vu=lu(),[bx,va]=wx(ha),yu=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:u="automatic",...c}=e,d=au(s),[g,h]=_n({prop:r,onChange:o,defaultProp:i});return l.jsx(bx,{scope:n,baseId:Pn(),value:g,onValueChange:h,orientation:a,dir:d,activationMode:u,children:l.jsx(go.div,{dir:d,"data-orientation":a,...c,ref:t})})});yu.displayName=ha;var xu="TabsList",wu=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=va(xu,n),a=vu(n);return l.jsx(sx,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:l.jsx(go.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});wu.displayName=xu;var bu="TabsTrigger",Su=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=va(bu,n),s=vu(n),u=Tu(a.baseId,r),c=_u(a.baseId,r),d=r===a.value;return l.jsx(lx,{asChild:!0,...s,focusable:!o,active:d,children:l.jsx(go.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:sa(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?a.onValueChange(r):g.preventDefault()}),onKeyDown:sa(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&a.onValueChange(r)}),onFocus:sa(e.onFocus,()=>{const g=a.activationMode!=="manual";!d&&!o&&g&&a.onValueChange(r)})})})});Su.displayName=bu;var Cu="TabsContent",Eu=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=va(Cu,n),u=Tu(s.baseId,r),c=_u(s.baseId,r),d=r===s.value,g=f.useRef(d);return f.useEffect(()=>{const h=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(gu,{present:o||d,children:({present:h})=>l.jsx(go.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:h&&i})})});Eu.displayName=Cu;function Tu(e,t){return`${e}-trigger-${t}`}function _u(e,t){return`${e}-content-${t}`}var Sx=yu,Au=wu,Pu=Su,Nu=Eu;const Cx=Sx,Ou=f.forwardRef(({className:e,...t},n)=>l.jsx(Au,{ref:n,className:ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ou.displayName=Au.displayName;const mo=f.forwardRef(({className:e,...t},n)=>l.jsx(Pu,{ref:n,className:ge("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));mo.displayName=Pu.displayName;const ho=f.forwardRef(({className:e,...t},n)=>l.jsx(Nu,{ref:n,className:ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ho.displayName=Nu.displayName;const ar=f.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ge("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));ar.displayName="Textarea";function Ex(e,t=[]){let n=[];function r(i,a){const s=f.createContext(a),u=n.length;n=[...n,a];function c(g){const{scope:h,children:p,...v}=g,m=(h==null?void 0:h[e][u])||s,y=f.useMemo(()=>v,Object.values(v));return l.jsx(m.Provider,{value:y,children:p})}function d(g,h){const p=(h==null?void 0:h[e][u])||s,v=f.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}const o=()=>{const i=n.map(a=>f.createContext(a));return function(s){const u=(s==null?void 0:s[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,Tx(o,...t)]}function Tx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:u,scopeName:c})=>{const g=u(i)[`__scope${c}`];return{...s,...g}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var ya=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),i=o.find(Ax);if(i){const a=i.props.children,s=o.map(u=>u===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return l.jsx(xa,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,s):null})}return l.jsx(xa,{...r,ref:t,children:n})});ya.displayName="Slot";var xa=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Nx(n);return f.cloneElement(n,{...Px(r,n.props),ref:t?qr(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});xa.displayName="SlotClone";var _x=({children:e})=>l.jsx(l.Fragment,{children:e});function Ax(e){return f.isValidElement(e)&&e.type===_x}function Px(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ox(e){const t=e+"CollectionProvider",[n,r]=Ex(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:m}=p,y=T.useRef(null),w=T.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};a.displayName=t;const s=e+"CollectionSlot",u=T.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=i(s,m),b=st(v,w.collectionRef);return l.jsx(ya,{ref:b,children:y})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",g=T.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,b=T.useRef(null),S=st(v,b),E=i(c,m);return T.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(ya,{[d]:"",ref:S,children:y})});g.displayName=c;function h(p){const v=i(e+"CollectionConsumer",p);return T.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:g},h,r]}var Fx="VisuallyHidden",wa=f.forwardRef((e,t)=>l.jsx(Le.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));wa.displayName=Fx;var ba="ToastProvider",[Sa,kx,Dx]=Ox("Toast"),[Fu,SE]=Jt("Toast",[Dx]),[Mx,vo]=Fu(ba),ku=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=e,[s,u]=f.useState(null),[c,d]=f.useState(0),g=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ba}\`. Expected non-empty \`string\`.`),l.jsx(Sa.Provider,{scope:t,children:l.jsx(Mx,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:c,viewport:s,onViewportChange:u,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:h,children:a})})};ku.displayName=ba;var Du="ToastViewport",$x=["F8"],Ca="toast.viewportPause",Ea="toast.viewportResume",Mu=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=$x,label:o="Notifications ({hotkey})",...i}=e,a=vo(Du,n),s=kx(n),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),g=f.useRef(null),h=st(t,g,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=a.toastCount>0;f.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),f.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const b=()=>{if(!a.isClosePausedRef.current){const O=new CustomEvent(Ca);w.dispatchEvent(O),a.isClosePausedRef.current=!0}},S=()=>{if(a.isClosePausedRef.current){const O=new CustomEvent(Ea);w.dispatchEvent(O),a.isClosePausedRef.current=!1}},E=O=>{!y.contains(O.relatedTarget)&&S()},x=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",x),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",x),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,a.isClosePausedRef]);const m=f.useCallback(({tabbingDirection:y})=>{const b=s().map(S=>{const E=S.ref.current,x=[E,...Kx(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[s]);return f.useEffect(()=>{const y=g.current;if(y){const w=b=>{var x,O,M;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const I=document.activeElement,H=b.shiftKey;if(b.target===y&&H){(x=c.current)==null||x.focus();return}const U=m({tabbingDirection:H?"backwards":"forwards"}),Z=U.findIndex(P=>P===I);Aa(U.slice(Z+1))?b.preventDefault():H?(O=c.current)==null||O.focus():(M=d.current)==null||M.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[s,m]),l.jsxs(Ev,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ta,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});Aa(y)}}),l.jsx(Sa.Slot,{scope:n,children:l.jsx(Le.ol,{tabIndex:-1,...i,ref:h})}),v&&l.jsx(Ta,{ref:d,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});Aa(y)}})]})});Mu.displayName=Du;var $u="ToastFocusProxy",Ta=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=vo($u,n);return l.jsx(wa,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=i.viewport)!=null&&c.contains(s))&&r()}})});Ta.displayName=$u;var yo="Toast",Ix="toast.swipeStart",Lx="toast.swipeMove",Rx="toast.swipeCancel",Vx="toast.swipeEnd",Iu=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=e,[s=!0,u]=_n({prop:r,defaultProp:o,onChange:i});return l.jsx(An,{present:n||s,children:l.jsx(Bx,{open:s,...a,ref:t,onClose:()=>u(!1),onPause:We(e.onPause),onResume:We(e.onResume),onSwipeStart:Ie(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ie(e.onSwipeMove,c=>{const{x:d,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ie(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ie(e.onSwipeEnd,c=>{const{x:d,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});Iu.displayName=yo;var[jx,zx]=Fu(yo,{onClose(){}}),Bx=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:s,onPause:u,onResume:c,onSwipeStart:d,onSwipeMove:g,onSwipeCancel:h,onSwipeEnd:p,...v}=e,m=vo(yo,n),[y,w]=f.useState(null),b=st(t,P=>w(P)),S=f.useRef(null),E=f.useRef(null),x=o||m.duration,O=f.useRef(0),M=f.useRef(x),I=f.useRef(0),{onToastAdd:H,onToastRemove:k}=m,G=We(()=>{var $;(y==null?void 0:y.contains(document.activeElement))&&(($=m.viewport)==null||$.focus()),a()}),U=f.useCallback(P=>{!P||P===1/0||(window.clearTimeout(I.current),O.current=new Date().getTime(),I.current=window.setTimeout(G,P))},[G]);f.useEffect(()=>{const P=m.viewport;if(P){const $=()=>{U(M.current),c==null||c()},F=()=>{const W=new Date().getTime()-O.current;M.current=M.current-W,window.clearTimeout(I.current),u==null||u()};return P.addEventListener(Ca,F),P.addEventListener(Ea,$),()=>{P.removeEventListener(Ca,F),P.removeEventListener(Ea,$)}}},[m.viewport,x,u,c,U]),f.useEffect(()=>{i&&!m.isClosePausedRef.current&&U(x)},[i,x,m.isClosePausedRef,U]),f.useEffect(()=>(H(),()=>k()),[H,k]);const Z=f.useMemo(()=>y?Hu(y):null,[y]);return m.viewport?l.jsxs(l.Fragment,{children:[Z&&l.jsx(Hx,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:Z}),l.jsx(jx,{scope:n,onClose:G,children:Pr.createPortal(l.jsx(Sa.ItemSlot,{scope:n,children:l.jsx(Cv,{asChild:!0,onEscapeKeyDown:Ie(s,()=>{m.isFocusedToastEscapeKeyDownRef.current||G(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Le.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ie(e.onKeyDown,P=>{P.key==="Escape"&&(s==null||s(P.nativeEvent),P.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Ie(e.onPointerDown,P=>{P.button===0&&(S.current={x:P.clientX,y:P.clientY})}),onPointerMove:Ie(e.onPointerMove,P=>{if(!S.current)return;const $=P.clientX-S.current.x,F=P.clientY-S.current.y,W=!!E.current,N=["left","right"].includes(m.swipeDirection),V=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,_=N?V(0,$):0,B=N?0:V(0,F),Q=P.pointerType==="touch"?10:2,re={x:_,y:B},ee={originalEvent:P,delta:re};W?(E.current=re,xo(Lx,g,ee,{discrete:!1})):Uu(re,m.swipeDirection,Q)?(E.current=re,xo(Ix,d,ee,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs($)>Q||Math.abs(F)>Q)&&(S.current=null)}),onPointerUp:Ie(e.onPointerUp,P=>{const $=E.current,F=P.target;if(F.hasPointerCapture(P.pointerId)&&F.releasePointerCapture(P.pointerId),E.current=null,S.current=null,$){const W=P.currentTarget,N={originalEvent:P,delta:$};Uu($,m.swipeDirection,m.swipeThreshold)?xo(Vx,p,N,{discrete:!0}):xo(Rx,h,N,{discrete:!0}),W.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Hx=e=>{const{__scopeToast:t,children:n,...r}=e,o=vo(yo,t),[i,a]=f.useState(!1),[s,u]=f.useState(!1);return qx(()=>a(!0)),f.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:l.jsx(Yi,{asChild:!0,children:l.jsx(wa,{...r,children:i&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Ux="ToastTitle",Lu=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(Le.div,{...r,ref:t})});Lu.displayName=Ux;var Wx="ToastDescription",Ru=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(Le.div,{...r,ref:t})});Ru.displayName=Wx;var Vu="ToastAction",ju=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Bu,{altText:n,asChild:!0,children:l.jsx(_a,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Vu}\`. Expected non-empty \`string\`.`),null)});ju.displayName=Vu;var zu="ToastClose",_a=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=zx(zu,n);return l.jsx(Bu,{asChild:!0,children:l.jsx(Le.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,o.onClose)})})});_a.displayName=zu;var Bu=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(Le.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Hu(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Gx(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Hu(r))}}),t}function xo(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Zl(o,i):o.dispatchEvent(i)}var Uu=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function qx(e=()=>{}){const t=We(e);et(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Gx(e){return e.nodeType===e.ELEMENT_NODE}function Kx(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Aa(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Yx=ku,Wu=Mu,qu=Iu,Gu=Lu,Ku=Ru,Yu=ju,Xu=_a;const Xx=Yx,Ju=f.forwardRef(({className:e,...t},n)=>l.jsx(Wu,{ref:n,className:ge("s3-explr-ui-toast-viewport fixed top-0 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px] z-[10000]",e),...t}));Ju.displayName=Wu.displayName;const Jx=zi("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Zu=f.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(qu,{ref:r,className:ge(Jx({variant:t}),e),...n}));Zu.displayName=qu.displayName;const Zx=f.forwardRef(({className:e,...t},n)=>l.jsx(Yu,{ref:n,className:ge("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Zx.displayName=Yu.displayName;const Qu=f.forwardRef(({className:e,...t},n)=>l.jsx(Xu,{ref:n,className:ge("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 font-bold",e),"toast-close":"",...t,children:l.jsx(Di,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Qu.displayName=Xu.displayName;const ed=f.forwardRef(({className:e,...t},n)=>l.jsx(Gu,{ref:n,className:ge("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));ed.displayName=Gu.displayName;const td=f.forwardRef(({className:e,...t},n)=>l.jsx(Ku,{ref:n,className:ge("text-sm opacity-90 font-bold",e),...t}));td.displayName=Ku.displayName;const Qx=1,ew=1e6;let Pa=0;function tw(){return Pa=(Pa+1)%Number.MAX_SAFE_INTEGER,Pa.toString()}const Na=new Map,nd=e=>{if(Na.has(e))return;const t=setTimeout(()=>{Na.delete(e),sr({type:"REMOVE_TOAST",toastId:e})},ew);Na.set(e,t)},nw=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Qx)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?nd(n):e.toasts.forEach(r=>{nd(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},wo=[];let bo={toasts:[]};function sr(e){bo=nw(bo,e),wo.forEach(t=>{t(bo)})}function rw({...e}){const t=tw(),n=o=>sr({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>sr({type:"DISMISS_TOAST",toastId:t});return sr({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function So(){const[e,t]=f.useState(bo);return f.useEffect(()=>(wo.push(t),()=>{const n=wo.indexOf(t);n>-1&&wo.splice(n,1)}),[e]),{...e,toast:rw,dismiss:n=>sr({type:"DISMISS_TOAST",toastId:n})}}function rd(){const{toasts:e}=So();return l.jsxs(Xx,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return l.jsxs(Zu,{...i,className:`s3-explr-ui-toast ${i.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(ed,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(td,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Qu,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Ju,{className:"s3-explr-ui-toast-viewport"})]})}function Vt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function od(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ow(...e){return t=>{let n=!1;const r=e.map(o=>{const i=od(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():od(e[o],null)}}}}function lr(...e){return f.useCallback(ow(...e),e)}var iw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],cr=iw.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Cn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function aw(e,t){e&&Pr.flushSync(()=>e.dispatchEvent(t))}var sw="DismissableLayer",Oa="dismissableLayer.update",lw="dismissableLayer.pointerDownOutside",cw="dismissableLayer.focusOutside",id,ad=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sd=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...u}=e,c=f.useContext(ad),[d,g]=f.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),v=lr(t,M=>g(M)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),b=d?m.indexOf(d):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=fw(M=>{const I=M.target,H=[...c.branches].some(k=>k.contains(I));!E||H||(o==null||o(M),a==null||a(M),M.defaultPrevented||s==null||s())},h),O=pw(M=>{const I=M.target;[...c.branches].some(k=>k.contains(I))||(i==null||i(M),a==null||a(M),M.defaultPrevented||s==null||s())},h);return oc(M=>{b===c.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&s&&(M.preventDefault(),s()))},h),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(id=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),ld(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=id)}},[d,h,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),ld())},[d,c]),f.useEffect(()=>{const M=()=>p({});return document.addEventListener(Oa,M),()=>document.removeEventListener(Oa,M)},[]),l.jsx(cr.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Vt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Vt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Vt(e.onPointerDownCapture,x.onPointerDownCapture)})});sd.displayName=sw;var uw="DismissableLayerBranch",dw=f.forwardRef((e,t)=>{const n=f.useContext(ad),r=f.useRef(null),o=lr(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),l.jsx(cr.div,{...e,ref:o})});dw.displayName=uw;function fw(e,t=globalThis==null?void 0:globalThis.document){const n=We(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){cd(lw,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pw(e,t=globalThis==null?void 0:globalThis.document){const n=We(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&cd(cw,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ld(){const e=new CustomEvent(Oa);document.dispatchEvent(e)}function cd(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?aw(o,i):o.dispatchEvent(i)}const gw=["top","right","bottom","left"],tn=Math.min,tt=Math.max,Co=Math.round,Eo=Math.floor,_t=e=>({x:e,y:e}),mw={left:"right",right:"left",bottom:"top",top:"bottom"},hw={start:"end",end:"start"};function Fa(e,t,n){return tt(e,tn(t,n))}function jt(e,t){return typeof e=="function"?e(t):e}function zt(e){return e.split("-")[0]}function In(e){return e.split("-")[1]}function ka(e){return e==="x"?"y":"x"}function Da(e){return e==="y"?"height":"width"}function nn(e){return["top","bottom"].includes(zt(e))?"y":"x"}function Ma(e){return ka(nn(e))}function vw(e,t,n){n===void 0&&(n=!1);const r=In(e),o=Ma(e),i=Da(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=To(a)),[a,To(a)]}function yw(e){const t=To(e);return[$a(e),t,$a(t)]}function $a(e){return e.replace(/start|end/g,t=>hw[t])}function xw(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function ww(e,t,n,r){const o=In(e);let i=xw(zt(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map($a)))),i}function To(e){return e.replace(/left|right|bottom|top/g,t=>mw[t])}function bw(e){return{top:0,right:0,bottom:0,left:0,...e}}function ud(e){return typeof e!="number"?bw(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function dd(e,t,n){let{reference:r,floating:o}=e;const i=nn(t),a=Ma(t),s=Da(a),u=zt(t),c=i==="y",d=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(u){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(In(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const Sw=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:g}=dd(c,r,u),h=r,p={},v=0;for(let m=0;m<s.length;m++){const{name:y,fn:w}=s[m],{x:b,y:S,data:E,reset:x}=await w({x:d,y:g,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=b??d,g=S??g,p={...p,[y]:{...p[y],...E}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(c=x.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:d,y:g}=dd(c,h,u)),m=-1)}return{x:d,y:g,placement:h,strategy:o,middlewareData:p}};async function ur(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:g="floating",altBoundary:h=!1,padding:p=0}=jt(t,e),v=ud(p),y=s[h?g==="floating"?"reference":"floating":g],w=_o(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),b=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),E=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},x=_o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-x.top+v.top)/E.y,bottom:(x.bottom-w.bottom+v.bottom)/E.y,left:(w.left-x.left+v.left)/E.x,right:(x.right-w.right+v.right)/E.x}}const Cw=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:c,padding:d=0}=jt(e,t)||{};if(c==null)return{};const g=ud(d),h={x:n,y:r},p=Ma(o),v=Da(p),m=await a.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=i.reference[v]+i.reference[p]-h[p]-i.floating[v],x=h[p]-i.reference[p],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=O?O[S]:0;(!M||!await(a.isElement==null?void 0:a.isElement(O)))&&(M=s.floating[S]||i.floating[v]);const I=E/2-x/2,H=M/2-m[v]/2-1,k=tn(g[w],H),G=tn(g[b],H),U=k,Z=M-m[v]-G,P=M/2-m[v]/2+I,$=Fa(U,P,Z),F=!u.arrow&&In(o)!=null&&P!==$&&i.reference[v]/2-(P<U?k:G)-m[v]/2<0,W=F?P<U?P-U:P-Z:0;return{[p]:h[p]+W,data:{[p]:$,centerOffset:P-$-W,...F&&{alignmentOffset:W}},reset:F}}}),Ew=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...y}=jt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=zt(o),b=nn(s),S=zt(s)===s,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=h||(S||!m?[To(s)]:yw(s)),O=v!=="none";!h&&O&&x.push(...ww(s,m,v,E));const M=[s,...x],I=await ur(t,y),H=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&H.push(I[w]),g){const P=vw(o,a,E);H.push(I[P[0]],I[P[1]])}if(k=[...k,{placement:o,overflows:H}],!H.every(P=>P<=0)){var G,U;const P=(((G=i.flip)==null?void 0:G.index)||0)+1,$=M[P];if($)return{data:{index:P,overflows:k},reset:{placement:$}};let F=(U=k.filter(W=>W.overflows[0]<=0).sort((W,N)=>W.overflows[1]-N.overflows[1])[0])==null?void 0:U.placement;if(!F)switch(p){case"bestFit":{var Z;const W=(Z=k.filter(N=>{if(O){const V=nn(N.placement);return V===b||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,_)=>V+_,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:Z[0];W&&(F=W);break}case"initialPlacement":F=s;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function fd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pd(e){return gw.some(t=>e[t]>=0)}const Tw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=jt(e,t);switch(r){case"referenceHidden":{const i=await ur(t,{...o,elementContext:"reference"}),a=fd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:pd(a)}}}case"escaped":{const i=await ur(t,{...o,altBoundary:!0}),a=fd(i,n.floating);return{data:{escapedOffsets:a,escaped:pd(a)}}}default:return{}}}}};async function _w(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=zt(n),s=In(n),u=nn(n)==="y",c=["left","top"].includes(a)?-1:1,d=i&&u?-1:1,g=jt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return s&&typeof v=="number"&&(p=s==="end"?v*-1:v),u?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const Aw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await _w(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},Pw=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:w,y:b}=y;return{x:w,y:b}}},...u}=jt(e,t),c={x:n,y:r},d=await ur(t,u),g=nn(zt(o)),h=ka(g);let p=c[h],v=c[g];if(i){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=p+d[y],S=p-d[w];p=Fa(b,p,S)}if(a){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+d[y],S=v-d[w];v=Fa(b,v,S)}const m=s.fn({...t,[h]:p,[g]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[g]:a}}}}}},Nw=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=jt(e,t),d={x:n,y:r},g=nn(o),h=ka(g);let p=d[h],v=d[g];const m=jt(s,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const S=h==="y"?"height":"width",E=i.reference[h]-i.floating[S]+y.mainAxis,x=i.reference[h]+i.reference[S]-y.mainAxis;p<E?p=E:p>x&&(p=x)}if(c){var w,b;const S=h==="y"?"width":"height",E=["top","left"].includes(zt(o)),x=i.reference[g]-i.floating[S]+(E&&((w=a.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),O=i.reference[g]+i.reference[S]+(E?0:((b=a.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<x?v=x:v>O&&(v=O)}return{[h]:p,[g]:v}}}},Ow=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...c}=jt(e,t),d=await ur(t,c),g=zt(o),h=In(o),p=nn(o)==="y",{width:v,height:m}=i.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=g,y=h==="end"?"top":"bottom");const b=m-d.top-d.bottom,S=v-d.left-d.right,E=tn(m-d[y],b),x=tn(v-d[w],S),O=!t.middlewareData.shift;let M=E,I=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=b),O&&!h){const k=tt(d.left,0),G=tt(d.right,0),U=tt(d.top,0),Z=tt(d.bottom,0);p?I=v-2*(k!==0||G!==0?k+G:tt(d.left,d.right)):M=m-2*(U!==0||Z!==0?U+Z:tt(d.top,d.bottom))}await u({...t,availableWidth:I,availableHeight:M});const H=await a.getDimensions(s.floating);return v!==H.width||m!==H.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<"u"}function Ln(e){return gd(e)?(e.nodeName||"").toLowerCase():"#document"}function nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(gd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gd(e){return Ao()?e instanceof Node||e instanceof nt(e).Node:!1}function vt(e){return Ao()?e instanceof Element||e instanceof nt(e).Element:!1}function Pt(e){return Ao()?e instanceof HTMLElement||e instanceof nt(e).HTMLElement:!1}function md(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nt(e).ShadowRoot}function dr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Fw(e){return["table","td","th"].includes(Ln(e))}function Po(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ia(e){const t=La(),n=vt(e)?yt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function kw(e){let t=rn(e);for(;Pt(t)&&!Rn(t);){if(Ia(t))return t;if(Po(t))return null;t=rn(t)}return null}function La(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rn(e){return["html","body","#document"].includes(Ln(e))}function yt(e){return nt(e).getComputedStyle(e)}function No(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rn(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||md(e)&&e.host||At(e);return md(t)?t.host:t}function hd(e){const t=rn(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&dr(t)?t:hd(t)}function fr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=hd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=nt(o);if(i){const s=Ra(a);return t.concat(a,a.visualViewport||[],dr(o)?o:[],s&&n?fr(s):[])}return t.concat(o,fr(o,[],n))}function Ra(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vd(e){const t=yt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pt(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Co(n)!==i||Co(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Va(e){return vt(e)?e:e.contextElement}function Vn(e){const t=Va(e);if(!Pt(t))return _t(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=vd(t);let a=(i?Co(n.width):n.width)/r,s=(i?Co(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Dw=_t(0);function yd(e){const t=nt(e);return!La()||!t.visualViewport?Dw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nt(e)?!1:t}function mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Va(e);let a=_t(1);t&&(r?vt(r)&&(a=Vn(r)):a=Vn(e));const s=Mw(i,n,r)?yd(i):_t(0);let u=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,g=o.height/a.y;if(i){const h=nt(i),p=r&&vt(r)?nt(r):r;let v=h,m=Ra(v);for(;m&&r&&p!==v;){const y=Vn(m),w=m.getBoundingClientRect(),b=yt(m),S=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,d*=y.x,g*=y.y,u+=S,c+=E,v=nt(m),m=Ra(v)}}return _o({width:d,height:g,x:u,y:c})}function ja(e,t){const n=No(e).scrollLeft;return t?t.left+n:mn(At(e)).left+n}function xd(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ja(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function $w(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=At(r),s=t?Po(t.floating):!1;if(r===a||s&&i)return n;let u={scrollLeft:0,scrollTop:0},c=_t(1);const d=_t(0),g=Pt(r);if((g||!g&&!i)&&((Ln(r)!=="body"||dr(a))&&(u=No(r)),Pt(r))){const p=mn(r);c=Vn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=a&&!g&&!i?xd(a,u,!0):_t(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-u.scrollTop*c.y+d.y+h.y}}function Iw(e){return Array.from(e.getClientRects())}function Lw(e){const t=At(e),n=No(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ja(e);const s=-n.scrollTop;return yt(r).direction==="rtl"&&(a+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Rw(e,t){const n=nt(e),r=At(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const c=La();(!c||c&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s,y:u}}function Vw(e,t){const n=mn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pt(e)?Vn(e):_t(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,c=r*i.y;return{width:a,height:s,x:u,y:c}}function wd(e,t,n){let r;if(t==="viewport")r=Rw(e,n);else if(t==="document")r=Lw(At(e));else if(vt(t))r=Vw(t,n);else{const o=yd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _o(r)}function bd(e,t){const n=rn(e);return n===t||!vt(n)||Rn(n)?!1:yt(n).position==="fixed"||bd(n,t)}function jw(e,t){const n=t.get(e);if(n)return n;let r=fr(e,[],!1).filter(s=>vt(s)&&Ln(s)!=="body"),o=null;const i=yt(e).position==="fixed";let a=i?rn(e):e;for(;vt(a)&&!Rn(a);){const s=yt(a),u=Ia(a);!u&&s.position==="fixed"&&(o=null),(i?!u&&!o:!u&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||dr(a)&&!u&&bd(e,a))?r=r.filter(d=>d!==a):o=s,a=rn(a)}return t.set(e,r),r}function zw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Po(t)?[]:jw(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((c,d)=>{const g=wd(t,d,o);return c.top=tt(g.top,c.top),c.right=tn(g.right,c.right),c.bottom=tn(g.bottom,c.bottom),c.left=tt(g.left,c.left),c},wd(t,s,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Bw(e){const{width:t,height:n}=vd(e);return{width:t,height:n}}function Hw(e,t,n){const r=Pt(t),o=At(t),i=n==="fixed",a=mn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=_t(0);if(r||!r&&!i)if((Ln(t)!=="body"||dr(o))&&(s=No(t)),r){const h=mn(t,!0,i,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&(u.x=ja(o));const c=o&&!r&&!i?xd(o,s):_t(0),d=a.left+s.scrollLeft-u.x-c.x,g=a.top+s.scrollTop-u.y-c.y;return{x:d,y:g,width:a.width,height:a.height}}function za(e){return yt(e).position==="static"}function Sd(e,t){if(!Pt(e)||yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function Cd(e,t){const n=nt(e);if(Po(e))return n;if(!Pt(e)){let o=rn(e);for(;o&&!Rn(o);){if(vt(o)&&!za(o))return o;o=rn(o)}return n}let r=Sd(e,t);for(;r&&Fw(r)&&za(r);)r=Sd(r,t);return r&&Rn(r)&&za(r)&&!Ia(r)?n:r||kw(e)||n}const Uw=async function(e){const t=this.getOffsetParent||Cd,n=this.getDimensions,r=await n(e.floating);return{reference:Hw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ww(e){return yt(e).direction==="rtl"}const qw={convertOffsetParentRelativeRectToViewportRelativeRect:$w,getDocumentElement:At,getClippingRect:zw,getOffsetParent:Cd,getElementRects:Uw,getClientRects:Iw,getDimensions:Bw,getScale:Vn,isElement:vt,isRTL:Ww};function Gw(e,t){let n=null,r;const o=At(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),i();const{left:c,top:d,width:g,height:h}=e.getBoundingClientRect();if(s||t(),!g||!h)return;const p=Eo(d),v=Eo(o.clientWidth-(c+g)),m=Eo(o.clientHeight-(d+h)),y=Eo(c),b={rootMargin:-p+"px "+-v+"px "+-m+"px "+-y+"px",threshold:tt(0,tn(1,u))||1};let S=!0;function E(x){const O=x[0].intersectionRatio;if(O!==u){if(!S)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return a(!0),i}function Kw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Va(e),d=o||i?[...c?fr(c):[],...fr(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const g=c&&s?Gw(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,m=u?mn(e):null;u&&y();function y(){const w=mn(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&n(),m=w,v=requestAnimationFrame(y)}return n(),()=>{var w;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Yw=Aw,Xw=Pw,Jw=Ew,Zw=Ow,Qw=Tw,Ed=Cw,eb=Nw,tb=(e,t,n)=>{const r=new Map,o={platform:qw,...n},i={...o.platform,_c:r};return Sw(e,t,{...o,platform:i})};var Oo=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Fo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Fo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Td(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){const n=Td(e);return Math.round(t*n)/n}function Ba(e){const t=f.useRef(e);return Oo(()=>{t.current=e}),t}function nb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[d,g]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);Fo(h,r)||p(r);const[v,m]=f.useState(null),[y,w]=f.useState(null),b=f.useCallback(N=>{N!==O.current&&(O.current=N,m(N))},[]),S=f.useCallback(N=>{N!==M.current&&(M.current=N,w(N))},[]),E=i||v,x=a||y,O=f.useRef(null),M=f.useRef(null),I=f.useRef(d),H=u!=null,k=Ba(u),G=Ba(o),U=Ba(c),Z=f.useCallback(()=>{if(!O.current||!M.current)return;const N={placement:t,strategy:n,middleware:h};G.current&&(N.platform=G.current),tb(O.current,M.current,N).then(V=>{const _={...V,isPositioned:U.current!==!1};P.current&&!Fo(I.current,_)&&(I.current=_,Pr.flushSync(()=>{g(_)}))})},[h,t,n,G,U]);Oo(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(N=>({...N,isPositioned:!1})))},[c]);const P=f.useRef(!1);Oo(()=>(P.current=!0,()=>{P.current=!1}),[]),Oo(()=>{if(E&&(O.current=E),x&&(M.current=x),E&&x){if(k.current)return k.current(E,x,Z);Z()}},[E,x,Z,k,H]);const $=f.useMemo(()=>({reference:O,floating:M,setReference:b,setFloating:S}),[b,S]),F=f.useMemo(()=>({reference:E,floating:x}),[E,x]),W=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!F.floating)return N;const V=_d(F.floating,d.x),_=_d(F.floating,d.y);return s?{...N,transform:"translate("+V+"px, "+_+"px)",...Td(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:_}},[n,s,F.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:Z,refs:$,elements:F,floatingStyles:W}),[d,Z,$,F,W])}const rb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ed({element:r.current,padding:o}).fn(n):{}:r?Ed({element:r,padding:o}).fn(n):{}}}},ob=(e,t)=>({...Yw(e),options:[e,t]}),ib=(e,t)=>({...Xw(e),options:[e,t]}),ab=(e,t)=>({...eb(e),options:[e,t]}),sb=(e,t)=>({...Jw(e),options:[e,t]}),lb=(e,t)=>({...Zw(e),options:[e,t]}),cb=(e,t)=>({...Qw(e),options:[e,t]}),ub=(e,t)=>({...rb(e),options:[e,t]});var db=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fb=db.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Cn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),pb="Arrow",Ad=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return l.jsx(fb.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ad.displayName=pb;var gb=Ad;function Pd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mb(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Pd(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Pd(e[o],null)}}}}function Nd(...e){return f.useCallback(mb(...e),e)}var hb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Od=hb.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Cn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ha="Popper",[Fd,kd]=Jt(Ha),[vb,Dd]=Fd(Ha),Md=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return l.jsx(vb,{scope:t,anchor:r,onAnchorChange:o,children:n})};Md.displayName=Ha;var $d="PopperAnchor",Id=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Dd($d,n),a=f.useRef(null),s=Nd(t,a);return f.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:l.jsx(Od.div,{...o,ref:s})});Id.displayName=$d;var Ua="PopperContent",[yb,xb]=Fd(Ua),Ld=f.forwardRef((e,t)=>{var ie,de,ue,le,Se,K;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:g="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,y=Dd(Ua,n),[w,b]=f.useState(null),S=Nd(t,Ee=>b(Ee)),[E,x]=f.useState(null),O=Xl(E),M=(O==null?void 0:O.width)??0,I=(O==null?void 0:O.height)??0,H=r+(i!=="center"?"-"+i:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},G=Array.isArray(c)?c:[c],U=G.length>0,Z={padding:k,boundary:G.filter(bb),altBoundary:U},{refs:P,floatingStyles:$,placement:F,isPositioned:W,middlewareData:N}=nb({strategy:"fixed",placement:H,whileElementsMounted:(...Ee)=>Kw(...Ee,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[ob({mainAxis:o+I,alignmentAxis:a}),u&&ib({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?ab():void 0,...Z}),u&&sb({...Z}),lb({...Z,apply:({elements:Ee,rects:He,availableWidth:Ue,availableHeight:Dt})=>{const{width:ot,height:C}=He.reference,A=Ee.floating.style;A.setProperty("--radix-popper-available-width",`${Ue}px`),A.setProperty("--radix-popper-available-height",`${Dt}px`),A.setProperty("--radix-popper-anchor-width",`${ot}px`),A.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&ub({element:E,padding:s}),Sb({arrowWidth:M,arrowHeight:I}),h&&cb({strategy:"referenceHidden",...Z})]}),[V,_]=jd(F),B=We(v);et(()=>{W&&(B==null||B())},[W,B]);const Q=(ie=N.arrow)==null?void 0:ie.x,re=(de=N.arrow)==null?void 0:de.y,ee=((ue=N.arrow)==null?void 0:ue.centerOffset)!==0,[ce,oe]=f.useState();return et(()=>{w&&oe(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:W?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(le=N.transformOrigin)==null?void 0:le.x,(Se=N.transformOrigin)==null?void 0:Se.y].join(" "),...((K=N.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(yb,{scope:n,placedSide:V,onArrowChange:x,arrowX:Q,arrowY:re,shouldHideArrow:ee,children:l.jsx(Od.div,{"data-side":V,"data-align":_,...m,ref:S,style:{...m.style,animation:W?void 0:"none"}})})})});Ld.displayName=Ua;var Rd="PopperArrow",wb={top:"bottom",right:"left",bottom:"top",left:"right"},Vd=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=xb(Rd,r),a=wb[i.placedSide];return l.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:l.jsx(gb,{...o,ref:n,style:{...o.style,display:"block"}})})});Vd.displayName=Rd;function bb(e){return e!==null}var Sb=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;const{placement:n,rects:r,middlewareData:o}=t,a=((y=o.arrow)==null?void 0:y.centerOffset)!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[c,d]=jd(n),g={start:"0%",center:"50%",end:"100%"}[d],h=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,p=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",m="";return c==="bottom"?(v=a?g:`${h}px`,m=`${-u}px`):c==="top"?(v=a?g:`${h}px`,m=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,m=a?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,m=a?g:`${p}px`),{data:{x:v,y:m}}}});function jd(e){const[t,n="center"]=e.split("-");return[t,n]}var Cb=Md,Eb=Id,Tb=Ld,_b=Vd,Ab="Portal",zd=f.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=f.useState(!1);et(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Jo.createPortal(l.jsx(cr.div,{...r,ref:t}),a):null});zd.displayName=Ab;function Pb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Wa=e=>{const{present:t,children:n}=e,r=Nb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=lr(r.ref,Ob(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Wa.displayName="Presence";function Nb(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Pb(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=ko(r.current);i.current=s==="mounted"?c:"none"},[s]),et(()=>{const c=r.current,d=o.current;if(d!==e){const h=i.current,p=ko(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),et(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,g=p=>{const m=ko(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=ko(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ko(e){return(e==null?void 0:e.animationName)||"none"}function Ob(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fb="VisuallyHidden",Bd=f.forwardRef((e,t)=>l.jsx(cr.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Bd.displayName=Fb;var kb=Bd,[Do,CE]=Jt("Tooltip",[kd]),Mo=kd(),Hd="TooltipProvider",Db=700,qa="tooltip.open",[Mb,Ga]=Do(Hd),Ud=e=>{const{__scopeTooltip:t,delayDuration:n=Db,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=f.useState(!0),u=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),l.jsx(Mb,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(d=>{u.current=d},[]),disableHoverableContent:o,children:i})};Ud.displayName=Hd;var $o="Tooltip",[$b,pr]=Do($o),Wd=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,u=Ga($o,e.__scopeTooltip),c=Mo(t),[d,g]=f.useState(null),h=Pn(),p=f.useRef(0),v=a??u.disableHoverableContent,m=s??u.delayDuration,y=f.useRef(!1),[w=!1,b]=_n({prop:r,defaultProp:o,onChange:M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(qa))):u.onClose(),i==null||i(M)}}),S=f.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),x=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),O=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},m)},[m,b]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(Cb,{...c,children:l.jsx($b,{scope:t,contentId:h,open:w,stateAttribute:S,trigger:d,onTriggerChange:g,onTriggerEnter:f.useCallback(()=>{u.isOpenDelayed?O():E()},[u.isOpenDelayed,O,E]),onTriggerLeave:f.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Wd.displayName=$o;var Ka="TooltipTrigger",qd=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=pr(Ka,n),i=Ga(Ka,n),a=Mo(n),s=f.useRef(null),u=lr(t,s,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),g=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(Eb,{asChild:!0,...a,children:l.jsx(cr.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Vt(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:Vt(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:Vt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Vt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Vt(e.onBlur,o.onClose),onClick:Vt(e.onClick,o.onClose)})})});qd.displayName=Ka;var Ya="TooltipPortal",[Ib,Lb]=Do(Ya,{forceMount:void 0}),Gd=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=pr(Ya,t);return l.jsx(Ib,{scope:t,forceMount:n,children:l.jsx(Wa,{present:n||i.open,children:l.jsx(zd,{asChild:!0,container:o,children:r})})})};Gd.displayName=Ya;var jn="TooltipContent",Kd=f.forwardRef((e,t)=>{const n=Lb(jn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=pr(jn,e.__scopeTooltip);return l.jsx(Wa,{present:r||a.open,children:a.disableHoverableContent?l.jsx(Yd,{side:o,...i,ref:t}):l.jsx(Rb,{side:o,...i,ref:t})})}),Rb=f.forwardRef((e,t)=>{const n=pr(jn,e.__scopeTooltip),r=Ga(jn,e.__scopeTooltip),o=f.useRef(null),i=lr(t,o),[a,s]=f.useState(null),{trigger:u,onClose:c}=n,d=o.current,{onPointerInTransitChange:g}=r,h=f.useCallback(()=>{s(null),g(!1)},[g]),p=f.useCallback((v,m)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},b=Bb(w,y.getBoundingClientRect()),S=Hb(w,b),E=Ub(m.getBoundingClientRect()),x=qb([...S,...E]);s(x),g(!0)},[g]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(u&&d){const v=y=>p(y,d),m=y=>p(y,u);return u.addEventListener("pointerleave",v),d.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",m)}}},[u,d,p,h]),f.useEffect(()=>{if(a){const v=m=>{const y=m.target,w={x:m.clientX,y:m.clientY},b=(u==null?void 0:u.contains(y))||(d==null?void 0:d.contains(y)),S=!Wb(w,a);b?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,d,a,c,h]),l.jsx(Yd,{...e,ref:i})}),[Vb,jb]=Do($o,{isInside:!1}),Yd=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,u=pr(jn,n),c=Mo(n),{onClose:d}=u;return f.useEffect(()=>(document.addEventListener(qa,d),()=>document.removeEventListener(qa,d)),[d]),f.useEffect(()=>{if(u.trigger){const g=h=>{const p=h.target;p!=null&&p.contains(u.trigger)&&d()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,d]),l.jsx(sd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:g=>g.preventDefault(),onDismiss:d,children:l.jsxs(Tb,{"data-state":u.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ml,{children:r}),l.jsx(Vb,{scope:n,isInside:!0,children:l.jsx(kb,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Kd.displayName=jn;var Xd="TooltipArrow",zb=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Mo(n);return jb(Xd,n).isInside?null:l.jsx(_b,{...o,...r,ref:t})});zb.displayName=Xd;function Bb(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Hb(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ub(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Wb(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,u=t[i].y,c=t[a].x,d=t[a].y;u>r!=d>r&&n<(c-s)*(r-u)/(d-u)+s&&(o=!o)}return o}function qb(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gb(t)}function Gb(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Kb=Ud,Yb=Wd,Xb=qd,Jb=Gd,Jd=Kd;const zn=Kb,Bn=Yb,Hn=Xb,hn=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Jb,{children:l.jsx(Jd,{ref:r,sideOffset:t,className:ge("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));hn.displayName=Jd.displayName;function Zb({title:e,titleId:t,...n},r){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?f.createElement("title",{id:t},e):null,f.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Qb=f.forwardRef(Zb);var e0=function(e){return function(t,n){var r=T.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Zd=function(e){return typeof e=="function"},Qd=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const t0=e0(T.useEffect);function ef(e){var t=T.useRef(e);return t.current=e,t}var n0=function(e){Qd&&(Zd(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=ef(e);T.useEffect(function(){return function(){t.current()}},[])};function r0(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var tf=r0,o0=typeof rr=="object"&&rr&&rr.Object===Object&&rr,i0=o0,a0=i0,s0=typeof self=="object"&&self&&self.Object===Object&&self,l0=a0||s0||Function("return this")(),nf=l0,c0=nf,u0=function(){return c0.Date.now()},d0=u0,f0=/\s/;function p0(e){for(var t=e.length;t--&&f0.test(e.charAt(t)););return t}var g0=p0,m0=g0,h0=/^\s+/;function v0(e){return e&&e.slice(0,m0(e)+1).replace(h0,"")}var y0=v0,x0=nf,w0=x0.Symbol,rf=w0,of=rf,af=Object.prototype,b0=af.hasOwnProperty,S0=af.toString,gr=of?of.toStringTag:void 0;function C0(e){var t=b0.call(e,gr),n=e[gr];try{e[gr]=void 0;var r=!0}catch{}var o=S0.call(e);return r&&(t?e[gr]=n:delete e[gr]),o}var E0=C0,T0=Object.prototype,_0=T0.toString;function A0(e){return _0.call(e)}var P0=A0,sf=rf,N0=E0,O0=P0,F0="[object Null]",k0="[object Undefined]",lf=sf?sf.toStringTag:void 0;function D0(e){return e==null?e===void 0?k0:F0:lf&&lf in Object(e)?N0(e):O0(e)}var M0=D0;function $0(e){return e!=null&&typeof e=="object"}var I0=$0,L0=M0,R0=I0,V0="[object Symbol]";function j0(e){return typeof e=="symbol"||R0(e)&&L0(e)==V0}var z0=j0,B0=y0,cf=tf,H0=z0,uf=NaN,U0=/^[-+]0x[0-9a-f]+$/i,W0=/^0b[01]+$/i,q0=/^0o[0-7]+$/i,G0=parseInt;function K0(e){if(typeof e=="number")return e;if(H0(e))return uf;if(cf(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=cf(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=B0(e);var n=W0.test(e);return n||q0.test(e)?G0(e.slice(2),n?2:8):U0.test(e)?uf:+e}var Y0=K0,X0=tf,Xa=d0,df=Y0,J0="Expected a function",Z0=Math.max,Q0=Math.min;function eS(e,t,n){var r,o,i,a,s,u,c=0,d=!1,g=!1,h=!0;if(typeof e!="function")throw new TypeError(J0);t=df(t)||0,X0(n)&&(d=!!n.leading,g="maxWait"in n,i=g?Z0(df(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function p(O){var M=r,I=o;return r=o=void 0,c=O,a=e.apply(I,M),a}function v(O){return c=O,s=setTimeout(w,t),d?p(O):a}function m(O){var M=O-u,I=O-c,H=t-M;return g?Q0(H,i-I):H}function y(O){var M=O-u,I=O-c;return u===void 0||M>=t||M<0||g&&I>=i}function w(){var O=Xa();if(y(O))return b(O);s=setTimeout(w,m(O))}function b(O){return s=void 0,h&&r?p(O):(r=o=void 0,a)}function S(){s!==void 0&&clearTimeout(s),c=0,r=u=o=s=void 0}function E(){return s===void 0?a:b(Xa())}function x(){var O=Xa(),M=y(O);if(r=arguments,o=this,u=O,M){if(s===void 0)return v(u);if(g)return clearTimeout(s),s=setTimeout(w,t),p(u)}return s===void 0&&(s=setTimeout(w,t)),a}return x.cancel=S,x.flush=E,x}var tS=eS;const nS=Wr(tS);function rS(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}rS()||(global.Date=Date);function oS(e,t){var n;Qd&&(Zd(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=ef(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,i=T.useMemo(function(){return nS(function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return r.current.apply(r,xc([],yc(a),!1))},o,t)},[]);return n0(function(){i.cancel()}),{run:i,cancel:i.cancel,flush:i.flush}}function iS(e,t,n){var r=yc(T.useState({}),2),o=r[0],i=r[1],a=oS(function(){i({})},n).run;T.useEffect(function(){return a()},t),t0(e,[o])}const aS=T.forwardRef(({onChange:e},t)=>{const n=T.useRef(null),[r,o]=T.useState("");return T.useImperativeHandle(t,()=>({setValue:i=>{var a;o(i),(a=n.current)==null||a.focus()}})),iS(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(en,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:i=>o(i.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var i;o(""),(i=n.current)==null||i.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(Qb,{className:"h-5 w-5"})})]})});var Ja={exports:{}},Io={exports:{}},_e={};/** @license React v16.13.1
152
152
  * react-is.production.min.js
153
153
  *
154
154
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -162,15 +162,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
162
162
  *
163
163
  * This source code is licensed under the MIT license found in the
164
164
  * LICENSE file in the root directory of this source tree.
165
- */var pf;function lS(){return pf||(pf=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(K){return typeof K=="string"||typeof K=="function"||K===r||K===c||K===i||K===o||K===g||K===h||typeof K=="object"&&K!==null&&(K.$$typeof===v||K.$$typeof===p||K.$$typeof===a||K.$$typeof===s||K.$$typeof===d||K.$$typeof===y||K.$$typeof===w||K.$$typeof===b||K.$$typeof===m)}function E(K){if(typeof K=="object"&&K!==null){var Ee=K.$$typeof;switch(Ee){case t:var He=K.type;switch(He){case u:case c:case r:case i:case o:case g:return He;default:var Ue=He&&He.$$typeof;switch(Ue){case s:case d:case v:case p:case a:return Ue;default:return Ee}}case n:return Ee}}}var x=u,O=c,M=s,I=a,H=t,k=d,G=r,U=v,Z=p,P=n,$=i,F=o,W=g,N=!1;function V(K){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(K)||E(K)===u}function _(K){return E(K)===c}function B(K){return E(K)===s}function Q(K){return E(K)===a}function ne(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function ee(K){return E(K)===d}function ce(K){return E(K)===r}function oe(K){return E(K)===v}function ie(K){return E(K)===p}function de(K){return E(K)===n}function ue(K){return E(K)===i}function le(K){return E(K)===o}function Se(K){return E(K)===g}Ae.AsyncMode=x,Ae.ConcurrentMode=O,Ae.ContextConsumer=M,Ae.ContextProvider=I,Ae.Element=H,Ae.ForwardRef=k,Ae.Fragment=G,Ae.Lazy=U,Ae.Memo=Z,Ae.Portal=P,Ae.Profiler=$,Ae.StrictMode=F,Ae.Suspense=W,Ae.isAsyncMode=V,Ae.isConcurrentMode=_,Ae.isContextConsumer=B,Ae.isContextProvider=Q,Ae.isElement=ne,Ae.isForwardRef=ee,Ae.isFragment=ce,Ae.isLazy=oe,Ae.isMemo=ie,Ae.isPortal=de,Ae.isProfiler=ue,Ae.isStrictMode=le,Ae.isSuspense=Se,Ae.isValidElementType=S,Ae.typeOf=E}()),Ae}var gf;function mf(){return gf||(gf=1,process.env.NODE_ENV==="production"?Io.exports=sS():Io.exports=lS()),Io.exports}/*
165
+ */var pf;function lS(){return pf||(pf=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(K){return typeof K=="string"||typeof K=="function"||K===r||K===c||K===i||K===o||K===g||K===h||typeof K=="object"&&K!==null&&(K.$$typeof===v||K.$$typeof===p||K.$$typeof===a||K.$$typeof===s||K.$$typeof===d||K.$$typeof===y||K.$$typeof===w||K.$$typeof===b||K.$$typeof===m)}function E(K){if(typeof K=="object"&&K!==null){var Ee=K.$$typeof;switch(Ee){case t:var He=K.type;switch(He){case u:case c:case r:case i:case o:case g:return He;default:var Ue=He&&He.$$typeof;switch(Ue){case s:case d:case v:case p:case a:return Ue;default:return Ee}}case n:return Ee}}}var x=u,O=c,M=s,I=a,H=t,k=d,G=r,U=v,Z=p,P=n,$=i,F=o,W=g,N=!1;function V(K){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(K)||E(K)===u}function _(K){return E(K)===c}function B(K){return E(K)===s}function Q(K){return E(K)===a}function re(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function ee(K){return E(K)===d}function ce(K){return E(K)===r}function oe(K){return E(K)===v}function ie(K){return E(K)===p}function de(K){return E(K)===n}function ue(K){return E(K)===i}function le(K){return E(K)===o}function Se(K){return E(K)===g}Ae.AsyncMode=x,Ae.ConcurrentMode=O,Ae.ContextConsumer=M,Ae.ContextProvider=I,Ae.Element=H,Ae.ForwardRef=k,Ae.Fragment=G,Ae.Lazy=U,Ae.Memo=Z,Ae.Portal=P,Ae.Profiler=$,Ae.StrictMode=F,Ae.Suspense=W,Ae.isAsyncMode=V,Ae.isConcurrentMode=_,Ae.isContextConsumer=B,Ae.isContextProvider=Q,Ae.isElement=re,Ae.isForwardRef=ee,Ae.isFragment=ce,Ae.isLazy=oe,Ae.isMemo=ie,Ae.isPortal=de,Ae.isProfiler=ue,Ae.isStrictMode=le,Ae.isSuspense=Se,Ae.isValidElementType=S,Ae.typeOf=E}()),Ae}var gf;function mf(){return gf||(gf=1,process.env.NODE_ENV==="production"?Io.exports=sS():Io.exports=lS()),Io.exports}/*
166
166
  object-assign
167
167
  (c) Sindre Sorhus
168
168
  @license MIT
169
- */var Za,hf;function cS(){if(hf)return Za;hf=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var u=Object.getOwnPropertyNames(a).map(function(d){return a[d]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Za=o()?Object.assign:function(i,a){for(var s,u=r(i),c,d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var g in s)t.call(s,g)&&(u[g]=s[g]);if(e){c=e(s);for(var h=0;h<c.length;h++)n.call(s,c[h])&&(u[c[h]]=s[c[h]])}}return u},Za}var Qa,vf;function es(){if(vf)return Qa;vf=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qa=e,Qa}var ts,yf;function xf(){return yf||(yf=1,ts=Function.call.bind(Object.prototype.hasOwnProperty)),ts}var ns,wf;function uS(){if(wf)return ns;wf=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=es(),n={},r=xf();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,s,u,c){if(process.env.NODE_ENV!=="production"){for(var d in i)if(r(i,d)){var g;try{if(typeof i[d]!="function"){var h=Error((u||"React class")+": "+s+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}g=i[d](a,d,u,s,null,t)}catch(v){g=v}if(g&&!(g instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var p=c?c():"";e("Failed "+s+" type: "+g.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ns=o,ns}var rs,bf;function dS(){if(bf)return rs;bf=1;var e=mf(),t=cS(),n=es(),r=xf(),o=uS(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var u="Warning: "+s;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return rs=function(s,u){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function g(_){var B=_&&(c&&_[c]||_[d]);if(typeof B=="function")return B}var h="<<anonymous>>",p={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:b(),arrayOf:S,element:E(),elementType:x(),instanceOf:O,node:k(),objectOf:I,oneOf:M,oneOfType:H,shape:U,exact:Z};function v(_,B){return _===B?_!==0||1/_===1/B:_!==_&&B!==B}function m(_,B){this.message=_,this.data=B&&typeof B=="object"?B:{},this.stack=""}m.prototype=Error.prototype;function y(_){if(process.env.NODE_ENV!=="production")var B={},Q=0;function ne(ce,oe,ie,de,ue,le,Se){if(de=de||h,le=le||ie,Se!==n){if(u){var K=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ee=de+":"+ie;!B[Ee]&&Q<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+de+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),B[Ee]=!0,Q++)}}return oe[ie]==null?ce?oe[ie]===null?new m("The "+ue+" `"+le+"` is marked as required "+("in `"+de+"`, but its value is `null`.")):new m("The "+ue+" `"+le+"` is marked as required in "+("`"+de+"`, but its value is `undefined`.")):null:_(oe,ie,de,ue,le)}var ee=ne.bind(null,!1);return ee.isRequired=ne.bind(null,!0),ee}function w(_){function B(Q,ne,ee,ce,oe,ie){var de=Q[ne],ue=F(de);if(ue!==_){var le=W(de);return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+le+"` supplied to `"+ee+"`, expected ")+("`"+_+"`."),{expectedType:_})}return null}return y(B)}function b(){return y(a)}function S(_){function B(Q,ne,ee,ce,oe){if(typeof _!="function")return new m("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var ie=Q[ne];if(!Array.isArray(ie)){var de=F(ie);return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected an array."))}for(var ue=0;ue<ie.length;ue++){var le=_(ie,ue,ee,ce,oe+"["+ue+"]",n);if(le instanceof Error)return le}return null}return y(B)}function E(){function _(B,Q,ne,ee,ce){var oe=B[Q];if(!s(oe)){var ie=F(oe);return new m("Invalid "+ee+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+ne+"`, expected a single ReactElement."))}return null}return y(_)}function x(){function _(B,Q,ne,ee,ce){var oe=B[Q];if(!e.isValidElementType(oe)){var ie=F(oe);return new m("Invalid "+ee+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+ne+"`, expected a single ReactElement type."))}return null}return y(_)}function O(_){function B(Q,ne,ee,ce,oe){if(!(Q[ne]instanceof _)){var ie=_.name||h,de=V(Q[ne]);return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected ")+("instance of `"+ie+"`."))}return null}return y(B)}function M(_){if(!Array.isArray(_))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function B(Q,ne,ee,ce,oe){for(var ie=Q[ne],de=0;de<_.length;de++)if(v(ie,_[de]))return null;var ue=JSON.stringify(_,function(Se,K){var Ee=W(K);return Ee==="symbol"?String(K):K});return new m("Invalid "+ce+" `"+oe+"` of value `"+String(ie)+"` "+("supplied to `"+ee+"`, expected one of "+ue+"."))}return y(B)}function I(_){function B(Q,ne,ee,ce,oe){if(typeof _!="function")return new m("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var ie=Q[ne],de=F(ie);if(de!=="object")return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected an object."));for(var ue in ie)if(r(ie,ue)){var le=_(ie,ue,ee,ce,oe+"."+ue,n);if(le instanceof Error)return le}return null}return y(B)}function H(_){if(!Array.isArray(_))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var B=0;B<_.length;B++){var Q=_[B];if(typeof Q!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+N(Q)+" at index "+B+"."),a}function ne(ee,ce,oe,ie,de){for(var ue=[],le=0;le<_.length;le++){var Se=_[le],K=Se(ee,ce,oe,ie,de,n);if(K==null)return null;K.data&&r(K.data,"expectedType")&&ue.push(K.data.expectedType)}var Ee=ue.length>0?", expected one of type ["+ue.join(", ")+"]":"";return new m("Invalid "+ie+" `"+de+"` supplied to "+("`"+oe+"`"+Ee+"."))}return y(ne)}function k(){function _(B,Q,ne,ee,ce){return P(B[Q])?null:new m("Invalid "+ee+" `"+ce+"` supplied to "+("`"+ne+"`, expected a ReactNode."))}return y(_)}function G(_,B,Q,ne,ee){return new m((_||"React class")+": "+B+" type `"+Q+"."+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function U(_){function B(Q,ne,ee,ce,oe){var ie=Q[ne],de=F(ie);if(de!=="object")return new m("Invalid "+ce+" `"+oe+"` of type `"+de+"` "+("supplied to `"+ee+"`, expected `object`."));for(var ue in _){var le=_[ue];if(typeof le!="function")return G(ee,ce,oe,ue,W(le));var Se=le(ie,ue,ee,ce,oe+"."+ue,n);if(Se)return Se}return null}return y(B)}function Z(_){function B(Q,ne,ee,ce,oe){var ie=Q[ne],de=F(ie);if(de!=="object")return new m("Invalid "+ce+" `"+oe+"` of type `"+de+"` "+("supplied to `"+ee+"`, expected `object`."));var ue=t({},Q[ne],_);for(var le in ue){var Se=_[le];if(r(_,le)&&typeof Se!="function")return G(ee,ce,oe,le,W(Se));if(!Se)return new m("Invalid "+ce+" `"+oe+"` key `"+le+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(Q[ne],null," ")+`
170
- Valid keys: `+JSON.stringify(Object.keys(_),null," "));var K=Se(ie,le,ee,ce,oe+"."+le,n);if(K)return K}return null}return y(B)}function P(_){switch(typeof _){case"number":case"string":case"undefined":return!0;case"boolean":return!_;case"object":if(Array.isArray(_))return _.every(P);if(_===null||s(_))return!0;var B=g(_);if(B){var Q=B.call(_),ne;if(B!==_.entries){for(;!(ne=Q.next()).done;)if(!P(ne.value))return!1}else for(;!(ne=Q.next()).done;){var ee=ne.value;if(ee&&!P(ee[1]))return!1}}else return!1;return!0;default:return!1}}function $(_,B){return _==="symbol"?!0:B?B["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&B instanceof Symbol:!1}function F(_){var B=typeof _;return Array.isArray(_)?"array":_ instanceof RegExp?"object":$(B,_)?"symbol":B}function W(_){if(typeof _>"u"||_===null)return""+_;var B=F(_);if(B==="object"){if(_ instanceof Date)return"date";if(_ instanceof RegExp)return"regexp"}return B}function N(_){var B=W(_);switch(B){case"array":case"object":return"an "+B;case"boolean":case"date":case"regexp":return"a "+B;default:return B}}function V(_){return!_.constructor||!_.constructor.name?h:_.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},rs}var os,Sf;function fS(){if(Sf)return os;Sf=1;var e=es();function t(){}function n(){}return n.resetWarningCache=t,os=function(){function r(a,s,u,c,d,g){if(g!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},os}if(process.env.NODE_ENV!=="production"){var pS=mf(),gS=!0;Ja.exports=dS()(pS.isElement,gS)}else Ja.exports=fS()();var mS=Ja.exports;const Pe=Wr(mS),hS=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Un(e,t,n){const r=vS(e),{webkitRelativePath:o}=e,i=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&Cf(r,"path",i),Cf(r,"relativePath",i),r}function vS(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=hS.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function Cf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const yS=[".DS_Store","Thumbs.db"];function xS(e){return dn(this,void 0,void 0,function*(){return Lo(e)&&wS(e.dataTransfer)?ES(e.dataTransfer,e.type):bS(e)?SS(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?CS(e):[]})}function wS(e){return Lo(e)}function bS(e){return Lo(e)&&Lo(e.target)}function Lo(e){return typeof e=="object"&&e!==null}function SS(e){return is(e.target.files).map(t=>Un(t))}function CS(e){return dn(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Un(n))})}function ES(e,t){return dn(this,void 0,void 0,function*(){if(e.items){const n=is(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(TS));return Ef(Tf(r))}return Ef(is(e.files).map(n=>Un(n)))})}function Ef(e){return e.filter(t=>yS.indexOf(t.name)===-1)}function is(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function TS(e){if(typeof e.webkitGetAsEntry!="function")return _f(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Af(t):_f(e,t)}function Tf(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Tf(n):[n]],[])}function _f(e,t){return dn(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const i=yield e.getAsFileSystemHandle();if(i===null)throw new Error(`${e} is not a File`);if(i!==void 0){const a=yield i.getFile();return a.handle=i,Un(a)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Un(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function _S(e){return dn(this,void 0,void 0,function*(){return e.isDirectory?Af(e):AS(e)})}function Af(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>dn(this,void 0,void 0,function*(){if(a.length){const s=Promise.all(a.map(_S));o.push(s),i()}else try{const s=yield Promise.all(o);n(s)}catch(s){r(s)}}),a=>{r(a)})}i()})}function AS(e){return dn(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Un(r,e.fullPath);t(o)},r=>{n(r)})})})}var as=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?i===s.replace(/\/.*$/,""):o===s})}return!0};function Pf(e){return OS(e)||NS(e)||kf(e)||PS()}function PS(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
169
+ */var Za,hf;function cS(){if(hf)return Za;hf=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var u=Object.getOwnPropertyNames(a).map(function(d){return a[d]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Za=o()?Object.assign:function(i,a){for(var s,u=r(i),c,d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var g in s)t.call(s,g)&&(u[g]=s[g]);if(e){c=e(s);for(var h=0;h<c.length;h++)n.call(s,c[h])&&(u[c[h]]=s[c[h]])}}return u},Za}var Qa,vf;function es(){if(vf)return Qa;vf=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qa=e,Qa}var ts,yf;function xf(){return yf||(yf=1,ts=Function.call.bind(Object.prototype.hasOwnProperty)),ts}var ns,wf;function uS(){if(wf)return ns;wf=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=es(),n={},r=xf();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,s,u,c){if(process.env.NODE_ENV!=="production"){for(var d in i)if(r(i,d)){var g;try{if(typeof i[d]!="function"){var h=Error((u||"React class")+": "+s+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}g=i[d](a,d,u,s,null,t)}catch(v){g=v}if(g&&!(g instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var p=c?c():"";e("Failed "+s+" type: "+g.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ns=o,ns}var rs,bf;function dS(){if(bf)return rs;bf=1;var e=mf(),t=cS(),n=es(),r=xf(),o=uS(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var u="Warning: "+s;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return rs=function(s,u){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function g(_){var B=_&&(c&&_[c]||_[d]);if(typeof B=="function")return B}var h="<<anonymous>>",p={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:b(),arrayOf:S,element:E(),elementType:x(),instanceOf:O,node:k(),objectOf:I,oneOf:M,oneOfType:H,shape:U,exact:Z};function v(_,B){return _===B?_!==0||1/_===1/B:_!==_&&B!==B}function m(_,B){this.message=_,this.data=B&&typeof B=="object"?B:{},this.stack=""}m.prototype=Error.prototype;function y(_){if(process.env.NODE_ENV!=="production")var B={},Q=0;function re(ce,oe,ie,de,ue,le,Se){if(de=de||h,le=le||ie,Se!==n){if(u){var K=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ee=de+":"+ie;!B[Ee]&&Q<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+de+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),B[Ee]=!0,Q++)}}return oe[ie]==null?ce?oe[ie]===null?new m("The "+ue+" `"+le+"` is marked as required "+("in `"+de+"`, but its value is `null`.")):new m("The "+ue+" `"+le+"` is marked as required in "+("`"+de+"`, but its value is `undefined`.")):null:_(oe,ie,de,ue,le)}var ee=re.bind(null,!1);return ee.isRequired=re.bind(null,!0),ee}function w(_){function B(Q,re,ee,ce,oe,ie){var de=Q[re],ue=F(de);if(ue!==_){var le=W(de);return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+le+"` supplied to `"+ee+"`, expected ")+("`"+_+"`."),{expectedType:_})}return null}return y(B)}function b(){return y(a)}function S(_){function B(Q,re,ee,ce,oe){if(typeof _!="function")return new m("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var ie=Q[re];if(!Array.isArray(ie)){var de=F(ie);return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected an array."))}for(var ue=0;ue<ie.length;ue++){var le=_(ie,ue,ee,ce,oe+"["+ue+"]",n);if(le instanceof Error)return le}return null}return y(B)}function E(){function _(B,Q,re,ee,ce){var oe=B[Q];if(!s(oe)){var ie=F(oe);return new m("Invalid "+ee+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+re+"`, expected a single ReactElement."))}return null}return y(_)}function x(){function _(B,Q,re,ee,ce){var oe=B[Q];if(!e.isValidElementType(oe)){var ie=F(oe);return new m("Invalid "+ee+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+re+"`, expected a single ReactElement type."))}return null}return y(_)}function O(_){function B(Q,re,ee,ce,oe){if(!(Q[re]instanceof _)){var ie=_.name||h,de=V(Q[re]);return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected ")+("instance of `"+ie+"`."))}return null}return y(B)}function M(_){if(!Array.isArray(_))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function B(Q,re,ee,ce,oe){for(var ie=Q[re],de=0;de<_.length;de++)if(v(ie,_[de]))return null;var ue=JSON.stringify(_,function(Se,K){var Ee=W(K);return Ee==="symbol"?String(K):K});return new m("Invalid "+ce+" `"+oe+"` of value `"+String(ie)+"` "+("supplied to `"+ee+"`, expected one of "+ue+"."))}return y(B)}function I(_){function B(Q,re,ee,ce,oe){if(typeof _!="function")return new m("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var ie=Q[re],de=F(ie);if(de!=="object")return new m("Invalid "+ce+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected an object."));for(var ue in ie)if(r(ie,ue)){var le=_(ie,ue,ee,ce,oe+"."+ue,n);if(le instanceof Error)return le}return null}return y(B)}function H(_){if(!Array.isArray(_))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var B=0;B<_.length;B++){var Q=_[B];if(typeof Q!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+N(Q)+" at index "+B+"."),a}function re(ee,ce,oe,ie,de){for(var ue=[],le=0;le<_.length;le++){var Se=_[le],K=Se(ee,ce,oe,ie,de,n);if(K==null)return null;K.data&&r(K.data,"expectedType")&&ue.push(K.data.expectedType)}var Ee=ue.length>0?", expected one of type ["+ue.join(", ")+"]":"";return new m("Invalid "+ie+" `"+de+"` supplied to "+("`"+oe+"`"+Ee+"."))}return y(re)}function k(){function _(B,Q,re,ee,ce){return P(B[Q])?null:new m("Invalid "+ee+" `"+ce+"` supplied to "+("`"+re+"`, expected a ReactNode."))}return y(_)}function G(_,B,Q,re,ee){return new m((_||"React class")+": "+B+" type `"+Q+"."+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function U(_){function B(Q,re,ee,ce,oe){var ie=Q[re],de=F(ie);if(de!=="object")return new m("Invalid "+ce+" `"+oe+"` of type `"+de+"` "+("supplied to `"+ee+"`, expected `object`."));for(var ue in _){var le=_[ue];if(typeof le!="function")return G(ee,ce,oe,ue,W(le));var Se=le(ie,ue,ee,ce,oe+"."+ue,n);if(Se)return Se}return null}return y(B)}function Z(_){function B(Q,re,ee,ce,oe){var ie=Q[re],de=F(ie);if(de!=="object")return new m("Invalid "+ce+" `"+oe+"` of type `"+de+"` "+("supplied to `"+ee+"`, expected `object`."));var ue=t({},Q[re],_);for(var le in ue){var Se=_[le];if(r(_,le)&&typeof Se!="function")return G(ee,ce,oe,le,W(Se));if(!Se)return new m("Invalid "+ce+" `"+oe+"` key `"+le+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(Q[re],null," ")+`
170
+ Valid keys: `+JSON.stringify(Object.keys(_),null," "));var K=Se(ie,le,ee,ce,oe+"."+le,n);if(K)return K}return null}return y(B)}function P(_){switch(typeof _){case"number":case"string":case"undefined":return!0;case"boolean":return!_;case"object":if(Array.isArray(_))return _.every(P);if(_===null||s(_))return!0;var B=g(_);if(B){var Q=B.call(_),re;if(B!==_.entries){for(;!(re=Q.next()).done;)if(!P(re.value))return!1}else for(;!(re=Q.next()).done;){var ee=re.value;if(ee&&!P(ee[1]))return!1}}else return!1;return!0;default:return!1}}function $(_,B){return _==="symbol"?!0:B?B["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&B instanceof Symbol:!1}function F(_){var B=typeof _;return Array.isArray(_)?"array":_ instanceof RegExp?"object":$(B,_)?"symbol":B}function W(_){if(typeof _>"u"||_===null)return""+_;var B=F(_);if(B==="object"){if(_ instanceof Date)return"date";if(_ instanceof RegExp)return"regexp"}return B}function N(_){var B=W(_);switch(B){case"array":case"object":return"an "+B;case"boolean":case"date":case"regexp":return"a "+B;default:return B}}function V(_){return!_.constructor||!_.constructor.name?h:_.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},rs}var os,Sf;function fS(){if(Sf)return os;Sf=1;var e=es();function t(){}function n(){}return n.resetWarningCache=t,os=function(){function r(a,s,u,c,d,g){if(g!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},os}if(process.env.NODE_ENV!=="production"){var pS=mf(),gS=!0;Ja.exports=dS()(pS.isElement,gS)}else Ja.exports=fS()();var mS=Ja.exports;const Pe=Wr(mS),hS=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Un(e,t,n){const r=vS(e),{webkitRelativePath:o}=e,i=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&Cf(r,"path",i),Cf(r,"relativePath",i),r}function vS(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=hS.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function Cf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const yS=[".DS_Store","Thumbs.db"];function xS(e){return dn(this,void 0,void 0,function*(){return Lo(e)&&wS(e.dataTransfer)?ES(e.dataTransfer,e.type):bS(e)?SS(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?CS(e):[]})}function wS(e){return Lo(e)}function bS(e){return Lo(e)&&Lo(e.target)}function Lo(e){return typeof e=="object"&&e!==null}function SS(e){return is(e.target.files).map(t=>Un(t))}function CS(e){return dn(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Un(n))})}function ES(e,t){return dn(this,void 0,void 0,function*(){if(e.items){const n=is(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(TS));return Ef(Tf(r))}return Ef(is(e.files).map(n=>Un(n)))})}function Ef(e){return e.filter(t=>yS.indexOf(t.name)===-1)}function is(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function TS(e){if(typeof e.webkitGetAsEntry!="function")return _f(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Af(t):_f(e,t)}function Tf(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Tf(n):[n]],[])}function _f(e,t){return dn(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const i=yield e.getAsFileSystemHandle();if(i===null)throw new Error(`${e} is not a File`);if(i!==void 0){const a=yield i.getFile();return a.handle=i,Un(a)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Un(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function _S(e){return dn(this,void 0,void 0,function*(){return e.isDirectory?Af(e):AS(e)})}function Af(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>dn(this,void 0,void 0,function*(){if(a.length){const s=Promise.all(a.map(_S));o.push(s),i()}else try{const s=yield Promise.all(o);n(s)}catch(s){r(s)}}),a=>{r(a)})}i()})}function AS(e){return dn(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Un(r,e.fullPath);t(o)},r=>{n(r)})})})}var as=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?i===s.replace(/\/.*$/,""):o===s})}return!0};function Pf(e){return OS(e)||NS(e)||kf(e)||PS()}function PS(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
171
171
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NS(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OS(e){if(Array.isArray(e))return ss(e)}function Nf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Of(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nf(Object(n),!0).forEach(function(r){Ff(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nf(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ff(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(e,t){return DS(e)||kS(e,t)||kf(e,t)||FS()}function FS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
172
172
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kf(e,t){if(e){if(typeof e=="string")return ss(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ss(e,t)}}function ss(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kS(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(u){i=!0,s=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function DS(e){if(Array.isArray(e))return e}var MS=typeof as=="function"?as:as.default,$S="file-invalid-type",IS="file-too-large",LS="file-too-small",RS="too-many-files",VS=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:$S,message:"File type must be ".concat(r)}},Df=function(t){return{code:IS,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Mf=function(t){return{code:LS,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},jS={code:RS,message:"Too many files"};function $f(e,t){var n=e.type==="application/x-moz-file"||MS(e,t);return[n,n?null:VS(t)]}function If(e,t,n){if(vn(e.size))if(vn(t)&&vn(n)){if(e.size>n)return[!1,Df(n)];if(e.size<t)return[!1,Mf(t)]}else{if(vn(t)&&e.size<t)return[!1,Mf(t)];if(vn(n)&&e.size>n)return[!1,Df(n)]}return[!0,null]}function vn(e){return e!=null}function zS(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(u){var c=$f(u,n),d=mr(c,1),g=d[0],h=If(u,r,o),p=mr(h,1),v=p[0],m=s?s(u):null;return g&&v&&!m})}function Ro(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Vo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Lf(e){e.preventDefault()}function BS(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function HS(e){return e.indexOf("Edge/")!==-1}function US(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return BS(e)||HS(e)}function Nt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return t.some(function(s){return!Ro(r)&&s&&s.apply(void 0,[r].concat(i)),Ro(r)})}}function WS(){return"showOpenFilePicker"in window}function qS(e){if(vn(e)){var t=Object.entries(e).filter(function(n){var r=mr(n,2),o=r[0],i=r[1],a=!0;return Rf(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(i)||!i.every(Vf))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var o=mr(r,2),i=o[0],a=o[1];return Of(Of({},n),{},Ff({},i,a))},{});return[{description:"Files",accept:t}]}return e}function GS(e){if(vn(e))return Object.entries(e).reduce(function(t,n){var r=mr(n,2),o=r[0],i=r[1];return[].concat(Pf(t),[o],Pf(i))},[]).filter(function(t){return Rf(t)||Vf(t)}).join(",")}function KS(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function YS(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Rf(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Vf(e){return/^.*\.[\w]+$/.test(e)}var XS=["children"],JS=["open"],ZS=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],QS=["refKey","onChange","onClick"];function eC(e){return rC(e)||nC(e)||jf(e)||tC()}function tC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
173
173
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rC(e){if(Array.isArray(e))return cs(e)}function ls(e,t){return aC(e)||iC(e,t)||jf(e,t)||oC()}function oC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
174
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jf(e,t){if(e){if(typeof e=="string")return cs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cs(e,t)}}function cs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(u){i=!0,s=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function aC(e){if(Array.isArray(e))return e}function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zf(Object(n),!0).forEach(function(r){us(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function us(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jo(e,t){if(e==null)return{};var n=sC(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sC(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var ds=T.forwardRef(function(e,t){var n=e.children,r=jo(e,XS),o=Hf(r),i=o.open,a=jo(o,JS);return T.useImperativeHandle(t,function(){return{open:i}},[i]),T.createElement(T.Fragment,null,n(Fe(Fe({},a),{},{open:i})))});ds.displayName="Dropzone";var Bf={disabled:!1,getFilesFromEvent:xS,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};ds.defaultProps=Bf,ds.propTypes={children:Pe.func,accept:Pe.objectOf(Pe.arrayOf(Pe.string)),multiple:Pe.bool,preventDropOnDocument:Pe.bool,noClick:Pe.bool,noKeyboard:Pe.bool,noDrag:Pe.bool,noDragEventsBubbling:Pe.bool,minSize:Pe.number,maxSize:Pe.number,maxFiles:Pe.number,disabled:Pe.bool,getFilesFromEvent:Pe.func,onFileDialogCancel:Pe.func,onFileDialogOpen:Pe.func,useFsAccessApi:Pe.bool,autoFocus:Pe.bool,onDragEnter:Pe.func,onDragLeave:Pe.func,onDragOver:Pe.func,onDrop:Pe.func,onDropAccepted:Pe.func,onDropRejected:Pe.func,onError:Pe.func,validator:Pe.func};var fs={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Hf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Fe(Fe({},Bf),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,g=t.onDragOver,h=t.onDrop,p=t.onDropAccepted,v=t.onDropRejected,m=t.onFileDialogCancel,y=t.onFileDialogOpen,w=t.useFsAccessApi,b=t.autoFocus,S=t.preventDropOnDocument,E=t.noClick,x=t.noKeyboard,O=t.noDrag,M=t.noDragEventsBubbling,I=t.onError,H=t.validator,k=T.useMemo(function(){return GS(n)},[n]),G=T.useMemo(function(){return qS(n)},[n]),U=T.useMemo(function(){return typeof y=="function"?y:Uf},[y]),Z=T.useMemo(function(){return typeof m=="function"?m:Uf},[m]),P=T.useRef(null),$=T.useRef(null),F=T.useReducer(lC,fs),W=ls(F,2),N=W[0],V=W[1],_=N.isFocused,B=N.isFileDialogActive,Q=T.useRef(typeof window<"u"&&window.isSecureContext&&w&&WS()),ne=function(){!Q.current&&B&&setTimeout(function(){if($.current){var Y=$.current.files;Y.length||(V({type:"closeDialog"}),Z())}},300)};T.useEffect(function(){return window.addEventListener("focus",ne,!1),function(){window.removeEventListener("focus",ne,!1)}},[$,B,Z,Q]);var ee=T.useRef([]),ce=function(Y){P.current&&P.current.contains(Y.target)||(Y.preventDefault(),ee.current=[])};T.useEffect(function(){return S&&(document.addEventListener("dragover",Lf,!1),document.addEventListener("drop",ce,!1)),function(){S&&(document.removeEventListener("dragover",Lf),document.removeEventListener("drop",ce))}},[P,S]),T.useEffect(function(){return!r&&b&&P.current&&P.current.focus(),function(){}},[P,b,r]);var oe=T.useCallback(function(j){I?I(j):console.error(j)},[I]),ie=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j),ee.current=[].concat(eC(ee.current),[j.target]),Vo(j)&&Promise.resolve(o(j)).then(function(Y){if(!(Ro(j)&&!M)){var ye=Y.length,be=ye>0&&zS({files:Y,accept:k,minSize:a,maxSize:i,multiple:s,maxFiles:u,validator:H}),Te=ye>0&&!be;V({isDragAccept:be,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),c&&c(j)}}).catch(function(Y){return oe(Y)})},[o,c,oe,M,k,a,i,s,u,H]),de=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j);var Y=Vo(j);if(Y&&j.dataTransfer)try{j.dataTransfer.dropEffect="copy"}catch{}return Y&&g&&g(j),!1},[g,M]),ue=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j);var Y=ee.current.filter(function(be){return P.current&&P.current.contains(be)}),ye=Y.indexOf(j.target);ye!==-1&&Y.splice(ye,1),ee.current=Y,!(Y.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Vo(j)&&d&&d(j))},[P,d,M]),le=T.useCallback(function(j,Y){var ye=[],be=[];j.forEach(function(Te){var Mt=$f(Te,k),ct=ls(Mt,2),Ve=ct[0],Ht=ct[1],Ut=If(Te,a,i),Wt=ls(Ut,2),Ce=Wt[0],an=Wt[1],Gn=H?H(Te):null;if(Ve&&Ce&&!Gn)ye.push(Te);else{var ut=[Ht,an];Gn&&(ut=ut.concat(Gn)),be.push({file:Te,errors:ut.filter(function(xn){return xn})})}}),(!s&&ye.length>1||s&&u>=1&&ye.length>u)&&(ye.forEach(function(Te){be.push({file:Te,errors:[jS]})}),ye.splice(0)),V({acceptedFiles:ye,fileRejections:be,isDragReject:be.length>0,type:"setFiles"}),h&&h(ye,be,Y),be.length>0&&v&&v(be,Y),ye.length>0&&p&&p(ye,Y)},[V,s,k,a,i,u,h,p,v,H]),Se=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j),ee.current=[],Vo(j)&&Promise.resolve(o(j)).then(function(Y){Ro(j)&&!M||le(Y,j)}).catch(function(Y){return oe(Y)}),V({type:"reset"})},[o,le,oe,M]),K=T.useCallback(function(){if(Q.current){V({type:"openDialog"}),U();var j={multiple:s,types:G};window.showOpenFilePicker(j).then(function(Y){return o(Y)}).then(function(Y){le(Y,null),V({type:"closeDialog"})}).catch(function(Y){KS(Y)?(Z(Y),V({type:"closeDialog"})):YS(Y)?(Q.current=!1,$.current?($.current.value=null,$.current.click()):oe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):oe(Y)});return}$.current&&(V({type:"openDialog"}),U(),$.current.value=null,$.current.click())},[V,U,Z,w,le,oe,G,s]),Ee=T.useCallback(function(j){!P.current||!P.current.isEqualNode(j.target)||(j.key===" "||j.key==="Enter"||j.keyCode===32||j.keyCode===13)&&(j.preventDefault(),K())},[P,K]),He=T.useCallback(function(){V({type:"focus"})},[]),Ue=T.useCallback(function(){V({type:"blur"})},[]),Dt=T.useCallback(function(){E||(US()?setTimeout(K,0):K())},[E,K]),ot=function(Y){return r?null:Y},C=function(Y){return x?null:ot(Y)},A=function(Y){return O?null:ot(Y)},R=function(Y){M&&Y.stopPropagation()},te=T.useMemo(function(){return function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=j.refKey,ye=Y===void 0?"ref":Y,be=j.role,Te=j.onKeyDown,Mt=j.onFocus,ct=j.onBlur,Ve=j.onClick,Ht=j.onDragEnter,Ut=j.onDragOver,Wt=j.onDragLeave,Ce=j.onDrop,an=jo(j,ZS);return Fe(Fe(us({onKeyDown:C(Nt(Te,Ee)),onFocus:C(Nt(Mt,He)),onBlur:C(Nt(ct,Ue)),onClick:ot(Nt(Ve,Dt)),onDragEnter:A(Nt(Ht,ie)),onDragOver:A(Nt(Ut,de)),onDragLeave:A(Nt(Wt,ue)),onDrop:A(Nt(Ce,Se)),role:typeof be=="string"&&be!==""?be:"presentation"},ye,P),!r&&!x?{tabIndex:0}:{}),an)}},[P,Ee,He,Ue,Dt,ie,de,ue,Se,x,O,r]),J=T.useCallback(function(j){j.stopPropagation()},[]),X=T.useMemo(function(){return function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=j.refKey,ye=Y===void 0?"ref":Y,be=j.onChange,Te=j.onClick,Mt=jo(j,QS),ct=us({accept:k,multiple:s,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(Nt(be,Se)),onClick:ot(Nt(Te,J)),tabIndex:-1},ye,$);return Fe(Fe({},ct),Mt)}},[$,n,s,Se,r]);return Fe(Fe({},N),{},{isFocused:_&&!r,getRootProps:te,getInputProps:X,rootRef:P,inputRef:$,open:ot(K)})}function lC(e,t){switch(t.type){case"focus":return Fe(Fe({},e),{},{isFocused:!0});case"blur":return Fe(Fe({},e),{},{isFocused:!1});case"openDialog":return Fe(Fe({},fs),{},{isFileDialogActive:!0});case"closeDialog":return Fe(Fe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Fe(Fe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Fe(Fe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Fe({},fs);default:return e}}function Uf(){}const cC=({onFilesSelected:e,children:t})=>{const[n,r]=T.useState(!1),{getRootProps:o,getInputProps:i}=Hf({noClick:!0,onDrop:a=>{if(a&&a.length>0)if(a[0].path.split("/").length>2){const u=a.map(c=>{const g=(c.path||c.relativePath||"").split("/").slice(1).join("/");return(!c.webkitRelativePath||c.webkitRelativePath==="")&&Object.defineProperty(c,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),c});e(u,"folder")}else e(a,"files");r(!1)},onDragOver:a=>{a.preventDefault(),n||r(!0)},multiple:!0});return T.useEffect(()=>{const a=s=>{s.clientX===0&&s.clientY===0&&r(!1)};return document.addEventListener("dragleave",a),()=>{document.removeEventListener("dragleave",a)}},[]),l.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?l.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):t,l.jsx("input",{...i()})]})},uC=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:i,ignoreCache:a})=>{var b;const[s,u]=T.useState({}),[c,d]=T.useState(!1),[g,h]=T.useState(!1),[p,v]=T.useState(""),{toast:m}=So();T.useEffect(()=>{e&&y(p)},[p,e]);const y=async S=>{try{h(!0);const E=await he.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{m({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{h(!1)}},w=async()=>{d(!0);try{const S=o.key,E=S.endsWith("/")?S:`${S}/`,x=p.endsWith("/")?p:`${p}/`;if(E===x||S===p){m({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),d(!1);return}await he.post(`${n}/api/move`,{oldPath:S,newPath:p}),a.current=!0,await i(),m({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${p}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),m({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{d(!1)}};return l.jsx(Rt,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(St,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(Ct,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),p.split("/").map((S,E,x)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":x.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(Et,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["( file Hoặc folder sẽ được di chuyển đến thư mục"," ",p===""?"Root":p," )"]})]}),l.jsx(Dn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:g?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(s))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(pn,{className:"flex justify-end space-x-2",children:[l.jsx(we,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(we,{onClick:w,disabled:c,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};Kt(he,{retries:3});const rt={current:!1},Wf="crawl:jobs",Wn="crawl:current_job",dC=e=>{const[t,n]=T.useState(null),[r,o]=T.useState(0);return T.useEffect(()=>{const i=localStorage.getItem(Wn);if(i){const a=JSON.parse(i);n(a),a!=null&&a.startTime&&o(Math.floor((Date.now()-a.startTime)/1e3))}},[]),T.useEffect(()=>{if(!(t!=null&&t.startTime))return;const i=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(i)},[t==null?void 0:t.startTime]),T.useEffect(()=>{if(!(t!=null&&t.id))return;const i=async()=>{try{const u=(await he.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const d={...c,status:u};return localStorage.setItem(Wn,JSON.stringify(d)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Wn)},100),d})}catch(s){console.error("Error polling job status:",s)}},a=setInterval(i,3e3);return i(),()=>clearInterval(a)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:i=>{i&&!i.startTime&&(i.startTime=Date.now()),n(i),i?localStorage.setItem(Wn,JSON.stringify(i)):localStorage.removeItem(Wn)}}},zo=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(a=>{n.push(a.key),a.isFolder&&r(a.key)})};return r(t),n},fC=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...zo(e,o.key))}),n},pC=(e,t,n=[],r,o,i)=>{const[a,s]=T.useState({}),[u,c]=T.useState(!1),[d,g]=T.useState(null),[h,p]=T.useState(0),v=T.useRef(t);T.useEffect(()=>{v.current=t},[t]);const m=async()=>{c(!0);try{const w=await he.get(`${e}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:v.current},timeout:3e5});s(w.data),g(null)}catch(w){g(w instanceof Error?w:new Error("Failed to fetch files"))}finally{c(!1),p(0),i("")}},y=async w=>{var b,S;try{if(!w)return;c(!0);const E=await he.get(`${e}/api/search-db?query=${w}&rootPrefix=${t}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return s({[t]:((b=E==null?void 0:E.data)==null?void 0:b.result)||[]}),p(((S=E==null?void 0:E.data)==null?void 0:S.estimatedTotalHits)||0),E}catch(E){g(E instanceof Error?E:new Error("Failed to fetch files"))}finally{c(!1)}};return T.useEffect(()=>{!r&&!u&&m(),r&&!u&&y(r)},[r,o]),{data:a,isLoading:u,error:d,estimatedTotalHits:h,refetch:m}},hr=e=>{var r,o,i;const t=((i=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:i.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},gC=T.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=s=>console.log("Đã chọn:",s),displayPrefixes:i,preSelectedFiles:a})=>{var hp;const[s,u]=T.useState([]),[c,d]=T.useState(""),[g,h]=T.useState(new Set),[p,v]=T.useState(n),[m,y]=T.useState(""),[w,b]=T.useState(!1),[S,E]=T.useState(""),[x,O]=T.useState(!1),[M,I]=T.useState(null),[H,k]=T.useState(null),[G,U]=T.useState(!1),[Z,P]=T.useState(!1),[$,F]=T.useState(null),W=T.useRef(null),{toast:N}=So(),[V,_]=T.useState(null),[B,Q]=T.useState(null),[ne,ee]=T.useState(""),[ce,oe]=T.useState(!1),[ie,de]=T.useState(!1),[ue,le]=T.useState(new Set),[Se,K]=T.useState(""),[Ee,He]=T.useState(!1),[Ue,Dt]=T.useState(!1),[ot,C]=T.useState("rename"),[A,R]=T.useState(!1),[te,J]=T.useState(""),[X,j]=T.useState("1"),[Y,ye]=T.useState(!1),[be,Te]=T.useState(!1),[Mt,ct]=T.useState(!1),[Ve,Ht]=T.useState(1),[Ut,Wt]=T.useState(!1),{currentJob:Ce,elapsedTime:an,setCurrentJob:Gn}=dC(t),[ut,xn]=T.useState(null),[br,Ko]=T.useState(""),[VC,Sr]=T.useState(!1),jC=new URL(window.location.href).searchParams.get("prefix")||"",zC=n+jC||m||n,{data:$t,isLoading:bs,error:BC,estimatedTotalHits:Cr,refetch:it}=pC(t,zC,i,c,Ve,d);T.useEffect(()=>{const D=new Set(a);h(D)},[]),T.useEffect(()=>{Ce!=null&&Ce.status&&(Ce.status.status==="completed"?(N({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Ce.url} với ${Ce.status.completed} trang`}),rt.current=!0,it()):Ce.status.status==="failed"&&N({title:"Thu thập website thất bại",description:`Không thể thu thập ${Ce.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(hp=Ce==null?void 0:Ce.status)==null?void 0:hp.status]);const fp=T.useMemo(()=>$t[p]||[],[$t,p]),sn=T.useMemo(()=>fp,[fp,p,$t]),Er=T.useMemo(()=>{const D={};return sn.forEach((z,q)=>{g.has(z.key)&&(D[q]=!0)}),D},[g,sn]),HC=D=>{const z=zo($t,D);if(z.length===0)return g.has(D)?"all":"none";const q=z.filter(re=>g.has(re)).length;return q===0?"none":q===z.length?"all":"partial"},Kn=(D,z=!0)=>{if(p!==D&&(Wt(!0),y(D),v(D),h(new Set),z)){console.log("🚀 ~ handleFolderClick ~ prefix:",D);const q=window.location.pathname==="/"?"":window.location.pathname,re=D?`${window.location.origin}${q}?prefix=${encodeURIComponent(D)}`:`${window.location.origin}${q}`;console.log("🚀 ~ useEffect ~ basePath:",q),console.log("🚀 ~ useEffect ~ newUrl:",re),window.history.pushState({path:re},"",re)}};T.useEffect(()=>{Ut&&(rt.current=!0,it().finally(()=>Wt(!1)))},[Ut]);const UC=async(D,z)=>{var q,re;O(!0);try{if(sn.some(Ge=>Ge.isFolder&&Ge.name.toLowerCase()===D.toLowerCase())){N({title:"Lỗi",description:`Thư mục "${D}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),O(!1);return}const me=`${z}${D}/`;if((await he.post(`${t}/api/create-folder`,{prefix:me})).status!==200){N({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}rt.current=!0,await it(),N({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${D}"`}),E(""),b(!1)}catch(se){console.error("Error creating folder:",se);const me=((re=(q=se==null?void 0:se.response)==null?void 0:q.data)==null?void 0:re.error)||"Không thể tạo thư mục";N({title:"Lỗi",description:me,variant:"destructive"})}finally{O(!1)}},Ss=async(D,z,q)=>{var re,se,me,ke,Ge,Yn,vp,yp,xp;F(q),Te(!0);try{if(Array.from(D).reduce((Ke,Ar)=>Ke+Ar.size,0)>=100*1024*1024){N({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),F(null),Te(!1);return}const Xo=Array.from(D).filter(Ke=>Ke.size===0);if(Xo.length>0){const Ke=Xo.map(Ar=>Ar.name).join(", ");N({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${Ke}`,variant:"destructive"}),Te(!1),F(null);return}let _r=localStorage.getItem("dataLogin"),Xn;try{_r&&(_r=JSON.parse(_r),Xn=_r.user)}catch{_r=null}const wn=new FormData;if(Xn!=null&&Xn.id&&wn.append("metadata",JSON.stringify({creator:Xn.username,creatorId:Xn.id,DataSource:"Tệp tải lên"})),q==="folder"&&D[0]){const Ke=D[0].webkitRelativePath.split("/")[0];Ke&&wn.append("folderName",Ke)}wn.append("prefix",z),Array.from(D).forEach(Ke=>q==="folder"?wn.append("files",Ke,Ke.webkitRelativePath):wn.append("files",Ke)),rt.current=!0;const je=await he.post(`${t}/api/check-files-existed`,wn,{headers:{"Content-Type":"multipart/form-data"}});if(((re=je==null?void 0:je.data)==null?void 0:re.status)===200)await he.post(`${t}/api/upload`,wn,{headers:{"Content-Type":"multipart/form-data"}}),d(""),y(z),setTimeout(async()=>{F(null),await it(),Te(!1)},500);else{if(((me=(se=je==null?void 0:je.data)==null?void 0:se.names)==null?void 0:me.length)>0&&!((ke=je==null?void 0:je.data)!=null&&ke.isFolder)){const Ke=Array.from(D).filter(Ar=>je.data.names.includes(Ar.name));xn(Ke),Sr(!0)}(Ge=je==null?void 0:je.data)!=null&&Ge.isFolder&&((Yn=je==null?void 0:je.data)!=null&&Yn.name)&&(Ko((vp=je==null?void 0:je.data)==null?void 0:vp.name),xn(D),Sr(!0))}}catch(Tr){console.error("Lỗi tải lên:",Tr);const Xo=((xp=(yp=Tr==null?void 0:Tr.response)==null?void 0:yp.data)==null?void 0:xp.error)||"Không thể tải lên tập tin";N({title:"Lỗi",description:Xo,variant:"destructive"}),F(null),Te(!1)}},WC=async()=>{var D,z;try{Te(!0);const q=new FormData;if(ut){F(br?"folder":"files"),Sr(!1);let re=localStorage.getItem("dataLogin"),se;try{re&&(re=JSON.parse(re),se=re.user)}catch{re=null}if(se!=null&&se.id&&(console.log("🚀 ~ uploadFiles ~ user:",se),q.append("metadata",JSON.stringify({creator:se.username,creatorId:se.id,DataSource:"Tệp tải lên"}))),br&&ut[0]){const me=ut[0].webkitRelativePath.split("/")[0];me&&q.append("folderName",me)}q.append("prefix",p),Array.from(ut).forEach(me=>br&&ut[0]?q.append("files",me,me.webkitRelativePath):q.append("files",me)),se!=null&&se.id&&q.append("metadata",JSON.stringify({creator:se.username,creatorId:se.id,DataSource:"Tệp tải lên"})),await he.post(`${t}/api/upload`,q,{headers:{"Content-Type":"multipart/form-data"}}),d(""),y(p),rt.current=!0}}catch(q){console.error("Lỗi tải lên:",q);const re=((z=(D=q==null?void 0:q.response)==null?void 0:D.data)==null?void 0:z.error)||"Không thể tải lên tập tin";N({title:"Lỗi",description:re,variant:"destructive"})}finally{setTimeout(async()=>{F(null),await it(),Te(!1),Ko(""),xn(null)},500)}},qC=async D=>{var z;try{if(await he.delete(`${t}/api/files`,{data:{paths:[D.key]}}),g.has(D.key)){const re=new Set(g);re.delete(D.key),h(re)}const q=((z=D.key)==null?void 0:z.replace(/^(.*?)(\/.*)?$/,(re,se,me)=>!me||me==="/"?"":se+"/"))||"";y(q),rt.current=!0,N({title:"Đã xóa tập tin",description:`Đã xóa thành công "${D.name}"`}),I(null)}catch(q){console.error("Error deleting file:",q),N({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{ct(!1),await it()}},Yo=D=>{const z=new Set(g),q=typeof D=="function"?D(Er):D;new Set(Object.keys(Er).map(Number)).forEach(se=>{const me=sn[se];me&&(q[se]||(z.delete(me.key),me.isFolder&&zo($t,me.key).forEach(ke=>z.delete(ke))))}),Object.entries(q).forEach(([se,me])=>{const ke=parseInt(se),Ge=sn[ke];Ge&&me&&(z.add(Ge.key),Ge.isFolder&&zo($t,Ge.key).forEach(Yn=>z.add(Yn)))}),h(z)},GC=async()=>{var D;U(!0);try{const z=Array.from(g),q=z.map(se=>Object.values($t).flat().find(me=>me.key===se)).filter(se=>se!==void 0);if(q.length===0){N({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await he.delete(`${t}/api/files`,{data:{paths:z}});const re=((D=q[0])==null?void 0:D.key.replace(/^(.*?)(\/.*)?$/,(se,me,ke)=>!ke||ke==="/"?"":me+"/"))||"";y(re),rt.current=!0,it(),N({title:"Đã xóa tập tin",description:`Đã xóa thành công ${q.length} mục`}),P(!1),h(new Set)}catch(z){console.error("Error deleting files:",z),N({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{U(!1)}},KC=async(D,z)=>{if(!p.trim()){N({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}de(!0);try{const q=D.key;let re;D.isFolder?re=q.split("/").slice(0,-2).join("/")+"/":re=q.substring(0,q.lastIndexOf("/")+1);const se=re+z+(D.isFolder?"/":"");await he.post(`${t}/api/rename`,{oldPath:q,newPath:se}),rt.current=!0,await it(),N({title:"Đã đổi tên",description:`Đã đổi tên thành công "${D.name}" thành "${z}"`}),_(null),ee(""),Q(null)}catch(q){console.error("Error renaming item:",q),N({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{de(!1)}},pp=async D=>{le(z=>new Set([...z,...D]));try{const z=await he.post(`${t}/api/download`,{paths:D},{responseType:"blob"}),q=window.URL.createObjectURL(z.data),re=document.createElement("a");re.href=q;const se=z.headers["Content-Disposition"]||z.headers["content-disposition"],me=se==null?void 0:se.match(/filename="(.+)"/),ke=me?decodeURIComponent(me[1]):"download.zip";re.setAttribute("download",ke),document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(q),N({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${D.length} mục${D.length>1,""}`})}catch(z){console.error("Error downloading files:",z),N({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{le(z=>{const q=new Set(z);return D.forEach(re=>q.delete(re)),q})}},gp=p?p.replace(n,"").split("/").filter(Boolean):[],YC=()=>Array.from(g).map(D=>{var z;for(const q in $t){const re=(z=$t[q])==null?void 0:z.find(se=>se.key===D);if(re)return re}return null}).filter(D=>D!==null),mp=T.useMemo(()=>{const D=[{id:"select",header:()=>{const z=fC($t,p),q=z.length>0&&z.every(se=>g.has(se)),re=z.some(se=>g.has(se));return l.jsx(Ui,{checked:q?!0:re?"indeterminate":!1,onCheckedChange:se=>{if(se){const me=sn.reduce((ke,Ge,Yn)=>(ke[Yn]=!0,ke),{});Yo(me)}else Yo({})},"aria-label":"Chọn tất cả"})},cell:({row:z})=>{const q=z.original,se=q.isFolder?HC(q.key):g.has(q.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Ui,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:me=>{const ke={...Er};me?ke[z.index]=!0:delete ke[z.index],Yo(ke)},"aria-label":"Chọn dòng"})})},enableSorting:!1,size:50},{id:"fileName",size:"100%",header:({column:z})=>l.jsxs(we,{variant:"ghost",onClick:()=>z.toggleSorting(z.getIsSorted()==="asc"),className:"px-0",children:["Tên tập tin",l.jsx(ki,{})]}),accessorKey:"name",cell:({row:z})=>{const q=z.original,re=q.key.substring(0,q.key.lastIndexOf("/"))||"/",se=c.trim()!==""&&re!==p,me=re.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${q.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{q.isFolder&&(h(new Set),Kn(q.key))},children:[q.isFolder?l.jsx(Zo,{className:"h-5 w-5 text-blue-500"}):null,q.name]}),se&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Zo,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Kn("")},children:"/"}),me.map((ke,Ge)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Kn(me.slice(0,Ge+1).join("/")+"/")},children:ke}),Ge<me.length-1&&l.jsx("span",{children:"/"})]},Ge))]})]})]})}}];return r||D.push({id:"size",header:({column:z})=>l.jsxs(we,{variant:"ghost",onClick:()=>z.toggleSorting(z.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Kích thước",l.jsx(ki,{})]}),accessorKey:"size",cell:({getValue:z,row:q})=>{const re=z();return l.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:l.jsx("span",{children:q.original.isFolder?"-":Yh(re)})})},size:100},{id:"lastModified",header:({column:z})=>l.jsxs(we,{variant:"ghost",onClick:()=>z.toggleSorting(z.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",l.jsx(ki,{})]}),accessorKey:"lastModified",cell:({row:z})=>{const q=z.original.lastModified;return l.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:l.jsx("span",{children:q&&Ol(q).isValid()?Ol(q).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",size:200,header:()=>l.jsx(we,{variant:"ghost",className:"w-full flex-row justify-end",children:"Hành động"}),accessorKey:"key",cell:({row:z})=>l.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>pp([z.original.key]),className:"h-8 w-8 p-0",disabled:ue.has(z.original.key),children:ue.has(z.original.key)?l.jsx($e,{className:"h-4 w-4 animate-spin"}):l.jsx(Ts,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Tải xuống"})]})}),p.trim()!==""&&l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>{_(z.original),ee(z.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Fp,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Đổi tên"})]})}),l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>{oe(!0),k(z.original)},className:"h-8 w-8 p-0",children:l.jsx(ch,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Di chuyển"})]})}),l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>I(z.original),className:"h-8 w-8 p-0",children:l.jsx(_s,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Xóa"})]})})]})}),D},[g,sn,Er,ue,r]),Cs=Vs({data:sn,columns:mp,state:{rowSelection:Er,sorting:s},onSortingChange:u,enableRowSelection:!0,onRowSelectionChange:Yo,getCoreRowModel:Rs(),getSortedRowModel:pg()}),XC=async D=>{var z,q;He(!0);try{if(hr(D)){const re=await he.get(`${t}/api/read-text`,{params:{path:D.key}});K(re.data.content)}try{const re=await he.get(`${t}/api/read-json`,{params:{path:D.key+".metadata.json"}}),se=((q=(z=re==null?void 0:re.data)==null?void 0:z.content)==null?void 0:q.metadataAttributes)||null;return Q({fullPath:V==null?void 0:V.key,...se})}catch{return Q("Lỗi phân tích siêu dữ liệu")}}catch(re){console.error("Error loading file content:",re),N({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{He(!1)}},JC=async(D,z)=>{Dt(!0);try{await he.post(`${t}/api/modify-text`,{path:D.key,content:z}),N({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),rt.current=!0,await it(),_(null),K(""),C("rename")}catch(q){console.error("Error saving file content:",q),N({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Dt(!1)}},ZC=async D=>{Dt(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",B),await he.post(`${t}/api/modify-json`,{path:D.key+".metadata.json",content:{metadataAttributes:B}}),N({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),rt.current=!0,await it(),_(null),K(""),C("rename")}catch(z){console.error("Error saving file content:",z),N({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Dt(!1)}};T.useEffect(()=>{V&&(V.isFolder||XC(V),C("rename"))},[V]);const QC=async(D,z)=>{var q;if(Ce){N({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}ye(!0);try{const{data:re}=await he.post(`${t}/api/crawl`,{url:D,limit:z,prefix:p});if(re.id){Gn({id:re.id,url:D,limit:z,prefix:p,taskId:((q=re.task)==null?void 0:q.id)||""});const se=localStorage.getItem(Wf),me=se?JSON.parse(se):[];me.some(ke=>ke.id===re.id)||(me.unshift({url:D,id:re.id,limit:z,prefix:p,timestamp:Date.now()}),me.length>20&&(me.length=20),localStorage.setItem(Wf,JSON.stringify(me))),N({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${D} với giới hạn ${z}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),R(!1),J(""),j("1")}}catch(re){console.error("Error crawling website:",re),N({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{ye(!1)}},eE=async()=>{try{if(!(Ce!=null&&Ce.id))return;Gn(null),localStorage.removeItem(Wn),N({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Ce.url}`})}catch(D){console.error("Error stopping job:",D),N({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return T.useEffect(()=>{const D=()=>{const q=new URL(window.location.href).searchParams.get("prefix")||"";q?Kn(n+q,!1):(h(new Set),y(""),v(""),rt.current=!0,setTimeout(()=>{it()},0))};return D(),window.addEventListener("popstate",D),()=>{window.removeEventListener("popstate",D)}},[]),l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(rd,{}),l.jsx(Rt,{open:VC,onOpenChange:D=>{Sr(D),D||(Ko(""),xn(null),Te(!1),F(null))},children:l.jsxs(St,{children:[l.jsxs(Ct,{children:[l.jsx(Et,{children:"Cảnh báo trùng lặp"}),l.jsxs(Dn,{children:[br&&l.jsxs(l.Fragment,{children:["Folder $",br," đã có."]}),ut&&ut.length>0&&l.jsxs(l.Fragment,{children:["Những tệp sau bị lặp:",l.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(ut).map((D,z)=>l.jsx("li",{children:D.name},z))})]})]})]}),l.jsxs(pn,{children:[l.jsx(we,{variant:"outline",onClick:()=>{Sr(!1),Ko(""),xn(null),Te(!1),F(null)},children:"Bỏ qua"}),l.jsx(we,{variant:"destructive",onClick:()=>WC(),children:"Ghi đè"})]})]})}),l.jsx(Ul,{className:"s3-explr-breadcrumb",children:l.jsxs(Wl,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Vi,{className:"s3-explr-breadcrumb-item",children:l.jsx(ji,{onClick:()=>Kn(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),gp.map((D,z)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(ql,{className:"s3-explr-breadcrumb-separator"},`sep-${z}`),l.jsx(Vi,{className:"s3-explr-breadcrumb-item",children:l.jsx(ji,{onClick:()=>Kn(n+gp.slice(0,z+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:D})},`item-${D}`)]},z))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(aS,{ref:W,onChange:D=>d(D)})}),l.jsxs(we,{variant:"outline",size:"sm",onClick:()=>{y(p),rt.current=!0,it()},disabled:bs,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Sp,{className:`h-4 w-4 s3-explr-refresh-icon ${bs?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[g.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(we,{variant:"outline",size:"sm",onClick:()=>pp(Array.from(g)),disabled:Array.from(g).some(D=>ue.has(D)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(g).some(D=>ue.has(D))?l.jsx($e,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ts,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",g.size,")"]}),l.jsxs(Rt,{open:Z,onOpenChange:P,children:[l.jsx(no,{asChild:!0,children:l.jsxs(we,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(_s,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",g.size,")"]})}),l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsxs(Ct,{className:"s3-explr-dialog-header",children:[l.jsx(Et,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(Dn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",g.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>P(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(we,{variant:"destructive",onClick:GC,disabled:G,className:"s3-explr-confirm-delete-btn",children:G?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Rt,{open:w,onOpenChange:b,children:[l.jsx(no,{asChild:!0,children:l.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!i&&!p,children:[l.jsx(_p,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsx(Ct,{className:"s3-explr-dialog-header",children:l.jsx(Et,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(en,{disabled:x,id:"name",value:S,onChange:D=>E(D.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(we,{onClick:()=>{S.trim()&&UC(S,p)},disabled:x,className:"s3-explr-create-btn",children:[x&&l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),x?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const D=document.createElement("input");D.type="file",D.multiple=!0,D.onchange=z=>{const q=z.target.files;q&&Ss(q,p,"files")},D.click()},disabled:$!==null||!!i&&!p,children:$==="files"?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ep,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const D=document.createElement("input");D.type="file",D.multiple=!0,D.webkitdirectory=!0,D.onchange=z=>{const q=z.target.files;q&&Ss(q,p,"folder")},D.click()},disabled:$!==null||!!i&&!p,children:$==="folder"?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zo,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),Ce?l.jsx(zn,{delayDuration:0,children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx($e,{className:"h-4 w-4 animate-spin s3-explr-loader"}),Ce.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",Ce.status.completed,"/",Ce.status.total,") - ",Math.floor(an/60),":",String(an%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(we,{variant:"destructive",size:"sm",onClick:()=>void eE(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Dp,{className:"h-4 w-4"})]})]})}),Ce.status&&l.jsx(hn,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Ce.url]}),l.jsxs("p",{children:["Tiến độ: ",Ce.status.completed,"/",Ce.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(an/60),":",String(an%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",Ce.status.status==="scraping"?"Đang thu thập":Ce.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Rt,{open:A,onOpenChange:R,children:[l.jsx(no,{asChild:!0,children:l.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!i&&!p,children:[l.jsx(Np,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsxs(Ct,{className:"s3-explr-dialog-header",children:[l.jsx(Et,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(Dn,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(en,{id:"websiteUrl",value:te,onChange:D=>J(D.target.value),placeholder:"https://example.com",type:"url",disabled:Y,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(en,{id:"crawlLimit",value:X,onChange:D=>{const z=D.target.value;/^\d*$/.test(z)&&j(z)},placeholder:"1",type:"text",disabled:Y,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>{R(!1),J(""),j("1")},disabled:Y,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(we,{onClick:()=>{te.trim()&&QC(te.trim(),parseInt(X)||1)},disabled:Y||!te.trim(),className:"s3-explr-crawl-btn",children:Y?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Rt,{open:!!M,onOpenChange:D=>!D&&I(null),children:l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsxs(Ct,{className:"s3-explr-dialog-header",children:[l.jsx(Et,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(Dn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",M==null?void 0:M.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>I(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(we,{variant:"destructive",onClick:()=>qC(M),disabled:Mt,className:"s3-explr-confirm-delete-btn",children:Mt?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Rt,{open:!!V,onOpenChange:D=>{D||(_(null),Q(null),ee(""),K(""),C("rename"))},children:l.jsxs(St,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(Ct,{className:"s3-explr-dialog-header",children:l.jsx(Et,{className:"s3-explr-dialog-title",children:V!=null&&V.isFolder?"Đổi tên thư mục":hr(V)?"Quản lý tập tin":"Đổi tên tập tin"})}),V&&l.jsxs(Cx,{value:ot,onValueChange:D=>C(D),children:[l.jsxs(Ou,{"aria-checked":!hr(V),"aria-disabled":V.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(mo,{value:"rename",children:"Đổi tên"}),!V.isFolder&&l.jsxs(l.Fragment,{children:[hr(V)&&l.jsx(mo,{value:"edit",children:"Sửa nội dung"}),l.jsx(mo,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(ho,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(en,{id:"newName",value:ne,onChange:D=>ee(D.target.value),placeholder:"Nhập tên mới",disabled:ie,className:"s3-explr-input"})]})})}),!V.isFolder&&l.jsxs(l.Fragment,{children:[hr(V)&&l.jsx(ho,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:Ee?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx($e,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(gn,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(ar,{id:"content",value:Se,onChange:D=>K(D.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Ue})]})})}),l.jsx(ho,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:Ee?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx($e,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:B&&typeof B=="object"&&Object.entries(B).map(([D,z],q)=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(gn,{htmlFor:D,className:"s3-explr-label flex items-center gap-1",children:[fh[D]||D,Mi(D)&&l.jsx(uh,{className:"h-[12px] w-[12px] text-red-500"})]}),ph(D)?l.jsx(ar,{id:D,value:typeof z=="string"?z:JSON.stringify(z),onChange:re=>{const se={...B,[D]:re.target.value};Q(se)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Ue||Mi(D)}):l.jsx(en,{id:D,value:typeof z=="string"?z:JSON.stringify(z),onChange:re=>{const se={...B,[D]:re.target.value};Q(se)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:Ue||Mi(D)})]},q))})})})]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>{_(null),Q(null),ee(""),K("")},className:"s3-explr-cancel-btn",children:"Hủy"}),ot==="edit"?l.jsx(we,{onClick:()=>V&&JC(V,Se),disabled:Ue||Ee,className:"s3-explr-save-btn",children:Ue?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):ot==="edit-metadata"?l.jsx(we,{onClick:()=>B&&typeof B=="object"&&V&&ZC(V),disabled:Ue||Ee,className:"s3-explr-save-btn",children:Ue?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(we,{onClick:()=>{ne.trim()&&V&&KC(V,ne.trim())},disabled:ie||!ne.trim()||ne.trim()===(V==null?void 0:V.name),className:"s3-explr-rename-btn",children:ie?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),H&&ce&&l.jsx(uC,{openDialogRename:ce,setOpenDialogRename:oe,apiBaseUrl:t,setFileToMove:k,fileToMove:H,refreshFiles:it,ignoreCache:rt})]})]}),BC&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx(cC,{onFilesSelected:(D,z)=>Ss(D,p,z),children:l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(lo,{className:"s3-explr-table",children:[l.jsx(co,{className:"s3-explr-table-header",children:Cs.getHeaderGroups().map(D=>l.jsx(ht,{className:"hover:bg-transparent s3-explr-header-row",children:D.headers.map(z=>l.jsx(Tt,{className:"s3-explr-header-cell",style:{width:z.getSize()},children:z.isPlaceholder?null:Dr(z.column.columnDef.header,z.getContext())},z.id))},D.id))}),l.jsx(uo,{className:"s3-explr-table-body",children:Cs.getRowModel().rows.length===0?l.jsx(ht,{className:"s3-explr-empty-row",children:l.jsx(Xe,{colSpan:mp.length,className:"h-24 text-center s3-explr-empty-cell",children:c?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',c,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:bs?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):Cs.getRowModel().rows.map(D=>l.jsx(ht,{className:"h-12 s3-explr-row",children:D.getVisibleCells().map(z=>l.jsx(Xe,{className:"align-middle s3-explr-cell",children:Dr(z.column.columnDef.cell,z.getContext())},z.id))},D.id))})]})})}),c&&Cr!==0&&l.jsx(l.Fragment,{children:l.jsx(ro,{children:l.jsxs(oo,{children:[l.jsx(io,{onClick:()=>Ht(D=>Math.max(D-1,1)),"aria-disabled":Ve===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(Cr/20)},(D,z)=>{const q=z+1,re=Math.ceil(Cr/20);return re>7&&!(q===1||q===re||q>=Ve-1&&q<=Ve+1)?q===Ve-2&&Ve>4||q===Ve+2&&Ve<re-3?l.jsx(so,{className:"pointer-events-none",children:"..."},z):null:l.jsx(mt,{className:"cursor-pointer",children:l.jsx(Mn,{isActive:Ve===q,onClick:()=>Ht(q),className:`${Ve===q?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:q})},z)}),l.jsx(mt,{children:l.jsx(ao,{onClick:()=>Ht(D=>Math.min(D+1,Math.ceil(Cr/20))),"aria-disabled":Ve===Math.ceil(Cr/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[g.size," ",(g.size===1,"tập tin")," đã chọn"]}),l.jsx(we,{variant:"default",onClick:()=>o(YC()),disabled:g.size===0,className:"s3-explr-ok-btn",children:"OK"})]})]})});var vr=e=>e.type==="checkbox",yn=e=>e instanceof Date,qe=e=>e==null;const qf=e=>typeof e=="object";var Me=e=>!qe(e)&&!Array.isArray(e)&&qf(e)&&!yn(e),mC=e=>Me(e)&&e.target?vr(e.target)?e.target.checked:e.target.value:e,hC=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,vC=(e,t)=>e.has(hC(t)),yC=e=>{const t=e.constructor&&e.constructor.prototype;return Me(t)&&t.hasOwnProperty("isPrototypeOf")},ps=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function lt(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ps&&(e instanceof Blob||r))&&(n||Me(e)))if(t=n?[]:{},!n&&!yC(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=lt(e[o]));else return e;return t}var Bo=e=>Array.isArray(e)?e.filter(Boolean):[],De=e=>e===void 0,ae=(e,t,n)=>{if(!t||!Me(e))return n;const r=Bo(t.split(/[,[\].]+?/)).reduce((o,i)=>qe(o)?o:o[i],e);return De(r)||r===e?De(e[t])?n:e[t]:r},Ot=e=>typeof e=="boolean",gs=e=>/^\w*$/.test(e),Gf=e=>Bo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(e,t,n)=>{let r=-1;const o=gs(t)?[t]:Gf(t),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let u=n;if(r!==a){const c=e[s];u=Me(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=u,e=e[s]}return e};const Kf={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};T.createContext(null);var xC=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==xt.all&&(t._proxyFormState[a]=!r||xt.all),e[a]}});return o},Je=e=>Me(e)&&!Object.keys(e).length,wC=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Je(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===xt.all)},Ho=e=>Array.isArray(e)?e:[e];function bC(e){const t=T.useRef(e);t.current=e,T.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Ft=e=>typeof e=="string",SC=(e,t,n,r,o)=>Ft(e)?(r&&t.watch.add(e),ae(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),ae(n,i))):(r&&(t.watchAll=!0),n),CC=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Yf=e=>({isOnSubmit:!e||e===xt.onSubmit,isOnBlur:e===xt.onBlur,isOnChange:e===xt.onChange,isOnAll:e===xt.all,isOnTouch:e===xt.onTouched}),Xf=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const yr=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=ae(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(yr(s,t))break}else if(Me(s)&&yr(s,t))break}}};var EC=(e,t,n)=>{const r=Ho(ae(e,n));return Oe(r,"root",t[n]),Oe(e,n,r),e},ms=e=>e.type==="file",kt=e=>typeof e=="function",Uo=e=>{if(!ps)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Wo=e=>Ft(e),hs=e=>e.type==="radio",qo=e=>e instanceof RegExp;const Jf={value:!1,isValid:!1},Zf={value:!0,isValid:!0};var Qf=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!De(e[0].attributes.value)?De(e[0].value)||e[0].value===""?Zf:{value:e[0].value,isValid:!0}:Zf:Jf}return Jf};const ep={isValid:!1,value:null};var tp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ep):ep;function np(e,t,n="validate"){if(Wo(e)||Array.isArray(e)&&e.every(Wo)||Ot(e)&&!e)return{type:n,message:Wo(e)?e:"",ref:t}}var qn=e=>Me(e)&&!qo(e)?e:{value:e,message:""},rp=async(e,t,n,r,o)=>{const{ref:i,refs:a,required:s,maxLength:u,minLength:c,min:d,max:g,pattern:h,validate:p,name:v,valueAsNumber:m,mount:y,disabled:w}=e._f,b=ae(t,v);if(!y||w)return{};const S=a?a[0]:i,E=U=>{r&&S.reportValidity&&(S.setCustomValidity(Ot(U)?"":U||""),S.reportValidity())},x={},O=hs(i),M=vr(i),I=O||M,H=(m||ms(i))&&De(i.value)&&De(b)||Uo(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,k=CC.bind(null,v,n,x),G=(U,Z,P,$=Bt.maxLength,F=Bt.minLength)=>{const W=U?Z:P;x[v]={type:U?$:F,message:W,ref:i,...k(U?$:F,W)}};if(o?!Array.isArray(b)||!b.length:s&&(!I&&(H||qe(b))||Ot(b)&&!b||M&&!Qf(a).isValid||O&&!tp(a).isValid)){const{value:U,message:Z}=Wo(s)?{value:!!s,message:s}:qn(s);if(U&&(x[v]={type:Bt.required,message:Z,ref:S,...k(Bt.required,Z)},!n))return E(Z),x}if(!H&&(!qe(d)||!qe(g))){let U,Z;const P=qn(g),$=qn(d);if(!qe(b)&&!isNaN(b)){const F=i.valueAsNumber||b&&+b;qe(P.value)||(U=F>P.value),qe($.value)||(Z=F<$.value)}else{const F=i.valueAsDate||new Date(b),W=_=>new Date(new Date().toDateString()+" "+_),N=i.type=="time",V=i.type=="week";Ft(P.value)&&b&&(U=N?W(b)>W(P.value):V?b>P.value:F>new Date(P.value)),Ft($.value)&&b&&(Z=N?W(b)<W($.value):V?b<$.value:F<new Date($.value))}if((U||Z)&&(G(!!U,P.message,$.message,Bt.max,Bt.min),!n))return E(x[v].message),x}if((u||c)&&!H&&(Ft(b)||o&&Array.isArray(b))){const U=qn(u),Z=qn(c),P=!qe(U.value)&&b.length>+U.value,$=!qe(Z.value)&&b.length<+Z.value;if((P||$)&&(G(P,U.message,Z.message),!n))return E(x[v].message),x}if(h&&!H&&Ft(b)){const{value:U,message:Z}=qn(h);if(qo(U)&&!b.match(U)&&(x[v]={type:Bt.pattern,message:Z,ref:i,...k(Bt.pattern,Z)},!n))return E(Z),x}if(p){if(kt(p)){const U=await p(b,t),Z=np(U,S);if(Z&&(x[v]={...Z,...k(Bt.validate,Z.message)},!n))return E(Z.message),x}else if(Me(p)){let U={};for(const Z in p){if(!Je(U)&&!n)break;const P=np(await p[Z](b,t),S,Z);P&&(U={...P,...k(Z,P.message)},E(P.message),n&&(x[v]=U))}if(!Je(U)&&(x[v]={ref:S,...U},!n))return x}}return E(!0),x};function TC(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=De(e)?r++:e[t[r++]];return e}function _C(e){for(const t in e)if(e.hasOwnProperty(t)&&!De(e[t]))return!1;return!0}function Re(e,t){const n=Array.isArray(t)?t:gs(t)?[t]:Gf(t),r=n.length===1?e:TC(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(Me(r)&&Je(r)||Array.isArray(r)&&_C(r))&&Re(e,n.slice(0,-1)),e}var vs=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},ys=e=>qe(e)||!qf(e);function on(e,t){if(ys(e)||ys(t))return e===t;if(yn(e)&&yn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=t[o];if(yn(i)&&yn(a)||Me(i)&&Me(a)||Array.isArray(i)&&Array.isArray(a)?!on(i,a):i!==a)return!1}}return!0}var op=e=>e.type==="select-multiple",AC=e=>hs(e)||vr(e),xs=e=>Uo(e)&&e.isConnected,ip=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Go(e,t={}){const n=Array.isArray(e);if(Me(e)||n)for(const r in e)Array.isArray(e[r])||Me(e[r])&&!ip(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Go(e[r],t[r])):qe(e[r])||(t[r]=!0);return t}function ap(e,t,n){const r=Array.isArray(e);if(Me(e)||r)for(const o in e)Array.isArray(e[o])||Me(e[o])&&!ip(e[o])?De(t)||ys(n[o])?n[o]=Array.isArray(e[o])?Go(e[o],[]):{...Go(e[o])}:ap(e[o],qe(t)?{}:t[o],n[o]):n[o]=!on(e[o],t[o]);return n}var xr=(e,t)=>ap(e,t,Go(t)),sp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>De(e)?e:t?e===""?NaN:e&&+e:n&&Ft(e)?new Date(e):r?r(e):e;function ws(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ms(t)?t.files:hs(t)?tp(e.refs).value:op(t)?[...t.selectedOptions].map(({value:n})=>n):vr(t)?Qf(e.refs).value:sp(De(t.value)?e.ref.value:t.value,e)}var PC=(e,t,n,r)=>{const o={};for(const i of e){const a=ae(t,i);a&&Oe(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},wr=e=>De(e)?e:qo(e)?e.source:Me(e)?qo(e.value)?e.value.source:e.value:e;const lp="AsyncFunction";var NC=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===lp||Me(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lp)),OC=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function cp(e,t,n){const r=ae(e,n);if(r||gs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=ae(t,i),s=ae(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}var FC=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,kC=(e,t)=>!Bo(ae(e,t)).length&&Re(e,t);const DC={mode:xt.onSubmit,reValidateMode:xt.onChange,shouldFocusError:!0};function MC(e={}){let t={...DC,...e},n={submitCount:0,isDirty:!1,isLoading:kt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Me(t.defaultValues)||Me(t.values)?lt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:lt(o),a={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:vs(),array:vs(),state:vs()},h=Yf(t.mode),p=Yf(t.reValidateMode),v=t.criteriaMode===xt.all,m=C=>A=>{clearTimeout(c),c=setTimeout(C,A)},y=async C=>{if(!t.disabled&&(d.isValid||C)){const A=t.resolver?Je((await I()).errors):await k(r,!0);A!==n.isValid&&g.state.next({isValid:A})}},w=(C,A)=>{!t.disabled&&(d.isValidating||d.validatingFields)&&((C||Array.from(s.mount)).forEach(R=>{R&&(A?Oe(n.validatingFields,R,A):Re(n.validatingFields,R))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Je(n.validatingFields)}))},b=(C,A=[],R,te,J=!0,X=!0)=>{if(te&&R&&!t.disabled){if(a.action=!0,X&&Array.isArray(ae(r,C))){const j=R(ae(r,C),te.argA,te.argB);J&&Oe(r,C,j)}if(X&&Array.isArray(ae(n.errors,C))){const j=R(ae(n.errors,C),te.argA,te.argB);J&&Oe(n.errors,C,j),kC(n.errors,C)}if(d.touchedFields&&X&&Array.isArray(ae(n.touchedFields,C))){const j=R(ae(n.touchedFields,C),te.argA,te.argB);J&&Oe(n.touchedFields,C,j)}d.dirtyFields&&(n.dirtyFields=xr(o,i)),g.state.next({name:C,isDirty:U(C,A),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Oe(i,C,A)},S=(C,A)=>{Oe(n.errors,C,A),g.state.next({errors:n.errors})},E=C=>{n.errors=C,g.state.next({errors:n.errors,isValid:!1})},x=(C,A,R,te)=>{const J=ae(r,C);if(J){const X=ae(i,C,De(R)?ae(o,C):R);De(X)||te&&te.defaultChecked||A?Oe(i,C,A?X:ws(J._f)):$(C,X),a.mount&&y()}},O=(C,A,R,te,J)=>{let X=!1,j=!1;const Y={name:C};if(!t.disabled){const ye=!!(ae(r,C)&&ae(r,C)._f&&ae(r,C)._f.disabled);if(!R||te){d.isDirty&&(j=n.isDirty,n.isDirty=Y.isDirty=U(),X=j!==Y.isDirty);const be=ye||on(ae(o,C),A);j=!!(!ye&&ae(n.dirtyFields,C)),be||ye?Re(n.dirtyFields,C):Oe(n.dirtyFields,C,!0),Y.dirtyFields=n.dirtyFields,X=X||d.dirtyFields&&j!==!be}if(R){const be=ae(n.touchedFields,C);be||(Oe(n.touchedFields,C,R),Y.touchedFields=n.touchedFields,X=X||d.touchedFields&&be!==R)}X&&J&&g.state.next(Y)}return X?Y:{}},M=(C,A,R,te)=>{const J=ae(n.errors,C),X=d.isValid&&Ot(A)&&n.isValid!==A;if(t.delayError&&R?(u=m(()=>S(C,R)),u(t.delayError)):(clearTimeout(c),u=null,R?Oe(n.errors,C,R):Re(n.errors,C)),(R?!on(J,R):J)||!Je(te)||X){const j={...te,...X&&Ot(A)?{isValid:A}:{},errors:n.errors,name:C};n={...n,...j},g.state.next(j)}},I=async C=>{w(C,!0);const A=await t.resolver(i,t.context,PC(C||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),A},H=async C=>{const{errors:A}=await I(C);if(C)for(const R of C){const te=ae(A,R);te?Oe(n.errors,R,te):Re(n.errors,R)}else n.errors=A;return A},k=async(C,A,R={valid:!0})=>{for(const te in C){const J=C[te];if(J){const{_f:X,...j}=J;if(X){const Y=s.array.has(X.name),ye=J._f&&NC(J._f);ye&&d.validatingFields&&w([te],!0);const be=await rp(J,i,v,t.shouldUseNativeValidation&&!A,Y);if(ye&&d.validatingFields&&w([te]),be[X.name]&&(R.valid=!1,A))break;!A&&(ae(be,X.name)?Y?EC(n.errors,be,X.name):Oe(n.errors,X.name,be[X.name]):Re(n.errors,X.name))}!Je(j)&&await k(j,A,R)}}return R.valid},G=()=>{for(const C of s.unMount){const A=ae(r,C);A&&(A._f.refs?A._f.refs.every(R=>!xs(R)):!xs(A._f.ref))&&oe(C)}s.unMount=new Set},U=(C,A)=>!t.disabled&&(C&&A&&Oe(i,C,A),!on(B(),o)),Z=(C,A,R)=>SC(C,s,{...a.mount?i:De(A)?o:Ft(C)?{[C]:A}:A},R,A),P=C=>Bo(ae(a.mount?i:o,C,t.shouldUnregister?ae(o,C,[]):[])),$=(C,A,R={})=>{const te=ae(r,C);let J=A;if(te){const X=te._f;X&&(!X.disabled&&Oe(i,C,sp(A,X)),J=Uo(X.ref)&&qe(A)?"":A,op(X.ref)?[...X.ref.options].forEach(j=>j.selected=J.includes(j.value)):X.refs?vr(X.ref)?X.refs.length>1?X.refs.forEach(j=>(!j.defaultChecked||!j.disabled)&&(j.checked=Array.isArray(J)?!!J.find(Y=>Y===j.value):J===j.value)):X.refs[0]&&(X.refs[0].checked=!!J):X.refs.forEach(j=>j.checked=j.value===J):ms(X.ref)?X.ref.value="":(X.ref.value=J,X.ref.type||g.values.next({name:C,values:{...i}})))}(R.shouldDirty||R.shouldTouch)&&O(C,J,R.shouldTouch,R.shouldDirty,!0),R.shouldValidate&&_(C)},F=(C,A,R)=>{for(const te in A){const J=A[te],X=`${C}.${te}`,j=ae(r,X);(s.array.has(C)||Me(J)||j&&!j._f)&&!yn(J)?F(X,J,R):$(X,J,R)}},W=(C,A,R={})=>{const te=ae(r,C),J=s.array.has(C),X=lt(A);Oe(i,C,X),J?(g.array.next({name:C,values:{...i}}),(d.isDirty||d.dirtyFields)&&R.shouldDirty&&g.state.next({name:C,dirtyFields:xr(o,i),isDirty:U(C,X)})):te&&!te._f&&!qe(X)?F(C,X,R):$(C,X,R),Xf(C,s)&&g.state.next({...n}),g.values.next({name:a.mount?C:void 0,values:{...i}})},N=async C=>{a.mount=!0;const A=C.target;let R=A.name,te=!0;const J=ae(r,R),X=()=>A.type?ws(J._f):mC(C),j=Y=>{te=Number.isNaN(Y)||yn(Y)&&isNaN(Y.getTime())||on(Y,ae(i,R,Y))};if(J){let Y,ye;const be=X(),Te=C.type===Kf.BLUR||C.type===Kf.FOCUS_OUT,Mt=!OC(J._f)&&!t.resolver&&!ae(n.errors,R)&&!J._f.deps||FC(Te,ae(n.touchedFields,R),n.isSubmitted,p,h),ct=Xf(R,s,Te);Oe(i,R,be),Te?(J._f.onBlur&&J._f.onBlur(C),u&&u(0)):J._f.onChange&&J._f.onChange(C);const Ve=O(R,be,Te,!1),Ht=!Je(Ve)||ct;if(!Te&&g.values.next({name:R,type:C.type,values:{...i}}),Mt)return d.isValid&&(t.mode==="onBlur"?Te&&y():y()),Ht&&g.state.next({name:R,...ct?{}:Ve});if(!Te&&ct&&g.state.next({...n}),t.resolver){const{errors:Ut}=await I([R]);if(j(be),te){const Wt=cp(n.errors,r,R),Ce=cp(Ut,r,Wt.name||R);Y=Ce.error,R=Ce.name,ye=Je(Ut)}}else w([R],!0),Y=(await rp(J,i,v,t.shouldUseNativeValidation))[R],w([R]),j(be),te&&(Y?ye=!1:d.isValid&&(ye=await k(r,!0)));te&&(J._f.deps&&_(J._f.deps),M(R,ye,Y,Ve))}},V=(C,A)=>{if(ae(n.errors,A)&&C.focus)return C.focus(),1},_=async(C,A={})=>{let R,te;const J=Ho(C);if(t.resolver){const X=await H(De(C)?C:J);R=Je(X),te=C?!J.some(j=>ae(X,j)):R}else C?(te=(await Promise.all(J.map(async X=>{const j=ae(r,X);return await k(j&&j._f?{[X]:j}:j)}))).every(Boolean),!(!te&&!n.isValid)&&y()):te=R=await k(r);return g.state.next({...!Ft(C)||d.isValid&&R!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:R}:{},errors:n.errors}),A.shouldFocus&&!te&&yr(r,V,C?J:s.mount),te},B=C=>{const A={...a.mount?i:o};return De(C)?A:Ft(C)?ae(A,C):C.map(R=>ae(A,R))},Q=(C,A)=>({invalid:!!ae((A||n).errors,C),isDirty:!!ae((A||n).dirtyFields,C),error:ae((A||n).errors,C),isValidating:!!ae(n.validatingFields,C),isTouched:!!ae((A||n).touchedFields,C)}),ne=C=>{C&&Ho(C).forEach(A=>Re(n.errors,A)),g.state.next({errors:C?n.errors:{}})},ee=(C,A,R)=>{const te=(ae(r,C,{_f:{}})._f||{}).ref,J=ae(n.errors,C)||{},{ref:X,message:j,type:Y,...ye}=J;Oe(n.errors,C,{...ye,...A,ref:te}),g.state.next({name:C,errors:n.errors,isValid:!1}),R&&R.shouldFocus&&te&&te.focus&&te.focus()},ce=(C,A)=>kt(C)?g.values.subscribe({next:R=>C(Z(void 0,A),R)}):Z(C,A,!0),oe=(C,A={})=>{for(const R of C?Ho(C):s.mount)s.mount.delete(R),s.array.delete(R),A.keepValue||(Re(r,R),Re(i,R)),!A.keepError&&Re(n.errors,R),!A.keepDirty&&Re(n.dirtyFields,R),!A.keepTouched&&Re(n.touchedFields,R),!A.keepIsValidating&&Re(n.validatingFields,R),!t.shouldUnregister&&!A.keepDefaultValue&&Re(o,R);g.values.next({values:{...i}}),g.state.next({...n,...A.keepDirty?{isDirty:U()}:{}}),!A.keepIsValid&&y()},ie=({disabled:C,name:A,field:R,fields:te,value:J})=>{if(Ot(C)&&a.mount||C){const X=C?void 0:De(J)?ws(R?R._f:ae(te,A)._f):J;(C||!C&&!De(X))&&Oe(i,A,X),O(A,X,!1,!1,!0)}},de=(C,A={})=>{let R=ae(r,C);const te=Ot(A.disabled)||Ot(t.disabled);return Oe(r,C,{...R||{},_f:{...R&&R._f?R._f:{ref:{name:C}},name:C,mount:!0,...A}}),s.mount.add(C),R?ie({field:R,disabled:Ot(A.disabled)?A.disabled:t.disabled,name:C,value:A.value}):x(C,!0,A.value),{...te?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:wr(A.min),max:wr(A.max),minLength:wr(A.minLength),maxLength:wr(A.maxLength),pattern:wr(A.pattern)}:{},name:C,onChange:N,onBlur:N,ref:J=>{if(J){de(C,A),R=ae(r,C);const X=De(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,j=AC(X),Y=R._f.refs||[];if(j?Y.find(ye=>ye===X):X===R._f.ref)return;Oe(r,C,{_f:{...R._f,...j?{refs:[...Y.filter(xs),X,...Array.isArray(ae(o,C))?[{}]:[]],ref:{type:X.type,name:C}}:{ref:X}}}),x(C,!1,void 0,X)}else R=ae(r,C,{}),R._f&&(R._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(vC(s.array,C)&&a.action)&&s.unMount.add(C)}}},ue=()=>t.shouldFocusError&&yr(r,V,s.mount),le=C=>{Ot(C)&&(g.state.next({disabled:C}),yr(r,(A,R)=>{const te=ae(r,R);te&&(A.disabled=te._f.disabled||C,Array.isArray(te._f.refs)&&te._f.refs.forEach(J=>{J.disabled=te._f.disabled||C}))},0,!1))},Se=(C,A)=>async R=>{let te;if(R&&(R.preventDefault&&R.preventDefault(),R.persist&&R.persist()),t.disabled){A&&await A({...n.errors},R);return}let J=lt(i);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:X,values:j}=await I();n.errors=X,J=j}else await k(r);if(Re(n.errors,"root"),Je(n.errors)){g.state.next({errors:{}});try{await C(J,R)}catch(X){te=X}}else A&&await A({...n.errors},R),ue(),setTimeout(ue);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Je(n.errors)&&!te,submitCount:n.submitCount+1,errors:n.errors}),te)throw te},K=(C,A={})=>{ae(r,C)&&(De(A.defaultValue)?W(C,lt(ae(o,C))):(W(C,A.defaultValue),Oe(o,C,lt(A.defaultValue))),A.keepTouched||Re(n.touchedFields,C),A.keepDirty||(Re(n.dirtyFields,C),n.isDirty=A.defaultValue?U(C,lt(ae(o,C))):U()),A.keepError||(Re(n.errors,C),d.isValid&&y()),g.state.next({...n}))},Ee=(C,A={})=>{const R=C?lt(C):o,te=lt(R),J=Je(C),X=J?o:te;if(A.keepDefaultValues||(o=R),!A.keepValues){if(A.keepDirtyValues){const j=new Set([...s.mount,...Object.keys(xr(o,i))]);for(const Y of Array.from(j))ae(n.dirtyFields,Y)?Oe(X,Y,ae(i,Y)):W(Y,ae(X,Y))}else{if(ps&&De(C))for(const j of s.mount){const Y=ae(r,j);if(Y&&Y._f){const ye=Array.isArray(Y._f.refs)?Y._f.refs[0]:Y._f.ref;if(Uo(ye)){const be=ye.closest("form");if(be){be.reset();break}}}}r={}}i=t.shouldUnregister?A.keepDefaultValues?lt(o):{}:lt(X),g.array.next({values:{...X}}),g.values.next({values:{...X}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!A.keepIsValid||!!A.keepDirtyValues,a.watch=!!t.shouldUnregister,g.state.next({submitCount:A.keepSubmitCount?n.submitCount:0,isDirty:J?!1:A.keepDirty?n.isDirty:!!(A.keepDefaultValues&&!on(C,o)),isSubmitted:A.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:J?{}:A.keepDirtyValues?A.keepDefaultValues&&i?xr(o,i):n.dirtyFields:A.keepDefaultValues&&C?xr(o,C):A.keepDirty?n.dirtyFields:{},touchedFields:A.keepTouched?n.touchedFields:{},errors:A.keepErrors?n.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},He=(C,A)=>Ee(kt(C)?C(i):C,A);return{control:{register:de,unregister:oe,getFieldState:Q,handleSubmit:Se,setError:ee,_executeSchema:I,_getWatch:Z,_getDirty:U,_updateValid:y,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:ie,_getFieldArray:P,_reset:Ee,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(C=>{He(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:le,_subjects:g,_proxyFormState:d,_setErrors:E,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(C){a=C},get _defaultValues(){return o},get _names(){return s},set _names(C){s=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:_,register:de,handleSubmit:Se,watch:ce,setValue:W,getValues:B,reset:He,resetField:K,clearErrors:ne,unregister:oe,setError:ee,setFocus:(C,A={})=>{const R=ae(r,C),te=R&&R._f;if(te){const J=te.refs?te.refs[0]:te.ref;J.focus&&(J.focus(),A.shouldSelect&&kt(J.select)&&J.select())}},getFieldState:Q}}function $C(e={}){const t=T.useRef(),n=T.useRef(),[r,o]=T.useState({isDirty:!1,isValidating:!1,isLoading:kt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:kt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...MC(e),formState:r});const i=t.current.control;return i._options=e,bC({subject:i._subjects.state,next:a=>{wC(a,i._proxyFormState,i._updateFormState)&&o({...i._formState})}}),T.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),T.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),T.useEffect(()=>{e.values&&!on(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[e.values,i]),T.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),T.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),T.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),T.useMemo(()=>({...t.current,formState:xC(r,i)}),[r,i])}const up=({className:e,children:t,content:n,side:r})=>{const[o,i]=T.useState(!1);return l.jsx(zn,{delayDuration:0,children:l.jsxs(Bn,{open:o,children:[l.jsx(Hn,{asChild:!0,children:l.jsx("button",{type:"button",className:ge("cursor-pointer",e),onClick:()=>i(!o),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onTouchStart:()=>i(!o),onKeyDown:a=>{a.preventDefault(),a.key==="Enter"&&i(!o)},children:t})}),l.jsx(hn,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},IC=(e,t)=>{const[n,r]=T.useState(e);return T.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},LC=({apiBaseUrl:e="http://localhost:3002"})=>{var O,M;const[t,n]=T.useState([]),[r,o]=T.useState(!1),[i,a]=T.useState([]),[s,u]=T.useState(1),[c,d]=T.useState(1),[g,h]=T.useState(null),[p,v]=T.useState(""),m=IC(p,500),y=I=>{const H=I.match(/\d{6}/);if(!H)return{month:"",year:""};const k=H[0],G=k.substring(0,2),U=k.substring(2);return{month:G,year:U}},w=I=>I.map(k=>{let G=(k==null?void 0:k.month)||"",U=(k==null?void 0:k.year)||"";if((!G||!U)&&(k!=null&&k.file_name)){const Z=y(k.file_name);G=G||Z.month,U=U||Z.year}return{id:k==null?void 0:k.id,prefix:(k==null?void 0:k.prefix)||"",model:(k==null?void 0:k.model)||"",fileName:(k==null?void 0:k.file_name)||"",code:(k==null?void 0:k.stock_id)||"",month:G,year:U,content:(k==null?void 0:k.text_summary)||"",status:(k==null?void 0:k.status)||"",note:(k==null?void 0:k.note)||"",lastUpdate:k==null?void 0:k.updated_at,stock_id:k==null?void 0:k.stock_id}}),b=I=>{if(!(I!=null&&I.data))return[];const H=w(I==null?void 0:I.data);n(H),d(I.pagination.totalPages)},S=async(I=1,H=15)=>{h(I),o(!0);try{const k=await he.get(`${e}/api/latest-summaries`,{params:{page:I,limit:H,search:p}});(k==null?void 0:k.status)===200?b(k.data):console.error(k)}catch(k){console.error("Error fetching data:",k)}finally{h(null),o(!1)}};T.useEffect(()=>{m&&u(1),S(s)},[s,m]);const E=T.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:H})=>l.jsx("span",{className:"flex flex-col",children:H.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:H})=>{const k=H.original.month,G=H.original.year;return l.jsx("span",{className:"flex flex-col",children:`${k.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:H})=>{const k=H.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:k})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:H})=>{const G=H.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:H})=>l.jsx(up,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:H.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:H.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:H})=>{const k=new Date(H.original.lastUpdate),G=k.getDate(),U=k.getMonth()+1,Z=`ngày ${G} tháng ${U}`;return l.jsx("span",{className:"flex flex-col",children:Z})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:H})=>{const[k,G]=T.useState(!1),[U,Z]=T.useState(!1),[P,$]=T.useState(!1),{handleSubmit:F,register:W,reset:N}=$C(),V=H.original.id,_=H.getValue("status"),B=H.getValue("content"),[Q,ne]=T.useState(!1),ee=async()=>{try{ne(!0);const oe=_==="unpublish"?"published":"unpublish",ie=await he.patch(`${e}/api/toggle-publish/${V}`,{id:V,typeAction:"update",status:_,idInput:V,stock_id:H.original.stock_id,prefix:H.original.prefix,model:H.original.model,summary_result:H.original.content,note:H.original.note});ie.status===200?n(de=>de.map(ue=>ue.id===V?{...ue,status:oe}:ue)):console.error("Failed to toggle publish status:",ie)}catch(oe){console.error("Error toggling publish status:",oe)}finally{ne(!1)}},ce=async oe=>{G(!0);try{const ie=await he.patch(`${e}/api/update-summary`,{note:oe.note,text_summary:oe.content,id:V});ie.status===200?(await S(s),Z(!1)):console.error("Failed to update summary:",ie)}catch(ie){console.error("Error updating summary:",ie)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(we,{variant:"outline",size:"sm",onClick:()=>$(!0),className:"px-2 py-0.5 h-7",children:l.jsx(lh,{className:"h-4 w-4"})}),l.jsx(Rt,{open:P,onOpenChange:$,children:l.jsxs(St,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(Ct,{children:l.jsx(Et,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:B})})]})}),l.jsxs(Rt,{open:U,onOpenChange:oe=>{Z(oe),oe?N({content:H.original.content,note:H.original.note}):N()},children:[l.jsx(no,{asChild:!0,children:l.jsx(we,{variant:"outline",size:"sm",onClick:()=>Z(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(St,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Ct,{className:"flex flex-col gap-3",children:[l.jsx(Et,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:F(ce),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(ar,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:H.original.answer||"",rows:10,...W("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(ar,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:H.original.note||"",rows:1,...W("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(we,{disabled:k,type:"submit",variant:"default",children:k?l.jsx($e,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(we,{variant:"outline",size:"sm",onClick:ee,disabled:Q,className:"w-[70px] px-2 py-0.5 h-7",children:Q?l.jsx($e,{className:"h-4 w-4 animate-spin"}):_==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Vs({data:t,columns:E,state:{columnFilters:i},enableRowSelection:!0,onColumnFiltersChange:a,getFilteredRowModel:fg(),getCoreRowModel:Rs()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(en,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:I=>v(I.target.value),className:"pr-8"}),p&&l.jsx(we,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx(Di,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(lo,{className:"s3-explr-table",children:[l.jsx(co,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(I=>l.jsx(ht,{className:"hover:bg-transparent s3-explr-header-row",children:I.headers.map(H=>l.jsx(Tt,{className:"s3-explr-header-cell",children:H.isPlaceholder?null:Dr(H.column.columnDef.header,H.getContext())},H.id))},I.id))}),l.jsx(uo,{className:"s3-explr-table-body",children:r?l.jsx(ht,{children:l.jsx(Xe,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(O=x.getRowModel().rows)!=null&&O.length?(M=x.getRowModel().rows)==null?void 0:M.map(I=>l.jsx(ht,{className:"h-12 s3-explr-row",children:I.getVisibleCells().map(H=>l.jsx(Xe,{className:"align-middle s3-explr-cell",children:Dr(H.column.columnDef.cell,H.getContext())},H.id))},I.id)):l.jsx(ht,{children:l.jsx(Xe,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ro,{children:l.jsxs(oo,{children:[l.jsx(mt,{children:l.jsx(io,{onClick:()=>u(I=>Math.max(1,I-1)),className:s===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(I,H)=>H+1).filter(I=>I===1||I===c||Math.abs(I-s)<=1).map((I,H,k)=>l.jsxs(l.Fragment,{children:[H>0&&k[H-1]!==I-1&&l.jsx(mt,{children:l.jsx(so,{})},I+"..."),l.jsx(mt,{children:l.jsx(Mn,{onClick:()=>u(I),isActive:s===I,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===I?l.jsx($e,{className:"h-4 w-4 animate-spin"}):I})},I)]})),l.jsx(mt,{children:l.jsx(ao,{onClick:()=>u(I=>Math.min(c,I+1)),className:s===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},dp=10,RC=T.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=T.useState(1),[r,o]=T.useState([]),[i,a]=T.useState({total:0,page:1,limit:dp,totalPages:1}),[s,u]=T.useState(!0),[c,d]=T.useState(null),[g,h]=T.useState(new Set),{toast:p}=So(),[v,m]=T.useState(!1),y=async x=>{try{d(x);const O=await he.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:dp.toString()}});o(O.data.data),a(O.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{d(null),u(!1)}};T.useEffect(()=>{y(t)},[t,e]);const w=async x=>{h(O=>new Set(O).add(x.toString()));try{await he.post(`${e}/api/retry-job`,{jobId:x}),p({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{h(O=>{const M=new Set(O);return M.delete(x.toString()),M})}},b=async()=>{m(!0),n(1),await y(1),m(!1)},S=x=>new Date(x).toLocaleString(),E=x=>{if(x=parseFloat(x),x<60)return`${x.toFixed(2)}s`;const O=Math.floor(x/60),M=(x%60).toFixed(0);return`${O}m ${M}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(oh,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(we,{variant:"outline",size:"icon",onClick:b,disabled:v||s,className:"ml-2",children:l.jsx(dh,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(lo,{children:[l.jsx(co,{children:l.jsxs(ht,{children:[l.jsx(Tt,{children:"ID"}),l.jsx(Tt,{children:"Tên Công Việc"}),l.jsx(Tt,{children:"Thời Gian Bắt Đầu"}),l.jsx(Tt,{children:"Thời Gian Cập Nhật"}),l.jsx(Tt,{children:"Thời Gian Thực Thi"}),l.jsx(Tt,{children:"Trạng Thái"}),l.jsx(Tt,{children:"Thao Tác"})]})}),l.jsx(uo,{children:s&&r.length===0?l.jsx(ht,{children:l.jsx(Xe,{colSpan:7,className:"text-center py-4",children:l.jsx($e,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var O,M;return l.jsxs(ht,{children:[l.jsx(Xe,{className:"!w-[100px]",children:x.id}),l.jsx(Xe,{className:"font-medium",children:(O=x.job_name)==null?void 0:O.replace("Upload file","Summary")}),l.jsx(Xe,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(Xe,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(Xe,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(Xe,{className:"!w-[200px]",children:l.jsx(up,{content:x.status==="fail"&&x.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:x.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
174
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jf(e,t){if(e){if(typeof e=="string")return cs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cs(e,t)}}function cs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iC(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(u){i=!0,s=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function aC(e){if(Array.isArray(e))return e}function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zf(Object(n),!0).forEach(function(r){us(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function us(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jo(e,t){if(e==null)return{};var n=sC(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sC(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var ds=T.forwardRef(function(e,t){var n=e.children,r=jo(e,XS),o=Hf(r),i=o.open,a=jo(o,JS);return T.useImperativeHandle(t,function(){return{open:i}},[i]),T.createElement(T.Fragment,null,n(Fe(Fe({},a),{},{open:i})))});ds.displayName="Dropzone";var Bf={disabled:!1,getFilesFromEvent:xS,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};ds.defaultProps=Bf,ds.propTypes={children:Pe.func,accept:Pe.objectOf(Pe.arrayOf(Pe.string)),multiple:Pe.bool,preventDropOnDocument:Pe.bool,noClick:Pe.bool,noKeyboard:Pe.bool,noDrag:Pe.bool,noDragEventsBubbling:Pe.bool,minSize:Pe.number,maxSize:Pe.number,maxFiles:Pe.number,disabled:Pe.bool,getFilesFromEvent:Pe.func,onFileDialogCancel:Pe.func,onFileDialogOpen:Pe.func,useFsAccessApi:Pe.bool,autoFocus:Pe.bool,onDragEnter:Pe.func,onDragLeave:Pe.func,onDragOver:Pe.func,onDrop:Pe.func,onDropAccepted:Pe.func,onDropRejected:Pe.func,onError:Pe.func,validator:Pe.func};var fs={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Hf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Fe(Fe({},Bf),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,g=t.onDragOver,h=t.onDrop,p=t.onDropAccepted,v=t.onDropRejected,m=t.onFileDialogCancel,y=t.onFileDialogOpen,w=t.useFsAccessApi,b=t.autoFocus,S=t.preventDropOnDocument,E=t.noClick,x=t.noKeyboard,O=t.noDrag,M=t.noDragEventsBubbling,I=t.onError,H=t.validator,k=T.useMemo(function(){return GS(n)},[n]),G=T.useMemo(function(){return qS(n)},[n]),U=T.useMemo(function(){return typeof y=="function"?y:Uf},[y]),Z=T.useMemo(function(){return typeof m=="function"?m:Uf},[m]),P=T.useRef(null),$=T.useRef(null),F=T.useReducer(lC,fs),W=ls(F,2),N=W[0],V=W[1],_=N.isFocused,B=N.isFileDialogActive,Q=T.useRef(typeof window<"u"&&window.isSecureContext&&w&&WS()),re=function(){!Q.current&&B&&setTimeout(function(){if($.current){var Y=$.current.files;Y.length||(V({type:"closeDialog"}),Z())}},300)};T.useEffect(function(){return window.addEventListener("focus",re,!1),function(){window.removeEventListener("focus",re,!1)}},[$,B,Z,Q]);var ee=T.useRef([]),ce=function(Y){P.current&&P.current.contains(Y.target)||(Y.preventDefault(),ee.current=[])};T.useEffect(function(){return S&&(document.addEventListener("dragover",Lf,!1),document.addEventListener("drop",ce,!1)),function(){S&&(document.removeEventListener("dragover",Lf),document.removeEventListener("drop",ce))}},[P,S]),T.useEffect(function(){return!r&&b&&P.current&&P.current.focus(),function(){}},[P,b,r]);var oe=T.useCallback(function(j){I?I(j):console.error(j)},[I]),ie=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j),ee.current=[].concat(eC(ee.current),[j.target]),Vo(j)&&Promise.resolve(o(j)).then(function(Y){if(!(Ro(j)&&!M)){var ye=Y.length,be=ye>0&&zS({files:Y,accept:k,minSize:a,maxSize:i,multiple:s,maxFiles:u,validator:H}),Te=ye>0&&!be;V({isDragAccept:be,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),c&&c(j)}}).catch(function(Y){return oe(Y)})},[o,c,oe,M,k,a,i,s,u,H]),de=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j);var Y=Vo(j);if(Y&&j.dataTransfer)try{j.dataTransfer.dropEffect="copy"}catch{}return Y&&g&&g(j),!1},[g,M]),ue=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j);var Y=ee.current.filter(function(be){return P.current&&P.current.contains(be)}),ye=Y.indexOf(j.target);ye!==-1&&Y.splice(ye,1),ee.current=Y,!(Y.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Vo(j)&&d&&d(j))},[P,d,M]),le=T.useCallback(function(j,Y){var ye=[],be=[];j.forEach(function(Te){var Mt=$f(Te,k),ct=ls(Mt,2),Ve=ct[0],Ht=ct[1],Ut=If(Te,a,i),Wt=ls(Ut,2),Ce=Wt[0],an=Wt[1],Gn=H?H(Te):null;if(Ve&&Ce&&!Gn)ye.push(Te);else{var ut=[Ht,an];Gn&&(ut=ut.concat(Gn)),be.push({file:Te,errors:ut.filter(function(xn){return xn})})}}),(!s&&ye.length>1||s&&u>=1&&ye.length>u)&&(ye.forEach(function(Te){be.push({file:Te,errors:[jS]})}),ye.splice(0)),V({acceptedFiles:ye,fileRejections:be,isDragReject:be.length>0,type:"setFiles"}),h&&h(ye,be,Y),be.length>0&&v&&v(be,Y),ye.length>0&&p&&p(ye,Y)},[V,s,k,a,i,u,h,p,v,H]),Se=T.useCallback(function(j){j.preventDefault(),j.persist(),R(j),ee.current=[],Vo(j)&&Promise.resolve(o(j)).then(function(Y){Ro(j)&&!M||le(Y,j)}).catch(function(Y){return oe(Y)}),V({type:"reset"})},[o,le,oe,M]),K=T.useCallback(function(){if(Q.current){V({type:"openDialog"}),U();var j={multiple:s,types:G};window.showOpenFilePicker(j).then(function(Y){return o(Y)}).then(function(Y){le(Y,null),V({type:"closeDialog"})}).catch(function(Y){KS(Y)?(Z(Y),V({type:"closeDialog"})):YS(Y)?(Q.current=!1,$.current?($.current.value=null,$.current.click()):oe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):oe(Y)});return}$.current&&(V({type:"openDialog"}),U(),$.current.value=null,$.current.click())},[V,U,Z,w,le,oe,G,s]),Ee=T.useCallback(function(j){!P.current||!P.current.isEqualNode(j.target)||(j.key===" "||j.key==="Enter"||j.keyCode===32||j.keyCode===13)&&(j.preventDefault(),K())},[P,K]),He=T.useCallback(function(){V({type:"focus"})},[]),Ue=T.useCallback(function(){V({type:"blur"})},[]),Dt=T.useCallback(function(){E||(US()?setTimeout(K,0):K())},[E,K]),ot=function(Y){return r?null:Y},C=function(Y){return x?null:ot(Y)},A=function(Y){return O?null:ot(Y)},R=function(Y){M&&Y.stopPropagation()},te=T.useMemo(function(){return function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=j.refKey,ye=Y===void 0?"ref":Y,be=j.role,Te=j.onKeyDown,Mt=j.onFocus,ct=j.onBlur,Ve=j.onClick,Ht=j.onDragEnter,Ut=j.onDragOver,Wt=j.onDragLeave,Ce=j.onDrop,an=jo(j,ZS);return Fe(Fe(us({onKeyDown:C(Nt(Te,Ee)),onFocus:C(Nt(Mt,He)),onBlur:C(Nt(ct,Ue)),onClick:ot(Nt(Ve,Dt)),onDragEnter:A(Nt(Ht,ie)),onDragOver:A(Nt(Ut,de)),onDragLeave:A(Nt(Wt,ue)),onDrop:A(Nt(Ce,Se)),role:typeof be=="string"&&be!==""?be:"presentation"},ye,P),!r&&!x?{tabIndex:0}:{}),an)}},[P,Ee,He,Ue,Dt,ie,de,ue,Se,x,O,r]),J=T.useCallback(function(j){j.stopPropagation()},[]),X=T.useMemo(function(){return function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=j.refKey,ye=Y===void 0?"ref":Y,be=j.onChange,Te=j.onClick,Mt=jo(j,QS),ct=us({accept:k,multiple:s,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(Nt(be,Se)),onClick:ot(Nt(Te,J)),tabIndex:-1},ye,$);return Fe(Fe({},ct),Mt)}},[$,n,s,Se,r]);return Fe(Fe({},N),{},{isFocused:_&&!r,getRootProps:te,getInputProps:X,rootRef:P,inputRef:$,open:ot(K)})}function lC(e,t){switch(t.type){case"focus":return Fe(Fe({},e),{},{isFocused:!0});case"blur":return Fe(Fe({},e),{},{isFocused:!1});case"openDialog":return Fe(Fe({},fs),{},{isFileDialogActive:!0});case"closeDialog":return Fe(Fe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Fe(Fe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Fe(Fe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Fe({},fs);default:return e}}function Uf(){}const cC=({onFilesSelected:e,children:t})=>{const[n,r]=T.useState(!1),{getRootProps:o,getInputProps:i}=Hf({noClick:!0,onDrop:a=>{if(a&&a.length>0)if(a[0].path.split("/").length>2){const u=a.map(c=>{const g=(c.path||c.relativePath||"").split("/").slice(1).join("/");return(!c.webkitRelativePath||c.webkitRelativePath==="")&&Object.defineProperty(c,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),c});e(u,"folder")}else e(a,"files");r(!1)},onDragOver:a=>{a.preventDefault(),n||r(!0)},multiple:!0});return T.useEffect(()=>{const a=s=>{s.clientX===0&&s.clientY===0&&r(!1)};return document.addEventListener("dragleave",a),()=>{document.removeEventListener("dragleave",a)}},[]),l.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?l.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):t,l.jsx("input",{...i()})]})},uC=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:i,ignoreCache:a})=>{var b;const[s,u]=T.useState({}),[c,d]=T.useState(!1),[g,h]=T.useState(!1),[p,v]=T.useState(""),{toast:m}=So();T.useEffect(()=>{e&&y(p)},[p,e]);const y=async S=>{try{h(!0);const E=await he.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{m({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{h(!1)}},w=async()=>{d(!0);try{const S=o.key,E=S.endsWith("/")?S:`${S}/`,x=p.endsWith("/")?p:`${p}/`;if(E===x||S===p){m({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),d(!1);return}await he.post(`${n}/api/move`,{oldPath:S,newPath:p}),a.current=!0,await i(),m({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${p}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),m({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{d(!1)}};return l.jsx(Rt,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(St,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(Ct,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),p.split("/").map((S,E,x)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":x.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(Et,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["( file Hoặc folder sẽ được di chuyển đến thư mục"," ",p===""?"Root":p," )"]})]}),l.jsx(Dn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:g?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(s))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(pn,{className:"flex justify-end space-x-2",children:[l.jsx(we,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(we,{onClick:w,disabled:c,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};Kt(he,{retries:3});const rt={current:!1},Wf="crawl:jobs",Wn="crawl:current_job",dC=e=>{const[t,n]=T.useState(null),[r,o]=T.useState(0);return T.useEffect(()=>{const i=localStorage.getItem(Wn);if(i){const a=JSON.parse(i);n(a),a!=null&&a.startTime&&o(Math.floor((Date.now()-a.startTime)/1e3))}},[]),T.useEffect(()=>{if(!(t!=null&&t.startTime))return;const i=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(i)},[t==null?void 0:t.startTime]),T.useEffect(()=>{if(!(t!=null&&t.id))return;const i=async()=>{try{const u=(await he.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const d={...c,status:u};return localStorage.setItem(Wn,JSON.stringify(d)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Wn)},100),d})}catch(s){console.error("Error polling job status:",s)}},a=setInterval(i,3e3);return i(),()=>clearInterval(a)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:i=>{i&&!i.startTime&&(i.startTime=Date.now()),n(i),i?localStorage.setItem(Wn,JSON.stringify(i)):localStorage.removeItem(Wn)}}},zo=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(a=>{n.push(a.key),a.isFolder&&r(a.key)})};return r(t),n},fC=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...zo(e,o.key))}),n},pC=(e,t,n=[],r,o,i)=>{const[a,s]=T.useState({}),[u,c]=T.useState(!1),[d,g]=T.useState(null),[h,p]=T.useState(0),v=T.useRef(t);T.useEffect(()=>{v.current=t},[t]);const m=async()=>{c(!0);try{const w=await he.get(`${e}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:v.current},timeout:3e5});s(w.data),g(null)}catch(w){g(w instanceof Error?w:new Error("Failed to fetch files"))}finally{c(!1),p(0),i("")}},y=async w=>{var b,S;try{if(!w)return;c(!0);const E=await he.get(`${e}/api/search-db?query=${w}&rootPrefix=${t}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return s({[t]:((b=E==null?void 0:E.data)==null?void 0:b.result)||[]}),p(((S=E==null?void 0:E.data)==null?void 0:S.estimatedTotalHits)||0),E}catch(E){g(E instanceof Error?E:new Error("Failed to fetch files"))}finally{c(!1)}};return T.useEffect(()=>{!r&&!u&&m(),r&&!u&&y(r)},[r,o]),{data:a,isLoading:u,error:d,estimatedTotalHits:h,refetch:m}},hr=e=>{var r,o,i;const t=((i=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:i.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},gC=T.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=s=>console.log("Đã chọn:",s),displayPrefixes:i,preSelectedFiles:a})=>{var hp;const[s,u]=T.useState([]),[c,d]=T.useState(""),[g,h]=T.useState(new Set(a)),[p,v]=T.useState(n),[m,y]=T.useState(""),[w,b]=T.useState(!1),[S,E]=T.useState(""),[x,O]=T.useState(!1),[M,I]=T.useState(null),[H,k]=T.useState(null),[G,U]=T.useState(!1),[Z,P]=T.useState(!1),[$,F]=T.useState(null),W=T.useRef(null),{toast:N}=So(),[V,_]=T.useState(null),[B,Q]=T.useState(null),[re,ee]=T.useState(""),[ce,oe]=T.useState(!1),[ie,de]=T.useState(!1),[ue,le]=T.useState(new Set),[Se,K]=T.useState(""),[Ee,He]=T.useState(!1),[Ue,Dt]=T.useState(!1),[ot,C]=T.useState("rename"),[A,R]=T.useState(!1),[te,J]=T.useState(""),[X,j]=T.useState("1"),[Y,ye]=T.useState(!1),[be,Te]=T.useState(!1),[Mt,ct]=T.useState(!1),[Ve,Ht]=T.useState(1),[Ut,Wt]=T.useState(!1),{currentJob:Ce,elapsedTime:an,setCurrentJob:Gn}=dC(t),[ut,xn]=T.useState(null),[br,Ko]=T.useState(""),[VC,Sr]=T.useState(!1),jC=new URL(window.location.href).searchParams.get("prefix")||"",zC=n+jC||m||n,{data:$t,isLoading:bs,error:BC,estimatedTotalHits:Cr,refetch:it}=pC(t,zC,i,c,Ve,d);T.useEffect(()=>{Ce!=null&&Ce.status&&(Ce.status.status==="completed"?(N({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Ce.url} với ${Ce.status.completed} trang`}),rt.current=!0,it()):Ce.status.status==="failed"&&N({title:"Thu thập website thất bại",description:`Không thể thu thập ${Ce.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(hp=Ce==null?void 0:Ce.status)==null?void 0:hp.status]);const fp=T.useMemo(()=>$t[p]||[],[$t,p]),sn=T.useMemo(()=>fp,[fp,p,$t]),Er=T.useMemo(()=>{const D={};return sn.forEach((z,q)=>{g.has(z.key)&&(D[q]=!0)}),D},[g,sn]),HC=D=>{const z=zo($t,D);if(z.length===0)return g.has(D)?"all":"none";const q=z.filter(ne=>g.has(ne)).length;return q===0?"none":q===z.length?"all":"partial"},Kn=(D,z=!0)=>{if(p!==D&&(Wt(!0),y(D),v(D),a||h(new Set),z)){console.log("🚀 ~ handleFolderClick ~ prefix:",D);const q=window.location.pathname==="/"?"":window.location.pathname,ne=D?`${window.location.origin}${q}?prefix=${encodeURIComponent(D)}`:`${window.location.origin}${q}`;console.log("🚀 ~ useEffect ~ basePath:",q),console.log("🚀 ~ useEffect ~ newUrl:",ne),window.history.pushState({path:ne},"",ne)}};T.useEffect(()=>{Ut&&(rt.current=!0,it().finally(()=>Wt(!1)))},[Ut]);const UC=async(D,z)=>{var q,ne;O(!0);try{if(sn.some(Ge=>Ge.isFolder&&Ge.name.toLowerCase()===D.toLowerCase())){N({title:"Lỗi",description:`Thư mục "${D}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),O(!1);return}const me=`${z}${D}/`;if((await he.post(`${t}/api/create-folder`,{prefix:me})).status!==200){N({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}rt.current=!0,await it(),N({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${D}"`}),E(""),b(!1)}catch(se){console.error("Error creating folder:",se);const me=((ne=(q=se==null?void 0:se.response)==null?void 0:q.data)==null?void 0:ne.error)||"Không thể tạo thư mục";N({title:"Lỗi",description:me,variant:"destructive"})}finally{O(!1)}},Ss=async(D,z,q)=>{var ne,se,me,ke,Ge,Yn,vp,yp,xp;F(q),Te(!0);try{if(Array.from(D).reduce((Ke,Ar)=>Ke+Ar.size,0)>=100*1024*1024){N({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),F(null),Te(!1);return}const Xo=Array.from(D).filter(Ke=>Ke.size===0);if(Xo.length>0){const Ke=Xo.map(Ar=>Ar.name).join(", ");N({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${Ke}`,variant:"destructive"}),Te(!1),F(null);return}let _r=localStorage.getItem("dataLogin"),Xn;try{_r&&(_r=JSON.parse(_r),Xn=_r.user)}catch{_r=null}const wn=new FormData;if(Xn!=null&&Xn.id&&wn.append("metadata",JSON.stringify({creator:Xn.username,creatorId:Xn.id,DataSource:"Tệp tải lên"})),q==="folder"&&D[0]){const Ke=D[0].webkitRelativePath.split("/")[0];Ke&&wn.append("folderName",Ke)}wn.append("prefix",z),Array.from(D).forEach(Ke=>q==="folder"?wn.append("files",Ke,Ke.webkitRelativePath):wn.append("files",Ke)),rt.current=!0;const je=await he.post(`${t}/api/check-files-existed`,wn,{headers:{"Content-Type":"multipart/form-data"}});if(((ne=je==null?void 0:je.data)==null?void 0:ne.status)===200)await he.post(`${t}/api/upload`,wn,{headers:{"Content-Type":"multipart/form-data"}}),d(""),y(z),setTimeout(async()=>{F(null),await it(),Te(!1)},500);else{if(((me=(se=je==null?void 0:je.data)==null?void 0:se.names)==null?void 0:me.length)>0&&!((ke=je==null?void 0:je.data)!=null&&ke.isFolder)){const Ke=Array.from(D).filter(Ar=>je.data.names.includes(Ar.name));xn(Ke),Sr(!0)}(Ge=je==null?void 0:je.data)!=null&&Ge.isFolder&&((Yn=je==null?void 0:je.data)!=null&&Yn.name)&&(Ko((vp=je==null?void 0:je.data)==null?void 0:vp.name),xn(D),Sr(!0))}}catch(Tr){console.error("Lỗi tải lên:",Tr);const Xo=((xp=(yp=Tr==null?void 0:Tr.response)==null?void 0:yp.data)==null?void 0:xp.error)||"Không thể tải lên tập tin";N({title:"Lỗi",description:Xo,variant:"destructive"}),F(null),Te(!1)}},WC=async()=>{var D,z;try{Te(!0);const q=new FormData;if(ut){F(br?"folder":"files"),Sr(!1);let ne=localStorage.getItem("dataLogin"),se;try{ne&&(ne=JSON.parse(ne),se=ne.user)}catch{ne=null}if(se!=null&&se.id&&(console.log("🚀 ~ uploadFiles ~ user:",se),q.append("metadata",JSON.stringify({creator:se.username,creatorId:se.id,DataSource:"Tệp tải lên"}))),br&&ut[0]){const me=ut[0].webkitRelativePath.split("/")[0];me&&q.append("folderName",me)}q.append("prefix",p),Array.from(ut).forEach(me=>br&&ut[0]?q.append("files",me,me.webkitRelativePath):q.append("files",me)),se!=null&&se.id&&q.append("metadata",JSON.stringify({creator:se.username,creatorId:se.id,DataSource:"Tệp tải lên"})),await he.post(`${t}/api/upload`,q,{headers:{"Content-Type":"multipart/form-data"}}),d(""),y(p),rt.current=!0}}catch(q){console.error("Lỗi tải lên:",q);const ne=((z=(D=q==null?void 0:q.response)==null?void 0:D.data)==null?void 0:z.error)||"Không thể tải lên tập tin";N({title:"Lỗi",description:ne,variant:"destructive"})}finally{setTimeout(async()=>{F(null),await it(),Te(!1),Ko(""),xn(null)},500)}},qC=async D=>{var z;try{if(await he.delete(`${t}/api/files`,{data:{paths:[D.key]}}),g.has(D.key)){const ne=new Set(g);ne.delete(D.key),h(ne)}const q=((z=D.key)==null?void 0:z.replace(/^(.*?)(\/.*)?$/,(ne,se,me)=>!me||me==="/"?"":se+"/"))||"";y(q),rt.current=!0,N({title:"Đã xóa tập tin",description:`Đã xóa thành công "${D.name}"`}),I(null)}catch(q){console.error("Error deleting file:",q),N({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{ct(!1),await it()}},Yo=D=>{const z=new Set(g),q=typeof D=="function"?D(Er):D;new Set(Object.keys(Er).map(Number)).forEach(se=>{const me=sn[se];me&&(q[se]||(z.delete(me.key),me.isFolder&&zo($t,me.key).forEach(ke=>z.delete(ke))))}),Object.entries(q).forEach(([se,me])=>{const ke=parseInt(se),Ge=sn[ke];Ge&&me&&(z.add(Ge.key),Ge.isFolder&&zo($t,Ge.key).forEach(Yn=>z.add(Yn)))}),h(z)},GC=async()=>{var D;U(!0);try{const z=Array.from(g),q=z.map(se=>Object.values($t).flat().find(me=>me.key===se)).filter(se=>se!==void 0);if(q.length===0){N({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await he.delete(`${t}/api/files`,{data:{paths:z}});const ne=((D=q[0])==null?void 0:D.key.replace(/^(.*?)(\/.*)?$/,(se,me,ke)=>!ke||ke==="/"?"":me+"/"))||"";y(ne),rt.current=!0,it(),N({title:"Đã xóa tập tin",description:`Đã xóa thành công ${q.length} mục`}),P(!1),h(new Set)}catch(z){console.error("Error deleting files:",z),N({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{U(!1)}},KC=async(D,z)=>{if(!p.trim()){N({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}de(!0);try{const q=D.key;let ne;D.isFolder?ne=q.split("/").slice(0,-2).join("/")+"/":ne=q.substring(0,q.lastIndexOf("/")+1);const se=ne+z+(D.isFolder?"/":"");await he.post(`${t}/api/rename`,{oldPath:q,newPath:se}),rt.current=!0,await it(),N({title:"Đã đổi tên",description:`Đã đổi tên thành công "${D.name}" thành "${z}"`}),_(null),ee(""),Q(null)}catch(q){console.error("Error renaming item:",q),N({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{de(!1)}},pp=async D=>{le(z=>new Set([...z,...D]));try{const z=await he.post(`${t}/api/download`,{paths:D},{responseType:"blob"}),q=window.URL.createObjectURL(z.data),ne=document.createElement("a");ne.href=q;const se=z.headers["Content-Disposition"]||z.headers["content-disposition"],me=se==null?void 0:se.match(/filename="(.+)"/),ke=me?decodeURIComponent(me[1]):"download.zip";ne.setAttribute("download",ke),document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),window.URL.revokeObjectURL(q),N({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${D.length} mục${D.length>1,""}`})}catch(z){console.error("Error downloading files:",z),N({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{le(z=>{const q=new Set(z);return D.forEach(ne=>q.delete(ne)),q})}},gp=p?p.replace(n,"").split("/").filter(Boolean):[],YC=()=>Array.from(g).map(D=>{var z;for(const q in $t){const ne=(z=$t[q])==null?void 0:z.find(se=>se.key===D);if(ne)return ne}return null}).filter(D=>D!==null),mp=T.useMemo(()=>{const D=[{id:"select",header:()=>{const z=fC($t,p),q=z.length>0&&z.every(se=>g.has(se)),ne=z.some(se=>g.has(se));return l.jsx(Ui,{checked:q?!0:ne?"indeterminate":!1,onCheckedChange:se=>{if(se){const me=sn.reduce((ke,Ge,Yn)=>(ke[Yn]=!0,ke),{});Yo(me)}else Yo({})},"aria-label":"Chọn tất cả"})},cell:({row:z})=>{const q=z.original,se=q.isFolder?HC(q.key):g.has(q.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Ui,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:me=>{const ke={...Er};me?ke[z.index]=!0:delete ke[z.index],Yo(ke)},"aria-label":"Chọn dòng"})})},enableSorting:!1,size:50},{id:"fileName",size:"100%",header:({column:z})=>l.jsxs(we,{variant:"ghost",onClick:()=>z.toggleSorting(z.getIsSorted()==="asc"),className:"px-0",children:["Tên tập tin",l.jsx(ki,{})]}),accessorKey:"name",cell:({row:z})=>{const q=z.original,ne=q.key.substring(0,q.key.lastIndexOf("/"))||"/",se=c.trim()!==""&&ne!==p,me=ne.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${q.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{q.isFolder&&(a||h(new Set),Kn(q.key))},children:[q.isFolder?l.jsx(Zo,{className:"h-5 w-5 text-blue-500"}):null,q.name]}),se&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Zo,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Kn("")},children:"/"}),me.map((ke,Ge)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Kn(me.slice(0,Ge+1).join("/")+"/")},children:ke}),Ge<me.length-1&&l.jsx("span",{children:"/"})]},Ge))]})]})]})}}];return r||D.push({id:"size",header:({column:z})=>l.jsxs(we,{variant:"ghost",onClick:()=>z.toggleSorting(z.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Kích thước",l.jsx(ki,{})]}),accessorKey:"size",cell:({getValue:z,row:q})=>{const ne=z();return l.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:l.jsx("span",{children:q.original.isFolder?"-":Yh(ne)})})},size:100},{id:"lastModified",header:({column:z})=>l.jsxs(we,{variant:"ghost",onClick:()=>z.toggleSorting(z.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",l.jsx(ki,{})]}),accessorKey:"lastModified",cell:({row:z})=>{const q=z.original.lastModified;return l.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:l.jsx("span",{children:q&&Ol(q).isValid()?Ol(q).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",size:200,header:()=>l.jsx(we,{variant:"ghost",className:"w-full flex-row justify-end",children:"Hành động"}),accessorKey:"key",cell:({row:z})=>l.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>pp([z.original.key]),className:"h-8 w-8 p-0",disabled:ue.has(z.original.key),children:ue.has(z.original.key)?l.jsx($e,{className:"h-4 w-4 animate-spin"}):l.jsx(Ts,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Tải xuống"})]})}),p.trim()!==""&&l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>{_(z.original),ee(z.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Fp,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Đổi tên"})]})}),l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>{oe(!0),k(z.original)},className:"h-8 w-8 p-0",children:l.jsx(ch,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Di chuyển"})]})}),l.jsx(zn,{children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsx(we,{variant:"ghost",size:"icon",onClick:()=>I(z.original),className:"h-8 w-8 p-0",children:l.jsx(_s,{className:"h-4 w-4"})})}),l.jsx(hn,{children:"Xóa"})]})})]})}),D},[g,sn,Er,ue,r]),Cs=Vs({data:sn,columns:mp,state:{rowSelection:Er,sorting:s},onSortingChange:u,enableRowSelection:!0,onRowSelectionChange:Yo,getCoreRowModel:Rs(),getSortedRowModel:pg()}),XC=async D=>{var z,q;He(!0);try{if(hr(D)){const ne=await he.get(`${t}/api/read-text`,{params:{path:D.key}});K(ne.data.content)}try{const ne=await he.get(`${t}/api/read-json`,{params:{path:D.key+".metadata.json"}}),se=((q=(z=ne==null?void 0:ne.data)==null?void 0:z.content)==null?void 0:q.metadataAttributes)||null;return Q({fullPath:V==null?void 0:V.key,...se})}catch{return Q("Lỗi phân tích siêu dữ liệu")}}catch(ne){console.error("Error loading file content:",ne),N({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{He(!1)}},JC=async(D,z)=>{Dt(!0);try{await he.post(`${t}/api/modify-text`,{path:D.key,content:z}),N({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),rt.current=!0,await it(),_(null),K(""),C("rename")}catch(q){console.error("Error saving file content:",q),N({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Dt(!1)}},ZC=async D=>{Dt(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",B),await he.post(`${t}/api/modify-json`,{path:D.key+".metadata.json",content:{metadataAttributes:B}}),N({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),rt.current=!0,await it(),_(null),K(""),C("rename")}catch(z){console.error("Error saving file content:",z),N({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Dt(!1)}};T.useEffect(()=>{V&&(V.isFolder||XC(V),C("rename"))},[V]);const QC=async(D,z)=>{var q;if(Ce){N({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}ye(!0);try{const{data:ne}=await he.post(`${t}/api/crawl`,{url:D,limit:z,prefix:p});if(ne.id){Gn({id:ne.id,url:D,limit:z,prefix:p,taskId:((q=ne.task)==null?void 0:q.id)||""});const se=localStorage.getItem(Wf),me=se?JSON.parse(se):[];me.some(ke=>ke.id===ne.id)||(me.unshift({url:D,id:ne.id,limit:z,prefix:p,timestamp:Date.now()}),me.length>20&&(me.length=20),localStorage.setItem(Wf,JSON.stringify(me))),N({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${D} với giới hạn ${z}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),R(!1),J(""),j("1")}}catch(ne){console.error("Error crawling website:",ne),N({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{ye(!1)}},eE=async()=>{try{if(!(Ce!=null&&Ce.id))return;Gn(null),localStorage.removeItem(Wn),N({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Ce.url}`})}catch(D){console.error("Error stopping job:",D),N({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return T.useEffect(()=>{const D=(z=!0)=>{const ne=new URL(window.location.href).searchParams.get("prefix")||"";ne?Kn(n+ne,!1):(z&&!a&&h(new Set),y(""),v(""),rt.current=!0,setTimeout(()=>{it()},0))};return D(!1),window.addEventListener("popstate",()=>D(!0)),()=>{window.removeEventListener("popstate",()=>D(!0))}},[]),l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(rd,{}),l.jsx(Rt,{open:VC,onOpenChange:D=>{Sr(D),D||(Ko(""),xn(null),Te(!1),F(null))},children:l.jsxs(St,{children:[l.jsxs(Ct,{children:[l.jsx(Et,{children:"Cảnh báo trùng lặp"}),l.jsxs(Dn,{children:[br&&l.jsxs(l.Fragment,{children:["Folder $",br," đã có."]}),ut&&ut.length>0&&l.jsxs(l.Fragment,{children:["Những tệp sau bị lặp:",l.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(ut).map((D,z)=>l.jsx("li",{children:D.name},z))})]})]})]}),l.jsxs(pn,{children:[l.jsx(we,{variant:"outline",onClick:()=>{Sr(!1),Ko(""),xn(null),Te(!1),F(null)},children:"Bỏ qua"}),l.jsx(we,{variant:"destructive",onClick:()=>WC(),children:"Ghi đè"})]})]})}),l.jsx(Ul,{className:"s3-explr-breadcrumb",children:l.jsxs(Wl,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Vi,{className:"s3-explr-breadcrumb-item",children:l.jsx(ji,{onClick:()=>Kn(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),gp.map((D,z)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(ql,{className:"s3-explr-breadcrumb-separator"},`sep-${z}`),l.jsx(Vi,{className:"s3-explr-breadcrumb-item",children:l.jsx(ji,{onClick:()=>Kn(n+gp.slice(0,z+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:D})},`item-${D}`)]},z))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(aS,{ref:W,onChange:D=>d(D)})}),l.jsxs(we,{variant:"outline",size:"sm",onClick:()=>{y(p),rt.current=!0,it()},disabled:bs,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Sp,{className:`h-4 w-4 s3-explr-refresh-icon ${bs?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[g.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(we,{variant:"outline",size:"sm",onClick:()=>pp(Array.from(g)),disabled:Array.from(g).some(D=>ue.has(D)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(g).some(D=>ue.has(D))?l.jsx($e,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ts,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",g.size,")"]}),l.jsxs(Rt,{open:Z,onOpenChange:P,children:[l.jsx(no,{asChild:!0,children:l.jsxs(we,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(_s,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",g.size,")"]})}),l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsxs(Ct,{className:"s3-explr-dialog-header",children:[l.jsx(Et,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(Dn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",g.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>P(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(we,{variant:"destructive",onClick:GC,disabled:G,className:"s3-explr-confirm-delete-btn",children:G?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Rt,{open:w,onOpenChange:b,children:[l.jsx(no,{asChild:!0,children:l.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!i&&!p,children:[l.jsx(_p,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsx(Ct,{className:"s3-explr-dialog-header",children:l.jsx(Et,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(en,{disabled:x,id:"name",value:S,onChange:D=>E(D.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(we,{onClick:()=>{S.trim()&&UC(S,p)},disabled:x,className:"s3-explr-create-btn",children:[x&&l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),x?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const D=document.createElement("input");D.type="file",D.multiple=!0,D.onchange=z=>{const q=z.target.files;q&&Ss(q,p,"files")},D.click()},disabled:$!==null||!!i&&!p,children:$==="files"?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ep,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const D=document.createElement("input");D.type="file",D.multiple=!0,D.webkitdirectory=!0,D.onchange=z=>{const q=z.target.files;q&&Ss(q,p,"folder")},D.click()},disabled:$!==null||!!i&&!p,children:$==="folder"?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zo,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),Ce?l.jsx(zn,{delayDuration:0,children:l.jsxs(Bn,{children:[l.jsx(Hn,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx($e,{className:"h-4 w-4 animate-spin s3-explr-loader"}),Ce.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",Ce.status.completed,"/",Ce.status.total,") - ",Math.floor(an/60),":",String(an%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(we,{variant:"destructive",size:"sm",onClick:()=>void eE(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Dp,{className:"h-4 w-4"})]})]})}),Ce.status&&l.jsx(hn,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Ce.url]}),l.jsxs("p",{children:["Tiến độ: ",Ce.status.completed,"/",Ce.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(an/60),":",String(an%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",Ce.status.status==="scraping"?"Đang thu thập":Ce.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Rt,{open:A,onOpenChange:R,children:[l.jsx(no,{asChild:!0,children:l.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!i&&!p,children:[l.jsx(Np,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsxs(Ct,{className:"s3-explr-dialog-header",children:[l.jsx(Et,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(Dn,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(en,{id:"websiteUrl",value:te,onChange:D=>J(D.target.value),placeholder:"https://example.com",type:"url",disabled:Y,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(en,{id:"crawlLimit",value:X,onChange:D=>{const z=D.target.value;/^\d*$/.test(z)&&j(z)},placeholder:"1",type:"text",disabled:Y,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>{R(!1),J(""),j("1")},disabled:Y,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(we,{onClick:()=>{te.trim()&&QC(te.trim(),parseInt(X)||1)},disabled:Y||!te.trim(),className:"s3-explr-crawl-btn",children:Y?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Rt,{open:!!M,onOpenChange:D=>!D&&I(null),children:l.jsxs(St,{className:"s3-explr-dialog-content",children:[l.jsxs(Ct,{className:"s3-explr-dialog-header",children:[l.jsx(Et,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(Dn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",M==null?void 0:M.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>I(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(we,{variant:"destructive",onClick:()=>qC(M),disabled:Mt,className:"s3-explr-confirm-delete-btn",children:Mt?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Rt,{open:!!V,onOpenChange:D=>{D||(_(null),Q(null),ee(""),K(""),C("rename"))},children:l.jsxs(St,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(Ct,{className:"s3-explr-dialog-header",children:l.jsx(Et,{className:"s3-explr-dialog-title",children:V!=null&&V.isFolder?"Đổi tên thư mục":hr(V)?"Quản lý tập tin":"Đổi tên tập tin"})}),V&&l.jsxs(Cx,{value:ot,onValueChange:D=>C(D),children:[l.jsxs(Ou,{"aria-checked":!hr(V),"aria-disabled":V.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(mo,{value:"rename",children:"Đổi tên"}),!V.isFolder&&l.jsxs(l.Fragment,{children:[hr(V)&&l.jsx(mo,{value:"edit",children:"Sửa nội dung"}),l.jsx(mo,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(ho,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(gn,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(en,{id:"newName",value:re,onChange:D=>ee(D.target.value),placeholder:"Nhập tên mới",disabled:ie,className:"s3-explr-input"})]})})}),!V.isFolder&&l.jsxs(l.Fragment,{children:[hr(V)&&l.jsx(ho,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:Ee?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx($e,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(gn,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(ar,{id:"content",value:Se,onChange:D=>K(D.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Ue})]})})}),l.jsx(ho,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:Ee?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx($e,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:B&&typeof B=="object"&&Object.entries(B).map(([D,z],q)=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(gn,{htmlFor:D,className:"s3-explr-label flex items-center gap-1",children:[fh[D]||D,Mi(D)&&l.jsx(uh,{className:"h-[12px] w-[12px] text-red-500"})]}),ph(D)?l.jsx(ar,{id:D,value:typeof z=="string"?z:JSON.stringify(z),onChange:ne=>{const se={...B,[D]:ne.target.value};Q(se)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Ue||Mi(D)}):l.jsx(en,{id:D,value:typeof z=="string"?z:JSON.stringify(z),onChange:ne=>{const se={...B,[D]:ne.target.value};Q(se)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:Ue||Mi(D)})]},q))})})})]})]}),l.jsxs(pn,{className:"s3-explr-dialog-footer",children:[l.jsx(we,{variant:"outline",onClick:()=>{_(null),Q(null),ee(""),K("")},className:"s3-explr-cancel-btn",children:"Hủy"}),ot==="edit"?l.jsx(we,{onClick:()=>V&&JC(V,Se),disabled:Ue||Ee,className:"s3-explr-save-btn",children:Ue?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):ot==="edit-metadata"?l.jsx(we,{onClick:()=>B&&typeof B=="object"&&V&&ZC(V),disabled:Ue||Ee,className:"s3-explr-save-btn",children:Ue?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(we,{onClick:()=>{re.trim()&&V&&KC(V,re.trim())},disabled:ie||!re.trim()||re.trim()===(V==null?void 0:V.name),className:"s3-explr-rename-btn",children:ie?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),H&&ce&&l.jsx(uC,{openDialogRename:ce,setOpenDialogRename:oe,apiBaseUrl:t,setFileToMove:k,fileToMove:H,refreshFiles:it,ignoreCache:rt})]})]}),BC&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx(cC,{onFilesSelected:(D,z)=>Ss(D,p,z),children:l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(lo,{className:"s3-explr-table",children:[l.jsx(co,{className:"s3-explr-table-header",children:Cs.getHeaderGroups().map(D=>l.jsx(ht,{className:"hover:bg-transparent s3-explr-header-row",children:D.headers.map(z=>l.jsx(Tt,{className:"s3-explr-header-cell",style:{width:z.getSize()},children:z.isPlaceholder?null:Dr(z.column.columnDef.header,z.getContext())},z.id))},D.id))}),l.jsx(uo,{className:"s3-explr-table-body",children:Cs.getRowModel().rows.length===0?l.jsx(ht,{className:"s3-explr-empty-row",children:l.jsx(Xe,{colSpan:mp.length,className:"h-24 text-center s3-explr-empty-cell",children:c?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',c,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:bs?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):Cs.getRowModel().rows.map(D=>l.jsx(ht,{className:"h-12 s3-explr-row",children:D.getVisibleCells().map(z=>l.jsx(Xe,{className:"align-middle s3-explr-cell",children:Dr(z.column.columnDef.cell,z.getContext())},z.id))},D.id))})]})})}),c&&Cr!==0&&l.jsx(l.Fragment,{children:l.jsx(ro,{children:l.jsxs(oo,{children:[l.jsx(io,{onClick:()=>Ht(D=>Math.max(D-1,1)),"aria-disabled":Ve===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(Cr/20)},(D,z)=>{const q=z+1,ne=Math.ceil(Cr/20);return ne>7&&!(q===1||q===ne||q>=Ve-1&&q<=Ve+1)?q===Ve-2&&Ve>4||q===Ve+2&&Ve<ne-3?l.jsx(so,{className:"pointer-events-none",children:"..."},z):null:l.jsx(mt,{className:"cursor-pointer",children:l.jsx(Mn,{isActive:Ve===q,onClick:()=>Ht(q),className:`${Ve===q?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:q})},z)}),l.jsx(mt,{children:l.jsx(ao,{onClick:()=>Ht(D=>Math.min(D+1,Math.ceil(Cr/20))),"aria-disabled":Ve===Math.ceil(Cr/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[g.size," ",(g.size===1,"tập tin")," đã chọn"]}),l.jsx(we,{variant:"default",onClick:()=>o(YC()),disabled:g.size===0,className:"s3-explr-ok-btn",children:"OK"})]})]})});var vr=e=>e.type==="checkbox",yn=e=>e instanceof Date,qe=e=>e==null;const qf=e=>typeof e=="object";var Me=e=>!qe(e)&&!Array.isArray(e)&&qf(e)&&!yn(e),mC=e=>Me(e)&&e.target?vr(e.target)?e.target.checked:e.target.value:e,hC=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,vC=(e,t)=>e.has(hC(t)),yC=e=>{const t=e.constructor&&e.constructor.prototype;return Me(t)&&t.hasOwnProperty("isPrototypeOf")},ps=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function lt(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ps&&(e instanceof Blob||r))&&(n||Me(e)))if(t=n?[]:{},!n&&!yC(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=lt(e[o]));else return e;return t}var Bo=e=>Array.isArray(e)?e.filter(Boolean):[],De=e=>e===void 0,ae=(e,t,n)=>{if(!t||!Me(e))return n;const r=Bo(t.split(/[,[\].]+?/)).reduce((o,i)=>qe(o)?o:o[i],e);return De(r)||r===e?De(e[t])?n:e[t]:r},Ot=e=>typeof e=="boolean",gs=e=>/^\w*$/.test(e),Gf=e=>Bo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(e,t,n)=>{let r=-1;const o=gs(t)?[t]:Gf(t),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let u=n;if(r!==a){const c=e[s];u=Me(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=u,e=e[s]}return e};const Kf={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};T.createContext(null);var xC=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==xt.all&&(t._proxyFormState[a]=!r||xt.all),e[a]}});return o},Je=e=>Me(e)&&!Object.keys(e).length,wC=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Je(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===xt.all)},Ho=e=>Array.isArray(e)?e:[e];function bC(e){const t=T.useRef(e);t.current=e,T.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Ft=e=>typeof e=="string",SC=(e,t,n,r,o)=>Ft(e)?(r&&t.watch.add(e),ae(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),ae(n,i))):(r&&(t.watchAll=!0),n),CC=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Yf=e=>({isOnSubmit:!e||e===xt.onSubmit,isOnBlur:e===xt.onBlur,isOnChange:e===xt.onChange,isOnAll:e===xt.all,isOnTouch:e===xt.onTouched}),Xf=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const yr=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=ae(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(yr(s,t))break}else if(Me(s)&&yr(s,t))break}}};var EC=(e,t,n)=>{const r=Ho(ae(e,n));return Oe(r,"root",t[n]),Oe(e,n,r),e},ms=e=>e.type==="file",kt=e=>typeof e=="function",Uo=e=>{if(!ps)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Wo=e=>Ft(e),hs=e=>e.type==="radio",qo=e=>e instanceof RegExp;const Jf={value:!1,isValid:!1},Zf={value:!0,isValid:!0};var Qf=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!De(e[0].attributes.value)?De(e[0].value)||e[0].value===""?Zf:{value:e[0].value,isValid:!0}:Zf:Jf}return Jf};const ep={isValid:!1,value:null};var tp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ep):ep;function np(e,t,n="validate"){if(Wo(e)||Array.isArray(e)&&e.every(Wo)||Ot(e)&&!e)return{type:n,message:Wo(e)?e:"",ref:t}}var qn=e=>Me(e)&&!qo(e)?e:{value:e,message:""},rp=async(e,t,n,r,o)=>{const{ref:i,refs:a,required:s,maxLength:u,minLength:c,min:d,max:g,pattern:h,validate:p,name:v,valueAsNumber:m,mount:y,disabled:w}=e._f,b=ae(t,v);if(!y||w)return{};const S=a?a[0]:i,E=U=>{r&&S.reportValidity&&(S.setCustomValidity(Ot(U)?"":U||""),S.reportValidity())},x={},O=hs(i),M=vr(i),I=O||M,H=(m||ms(i))&&De(i.value)&&De(b)||Uo(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,k=CC.bind(null,v,n,x),G=(U,Z,P,$=Bt.maxLength,F=Bt.minLength)=>{const W=U?Z:P;x[v]={type:U?$:F,message:W,ref:i,...k(U?$:F,W)}};if(o?!Array.isArray(b)||!b.length:s&&(!I&&(H||qe(b))||Ot(b)&&!b||M&&!Qf(a).isValid||O&&!tp(a).isValid)){const{value:U,message:Z}=Wo(s)?{value:!!s,message:s}:qn(s);if(U&&(x[v]={type:Bt.required,message:Z,ref:S,...k(Bt.required,Z)},!n))return E(Z),x}if(!H&&(!qe(d)||!qe(g))){let U,Z;const P=qn(g),$=qn(d);if(!qe(b)&&!isNaN(b)){const F=i.valueAsNumber||b&&+b;qe(P.value)||(U=F>P.value),qe($.value)||(Z=F<$.value)}else{const F=i.valueAsDate||new Date(b),W=_=>new Date(new Date().toDateString()+" "+_),N=i.type=="time",V=i.type=="week";Ft(P.value)&&b&&(U=N?W(b)>W(P.value):V?b>P.value:F>new Date(P.value)),Ft($.value)&&b&&(Z=N?W(b)<W($.value):V?b<$.value:F<new Date($.value))}if((U||Z)&&(G(!!U,P.message,$.message,Bt.max,Bt.min),!n))return E(x[v].message),x}if((u||c)&&!H&&(Ft(b)||o&&Array.isArray(b))){const U=qn(u),Z=qn(c),P=!qe(U.value)&&b.length>+U.value,$=!qe(Z.value)&&b.length<+Z.value;if((P||$)&&(G(P,U.message,Z.message),!n))return E(x[v].message),x}if(h&&!H&&Ft(b)){const{value:U,message:Z}=qn(h);if(qo(U)&&!b.match(U)&&(x[v]={type:Bt.pattern,message:Z,ref:i,...k(Bt.pattern,Z)},!n))return E(Z),x}if(p){if(kt(p)){const U=await p(b,t),Z=np(U,S);if(Z&&(x[v]={...Z,...k(Bt.validate,Z.message)},!n))return E(Z.message),x}else if(Me(p)){let U={};for(const Z in p){if(!Je(U)&&!n)break;const P=np(await p[Z](b,t),S,Z);P&&(U={...P,...k(Z,P.message)},E(P.message),n&&(x[v]=U))}if(!Je(U)&&(x[v]={ref:S,...U},!n))return x}}return E(!0),x};function TC(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=De(e)?r++:e[t[r++]];return e}function _C(e){for(const t in e)if(e.hasOwnProperty(t)&&!De(e[t]))return!1;return!0}function Re(e,t){const n=Array.isArray(t)?t:gs(t)?[t]:Gf(t),r=n.length===1?e:TC(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(Me(r)&&Je(r)||Array.isArray(r)&&_C(r))&&Re(e,n.slice(0,-1)),e}var vs=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},ys=e=>qe(e)||!qf(e);function on(e,t){if(ys(e)||ys(t))return e===t;if(yn(e)&&yn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=t[o];if(yn(i)&&yn(a)||Me(i)&&Me(a)||Array.isArray(i)&&Array.isArray(a)?!on(i,a):i!==a)return!1}}return!0}var op=e=>e.type==="select-multiple",AC=e=>hs(e)||vr(e),xs=e=>Uo(e)&&e.isConnected,ip=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Go(e,t={}){const n=Array.isArray(e);if(Me(e)||n)for(const r in e)Array.isArray(e[r])||Me(e[r])&&!ip(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Go(e[r],t[r])):qe(e[r])||(t[r]=!0);return t}function ap(e,t,n){const r=Array.isArray(e);if(Me(e)||r)for(const o in e)Array.isArray(e[o])||Me(e[o])&&!ip(e[o])?De(t)||ys(n[o])?n[o]=Array.isArray(e[o])?Go(e[o],[]):{...Go(e[o])}:ap(e[o],qe(t)?{}:t[o],n[o]):n[o]=!on(e[o],t[o]);return n}var xr=(e,t)=>ap(e,t,Go(t)),sp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>De(e)?e:t?e===""?NaN:e&&+e:n&&Ft(e)?new Date(e):r?r(e):e;function ws(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ms(t)?t.files:hs(t)?tp(e.refs).value:op(t)?[...t.selectedOptions].map(({value:n})=>n):vr(t)?Qf(e.refs).value:sp(De(t.value)?e.ref.value:t.value,e)}var PC=(e,t,n,r)=>{const o={};for(const i of e){const a=ae(t,i);a&&Oe(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},wr=e=>De(e)?e:qo(e)?e.source:Me(e)?qo(e.value)?e.value.source:e.value:e;const lp="AsyncFunction";var NC=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===lp||Me(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lp)),OC=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function cp(e,t,n){const r=ae(e,n);if(r||gs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=ae(t,i),s=ae(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}var FC=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,kC=(e,t)=>!Bo(ae(e,t)).length&&Re(e,t);const DC={mode:xt.onSubmit,reValidateMode:xt.onChange,shouldFocusError:!0};function MC(e={}){let t={...DC,...e},n={submitCount:0,isDirty:!1,isLoading:kt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Me(t.defaultValues)||Me(t.values)?lt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:lt(o),a={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:vs(),array:vs(),state:vs()},h=Yf(t.mode),p=Yf(t.reValidateMode),v=t.criteriaMode===xt.all,m=C=>A=>{clearTimeout(c),c=setTimeout(C,A)},y=async C=>{if(!t.disabled&&(d.isValid||C)){const A=t.resolver?Je((await I()).errors):await k(r,!0);A!==n.isValid&&g.state.next({isValid:A})}},w=(C,A)=>{!t.disabled&&(d.isValidating||d.validatingFields)&&((C||Array.from(s.mount)).forEach(R=>{R&&(A?Oe(n.validatingFields,R,A):Re(n.validatingFields,R))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Je(n.validatingFields)}))},b=(C,A=[],R,te,J=!0,X=!0)=>{if(te&&R&&!t.disabled){if(a.action=!0,X&&Array.isArray(ae(r,C))){const j=R(ae(r,C),te.argA,te.argB);J&&Oe(r,C,j)}if(X&&Array.isArray(ae(n.errors,C))){const j=R(ae(n.errors,C),te.argA,te.argB);J&&Oe(n.errors,C,j),kC(n.errors,C)}if(d.touchedFields&&X&&Array.isArray(ae(n.touchedFields,C))){const j=R(ae(n.touchedFields,C),te.argA,te.argB);J&&Oe(n.touchedFields,C,j)}d.dirtyFields&&(n.dirtyFields=xr(o,i)),g.state.next({name:C,isDirty:U(C,A),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Oe(i,C,A)},S=(C,A)=>{Oe(n.errors,C,A),g.state.next({errors:n.errors})},E=C=>{n.errors=C,g.state.next({errors:n.errors,isValid:!1})},x=(C,A,R,te)=>{const J=ae(r,C);if(J){const X=ae(i,C,De(R)?ae(o,C):R);De(X)||te&&te.defaultChecked||A?Oe(i,C,A?X:ws(J._f)):$(C,X),a.mount&&y()}},O=(C,A,R,te,J)=>{let X=!1,j=!1;const Y={name:C};if(!t.disabled){const ye=!!(ae(r,C)&&ae(r,C)._f&&ae(r,C)._f.disabled);if(!R||te){d.isDirty&&(j=n.isDirty,n.isDirty=Y.isDirty=U(),X=j!==Y.isDirty);const be=ye||on(ae(o,C),A);j=!!(!ye&&ae(n.dirtyFields,C)),be||ye?Re(n.dirtyFields,C):Oe(n.dirtyFields,C,!0),Y.dirtyFields=n.dirtyFields,X=X||d.dirtyFields&&j!==!be}if(R){const be=ae(n.touchedFields,C);be||(Oe(n.touchedFields,C,R),Y.touchedFields=n.touchedFields,X=X||d.touchedFields&&be!==R)}X&&J&&g.state.next(Y)}return X?Y:{}},M=(C,A,R,te)=>{const J=ae(n.errors,C),X=d.isValid&&Ot(A)&&n.isValid!==A;if(t.delayError&&R?(u=m(()=>S(C,R)),u(t.delayError)):(clearTimeout(c),u=null,R?Oe(n.errors,C,R):Re(n.errors,C)),(R?!on(J,R):J)||!Je(te)||X){const j={...te,...X&&Ot(A)?{isValid:A}:{},errors:n.errors,name:C};n={...n,...j},g.state.next(j)}},I=async C=>{w(C,!0);const A=await t.resolver(i,t.context,PC(C||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),A},H=async C=>{const{errors:A}=await I(C);if(C)for(const R of C){const te=ae(A,R);te?Oe(n.errors,R,te):Re(n.errors,R)}else n.errors=A;return A},k=async(C,A,R={valid:!0})=>{for(const te in C){const J=C[te];if(J){const{_f:X,...j}=J;if(X){const Y=s.array.has(X.name),ye=J._f&&NC(J._f);ye&&d.validatingFields&&w([te],!0);const be=await rp(J,i,v,t.shouldUseNativeValidation&&!A,Y);if(ye&&d.validatingFields&&w([te]),be[X.name]&&(R.valid=!1,A))break;!A&&(ae(be,X.name)?Y?EC(n.errors,be,X.name):Oe(n.errors,X.name,be[X.name]):Re(n.errors,X.name))}!Je(j)&&await k(j,A,R)}}return R.valid},G=()=>{for(const C of s.unMount){const A=ae(r,C);A&&(A._f.refs?A._f.refs.every(R=>!xs(R)):!xs(A._f.ref))&&oe(C)}s.unMount=new Set},U=(C,A)=>!t.disabled&&(C&&A&&Oe(i,C,A),!on(B(),o)),Z=(C,A,R)=>SC(C,s,{...a.mount?i:De(A)?o:Ft(C)?{[C]:A}:A},R,A),P=C=>Bo(ae(a.mount?i:o,C,t.shouldUnregister?ae(o,C,[]):[])),$=(C,A,R={})=>{const te=ae(r,C);let J=A;if(te){const X=te._f;X&&(!X.disabled&&Oe(i,C,sp(A,X)),J=Uo(X.ref)&&qe(A)?"":A,op(X.ref)?[...X.ref.options].forEach(j=>j.selected=J.includes(j.value)):X.refs?vr(X.ref)?X.refs.length>1?X.refs.forEach(j=>(!j.defaultChecked||!j.disabled)&&(j.checked=Array.isArray(J)?!!J.find(Y=>Y===j.value):J===j.value)):X.refs[0]&&(X.refs[0].checked=!!J):X.refs.forEach(j=>j.checked=j.value===J):ms(X.ref)?X.ref.value="":(X.ref.value=J,X.ref.type||g.values.next({name:C,values:{...i}})))}(R.shouldDirty||R.shouldTouch)&&O(C,J,R.shouldTouch,R.shouldDirty,!0),R.shouldValidate&&_(C)},F=(C,A,R)=>{for(const te in A){const J=A[te],X=`${C}.${te}`,j=ae(r,X);(s.array.has(C)||Me(J)||j&&!j._f)&&!yn(J)?F(X,J,R):$(X,J,R)}},W=(C,A,R={})=>{const te=ae(r,C),J=s.array.has(C),X=lt(A);Oe(i,C,X),J?(g.array.next({name:C,values:{...i}}),(d.isDirty||d.dirtyFields)&&R.shouldDirty&&g.state.next({name:C,dirtyFields:xr(o,i),isDirty:U(C,X)})):te&&!te._f&&!qe(X)?F(C,X,R):$(C,X,R),Xf(C,s)&&g.state.next({...n}),g.values.next({name:a.mount?C:void 0,values:{...i}})},N=async C=>{a.mount=!0;const A=C.target;let R=A.name,te=!0;const J=ae(r,R),X=()=>A.type?ws(J._f):mC(C),j=Y=>{te=Number.isNaN(Y)||yn(Y)&&isNaN(Y.getTime())||on(Y,ae(i,R,Y))};if(J){let Y,ye;const be=X(),Te=C.type===Kf.BLUR||C.type===Kf.FOCUS_OUT,Mt=!OC(J._f)&&!t.resolver&&!ae(n.errors,R)&&!J._f.deps||FC(Te,ae(n.touchedFields,R),n.isSubmitted,p,h),ct=Xf(R,s,Te);Oe(i,R,be),Te?(J._f.onBlur&&J._f.onBlur(C),u&&u(0)):J._f.onChange&&J._f.onChange(C);const Ve=O(R,be,Te,!1),Ht=!Je(Ve)||ct;if(!Te&&g.values.next({name:R,type:C.type,values:{...i}}),Mt)return d.isValid&&(t.mode==="onBlur"?Te&&y():y()),Ht&&g.state.next({name:R,...ct?{}:Ve});if(!Te&&ct&&g.state.next({...n}),t.resolver){const{errors:Ut}=await I([R]);if(j(be),te){const Wt=cp(n.errors,r,R),Ce=cp(Ut,r,Wt.name||R);Y=Ce.error,R=Ce.name,ye=Je(Ut)}}else w([R],!0),Y=(await rp(J,i,v,t.shouldUseNativeValidation))[R],w([R]),j(be),te&&(Y?ye=!1:d.isValid&&(ye=await k(r,!0)));te&&(J._f.deps&&_(J._f.deps),M(R,ye,Y,Ve))}},V=(C,A)=>{if(ae(n.errors,A)&&C.focus)return C.focus(),1},_=async(C,A={})=>{let R,te;const J=Ho(C);if(t.resolver){const X=await H(De(C)?C:J);R=Je(X),te=C?!J.some(j=>ae(X,j)):R}else C?(te=(await Promise.all(J.map(async X=>{const j=ae(r,X);return await k(j&&j._f?{[X]:j}:j)}))).every(Boolean),!(!te&&!n.isValid)&&y()):te=R=await k(r);return g.state.next({...!Ft(C)||d.isValid&&R!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:R}:{},errors:n.errors}),A.shouldFocus&&!te&&yr(r,V,C?J:s.mount),te},B=C=>{const A={...a.mount?i:o};return De(C)?A:Ft(C)?ae(A,C):C.map(R=>ae(A,R))},Q=(C,A)=>({invalid:!!ae((A||n).errors,C),isDirty:!!ae((A||n).dirtyFields,C),error:ae((A||n).errors,C),isValidating:!!ae(n.validatingFields,C),isTouched:!!ae((A||n).touchedFields,C)}),re=C=>{C&&Ho(C).forEach(A=>Re(n.errors,A)),g.state.next({errors:C?n.errors:{}})},ee=(C,A,R)=>{const te=(ae(r,C,{_f:{}})._f||{}).ref,J=ae(n.errors,C)||{},{ref:X,message:j,type:Y,...ye}=J;Oe(n.errors,C,{...ye,...A,ref:te}),g.state.next({name:C,errors:n.errors,isValid:!1}),R&&R.shouldFocus&&te&&te.focus&&te.focus()},ce=(C,A)=>kt(C)?g.values.subscribe({next:R=>C(Z(void 0,A),R)}):Z(C,A,!0),oe=(C,A={})=>{for(const R of C?Ho(C):s.mount)s.mount.delete(R),s.array.delete(R),A.keepValue||(Re(r,R),Re(i,R)),!A.keepError&&Re(n.errors,R),!A.keepDirty&&Re(n.dirtyFields,R),!A.keepTouched&&Re(n.touchedFields,R),!A.keepIsValidating&&Re(n.validatingFields,R),!t.shouldUnregister&&!A.keepDefaultValue&&Re(o,R);g.values.next({values:{...i}}),g.state.next({...n,...A.keepDirty?{isDirty:U()}:{}}),!A.keepIsValid&&y()},ie=({disabled:C,name:A,field:R,fields:te,value:J})=>{if(Ot(C)&&a.mount||C){const X=C?void 0:De(J)?ws(R?R._f:ae(te,A)._f):J;(C||!C&&!De(X))&&Oe(i,A,X),O(A,X,!1,!1,!0)}},de=(C,A={})=>{let R=ae(r,C);const te=Ot(A.disabled)||Ot(t.disabled);return Oe(r,C,{...R||{},_f:{...R&&R._f?R._f:{ref:{name:C}},name:C,mount:!0,...A}}),s.mount.add(C),R?ie({field:R,disabled:Ot(A.disabled)?A.disabled:t.disabled,name:C,value:A.value}):x(C,!0,A.value),{...te?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:wr(A.min),max:wr(A.max),minLength:wr(A.minLength),maxLength:wr(A.maxLength),pattern:wr(A.pattern)}:{},name:C,onChange:N,onBlur:N,ref:J=>{if(J){de(C,A),R=ae(r,C);const X=De(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,j=AC(X),Y=R._f.refs||[];if(j?Y.find(ye=>ye===X):X===R._f.ref)return;Oe(r,C,{_f:{...R._f,...j?{refs:[...Y.filter(xs),X,...Array.isArray(ae(o,C))?[{}]:[]],ref:{type:X.type,name:C}}:{ref:X}}}),x(C,!1,void 0,X)}else R=ae(r,C,{}),R._f&&(R._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(vC(s.array,C)&&a.action)&&s.unMount.add(C)}}},ue=()=>t.shouldFocusError&&yr(r,V,s.mount),le=C=>{Ot(C)&&(g.state.next({disabled:C}),yr(r,(A,R)=>{const te=ae(r,R);te&&(A.disabled=te._f.disabled||C,Array.isArray(te._f.refs)&&te._f.refs.forEach(J=>{J.disabled=te._f.disabled||C}))},0,!1))},Se=(C,A)=>async R=>{let te;if(R&&(R.preventDefault&&R.preventDefault(),R.persist&&R.persist()),t.disabled){A&&await A({...n.errors},R);return}let J=lt(i);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:X,values:j}=await I();n.errors=X,J=j}else await k(r);if(Re(n.errors,"root"),Je(n.errors)){g.state.next({errors:{}});try{await C(J,R)}catch(X){te=X}}else A&&await A({...n.errors},R),ue(),setTimeout(ue);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Je(n.errors)&&!te,submitCount:n.submitCount+1,errors:n.errors}),te)throw te},K=(C,A={})=>{ae(r,C)&&(De(A.defaultValue)?W(C,lt(ae(o,C))):(W(C,A.defaultValue),Oe(o,C,lt(A.defaultValue))),A.keepTouched||Re(n.touchedFields,C),A.keepDirty||(Re(n.dirtyFields,C),n.isDirty=A.defaultValue?U(C,lt(ae(o,C))):U()),A.keepError||(Re(n.errors,C),d.isValid&&y()),g.state.next({...n}))},Ee=(C,A={})=>{const R=C?lt(C):o,te=lt(R),J=Je(C),X=J?o:te;if(A.keepDefaultValues||(o=R),!A.keepValues){if(A.keepDirtyValues){const j=new Set([...s.mount,...Object.keys(xr(o,i))]);for(const Y of Array.from(j))ae(n.dirtyFields,Y)?Oe(X,Y,ae(i,Y)):W(Y,ae(X,Y))}else{if(ps&&De(C))for(const j of s.mount){const Y=ae(r,j);if(Y&&Y._f){const ye=Array.isArray(Y._f.refs)?Y._f.refs[0]:Y._f.ref;if(Uo(ye)){const be=ye.closest("form");if(be){be.reset();break}}}}r={}}i=t.shouldUnregister?A.keepDefaultValues?lt(o):{}:lt(X),g.array.next({values:{...X}}),g.values.next({values:{...X}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!A.keepIsValid||!!A.keepDirtyValues,a.watch=!!t.shouldUnregister,g.state.next({submitCount:A.keepSubmitCount?n.submitCount:0,isDirty:J?!1:A.keepDirty?n.isDirty:!!(A.keepDefaultValues&&!on(C,o)),isSubmitted:A.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:J?{}:A.keepDirtyValues?A.keepDefaultValues&&i?xr(o,i):n.dirtyFields:A.keepDefaultValues&&C?xr(o,C):A.keepDirty?n.dirtyFields:{},touchedFields:A.keepTouched?n.touchedFields:{},errors:A.keepErrors?n.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},He=(C,A)=>Ee(kt(C)?C(i):C,A);return{control:{register:de,unregister:oe,getFieldState:Q,handleSubmit:Se,setError:ee,_executeSchema:I,_getWatch:Z,_getDirty:U,_updateValid:y,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:ie,_getFieldArray:P,_reset:Ee,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(C=>{He(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:le,_subjects:g,_proxyFormState:d,_setErrors:E,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(C){a=C},get _defaultValues(){return o},get _names(){return s},set _names(C){s=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:_,register:de,handleSubmit:Se,watch:ce,setValue:W,getValues:B,reset:He,resetField:K,clearErrors:re,unregister:oe,setError:ee,setFocus:(C,A={})=>{const R=ae(r,C),te=R&&R._f;if(te){const J=te.refs?te.refs[0]:te.ref;J.focus&&(J.focus(),A.shouldSelect&&kt(J.select)&&J.select())}},getFieldState:Q}}function $C(e={}){const t=T.useRef(),n=T.useRef(),[r,o]=T.useState({isDirty:!1,isValidating:!1,isLoading:kt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:kt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...MC(e),formState:r});const i=t.current.control;return i._options=e,bC({subject:i._subjects.state,next:a=>{wC(a,i._proxyFormState,i._updateFormState)&&o({...i._formState})}}),T.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),T.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),T.useEffect(()=>{e.values&&!on(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[e.values,i]),T.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),T.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),T.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),T.useMemo(()=>({...t.current,formState:xC(r,i)}),[r,i])}const up=({className:e,children:t,content:n,side:r})=>{const[o,i]=T.useState(!1);return l.jsx(zn,{delayDuration:0,children:l.jsxs(Bn,{open:o,children:[l.jsx(Hn,{asChild:!0,children:l.jsx("button",{type:"button",className:ge("cursor-pointer",e),onClick:()=>i(!o),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onTouchStart:()=>i(!o),onKeyDown:a=>{a.preventDefault(),a.key==="Enter"&&i(!o)},children:t})}),l.jsx(hn,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},IC=(e,t)=>{const[n,r]=T.useState(e);return T.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},LC=({apiBaseUrl:e="http://localhost:3002"})=>{var O,M;const[t,n]=T.useState([]),[r,o]=T.useState(!1),[i,a]=T.useState([]),[s,u]=T.useState(1),[c,d]=T.useState(1),[g,h]=T.useState(null),[p,v]=T.useState(""),m=IC(p,500),y=I=>{const H=I.match(/\d{6}/);if(!H)return{month:"",year:""};const k=H[0],G=k.substring(0,2),U=k.substring(2);return{month:G,year:U}},w=I=>I.map(k=>{let G=(k==null?void 0:k.month)||"",U=(k==null?void 0:k.year)||"";if((!G||!U)&&(k!=null&&k.file_name)){const Z=y(k.file_name);G=G||Z.month,U=U||Z.year}return{id:k==null?void 0:k.id,prefix:(k==null?void 0:k.prefix)||"",model:(k==null?void 0:k.model)||"",fileName:(k==null?void 0:k.file_name)||"",code:(k==null?void 0:k.stock_id)||"",month:G,year:U,content:(k==null?void 0:k.text_summary)||"",status:(k==null?void 0:k.status)||"",note:(k==null?void 0:k.note)||"",lastUpdate:k==null?void 0:k.updated_at,stock_id:k==null?void 0:k.stock_id}}),b=I=>{if(!(I!=null&&I.data))return[];const H=w(I==null?void 0:I.data);n(H),d(I.pagination.totalPages)},S=async(I=1,H=15)=>{h(I),o(!0);try{const k=await he.get(`${e}/api/latest-summaries`,{params:{page:I,limit:H,search:p}});(k==null?void 0:k.status)===200?b(k.data):console.error(k)}catch(k){console.error("Error fetching data:",k)}finally{h(null),o(!1)}};T.useEffect(()=>{m&&u(1),S(s)},[s,m]);const E=T.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:H})=>l.jsx("span",{className:"flex flex-col",children:H.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:H})=>{const k=H.original.month,G=H.original.year;return l.jsx("span",{className:"flex flex-col",children:`${k.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:H})=>{const k=H.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:k})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:H})=>{const G=H.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:H})=>l.jsx(up,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:H.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:H.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:H})=>{const k=new Date(H.original.lastUpdate),G=k.getDate(),U=k.getMonth()+1,Z=`ngày ${G} tháng ${U}`;return l.jsx("span",{className:"flex flex-col",children:Z})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:H})=>{const[k,G]=T.useState(!1),[U,Z]=T.useState(!1),[P,$]=T.useState(!1),{handleSubmit:F,register:W,reset:N}=$C(),V=H.original.id,_=H.getValue("status"),B=H.getValue("content"),[Q,re]=T.useState(!1),ee=async()=>{try{re(!0);const oe=_==="unpublish"?"published":"unpublish",ie=await he.patch(`${e}/api/toggle-publish/${V}`,{id:V,typeAction:"update",status:_,idInput:V,stock_id:H.original.stock_id,prefix:H.original.prefix,model:H.original.model,summary_result:H.original.content,note:H.original.note});ie.status===200?n(de=>de.map(ue=>ue.id===V?{...ue,status:oe}:ue)):console.error("Failed to toggle publish status:",ie)}catch(oe){console.error("Error toggling publish status:",oe)}finally{re(!1)}},ce=async oe=>{G(!0);try{const ie=await he.patch(`${e}/api/update-summary`,{note:oe.note,text_summary:oe.content,id:V});ie.status===200?(await S(s),Z(!1)):console.error("Failed to update summary:",ie)}catch(ie){console.error("Error updating summary:",ie)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(we,{variant:"outline",size:"sm",onClick:()=>$(!0),className:"px-2 py-0.5 h-7",children:l.jsx(lh,{className:"h-4 w-4"})}),l.jsx(Rt,{open:P,onOpenChange:$,children:l.jsxs(St,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(Ct,{children:l.jsx(Et,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:B})})]})}),l.jsxs(Rt,{open:U,onOpenChange:oe=>{Z(oe),oe?N({content:H.original.content,note:H.original.note}):N()},children:[l.jsx(no,{asChild:!0,children:l.jsx(we,{variant:"outline",size:"sm",onClick:()=>Z(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(St,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Ct,{className:"flex flex-col gap-3",children:[l.jsx(Et,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:F(ce),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(ar,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:H.original.answer||"",rows:10,...W("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(ar,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:H.original.note||"",rows:1,...W("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(we,{disabled:k,type:"submit",variant:"default",children:k?l.jsx($e,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(we,{variant:"outline",size:"sm",onClick:ee,disabled:Q,className:"w-[70px] px-2 py-0.5 h-7",children:Q?l.jsx($e,{className:"h-4 w-4 animate-spin"}):_==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Vs({data:t,columns:E,state:{columnFilters:i},enableRowSelection:!0,onColumnFiltersChange:a,getFilteredRowModel:fg(),getCoreRowModel:Rs()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(en,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:I=>v(I.target.value),className:"pr-8"}),p&&l.jsx(we,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx(Di,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(lo,{className:"s3-explr-table",children:[l.jsx(co,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(I=>l.jsx(ht,{className:"hover:bg-transparent s3-explr-header-row",children:I.headers.map(H=>l.jsx(Tt,{className:"s3-explr-header-cell",children:H.isPlaceholder?null:Dr(H.column.columnDef.header,H.getContext())},H.id))},I.id))}),l.jsx(uo,{className:"s3-explr-table-body",children:r?l.jsx(ht,{children:l.jsx(Xe,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(O=x.getRowModel().rows)!=null&&O.length?(M=x.getRowModel().rows)==null?void 0:M.map(I=>l.jsx(ht,{className:"h-12 s3-explr-row",children:I.getVisibleCells().map(H=>l.jsx(Xe,{className:"align-middle s3-explr-cell",children:Dr(H.column.columnDef.cell,H.getContext())},H.id))},I.id)):l.jsx(ht,{children:l.jsx(Xe,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ro,{children:l.jsxs(oo,{children:[l.jsx(mt,{children:l.jsx(io,{onClick:()=>u(I=>Math.max(1,I-1)),className:s===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(I,H)=>H+1).filter(I=>I===1||I===c||Math.abs(I-s)<=1).map((I,H,k)=>l.jsxs(l.Fragment,{children:[H>0&&k[H-1]!==I-1&&l.jsx(mt,{children:l.jsx(so,{})},I+"..."),l.jsx(mt,{children:l.jsx(Mn,{onClick:()=>u(I),isActive:s===I,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===I?l.jsx($e,{className:"h-4 w-4 animate-spin"}):I})},I)]})),l.jsx(mt,{children:l.jsx(ao,{onClick:()=>u(I=>Math.min(c,I+1)),className:s===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},dp=10,RC=T.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=T.useState(1),[r,o]=T.useState([]),[i,a]=T.useState({total:0,page:1,limit:dp,totalPages:1}),[s,u]=T.useState(!0),[c,d]=T.useState(null),[g,h]=T.useState(new Set),{toast:p}=So(),[v,m]=T.useState(!1),y=async x=>{try{d(x);const O=await he.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:dp.toString()}});o(O.data.data),a(O.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{d(null),u(!1)}};T.useEffect(()=>{y(t)},[t,e]);const w=async x=>{h(O=>new Set(O).add(x.toString()));try{await he.post(`${e}/api/retry-job`,{jobId:x}),p({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{h(O=>{const M=new Set(O);return M.delete(x.toString()),M})}},b=async()=>{m(!0),n(1),await y(1),m(!1)},S=x=>new Date(x).toLocaleString(),E=x=>{if(x=parseFloat(x),x<60)return`${x.toFixed(2)}s`;const O=Math.floor(x/60),M=(x%60).toFixed(0);return`${O}m ${M}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(oh,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(we,{variant:"outline",size:"icon",onClick:b,disabled:v||s,className:"ml-2",children:l.jsx(dh,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(lo,{children:[l.jsx(co,{children:l.jsxs(ht,{children:[l.jsx(Tt,{children:"ID"}),l.jsx(Tt,{children:"Tên Công Việc"}),l.jsx(Tt,{children:"Thời Gian Bắt Đầu"}),l.jsx(Tt,{children:"Thời Gian Cập Nhật"}),l.jsx(Tt,{children:"Thời Gian Thực Thi"}),l.jsx(Tt,{children:"Trạng Thái"}),l.jsx(Tt,{children:"Thao Tác"})]})}),l.jsx(uo,{children:s&&r.length===0?l.jsx(ht,{children:l.jsx(Xe,{colSpan:7,className:"text-center py-4",children:l.jsx($e,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var O,M;return l.jsxs(ht,{children:[l.jsx(Xe,{className:"!w-[100px]",children:x.id}),l.jsx(Xe,{className:"font-medium",children:(O=x.job_name)==null?void 0:O.replace("Upload file","Summary")}),l.jsx(Xe,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(Xe,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(Xe,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(Xe,{className:"!w-[200px]",children:l.jsx(up,{content:x.status==="fail"&&x.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:x.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
175
175
  ${x.status==="done"?"bg-green-100 text-green-800":x.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:x.status==="fail"?"FAILED":(M=x.status)==null?void 0:M.toUpperCase()})})}),l.jsx(Xe,{className:"!w-[200px]",children:x.status==="fail"?l.jsx(we,{variant:"outline",size:"sm",onClick:()=>w(x.id),disabled:g.has(x.id.toString()),className:"h-[32px]",children:g.has(x.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx($e,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},x.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ro,{children:l.jsxs(oo,{children:[l.jsx(mt,{children:l.jsx(io,{onClick:()=>n(x=>Math.max(1,x-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:i.totalPages},(x,O)=>O+1).filter(x=>x===1||x===i.totalPages||Math.abs(x-t)<=1).map((x,O,M)=>l.jsxs(l.Fragment,{children:[O>0&&M[O-1]!==x-1&&l.jsx(mt,{children:l.jsx(so,{})},x+"..."),l.jsx(mt,{children:l.jsx(Mn,{onClick:()=>n(x),isActive:t===x,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===x?l.jsx($e,{className:"h-4 w-4 animate-spin"}):x})},x)]})),l.jsx(mt,{children:l.jsx(ao,{onClick:()=>n(x=>Math.min(i.totalPages,x+1)),className:t===i.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(rd,{})]})});dt.Job=RC,dt.S3Explorer=gC,dt.Summary=LC,Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"})});
176
176
  //# sourceMappingURL=s3-explorer.umd.cjs.map