@spaceandtimelabs/makeinfinite-ui 0.37.1 → 0.39.0

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.
@@ -1,29 +1,29 @@
1
- (function(be,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react"),require("@babel/standalone"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@babel/standalone","react-dom"],K):(be=typeof globalThis<"u"?globalThis:be||self,K(be.MakeInfinite={},be.React,be.Babel,be.ReactDOM))})(this,function(be,K,mh,wc){"use strict";function wh(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gc=wh(mh);var Ci=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xa(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var gh=yh;function yh(e){var t,r;if(typeof e!="function")throw new Error("expected a function but got "+e);return function(){return t||(t=!0,r=e.apply(this,arguments)),r}}(function(e){function t(y,v){var O;return y instanceof Buffer?O=y:O=Buffer.from(y.buffer,y.byteOffset,y.byteLength),O.toString(v)}var r=function(y){return Buffer.from(y)};function n(y){for(var v=0,O=Math.min(256*256,y.length+1),R=new Uint16Array(O),b=[],C=0;;){var k=v<y.length;if(!k||C>=O-1){var S=R.subarray(0,C),P=S;if(b.push(String.fromCharCode.apply(null,P)),!k)return b.join("");y=y.subarray(v),v=0,C=0}var $=y[v++];if(!($&128))R[C++]=$;else if(($&224)===192){var B=y[v++]&63;R[C++]=($&31)<<6|B}else if(($&240)===224){var B=y[v++]&63,M=y[v++]&63;R[C++]=($&31)<<12|B<<6|M}else if(($&248)===240){var B=y[v++]&63,M=y[v++]&63,H=y[v++]&63,Y=($&7)<<18|B<<12|M<<6|H;Y>65535&&(Y-=65536,R[C++]=Y>>>10&1023|55296,Y=56320|Y&1023),R[C++]=Y}}}function i(y){for(var v=0,O=y.length,R=0,b=Math.max(32,O+(O>>>1)+7),C=new Uint8Array(b>>>3<<3);v<O;){var k=y.charCodeAt(v++);if(k>=55296&&k<=56319){if(v<O){var S=y.charCodeAt(v);(S&64512)===56320&&(++v,k=((k&1023)<<10)+(S&1023)+65536)}if(k>=55296&&k<=56319)continue}if(R+4>C.length){b+=8,b*=1+v/y.length*2,b=b>>>3<<3;var P=new Uint8Array(b);P.set(C),C=P}if(k&4294967168)if(!(k&4294965248))C[R++]=k>>>6&31|192;else if(!(k&4294901760))C[R++]=k>>>12&15|224,C[R++]=k>>>6&63|128;else if(!(k&4292870144))C[R++]=k>>>18&7|240,C[R++]=k>>>12&63|128,C[R++]=k>>>6&63|128;else continue;else{C[R++]=k;continue}C[R++]=k&63|128}return C.slice?C.slice(0,R):C.subarray(0,R)}var a="Failed to ",o=function(y,v,O){if(y)throw new Error("".concat(a).concat(v,": the '").concat(O,"' option is unsupported."))},s=typeof Buffer=="function"&&Buffer.from,l=s?r:i;function c(){this.encoding="utf-8"}c.prototype.encode=function(y,v){return o(v&&v.stream,"encode","stream"),l(y)};function u(y){var v;try{var O=new Blob([y],{type:"text/plain;charset=UTF-8"});v=URL.createObjectURL(O);var R=new XMLHttpRequest;return R.open("GET",v,!1),R.send(),R.responseText}finally{v&&URL.revokeObjectURL(v)}}var d=!s&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",p=["utf-8","utf8","unicode-1-1-utf-8"],m=n;s?m=t:d&&(m=function(y){try{return u(y)}catch{return n(y)}});var g="construct 'TextDecoder'",_="".concat(a," ").concat(g,": the ");function x(y,v){o(v&&v.fatal,g,"fatal"),y=y||"utf-8";var O;if(s?O=Buffer.isEncoding(y):O=p.indexOf(y.toLowerCase())!==-1,!O)throw new RangeError("".concat(_," encoding label provided ('").concat(y,"') is invalid."));this.encoding=y,this.fatal=!1,this.ignoreBOM=!1}x.prototype.decode=function(y,v){o(v&&v.stream,"decode","stream");var O;return y instanceof Uint8Array?O=y:y.buffer instanceof ArrayBuffer?O=new Uint8Array(y.buffer):O=new Uint8Array(y),m(O,this.encoding)},e.TextEncoder=e.TextEncoder||c,e.TextDecoder=e.TextDecoder||x})(typeof window<"u"?window:Ci);var bh={encode:e=>new TextEncoder().encode(e),decode:e=>new TextDecoder().decode(e)},_h=vh;function vh(e,t,r){var n;return function(){if(!t)return e.apply(this,arguments);var i=this,a=arguments,o=r&&!n;if(clearTimeout(n),n=setTimeout(function(){if(n=null,!o)return e.apply(i,a)},t),o)return e.apply(this,arguments)}}function yc(e){if(e.length===0)return".";let t=bc(e);return t=t.reduce(kh,[]),Za(...t)}function xh(...e){let t="";for(let r of e)r.startsWith("/")?t=r:t=yc(Za(t,r));return t}function Za(...e){if(e.length===0)return"";let t=e.join("/");return t=t.replace(/\/{2,}/g,"/"),t}function bc(e){if(e.length===0)return[];if(e==="/")return["/"];let t=e.split("/");return t[t.length-1]===""&&t.pop(),e[0]==="/"?t[0]="/":t[0]!=="."&&t.unshift("."),t}function Eh(e){const t=e.lastIndexOf("/");if(t===-1)throw new Error(`Cannot get dirname of "${e}"`);return t===0?"/":e.slice(0,t)}function Sh(e){if(e==="/")throw new Error(`Cannot get basename of "${e}"`);const t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function kh(e,t){if(e.length===0)return e.push(t),e;if(t===".")return e;if(t===".."){if(e.length===1){if(e[0]==="/")throw new Error("Unable to normalize path - traverses above root directory");if(e[0]===".")return e.push(t),e}return e[e.length-1]===".."?(e.push(".."),e):(e.pop(),e)}return e.push(t),e}var Va={join:Za,normalize:yc,split:bc,basename:Sh,dirname:Eh,resolve:xh};function On(e){return class extends Error{constructor(...t){super(...t),this.code=e,this.message?this.message=e+": "+this.message:this.message=e}}}const Rh=On("EEXIST"),Oh=On("ENOENT"),Ch=On("ENOTDIR"),Th=On("ENOTEMPTY"),Ph=On("ETIMEDOUT");var _c={EEXIST:Rh,ENOENT:Oh,ENOTDIR:Ch,ENOTEMPTY:Th,ETIMEDOUT:Ph};const et=Va,{EEXIST:vc,ENOENT:Ah,ENOTDIR:xc,ENOTEMPTY:$h}=_c,Ve=0;var Dh=class{constructor(){}_makeRoot(t=new Map){return t.set(Ve,{mode:511,type:"dir",size:0,ino:0,mtimeMs:Date.now()}),t}activate(t=null){t===null?this._root=new Map([["/",this._makeRoot()]]):typeof t=="string"?this._root=new Map([["/",this._makeRoot(this.parse(t))]]):this._root=t}get activated(){return!!this._root}deactivate(){this._root=void 0}size(){return this._countInodes(this._root.get("/"))-1}_countInodes(t){let r=1;for(let[n,i]of t)n!==Ve&&(r+=this._countInodes(i));return r}autoinc(){return this._maxInode(this._root.get("/"))+1}_maxInode(t){let r=t.get(Ve).ino;for(let[n,i]of t)n!==Ve&&(r=Math.max(r,this._maxInode(i)));return r}print(t=this._root.get("/")){let r="";const n=(i,a)=>{for(let[o,s]of i){if(o===0)continue;let l=s.get(Ve),c=l.mode.toString(8);r+=`${" ".repeat(a)}${o} ${c}`,l.type==="file"?r+=` ${l.size} ${l.mtimeMs}
2
- `:(r+=`
3
- `,n(s,a+1))}};return n(t,0),r}parse(t){let r=0;function n(s){const l=++r,c=s.length===1?"dir":"file";let[u,d,p]=s;return u=parseInt(u,8),d=d?parseInt(d):0,p=p?parseInt(p):Date.now(),new Map([[Ve,{mode:u,type:c,size:d,mtimeMs:p,ino:l}]])}let i=t.trim().split(`
4
- `),a=this._makeRoot(),o=[{indent:-1,node:a},{indent:0,node:null}];for(let s of i){let c=s.match(/^\t*/)[0].length;s=s.slice(c);let[u,...d]=s.split(" "),p=n(d);if(c<=o[o.length-1].indent)for(;c<=o[o.length-1].indent;)o.pop();o.push({indent:c,node:p}),o[o.length-2].node.set(u,p)}return a}_lookup(t,r=!0){let n=this._root,i="/",a=et.split(t);for(let o=0;o<a.length;++o){let s=a[o];if(n=n.get(s),!n)throw new Ah(t);if(r||o<a.length-1){const l=n.get(Ve);if(l.type==="symlink"){let c=et.resolve(i,l.target);n=this._lookup(c)}i?i=et.join(i,s):i=s}}return n}mkdir(t,{mode:r}){if(t==="/")throw new vc;let n=this._lookup(et.dirname(t)),i=et.basename(t);if(n.has(i))throw new vc;let a=new Map,o={mode:r,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};a.set(Ve,o),n.set(i,a)}rmdir(t){let r=this._lookup(t);if(r.get(Ve).type!=="dir")throw new xc;if(r.size>1)throw new $h;let n=this._lookup(et.dirname(t)),i=et.basename(t);n.delete(i)}readdir(t){let r=this._lookup(t);if(r.get(Ve).type!=="dir")throw new xc;return[...r.keys()].filter(n=>typeof n=="string")}writeStat(t,r,{mode:n}){let i;try{let c=this.stat(t);n==null&&(n=c.mode),i=c.ino}catch{}n==null&&(n=438),i==null&&(i=this.autoinc());let a=this._lookup(et.dirname(t)),o=et.basename(t),s={mode:n,type:"file",size:r,mtimeMs:Date.now(),ino:i},l=new Map;return l.set(Ve,s),a.set(o,l),s}unlink(t){let r=this._lookup(et.dirname(t)),n=et.basename(t);r.delete(n)}rename(t,r){let n=et.basename(r),i=this._lookup(t);this._lookup(et.dirname(r)).set(n,i),this.unlink(t)}stat(t){return this._lookup(t).get(Ve)}lstat(t){return this._lookup(t,!1).get(Ve)}readlink(t){return this._lookup(t,!1).get(Ve).target}symlink(t,r){let n,i;try{let c=this.stat(r);i===null&&(i=c.mode),n=c.ino}catch{}i==null&&(i=40960),n==null&&(n=this.autoinc());let a=this._lookup(et.dirname(r)),o=et.basename(r),s={mode:i,type:"symlink",target:t,size:0,mtimeMs:Date.now(),ino:n},l=new Map;return l.set(Ve,s),a.set(o,l),s}_du(t){let r=0;for(const[n,i]of t.entries())n===Ve?r+=i.size:r+=this._du(i);return r}du(t){let r=this._lookup(t);return this._du(r)}};class Ec{constructor(t="keyval-store",r="keyval"){this.storeName=r,this._dbName=t,this._storeName=r,this._init()}_init(){this._dbp||(this._dbp=new Promise((t,r)=>{const n=indexedDB.open(this._dbName);n.onerror=()=>r(n.error),n.onsuccess=()=>t(n.result),n.onupgradeneeded=()=>{n.result.createObjectStore(this._storeName)}}))}_withIDBStore(t,r){return this._init(),this._dbp.then(n=>new Promise((i,a)=>{const o=n.transaction(this.storeName,t);o.oncomplete=()=>i(),o.onabort=o.onerror=()=>a(o.error),r(o.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(t=>{t.close(),this._dbp=void 0})}}let Ka;function vr(){return Ka||(Ka=new Ec),Ka}function Ih(e,t=vr()){let r;return t._withIDBStore("readwrite",n=>{r=n.get(e)}).then(()=>r.result)}function jh(e,t,r=vr()){return r._withIDBStore("readwrite",n=>{n.put(t,e)})}function Bh(e,t,r=vr()){return r._withIDBStore("readwrite",n=>{const i=n.get(e);i.onsuccess=()=>{n.put(t(i.result),e)}})}function zh(e,t=vr()){return t._withIDBStore("readwrite",r=>{r.delete(e)})}function Nh(e=vr()){return e._withIDBStore("readwrite",t=>{t.clear()})}function Mh(e=vr()){const t=[];return e._withIDBStore("readwrite",r=>{(r.openKeyCursor||r.openCursor).call(r).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)}function Lh(e=vr()){return e._close()}const Sc=Xa(Object.freeze(Object.defineProperty({__proto__:null,Store:Ec,clear:Nh,close:Lh,del:zh,get:Ih,keys:Mh,set:jh,update:Bh},Symbol.toStringTag,{value:"Module"}))),tr=Sc;var Fh=class{constructor(t,r){this._database=t,this._storename=r,this._store=new tr.Store(this._database,this._storename)}saveSuperblock(t){return tr.set("!root",t,this._store)}loadSuperblock(){return tr.get("!root",this._store)}readFile(t){return tr.get(t,this._store)}writeFile(t,r){return tr.set(t,r,this._store)}unlink(t){return tr.del(t,this._store)}wipe(){return tr.clear(this._store)}close(){return tr.close(this._store)}},Uh=class{constructor(t){this._url=t}loadSuperblock(){return fetch(this._url+"/.superblock.txt").then(t=>t.ok?t.text():null)}async readFile(t){const r=await fetch(this._url+t);if(r.status===200)return r.arrayBuffer();throw new Error("ENOENT")}async sizeFile(t){const r=await fetch(this._url+t,{method:"HEAD"});if(r.status===200)return r.headers.get("content-length");throw new Error("ENOENT")}};const Cn=Sc,Hh=e=>new Promise(t=>setTimeout(t,e));var Wh=class{constructor(t,r){this._id=Math.random(),this._database=t,this._storename=r,this._store=new Cn.Store(this._database,this._storename),this._lock=null}async has({margin:t=2e3}={}){if(this._lock&&this._lock.holder===this._id){const r=Date.now();return this._lock.expires>r+t?!0:await this.renew()}else return!1}async renew({ttl:t=5e3}={}){let r;return await Cn.update("lock",n=>{const a=Date.now()+t;return r=n&&n.holder===this._id,this._lock=r?{holder:this._id,expires:a}:n,this._lock},this._store),r}async acquire({ttl:t=5e3}={}){let r,n,i;if(await Cn.update("lock",a=>{const o=Date.now(),s=o+t;return n=a&&a.expires<o,r=a===void 0||n,i=a&&a.holder===this._id,this._lock=r?{holder:this._id,expires:s}:a,this._lock},this._store),i)throw new Error("Mutex double-locked");return r}async wait({interval:t=100,limit:r=6e3,ttl:n}={}){for(;r--;){if(await this.acquire({ttl:n}))return!0;await Hh(t)}throw new Error("Mutex timeout")}async release({force:t=!1}={}){let r,n,i;if(await Cn.update("lock",a=>(r=t||a&&a.holder===this._id,n=a===void 0,i=a&&a.holder!==this._id,this._lock=r?void 0:a,this._lock),this._store),await Cn.close(this._store),!r&&!t){if(n)throw new Error("Mutex double-freed");if(i)throw new Error("Mutex lost ownership")}return r}},Gh=class{constructor(t){this._id=Math.random(),this._database=t,this._has=!1,this._release=null}async has(){return this._has}async acquire(){return new Promise(t=>{navigator.locks.request(this._database+"_lock",{ifAvailable:!0},r=>(this._has=!!r,t(!!r),new Promise(n=>{this._release=n})))})}async wait({timeout:t=6e5}={}){return new Promise((r,n)=>{const i=new AbortController;setTimeout(()=>{i.abort(),n(new Error("Mutex timeout"))},t),navigator.locks.request(this._database+"_lock",{signal:i.signal},a=>(this._has=!!a,r(!!a),new Promise(o=>{this._release=o})))})}async release({force:t=!1}={}){this._has=!1,this._release?this._release():t&&navigator.locks.request(this._database+"_lock",{steal:!0},r=>!0)}};const{encode:qh,decode:kc}=bh,Yh=_h,Xh=Dh,{ENOENT:Zh,ENOTEMPTY:Vh,ETIMEDOUT:Kh}=_c,Jh=Fh,Qh=Uh,ep=Wh,tp=Gh,Tn=Va;var rp=class{constructor(){this.saveSuperblock=Yh(()=>{this.flush()},500)}async init(t,{wipe:r,url:n,urlauto:i,fileDbName:a=t,db:o=null,fileStoreName:s=t+"_files",lockDbName:l=t+"_lock",lockStoreName:c=t+"_lock"}={}){this._name=t,this._idb=o||new Jh(a,s),this._mutex=navigator.locks?new tp(t):new ep(l,c),this._cache=new Xh(t),this._opts={wipe:r,url:n},this._needsWipe=!!r,n&&(this._http=new Qh(n),this._urlauto=!!i)}async activate(){if(this._cache.activated)return;this._needsWipe&&(this._needsWipe=!1,await this._idb.wipe(),await this._mutex.release({force:!0})),await this._mutex.has()||await this._mutex.wait();const t=await this._idb.loadSuperblock();if(t)this._cache.activate(t);else if(this._http){const r=await this._http.loadSuperblock();this._cache.activate(r),await this._saveSuperblock()}else this._cache.activate();if(!await this._mutex.has())throw new Kh}async deactivate(){await this._mutex.has()&&await this._saveSuperblock(),this._cache.deactivate();try{await this._mutex.release()}catch(t){console.log(t)}await this._idb.close()}async _saveSuperblock(){this._cache.activated&&(this._lastSavedAt=Date.now(),await this._idb.saveSuperblock(this._cache._root))}_writeStat(t,r,n){let i=Tn.split(Tn.dirname(t)),a=i.shift();for(let o of i){a=Tn.join(a,o);try{this._cache.mkdir(a,{mode:511})}catch{}}return this._cache.writeStat(t,r,n)}async readFile(t,r){const{encoding:n}=r;if(n&&n!=="utf8")throw new Error('Only "utf8" encoding is supported in readFile');let i=null,a=null;try{a=this._cache.stat(t),i=await this._idb.readFile(a.ino)}catch(o){if(!this._urlauto)throw o}if(!i&&this._http){let o=this._cache.lstat(t);for(;o.type==="symlink";)t=Tn.resolve(Tn.dirname(t),o.target),o=this._cache.lstat(t);i=await this._http.readFile(t)}if(i&&((!a||a.size!=i.byteLength)&&(a=await this._writeStat(t,i.byteLength,{mode:a?a.mode:438}),this.saveSuperblock()),n==="utf8"?i=kc(i):i.toString=()=>kc(i)),!a)throw new Zh(t);return i}async writeFile(t,r,n){const{mode:i,encoding:a="utf8"}=n;if(typeof r=="string"){if(a!=="utf8")throw new Error('Only "utf8" encoding is supported in writeFile');r=qh(r)}const o=await this._cache.writeStat(t,r.byteLength,{mode:i});await this._idb.writeFile(o.ino,r)}async unlink(t,r){const n=this._cache.lstat(t);this._cache.unlink(t),n.type!=="symlink"&&await this._idb.unlink(n.ino)}readdir(t,r){return this._cache.readdir(t)}mkdir(t,r){const{mode:n=511}=r;this._cache.mkdir(t,{mode:n})}rmdir(t,r){if(t==="/")throw new Vh;this._cache.rmdir(t)}rename(t,r){this._cache.rename(t,r)}stat(t,r){return this._cache.stat(t)}lstat(t,r){return this._cache.lstat(t)}readlink(t,r){return this._cache.readlink(t)}symlink(t,r){this._cache.symlink(t,r)}async backFile(t,r){let n=await this._http.sizeFile(t);await this._writeStat(t,n,r)}du(t){return this._cache.du(t)}flush(){return this._saveSuperblock()}},np=class{constructor(t){this.type=t.type,this.mode=t.mode,this.size=t.size,this.ino=t.ino,this.mtimeMs=t.mtimeMs,this.ctimeMs=t.ctimeMs||t.mtimeMs,this.uid=1,this.gid=1,this.dev=1}isFile(){return this.type==="file"}isDirectory(){return this.type==="dir"}isSymbolicLink(){return this.type==="symlink"}};const ip=rp,Rc=np,Ti=Va;function Pt(e,t,...r){return e=Ti.normalize(e),(typeof t>"u"||typeof t=="function")&&(t={}),typeof t=="string"&&(t={encoding:t}),[e,t,...r]}function ap(e,t,r,...n){return e=Ti.normalize(e),(typeof r>"u"||typeof r=="function")&&(r={}),typeof r=="string"&&(r={encoding:r}),[e,t,r,...n]}function Oc(e,t,...r){return[Ti.normalize(e),Ti.normalize(t),...r]}var op=class{constructor(t,r={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,Pt,!1),this.writeFile=this._wrap(this.writeFile,ap,!0),this.unlink=this._wrap(this.unlink,Pt,!0),this.readdir=this._wrap(this.readdir,Pt,!1),this.mkdir=this._wrap(this.mkdir,Pt,!0),this.rmdir=this._wrap(this.rmdir,Pt,!0),this.rename=this._wrap(this.rename,Oc,!0),this.stat=this._wrap(this.stat,Pt,!1),this.lstat=this._wrap(this.lstat,Pt,!1),this.readlink=this._wrap(this.readlink,Pt,!1),this.symlink=this._wrap(this.symlink,Oc,!0),this.backFile=this._wrap(this.backFile,Pt,!0),this.du=this._wrap(this.du,Pt,!1),this._deactivationPromise=null,this._deactivationTimeout=null,this._activationPromise=null,this._operations=new Set,t&&this.init(t,r)}async init(...t){return this._initPromiseResolve&&await this._initPromise,this._initPromise=this._init(...t),this._initPromise}async _init(t,r={}){await this._gracefulShutdown(),this._activationPromise&&await this._deactivate(),this._backend&&this._backend.destroy&&await this._backend.destroy(),this._backend=r.backend||new ip,this._backend.init&&await this._backend.init(t,r),this._initPromiseResolve&&(this._initPromiseResolve(),this._initPromiseResolve=null),r.defer||this.stat("/")}async _gracefulShutdown(){this._operations.size>0&&(this._isShuttingDown=!0,await new Promise(t=>this._gracefulShutdownResolve=t),this._isShuttingDown=!1,this._gracefulShutdownResolve=null)}_wrap(t,r,n){return async(...i)=>{i=r(...i);let a={name:t.name,args:i};this._operations.add(a);try{return await this._activate(),await t.apply(this,i)}finally{this._operations.delete(a),n&&this._backend.saveSuperblock(),this._operations.size===0&&(this._deactivationTimeout||clearTimeout(this._deactivationTimeout),this._deactivationTimeout=setTimeout(this._deactivate.bind(this),500))}}}async _activate(){this._initPromise||console.warn(new Error(`Attempted to use LightningFS ${this._name} before it was initialized.`)),await this._initPromise,this._deactivationTimeout&&(clearTimeout(this._deactivationTimeout),this._deactivationTimeout=null),this._deactivationPromise&&await this._deactivationPromise,this._deactivationPromise=null,this._activationPromise||(this._activationPromise=this._backend.activate?this._backend.activate():Promise.resolve()),await this._activationPromise}async _deactivate(){return this._activationPromise&&await this._activationPromise,this._deactivationPromise||(this._deactivationPromise=this._backend.deactivate?this._backend.deactivate():Promise.resolve()),this._activationPromise=null,this._gracefulShutdownResolve&&this._gracefulShutdownResolve(),this._deactivationPromise}async readFile(t,r){return this._backend.readFile(t,r)}async writeFile(t,r,n){return await this._backend.writeFile(t,r,n),null}async unlink(t,r){return await this._backend.unlink(t,r),null}async readdir(t,r){return this._backend.readdir(t,r)}async mkdir(t,r){return await this._backend.mkdir(t,r),null}async rmdir(t,r){return await this._backend.rmdir(t,r),null}async rename(t,r){return await this._backend.rename(t,r),null}async stat(t,r){const n=await this._backend.stat(t,r);return new Rc(n)}async lstat(t,r){const n=await this._backend.lstat(t,r);return new Rc(n)}async readlink(t,r){return this._backend.readlink(t,r)}async symlink(t,r){return await this._backend.symlink(t,r),null}async backFile(t,r){return await this._backend.backFile(t,r),null}async du(t){return this._backend.du(t)}async flush(){return this._backend.flush()}};const sp=gh,cp=op;function ot(e,t){return typeof e=="function"&&(t=e),t=sp(t),[(...n)=>t(null,...n),t]}var lp=class{constructor(...t){this.promises=new cp(...t),this.init=this.init.bind(this),this.readFile=this.readFile.bind(this),this.writeFile=this.writeFile.bind(this),this.unlink=this.unlink.bind(this),this.readdir=this.readdir.bind(this),this.mkdir=this.mkdir.bind(this),this.rmdir=this.rmdir.bind(this),this.rename=this.rename.bind(this),this.stat=this.stat.bind(this),this.lstat=this.lstat.bind(this),this.readlink=this.readlink.bind(this),this.symlink=this.symlink.bind(this),this.backFile=this.backFile.bind(this),this.du=this.du.bind(this),this.flush=this.flush.bind(this)}init(t,r){return this.promises.init(t,r)}readFile(t,r,n){const[i,a]=ot(r,n);this.promises.readFile(t,r).then(i).catch(a)}writeFile(t,r,n,i){const[a,o]=ot(n,i);this.promises.writeFile(t,r,n).then(a).catch(o)}unlink(t,r,n){const[i,a]=ot(r,n);this.promises.unlink(t,r).then(i).catch(a)}readdir(t,r,n){const[i,a]=ot(r,n);this.promises.readdir(t,r).then(i).catch(a)}mkdir(t,r,n){const[i,a]=ot(r,n);this.promises.mkdir(t,r).then(i).catch(a)}rmdir(t,r,n){const[i,a]=ot(r,n);this.promises.rmdir(t,r).then(i).catch(a)}rename(t,r,n){const[i,a]=ot(n);this.promises.rename(t,r).then(i).catch(a)}stat(t,r,n){const[i,a]=ot(r,n);this.promises.stat(t).then(i).catch(a)}lstat(t,r,n){const[i,a]=ot(r,n);this.promises.lstat(t).then(i).catch(a)}readlink(t,r,n){const[i,a]=ot(r,n);this.promises.readlink(t).then(i).catch(a)}symlink(t,r,n){const[i,a]=ot(n);this.promises.symlink(t,r).then(i).catch(a)}backFile(t,r,n){const[i,a]=ot(r,n);this.promises.backFile(t,r).then(i).catch(a)}du(t,r){const[n,i]=ot(r);this.promises.du(t).then(n).catch(i)}flush(t){const[r,n]=ot(t);this.promises.flush().then(r).catch(n)}};const up=St(lp);var Ja={},Pi={};Pi.byteLength=hp,Pi.toByteArray=mp,Pi.fromByteArray=yp;for(var At=[],yt=[],fp=typeof Uint8Array<"u"?Uint8Array:Array,Qa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ur=0,dp=Qa.length;Ur<dp;++Ur)At[Ur]=Qa[Ur],yt[Qa.charCodeAt(Ur)]=Ur;yt[45]=62,yt[95]=63;function Cc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function hp(e){var t=Cc(e),r=t[0],n=t[1];return(r+n)*3/4-n}function pp(e,t,r){return(t+r)*3/4-r}function mp(e){var t,r=Cc(e),n=r[0],i=r[1],a=new fp(pp(e,n,i)),o=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)t=yt[e.charCodeAt(l)]<<18|yt[e.charCodeAt(l+1)]<<12|yt[e.charCodeAt(l+2)]<<6|yt[e.charCodeAt(l+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=yt[e.charCodeAt(l)]<<2|yt[e.charCodeAt(l+1)]>>4,a[o++]=t&255),i===1&&(t=yt[e.charCodeAt(l)]<<10|yt[e.charCodeAt(l+1)]<<4|yt[e.charCodeAt(l+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function wp(e){return At[e>>18&63]+At[e>>12&63]+At[e>>6&63]+At[e&63]}function gp(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(wp(n));return i.join("")}function yp(e){for(var t,r=e.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(gp(e,o,o+a>s?s:o+a));return n===1?(t=e[r-1],i.push(At[t>>2]+At[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(At[t>>10]+At[t>>4&63]+At[t<<2&63]+"=")),i.join("")}var eo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */eo.read=function(e,t,r,n,i){var a,o,s=i*8-n-1,l=(1<<s)-1,c=l>>1,u=-7,d=r?i-1:0,p=r?-1:1,m=e[t+d];for(d+=p,a=m&(1<<-u)-1,m>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=o*256+e[t+d],d+=p,u-=8);if(a===0)a=1-c;else{if(a===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(m?-1:1)*o*Math.pow(2,a-n)},eo.write=function(e,t,r,n,i,a){var o,s,l,c=a*8-i-1,u=(1<<c)-1,d=u>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:a-1,g=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=p/l:t+=p*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+m]=s&255,m+=g,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+m]=o&255,m+=g,o/=256,c-=8);e[r+m-g]|=_*128};/*!
1
+ (function($e,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@babel/standalone"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@babel/standalone","react-dom"],E):($e=typeof globalThis<"u"?globalThis:$e||self,E($e.MakeInfinite={},$e.React,$e.Babel,$e.ReactDOM))})(this,function($e,E,nO,tr){"use strict";function af(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=af(E),Fv=af(nO),nc=af(tr);var rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var rO=oO;function oO(e){var t,n;if(typeof e!="function")throw new Error("expected a function but got "+e);return function(){return t||(t=!0,n=e.apply(this,arguments)),n}}(function(e){function t(w,b){var x;return w instanceof Buffer?x=w:x=Buffer.from(w.buffer,w.byteOffset,w.byteLength),x.toString(b)}var n=function(w){return Buffer.from(w)};function r(w){for(var b=0,x=Math.min(256*256,w.length+1),S=new Uint16Array(x),C=[],N=0;;){var R=b<w.length;if(!R||N>=x-1){var T=S.subarray(0,N),M=T;if(C.push(String.fromCharCode.apply(null,M)),!R)return C.join("");w=w.subarray(b),b=0,N=0}var A=w[b++];if(!(A&128))S[N++]=A;else if((A&224)===192){var k=w[b++]&63;S[N++]=(A&31)<<6|k}else if((A&240)===224){var k=w[b++]&63,F=w[b++]&63;S[N++]=(A&31)<<12|k<<6|F}else if((A&248)===240){var k=w[b++]&63,F=w[b++]&63,L=w[b++]&63,Y=(A&7)<<18|k<<12|F<<6|L;Y>65535&&(Y-=65536,S[N++]=Y>>>10&1023|55296,Y=56320|Y&1023),S[N++]=Y}}}function o(w){for(var b=0,x=w.length,S=0,C=Math.max(32,x+(x>>>1)+7),N=new Uint8Array(C>>>3<<3);b<x;){var R=w.charCodeAt(b++);if(R>=55296&&R<=56319){if(b<x){var T=w.charCodeAt(b);(T&64512)===56320&&(++b,R=((R&1023)<<10)+(T&1023)+65536)}if(R>=55296&&R<=56319)continue}if(S+4>N.length){C+=8,C*=1+b/w.length*2,C=C>>>3<<3;var M=new Uint8Array(C);M.set(N),N=M}if(R&4294967168)if(!(R&4294965248))N[S++]=R>>>6&31|192;else if(!(R&4294901760))N[S++]=R>>>12&15|224,N[S++]=R>>>6&63|128;else if(!(R&4292870144))N[S++]=R>>>18&7|240,N[S++]=R>>>12&63|128,N[S++]=R>>>6&63|128;else continue;else{N[S++]=R;continue}N[S++]=R&63|128}return N.slice?N.slice(0,S):N.subarray(0,S)}var i="Failed to ",a=function(w,b,x){if(w)throw new Error("".concat(i).concat(b,": the '").concat(x,"' option is unsupported."))},s=typeof Buffer=="function"&&Buffer.from,l=s?n:o;function c(){this.encoding="utf-8"}c.prototype.encode=function(w,b){return a(b&&b.stream,"encode","stream"),l(w)};function u(w){var b;try{var x=new Blob([w],{type:"text/plain;charset=UTF-8"});b=URL.createObjectURL(x);var S=new XMLHttpRequest;return S.open("GET",b,!1),S.send(),S.responseText}finally{b&&URL.revokeObjectURL(b)}}var d=!s&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",f=["utf-8","utf8","unicode-1-1-utf-8"],h=r;s?h=t:d&&(h=function(w){try{return u(w)}catch{return r(w)}});var p="construct 'TextDecoder'",m="".concat(i," ").concat(p,": the ");function v(w,b){a(b&&b.fatal,p,"fatal"),w=w||"utf-8";var x;if(s?x=Buffer.isEncoding(w):x=f.indexOf(w.toLowerCase())!==-1,!x)throw new RangeError("".concat(m," encoding label provided ('").concat(w,"') is invalid."));this.encoding=w,this.fatal=!1,this.ignoreBOM=!1}v.prototype.decode=function(w,b){a(b&&b.stream,"decode","stream");var x;return w instanceof Uint8Array?x=w:w.buffer instanceof ArrayBuffer?x=new Uint8Array(w.buffer):x=new Uint8Array(w),h(x,this.encoding)},e.TextEncoder=e.TextEncoder||c,e.TextDecoder=e.TextDecoder||v})(typeof window<"u"?window:rc);var iO={encode:e=>new TextEncoder().encode(e),decode:e=>new TextDecoder().decode(e)},aO=sO;function sO(e,t,n){var r;return function(){if(!t)return e.apply(this,arguments);var o=this,i=arguments,a=n&&!r;if(clearTimeout(r),r=setTimeout(function(){if(r=null,!a)return e.apply(o,i)},t),a)return e.apply(this,arguments)}}function Lv(e){if(e.length===0)return".";let t=zv(e);return t=t.reduce(dO,[]),sf(...t)}function lO(...e){let t="";for(let n of e)n.startsWith("/")?t=n:t=Lv(sf(t,n));return t}function sf(...e){if(e.length===0)return"";let t=e.join("/");return t=t.replace(/\/{2,}/g,"/"),t}function zv(e){if(e.length===0)return[];if(e==="/")return["/"];let t=e.split("/");return t[t.length-1]===""&&t.pop(),e[0]==="/"?t[0]="/":t[0]!=="."&&t.unshift("."),t}function cO(e){const t=e.lastIndexOf("/");if(t===-1)throw new Error(`Cannot get dirname of "${e}"`);return t===0?"/":e.slice(0,t)}function uO(e){if(e==="/")throw new Error(`Cannot get basename of "${e}"`);const t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function dO(e,t){if(e.length===0)return e.push(t),e;if(t===".")return e;if(t===".."){if(e.length===1){if(e[0]==="/")throw new Error("Unable to normalize path - traverses above root directory");if(e[0]===".")return e.push(t),e}return e[e.length-1]===".."?(e.push(".."),e):(e.pop(),e)}return e.push(t),e}var lf={join:sf,normalize:Lv,split:zv,basename:uO,dirname:cO,resolve:lO};function Ja(e){return class extends Error{constructor(...t){super(...t),this.code=e,this.message?this.message=e+": "+this.message:this.message=e}}}const fO=Ja("EEXIST"),hO=Ja("ENOENT"),pO=Ja("ENOTDIR"),mO=Ja("ENOTEMPTY"),gO=Ja("ETIMEDOUT");var Bv={EEXIST:fO,ENOENT:hO,ENOTDIR:pO,ENOTEMPTY:mO,ETIMEDOUT:gO};const Gt=lf,{EEXIST:Hv,ENOENT:wO,ENOTDIR:Uv,ENOTEMPTY:vO}=Bv,It=0;var yO=class{constructor(){}_makeRoot(t=new Map){return t.set(It,{mode:511,type:"dir",size:0,ino:0,mtimeMs:Date.now()}),t}activate(t=null){t===null?this._root=new Map([["/",this._makeRoot()]]):typeof t=="string"?this._root=new Map([["/",this._makeRoot(this.parse(t))]]):this._root=t}get activated(){return!!this._root}deactivate(){this._root=void 0}size(){return this._countInodes(this._root.get("/"))-1}_countInodes(t){let n=1;for(let[r,o]of t)r!==It&&(n+=this._countInodes(o));return n}autoinc(){return this._maxInode(this._root.get("/"))+1}_maxInode(t){let n=t.get(It).ino;for(let[r,o]of t)r!==It&&(n=Math.max(n,this._maxInode(o)));return n}print(t=this._root.get("/")){let n="";const r=(o,i)=>{for(let[a,s]of o){if(a===0)continue;let l=s.get(It),c=l.mode.toString(8);n+=`${" ".repeat(i)}${a} ${c}`,l.type==="file"?n+=` ${l.size} ${l.mtimeMs}
2
+ `:(n+=`
3
+ `,r(s,i+1))}};return r(t,0),n}parse(t){let n=0;function r(s){const l=++n,c=s.length===1?"dir":"file";let[u,d,f]=s;return u=parseInt(u,8),d=d?parseInt(d):0,f=f?parseInt(f):Date.now(),new Map([[It,{mode:u,type:c,size:d,mtimeMs:f,ino:l}]])}let o=t.trim().split(`
4
+ `),i=this._makeRoot(),a=[{indent:-1,node:i},{indent:0,node:null}];for(let s of o){let c=s.match(/^\t*/)[0].length;s=s.slice(c);let[u,...d]=s.split(" "),f=r(d);if(c<=a[a.length-1].indent)for(;c<=a[a.length-1].indent;)a.pop();a.push({indent:c,node:f}),a[a.length-2].node.set(u,f)}return i}_lookup(t,n=!0){let r=this._root,o="/",i=Gt.split(t);for(let a=0;a<i.length;++a){let s=i[a];if(r=r.get(s),!r)throw new wO(t);if(n||a<i.length-1){const l=r.get(It);if(l.type==="symlink"){let c=Gt.resolve(o,l.target);r=this._lookup(c)}o?o=Gt.join(o,s):o=s}}return r}mkdir(t,{mode:n}){if(t==="/")throw new Hv;let r=this._lookup(Gt.dirname(t)),o=Gt.basename(t);if(r.has(o))throw new Hv;let i=new Map,a={mode:n,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};i.set(It,a),r.set(o,i)}rmdir(t){let n=this._lookup(t);if(n.get(It).type!=="dir")throw new Uv;if(n.size>1)throw new vO;let r=this._lookup(Gt.dirname(t)),o=Gt.basename(t);r.delete(o)}readdir(t){let n=this._lookup(t);if(n.get(It).type!=="dir")throw new Uv;return[...n.keys()].filter(r=>typeof r=="string")}writeStat(t,n,{mode:r}){let o;try{let c=this.stat(t);r==null&&(r=c.mode),o=c.ino}catch{}r==null&&(r=438),o==null&&(o=this.autoinc());let i=this._lookup(Gt.dirname(t)),a=Gt.basename(t),s={mode:r,type:"file",size:n,mtimeMs:Date.now(),ino:o},l=new Map;return l.set(It,s),i.set(a,l),s}unlink(t){let n=this._lookup(Gt.dirname(t)),r=Gt.basename(t);n.delete(r)}rename(t,n){let r=Gt.basename(n),o=this._lookup(t);this._lookup(Gt.dirname(n)).set(r,o),this.unlink(t)}stat(t){return this._lookup(t).get(It)}lstat(t){return this._lookup(t,!1).get(It)}readlink(t){return this._lookup(t,!1).get(It).target}symlink(t,n){let r,o;try{let c=this.stat(n);o===null&&(o=c.mode),r=c.ino}catch{}o==null&&(o=40960),r==null&&(r=this.autoinc());let i=this._lookup(Gt.dirname(n)),a=Gt.basename(n),s={mode:o,type:"symlink",target:t,size:0,mtimeMs:Date.now(),ino:r},l=new Map;return l.set(It,s),i.set(a,l),s}_du(t){let n=0;for(const[r,o]of t.entries())r===It?n+=o.size:n+=this._du(o);return n}du(t){let n=this._lookup(t);return this._du(n)}};class Vv{constructor(t="keyval-store",n="keyval"){this.storeName=n,this._dbName=t,this._storeName=n,this._init()}_init(){this._dbp||(this._dbp=new Promise((t,n)=>{const r=indexedDB.open(this._dbName);r.onerror=()=>n(r.error),r.onsuccess=()=>t(r.result),r.onupgradeneeded=()=>{r.result.createObjectStore(this._storeName)}}))}_withIDBStore(t,n){return this._init(),this._dbp.then(r=>new Promise((o,i)=>{const a=r.transaction(this.storeName,t);a.oncomplete=()=>o(),a.onabort=a.onerror=()=>i(a.error),n(a.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(t=>{t.close(),this._dbp=void 0})}}let cf;function Ao(){return cf||(cf=new Vv),cf}function bO(e,t=Ao()){let n;return t._withIDBStore("readwrite",r=>{n=r.get(e)}).then(()=>n.result)}function xO(e,t,n=Ao()){return n._withIDBStore("readwrite",r=>{r.put(t,e)})}function _O(e,t,n=Ao()){return n._withIDBStore("readwrite",r=>{const o=r.get(e);o.onsuccess=()=>{r.put(t(o.result),e)}})}function SO(e,t=Ao()){return t._withIDBStore("readwrite",n=>{n.delete(e)})}function CO(e=Ao()){return e._withIDBStore("readwrite",t=>{t.clear()})}function EO(e=Ao()){const t=[];return e._withIDBStore("readwrite",n=>{(n.openKeyCursor||n.openCursor).call(n).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)}function PO(e=Ao()){return e._close()}const Wv=oc(Object.freeze(Object.defineProperty({__proto__:null,Store:Vv,clear:CO,close:PO,del:SO,get:bO,keys:EO,set:xO,update:_O},Symbol.toStringTag,{value:"Module"}))),qr=Wv;var RO=class{constructor(t,n){this._database=t,this._storename=n,this._store=new qr.Store(this._database,this._storename)}saveSuperblock(t){return qr.set("!root",t,this._store)}loadSuperblock(){return qr.get("!root",this._store)}readFile(t){return qr.get(t,this._store)}writeFile(t,n){return qr.set(t,n,this._store)}unlink(t){return qr.del(t,this._store)}wipe(){return qr.clear(this._store)}close(){return qr.close(this._store)}},NO=class{constructor(t){this._url=t}loadSuperblock(){return fetch(this._url+"/.superblock.txt").then(t=>t.ok?t.text():null)}async readFile(t){const n=await fetch(this._url+t);if(n.status===200)return n.arrayBuffer();throw new Error("ENOENT")}async sizeFile(t){const n=await fetch(this._url+t,{method:"HEAD"});if(n.status===200)return n.headers.get("content-length");throw new Error("ENOENT")}};const Qa=Wv,TO=e=>new Promise(t=>setTimeout(t,e));var MO=class{constructor(t,n){this._id=Math.random(),this._database=t,this._storename=n,this._store=new Qa.Store(this._database,this._storename),this._lock=null}async has({margin:t=2e3}={}){if(this._lock&&this._lock.holder===this._id){const n=Date.now();return this._lock.expires>n+t?!0:await this.renew()}else return!1}async renew({ttl:t=5e3}={}){let n;return await Qa.update("lock",r=>{const i=Date.now()+t;return n=r&&r.holder===this._id,this._lock=n?{holder:this._id,expires:i}:r,this._lock},this._store),n}async acquire({ttl:t=5e3}={}){let n,r,o;if(await Qa.update("lock",i=>{const a=Date.now(),s=a+t;return r=i&&i.expires<a,n=i===void 0||r,o=i&&i.holder===this._id,this._lock=n?{holder:this._id,expires:s}:i,this._lock},this._store),o)throw new Error("Mutex double-locked");return n}async wait({interval:t=100,limit:n=6e3,ttl:r}={}){for(;n--;){if(await this.acquire({ttl:r}))return!0;await TO(t)}throw new Error("Mutex timeout")}async release({force:t=!1}={}){let n,r,o;if(await Qa.update("lock",i=>(n=t||i&&i.holder===this._id,r=i===void 0,o=i&&i.holder!==this._id,this._lock=n?void 0:i,this._lock),this._store),await Qa.close(this._store),!n&&!t){if(r)throw new Error("Mutex double-freed");if(o)throw new Error("Mutex lost ownership")}return n}},DO=class{constructor(t){this._id=Math.random(),this._database=t,this._has=!1,this._release=null}async has(){return this._has}async acquire(){return new Promise(t=>{navigator.locks.request(this._database+"_lock",{ifAvailable:!0},n=>(this._has=!!n,t(!!n),new Promise(r=>{this._release=r})))})}async wait({timeout:t=6e5}={}){return new Promise((n,r)=>{const o=new AbortController;setTimeout(()=>{o.abort(),r(new Error("Mutex timeout"))},t),navigator.locks.request(this._database+"_lock",{signal:o.signal},i=>(this._has=!!i,n(!!i),new Promise(a=>{this._release=a})))})}async release({force:t=!1}={}){this._has=!1,this._release?this._release():t&&navigator.locks.request(this._database+"_lock",{steal:!0},n=>!0)}};const{encode:AO,decode:Gv}=iO,kO=aO,IO=yO,{ENOENT:OO,ENOTEMPTY:jO,ETIMEDOUT:$O}=Bv,FO=RO,LO=NO,zO=MO,BO=DO,es=lf;var HO=class{constructor(){this.saveSuperblock=kO(()=>{this.flush()},500)}async init(t,{wipe:n,url:r,urlauto:o,fileDbName:i=t,db:a=null,fileStoreName:s=t+"_files",lockDbName:l=t+"_lock",lockStoreName:c=t+"_lock"}={}){this._name=t,this._idb=a||new FO(i,s),this._mutex=navigator.locks?new BO(t):new zO(l,c),this._cache=new IO(t),this._opts={wipe:n,url:r},this._needsWipe=!!n,r&&(this._http=new LO(r),this._urlauto=!!o)}async activate(){if(this._cache.activated)return;this._needsWipe&&(this._needsWipe=!1,await this._idb.wipe(),await this._mutex.release({force:!0})),await this._mutex.has()||await this._mutex.wait();const t=await this._idb.loadSuperblock();if(t)this._cache.activate(t);else if(this._http){const n=await this._http.loadSuperblock();this._cache.activate(n),await this._saveSuperblock()}else this._cache.activate();if(!await this._mutex.has())throw new $O}async deactivate(){await this._mutex.has()&&await this._saveSuperblock(),this._cache.deactivate();try{await this._mutex.release()}catch(t){console.log(t)}await this._idb.close()}async _saveSuperblock(){this._cache.activated&&(this._lastSavedAt=Date.now(),await this._idb.saveSuperblock(this._cache._root))}_writeStat(t,n,r){let o=es.split(es.dirname(t)),i=o.shift();for(let a of o){i=es.join(i,a);try{this._cache.mkdir(i,{mode:511})}catch{}}return this._cache.writeStat(t,n,r)}async readFile(t,n){const{encoding:r}=n;if(r&&r!=="utf8")throw new Error('Only "utf8" encoding is supported in readFile');let o=null,i=null;try{i=this._cache.stat(t),o=await this._idb.readFile(i.ino)}catch(a){if(!this._urlauto)throw a}if(!o&&this._http){let a=this._cache.lstat(t);for(;a.type==="symlink";)t=es.resolve(es.dirname(t),a.target),a=this._cache.lstat(t);o=await this._http.readFile(t)}if(o&&((!i||i.size!=o.byteLength)&&(i=await this._writeStat(t,o.byteLength,{mode:i?i.mode:438}),this.saveSuperblock()),r==="utf8"?o=Gv(o):o.toString=()=>Gv(o)),!i)throw new OO(t);return o}async writeFile(t,n,r){const{mode:o,encoding:i="utf8"}=r;if(typeof n=="string"){if(i!=="utf8")throw new Error('Only "utf8" encoding is supported in writeFile');n=AO(n)}const a=await this._cache.writeStat(t,n.byteLength,{mode:o});await this._idb.writeFile(a.ino,n)}async unlink(t,n){const r=this._cache.lstat(t);this._cache.unlink(t),r.type!=="symlink"&&await this._idb.unlink(r.ino)}readdir(t,n){return this._cache.readdir(t)}mkdir(t,n){const{mode:r=511}=n;this._cache.mkdir(t,{mode:r})}rmdir(t,n){if(t==="/")throw new jO;this._cache.rmdir(t)}rename(t,n){this._cache.rename(t,n)}stat(t,n){return this._cache.stat(t)}lstat(t,n){return this._cache.lstat(t)}readlink(t,n){return this._cache.readlink(t)}symlink(t,n){this._cache.symlink(t,n)}async backFile(t,n){let r=await this._http.sizeFile(t);await this._writeStat(t,r,n)}du(t){return this._cache.du(t)}flush(){return this._saveSuperblock()}},UO=class{constructor(t){this.type=t.type,this.mode=t.mode,this.size=t.size,this.ino=t.ino,this.mtimeMs=t.mtimeMs,this.ctimeMs=t.ctimeMs||t.mtimeMs,this.uid=1,this.gid=1,this.dev=1}isFile(){return this.type==="file"}isDirectory(){return this.type==="dir"}isSymbolicLink(){return this.type==="symlink"}};const VO=HO,qv=UO,ic=lf;function nr(e,t,...n){return e=ic.normalize(e),(typeof t>"u"||typeof t=="function")&&(t={}),typeof t=="string"&&(t={encoding:t}),[e,t,...n]}function WO(e,t,n,...r){return e=ic.normalize(e),(typeof n>"u"||typeof n=="function")&&(n={}),typeof n=="string"&&(n={encoding:n}),[e,t,n,...r]}function Yv(e,t,...n){return[ic.normalize(e),ic.normalize(t),...n]}var GO=class{constructor(t,n={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,nr,!1),this.writeFile=this._wrap(this.writeFile,WO,!0),this.unlink=this._wrap(this.unlink,nr,!0),this.readdir=this._wrap(this.readdir,nr,!1),this.mkdir=this._wrap(this.mkdir,nr,!0),this.rmdir=this._wrap(this.rmdir,nr,!0),this.rename=this._wrap(this.rename,Yv,!0),this.stat=this._wrap(this.stat,nr,!1),this.lstat=this._wrap(this.lstat,nr,!1),this.readlink=this._wrap(this.readlink,nr,!1),this.symlink=this._wrap(this.symlink,Yv,!0),this.backFile=this._wrap(this.backFile,nr,!0),this.du=this._wrap(this.du,nr,!1),this._deactivationPromise=null,this._deactivationTimeout=null,this._activationPromise=null,this._operations=new Set,t&&this.init(t,n)}async init(...t){return this._initPromiseResolve&&await this._initPromise,this._initPromise=this._init(...t),this._initPromise}async _init(t,n={}){await this._gracefulShutdown(),this._activationPromise&&await this._deactivate(),this._backend&&this._backend.destroy&&await this._backend.destroy(),this._backend=n.backend||new VO,this._backend.init&&await this._backend.init(t,n),this._initPromiseResolve&&(this._initPromiseResolve(),this._initPromiseResolve=null),n.defer||this.stat("/")}async _gracefulShutdown(){this._operations.size>0&&(this._isShuttingDown=!0,await new Promise(t=>this._gracefulShutdownResolve=t),this._isShuttingDown=!1,this._gracefulShutdownResolve=null)}_wrap(t,n,r){return async(...o)=>{o=n(...o);let i={name:t.name,args:o};this._operations.add(i);try{return await this._activate(),await t.apply(this,o)}finally{this._operations.delete(i),r&&this._backend.saveSuperblock(),this._operations.size===0&&(this._deactivationTimeout||clearTimeout(this._deactivationTimeout),this._deactivationTimeout=setTimeout(this._deactivate.bind(this),500))}}}async _activate(){this._initPromise||console.warn(new Error(`Attempted to use LightningFS ${this._name} before it was initialized.`)),await this._initPromise,this._deactivationTimeout&&(clearTimeout(this._deactivationTimeout),this._deactivationTimeout=null),this._deactivationPromise&&await this._deactivationPromise,this._deactivationPromise=null,this._activationPromise||(this._activationPromise=this._backend.activate?this._backend.activate():Promise.resolve()),await this._activationPromise}async _deactivate(){return this._activationPromise&&await this._activationPromise,this._deactivationPromise||(this._deactivationPromise=this._backend.deactivate?this._backend.deactivate():Promise.resolve()),this._activationPromise=null,this._gracefulShutdownResolve&&this._gracefulShutdownResolve(),this._deactivationPromise}async readFile(t,n){return this._backend.readFile(t,n)}async writeFile(t,n,r){return await this._backend.writeFile(t,n,r),null}async unlink(t,n){return await this._backend.unlink(t,n),null}async readdir(t,n){return this._backend.readdir(t,n)}async mkdir(t,n){return await this._backend.mkdir(t,n),null}async rmdir(t,n){return await this._backend.rmdir(t,n),null}async rename(t,n){return await this._backend.rename(t,n),null}async stat(t,n){const r=await this._backend.stat(t,n);return new qv(r)}async lstat(t,n){const r=await this._backend.lstat(t,n);return new qv(r)}async readlink(t,n){return this._backend.readlink(t,n)}async symlink(t,n){return await this._backend.symlink(t,n),null}async backFile(t,n){return await this._backend.backFile(t,n),null}async du(t){return this._backend.du(t)}async flush(){return this._backend.flush()}};const qO=rO,YO=GO;function Qt(e,t){return typeof e=="function"&&(t=e),t=qO(t),[(...r)=>t(null,...r),t]}var KO=class{constructor(...t){this.promises=new YO(...t),this.init=this.init.bind(this),this.readFile=this.readFile.bind(this),this.writeFile=this.writeFile.bind(this),this.unlink=this.unlink.bind(this),this.readdir=this.readdir.bind(this),this.mkdir=this.mkdir.bind(this),this.rmdir=this.rmdir.bind(this),this.rename=this.rename.bind(this),this.stat=this.stat.bind(this),this.lstat=this.lstat.bind(this),this.readlink=this.readlink.bind(this),this.symlink=this.symlink.bind(this),this.backFile=this.backFile.bind(this),this.du=this.du.bind(this),this.flush=this.flush.bind(this)}init(t,n){return this.promises.init(t,n)}readFile(t,n,r){const[o,i]=Qt(n,r);this.promises.readFile(t,n).then(o).catch(i)}writeFile(t,n,r,o){const[i,a]=Qt(r,o);this.promises.writeFile(t,n,r).then(i).catch(a)}unlink(t,n,r){const[o,i]=Qt(n,r);this.promises.unlink(t,n).then(o).catch(i)}readdir(t,n,r){const[o,i]=Qt(n,r);this.promises.readdir(t,n).then(o).catch(i)}mkdir(t,n,r){const[o,i]=Qt(n,r);this.promises.mkdir(t,n).then(o).catch(i)}rmdir(t,n,r){const[o,i]=Qt(n,r);this.promises.rmdir(t,n).then(o).catch(i)}rename(t,n,r){const[o,i]=Qt(r);this.promises.rename(t,n).then(o).catch(i)}stat(t,n,r){const[o,i]=Qt(n,r);this.promises.stat(t).then(o).catch(i)}lstat(t,n,r){const[o,i]=Qt(n,r);this.promises.lstat(t).then(o).catch(i)}readlink(t,n,r){const[o,i]=Qt(n,r);this.promises.readlink(t).then(o).catch(i)}symlink(t,n,r){const[o,i]=Qt(r);this.promises.symlink(t,n).then(o).catch(i)}backFile(t,n,r){const[o,i]=Qt(n,r);this.promises.backFile(t,n).then(o).catch(i)}du(t,n){const[r,o]=Qt(n);this.promises.du(t).then(r).catch(o)}flush(t){const[n,r]=Qt(t);this.promises.flush().then(n).catch(r)}};const XO=Nn(KO);var uf={},ac={};ac.byteLength=QO,ac.toByteArray=tj,ac.fromByteArray=oj;for(var rr=[],Tn=[],ZO=typeof Uint8Array<"u"?Uint8Array:Array,df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yi=0,JO=df.length;yi<JO;++yi)rr[yi]=df[yi],Tn[df.charCodeAt(yi)]=yi;Tn[45]=62,Tn[95]=63;function Kv(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function QO(e){var t=Kv(e),n=t[0],r=t[1];return(n+r)*3/4-r}function ej(e,t,n){return(t+n)*3/4-n}function tj(e){var t,n=Kv(e),r=n[0],o=n[1],i=new ZO(ej(e,r,o)),a=0,s=o>0?r-4:r,l;for(l=0;l<s;l+=4)t=Tn[e.charCodeAt(l)]<<18|Tn[e.charCodeAt(l+1)]<<12|Tn[e.charCodeAt(l+2)]<<6|Tn[e.charCodeAt(l+3)],i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=Tn[e.charCodeAt(l)]<<2|Tn[e.charCodeAt(l+1)]>>4,i[a++]=t&255),o===1&&(t=Tn[e.charCodeAt(l)]<<10|Tn[e.charCodeAt(l+1)]<<4|Tn[e.charCodeAt(l+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function nj(e){return rr[e>>18&63]+rr[e>>12&63]+rr[e>>6&63]+rr[e&63]}function rj(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(nj(r));return o.join("")}function oj(e){for(var t,n=e.length,r=n%3,o=[],i=16383,a=0,s=n-r;a<s;a+=i)o.push(rj(e,a,a+i>s?s:a+i));return r===1?(t=e[n-1],o.push(rr[t>>2]+rr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(rr[t>>10]+rr[t>>4&63]+rr[t<<2&63]+"=")),o.join("")}var ff={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ff.read=function(e,t,n,r,o){var i,a,s=o*8-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=i*256+e[t+d],d+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=a*256+e[t+d],d+=f,u-=8);if(i===0)i=1-c;else{if(i===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,r),i=i-c}return(h?-1:1)*a*Math.pow(2,i-r)},ff.write=function(e,t,n,r,o,i){var a,s,l,c=i*8-o-1,u=(1<<c)-1,d=u>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a=a+d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=s&255,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=a&255,h+=p,a/=256,c-=8);e[n+h-p]|=m*128};/*!
5
5
  * The buffer module from node.js, for the browser.
6
6
  *
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
- */(function(e){const t=Pi,r=eo,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const w=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(w,f),w.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(w){if(w>i)throw new RangeError('The value "'+w+'" is invalid for option "size"');const f=new Uint8Array(w);return Object.setPrototypeOf(f,s.prototype),f}function s(w,f,h){if(typeof w=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(w)}return l(w,f,h)}s.poolSize=8192;function l(w,f,h){if(typeof w=="string")return p(w,f);if(ArrayBuffer.isView(w))return g(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(We(w,ArrayBuffer)||w&&We(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(w,SharedArrayBuffer)||w&&We(w.buffer,SharedArrayBuffer)))return _(w,f,h);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const E=w.valueOf&&w.valueOf();if(E!=null&&E!==w)return s.from(E,f,h);const A=x(w);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return s.from(w[Symbol.toPrimitive]("string"),f,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}s.from=function(w,f,h){return l(w,f,h)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function u(w,f,h){return c(w),w<=0?o(w):f!==void 0?typeof h=="string"?o(w).fill(f,h):o(w).fill(f):o(w)}s.alloc=function(w,f,h){return u(w,f,h)};function d(w){return c(w),o(w<0?0:y(w)|0)}s.allocUnsafe=function(w){return d(w)},s.allocUnsafeSlow=function(w){return d(w)};function p(w,f){if((typeof f!="string"||f==="")&&(f="utf8"),!s.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const h=O(w,f)|0;let E=o(h);const A=E.write(w,f);return A!==h&&(E=E.slice(0,A)),E}function m(w){const f=w.length<0?0:y(w.length)|0,h=o(f);for(let E=0;E<f;E+=1)h[E]=w[E]&255;return h}function g(w){if(We(w,Uint8Array)){const f=new Uint8Array(w);return _(f.buffer,f.byteOffset,f.byteLength)}return m(w)}function _(w,f,h){if(f<0||w.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<f+(h||0))throw new RangeError('"length" is outside of buffer bounds');let E;return f===void 0&&h===void 0?E=new Uint8Array(w):h===void 0?E=new Uint8Array(w,f):E=new Uint8Array(w,f,h),Object.setPrototypeOf(E,s.prototype),E}function x(w){if(s.isBuffer(w)){const f=y(w.length)|0,h=o(f);return h.length===0||w.copy(h,0,0,f),h}if(w.length!==void 0)return typeof w.length!="number"||Ae(w.length)?o(0):m(w);if(w.type==="Buffer"&&Array.isArray(w.data))return m(w.data)}function y(w){if(w>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return w|0}function v(w){return+w!=w&&(w=0),s.alloc(+w)}s.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==s.prototype},s.compare=function(f,h){if(We(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),We(h,Uint8Array)&&(h=s.from(h,h.offset,h.byteLength)),!s.isBuffer(f)||!s.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===h)return 0;let E=f.length,A=h.length;for(let j=0,z=Math.min(E,A);j<z;++j)if(f[j]!==h[j]){E=f[j],A=h[j];break}return E<A?-1:A<E?1:0},s.isEncoding=function(f){switch(String(f).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(f,h){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return s.alloc(0);let E;if(h===void 0)for(h=0,E=0;E<f.length;++E)h+=f[E].length;const A=s.allocUnsafe(h);let j=0;for(E=0;E<f.length;++E){let z=f[E];if(We(z,Uint8Array))j+z.length>A.length?(s.isBuffer(z)||(z=s.from(z)),z.copy(A,j)):Uint8Array.prototype.set.call(A,z,j);else if(s.isBuffer(z))z.copy(A,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=z.length}return A};function O(w,f){if(s.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||We(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);const h=w.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&h===0)return 0;let A=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return ne(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ee(w).length;default:if(A)return E?-1:ne(w).length;f=(""+f).toLowerCase(),A=!0}}s.byteLength=O;function R(w,f,h){let E=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,f>>>=0,h<=f))return"";for(w||(w="utf8");;)switch(w){case"hex":return Pe(this,f,h);case"utf8":case"utf-8":return Y(this,f,h);case"ascii":return me(this,f,h);case"latin1":case"binary":return ge(this,f,h);case"base64":return H(this,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ue(this,f,h);default:if(E)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),E=!0}}s.prototype._isBuffer=!0;function b(w,f,h){const E=w[f];w[f]=w[h],w[h]=E}s.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<f;h+=2)b(this,h,h+1);return this},s.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<f;h+=4)b(this,h,h+3),b(this,h+1,h+2);return this},s.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<f;h+=8)b(this,h,h+7),b(this,h+1,h+6),b(this,h+2,h+5),b(this,h+3,h+4);return this},s.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?Y(this,0,f):R.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(f){if(!s.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:s.compare(this,f)===0},s.prototype.inspect=function(){let f="";const h=e.INSPECT_MAX_BYTES;return f=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(f+=" ... "),"<Buffer "+f+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(f,h,E,A,j){if(We(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(h===void 0&&(h=0),E===void 0&&(E=f?f.length:0),A===void 0&&(A=0),j===void 0&&(j=this.length),h<0||E>f.length||A<0||j>this.length)throw new RangeError("out of range index");if(A>=j&&h>=E)return 0;if(A>=j)return-1;if(h>=E)return 1;if(h>>>=0,E>>>=0,A>>>=0,j>>>=0,this===f)return 0;let z=j-A,pe=E-h;const ze=Math.min(z,pe),je=this.slice(A,j),Ne=f.slice(h,E);for(let Ce=0;Ce<ze;++Ce)if(je[Ce]!==Ne[Ce]){z=je[Ce],pe=Ne[Ce];break}return z<pe?-1:pe<z?1:0};function C(w,f,h,E,A){if(w.length===0)return-1;if(typeof h=="string"?(E=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ae(h)&&(h=A?0:w.length-1),h<0&&(h=w.length+h),h>=w.length){if(A)return-1;h=w.length-1}else if(h<0)if(A)h=0;else return-1;if(typeof f=="string"&&(f=s.from(f,E)),s.isBuffer(f))return f.length===0?-1:k(w,f,h,E,A);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(w,f,h):Uint8Array.prototype.lastIndexOf.call(w,f,h):k(w,[f],h,E,A);throw new TypeError("val must be string, number or Buffer")}function k(w,f,h,E,A){let j=1,z=w.length,pe=f.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(w.length<2||f.length<2)return-1;j=2,z/=2,pe/=2,h/=2}function ze(Ne,Ce){return j===1?Ne[Ce]:Ne.readUInt16BE(Ce*j)}let je;if(A){let Ne=-1;for(je=h;je<z;je++)if(ze(w,je)===ze(f,Ne===-1?0:je-Ne)){if(Ne===-1&&(Ne=je),je-Ne+1===pe)return Ne*j}else Ne!==-1&&(je-=je-Ne),Ne=-1}else for(h+pe>z&&(h=z-pe),je=h;je>=0;je--){let Ne=!0;for(let Ce=0;Ce<pe;Ce++)if(ze(w,je+Ce)!==ze(f,Ce)){Ne=!1;break}if(Ne)return je}return-1}s.prototype.includes=function(f,h,E){return this.indexOf(f,h,E)!==-1},s.prototype.indexOf=function(f,h,E){return C(this,f,h,E,!0)},s.prototype.lastIndexOf=function(f,h,E){return C(this,f,h,E,!1)};function S(w,f,h,E){h=Number(h)||0;const A=w.length-h;E?(E=Number(E),E>A&&(E=A)):E=A;const j=f.length;E>j/2&&(E=j/2);let z;for(z=0;z<E;++z){const pe=parseInt(f.substr(z*2,2),16);if(Ae(pe))return z;w[h+z]=pe}return z}function P(w,f,h,E){return Et(ne(f,w.length-h),w,h,E)}function $(w,f,h,E){return Et(ie(f),w,h,E)}function B(w,f,h,E){return Et(Ee(f),w,h,E)}function M(w,f,h,E){return Et(Re(f,w.length-h),w,h,E)}s.prototype.write=function(f,h,E,A){if(h===void 0)A="utf8",E=this.length,h=0;else if(E===void 0&&typeof h=="string")A=h,E=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(E)?(E=E>>>0,A===void 0&&(A="utf8")):(A=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-h;if((E===void 0||E>j)&&(E=j),f.length>0&&(E<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");let z=!1;for(;;)switch(A){case"hex":return S(this,f,h,E);case"utf8":case"utf-8":return P(this,f,h,E);case"ascii":case"latin1":case"binary":return $(this,f,h,E);case"base64":return B(this,f,h,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,f,h,E);default:if(z)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),z=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(w,f,h){return f===0&&h===w.length?t.fromByteArray(w):t.fromByteArray(w.slice(f,h))}function Y(w,f,h){h=Math.min(w.length,h);const E=[];let A=f;for(;A<h;){const j=w[A];let z=null,pe=j>239?4:j>223?3:j>191?2:1;if(A+pe<=h){let ze,je,Ne,Ce;switch(pe){case 1:j<128&&(z=j);break;case 2:ze=w[A+1],(ze&192)===128&&(Ce=(j&31)<<6|ze&63,Ce>127&&(z=Ce));break;case 3:ze=w[A+1],je=w[A+2],(ze&192)===128&&(je&192)===128&&(Ce=(j&15)<<12|(ze&63)<<6|je&63,Ce>2047&&(Ce<55296||Ce>57343)&&(z=Ce));break;case 4:ze=w[A+1],je=w[A+2],Ne=w[A+3],(ze&192)===128&&(je&192)===128&&(Ne&192)===128&&(Ce=(j&15)<<18|(ze&63)<<12|(je&63)<<6|Ne&63,Ce>65535&&Ce<1114112&&(z=Ce))}}z===null?(z=65533,pe=1):z>65535&&(z-=65536,E.push(z>>>10&1023|55296),z=56320|z&1023),E.push(z),A+=pe}return Te(E)}const ue=4096;function Te(w){const f=w.length;if(f<=ue)return String.fromCharCode.apply(String,w);let h="",E=0;for(;E<f;)h+=String.fromCharCode.apply(String,w.slice(E,E+=ue));return h}function me(w,f,h){let E="";h=Math.min(w.length,h);for(let A=f;A<h;++A)E+=String.fromCharCode(w[A]&127);return E}function ge(w,f,h){let E="";h=Math.min(w.length,h);for(let A=f;A<h;++A)E+=String.fromCharCode(w[A]);return E}function Pe(w,f,h){const E=w.length;(!f||f<0)&&(f=0),(!h||h<0||h>E)&&(h=E);let A="";for(let j=f;j<h;++j)A+=se[w[j]];return A}function Ue(w,f,h){const E=w.slice(f,h);let A="";for(let j=0;j<E.length-1;j+=2)A+=String.fromCharCode(E[j]+E[j+1]*256);return A}s.prototype.slice=function(f,h){const E=this.length;f=~~f,h=h===void 0?E:~~h,f<0?(f+=E,f<0&&(f=0)):f>E&&(f=E),h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),h<f&&(h=f);const A=this.subarray(f,h);return Object.setPrototypeOf(A,s.prototype),A};function oe(w,f,h){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+f>h)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=this[f],j=1,z=0;for(;++z<h&&(j*=256);)A+=this[f+z]*j;return A},s.prototype.readUintBE=s.prototype.readUIntBE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=this[f+--h],j=1;for(;h>0&&(j*=256);)A+=this[f+--h]*j;return A},s.prototype.readUint8=s.prototype.readUInt8=function(f,h){return f=f>>>0,h||oe(f,1,this.length),this[f]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(f,h){return f=f>>>0,h||oe(f,2,this.length),this[f]|this[f+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(f,h){return f=f>>>0,h||oe(f,2,this.length),this[f]<<8|this[f+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},s.prototype.readBigUInt64LE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,j=this[++f]+this[++f]*2**8+this[++f]*2**16+E*2**24;return BigInt(A)+(BigInt(j)<<BigInt(32))}),s.prototype.readBigUInt64BE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=h*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],j=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+E;return(BigInt(A)<<BigInt(32))+BigInt(j)}),s.prototype.readIntLE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=this[f],j=1,z=0;for(;++z<h&&(j*=256);)A+=this[f+z]*j;return j*=128,A>=j&&(A-=Math.pow(2,8*h)),A},s.prototype.readIntBE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=h,j=1,z=this[f+--A];for(;A>0&&(j*=256);)z+=this[f+--A]*j;return j*=128,z>=j&&(z-=Math.pow(2,8*h)),z},s.prototype.readInt8=function(f,h){return f=f>>>0,h||oe(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},s.prototype.readInt16LE=function(f,h){f=f>>>0,h||oe(f,2,this.length);const E=this[f]|this[f+1]<<8;return E&32768?E|4294901760:E},s.prototype.readInt16BE=function(f,h){f=f>>>0,h||oe(f,2,this.length);const E=this[f+1]|this[f]<<8;return E&32768?E|4294901760:E},s.prototype.readInt32LE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},s.prototype.readInt32BE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},s.prototype.readBigInt64LE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(E<<24);return(BigInt(A)<<BigInt(32))+BigInt(h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),s.prototype.readBigInt64BE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=(h<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(A)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+E)}),s.prototype.readFloatLE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),r.read(this,f,!0,23,4)},s.prototype.readFloatBE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),r.read(this,f,!1,23,4)},s.prototype.readDoubleLE=function(f,h){return f=f>>>0,h||oe(f,8,this.length),r.read(this,f,!0,52,8)},s.prototype.readDoubleBE=function(f,h){return f=f>>>0,h||oe(f,8,this.length),r.read(this,f,!1,52,8)};function L(w,f,h,E,A,j){if(!s.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>A||f<j)throw new RangeError('"value" argument is out of bounds');if(h+E>w.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(f,h,E,A){if(f=+f,h=h>>>0,E=E>>>0,!A){const pe=Math.pow(2,8*E)-1;L(this,f,h,E,pe,0)}let j=1,z=0;for(this[h]=f&255;++z<E&&(j*=256);)this[h+z]=f/j&255;return h+E},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(f,h,E,A){if(f=+f,h=h>>>0,E=E>>>0,!A){const pe=Math.pow(2,8*E)-1;L(this,f,h,E,pe,0)}let j=E-1,z=1;for(this[h+j]=f&255;--j>=0&&(z*=256);)this[h+j]=f/z&255;return h+E},s.prototype.writeUint8=s.prototype.writeUInt8=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,1,255,0),this[h]=f&255,h+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,65535,0),this[h]=f&255,this[h+1]=f>>>8,h+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,65535,0),this[h]=f>>>8,this[h+1]=f&255,h+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,4294967295,0),this[h+3]=f>>>24,this[h+2]=f>>>16,this[h+1]=f>>>8,this[h]=f&255,h+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,4294967295,0),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4};function W(w,f,h,E,A){F(f,E,A,w,h,7);let j=Number(f&BigInt(4294967295));w[h++]=j,j=j>>8,w[h++]=j,j=j>>8,w[h++]=j,j=j>>8,w[h++]=j;let z=Number(f>>BigInt(32)&BigInt(4294967295));return w[h++]=z,z=z>>8,w[h++]=z,z=z>>8,w[h++]=z,z=z>>8,w[h++]=z,h}function G(w,f,h,E,A){F(f,E,A,w,h,7);let j=Number(f&BigInt(4294967295));w[h+7]=j,j=j>>8,w[h+6]=j,j=j>>8,w[h+5]=j,j=j>>8,w[h+4]=j;let z=Number(f>>BigInt(32)&BigInt(4294967295));return w[h+3]=z,z=z>>8,w[h+2]=z,z=z>>8,w[h+1]=z,z=z>>8,w[h]=z,h+8}s.prototype.writeBigUInt64LE=Se(function(f,h=0){return W(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Se(function(f,h=0){return G(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(f,h,E,A){if(f=+f,h=h>>>0,!A){const ze=Math.pow(2,8*E-1);L(this,f,h,E,ze-1,-ze)}let j=0,z=1,pe=0;for(this[h]=f&255;++j<E&&(z*=256);)f<0&&pe===0&&this[h+j-1]!==0&&(pe=1),this[h+j]=(f/z>>0)-pe&255;return h+E},s.prototype.writeIntBE=function(f,h,E,A){if(f=+f,h=h>>>0,!A){const ze=Math.pow(2,8*E-1);L(this,f,h,E,ze-1,-ze)}let j=E-1,z=1,pe=0;for(this[h+j]=f&255;--j>=0&&(z*=256);)f<0&&pe===0&&this[h+j+1]!==0&&(pe=1),this[h+j]=(f/z>>0)-pe&255;return h+E},s.prototype.writeInt8=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,1,127,-128),f<0&&(f=255+f+1),this[h]=f&255,h+1},s.prototype.writeInt16LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,32767,-32768),this[h]=f&255,this[h+1]=f>>>8,h+2},s.prototype.writeInt16BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,32767,-32768),this[h]=f>>>8,this[h+1]=f&255,h+2},s.prototype.writeInt32LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,2147483647,-2147483648),this[h]=f&255,this[h+1]=f>>>8,this[h+2]=f>>>16,this[h+3]=f>>>24,h+4},s.prototype.writeInt32BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4},s.prototype.writeBigInt64LE=Se(function(f,h=0){return W(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Se(function(f,h=0){return G(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(w,f,h,E,A,j){if(h+E>w.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function I(w,f,h,E,A){return f=+f,h=h>>>0,A||te(w,f,h,4),r.write(w,f,h,E,23,4),h+4}s.prototype.writeFloatLE=function(f,h,E){return I(this,f,h,!0,E)},s.prototype.writeFloatBE=function(f,h,E){return I(this,f,h,!1,E)};function ee(w,f,h,E,A){return f=+f,h=h>>>0,A||te(w,f,h,8),r.write(w,f,h,E,52,8),h+8}s.prototype.writeDoubleLE=function(f,h,E){return ee(this,f,h,!0,E)},s.prototype.writeDoubleBE=function(f,h,E){return ee(this,f,h,!1,E)},s.prototype.copy=function(f,h,E,A){if(!s.isBuffer(f))throw new TypeError("argument should be a Buffer");if(E||(E=0),!A&&A!==0&&(A=this.length),h>=f.length&&(h=f.length),h||(h=0),A>0&&A<E&&(A=E),A===E||f.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),f.length-h<A-E&&(A=f.length-h+E);const j=A-E;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,E,A):Uint8Array.prototype.set.call(f,this.subarray(E,A),h),j},s.prototype.fill=function(f,h,E,A){if(typeof f=="string"){if(typeof h=="string"?(A=h,h=0,E=this.length):typeof E=="string"&&(A=E,E=this.length),A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!s.isEncoding(A))throw new TypeError("Unknown encoding: "+A);if(f.length===1){const z=f.charCodeAt(0);(A==="utf8"&&z<128||A==="latin1")&&(f=z)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(h<0||this.length<h||this.length<E)throw new RangeError("Out of range index");if(E<=h)return this;h=h>>>0,E=E===void 0?this.length:E>>>0,f||(f=0);let j;if(typeof f=="number")for(j=h;j<E;++j)this[j]=f;else{const z=s.isBuffer(f)?f:s.from(f,A),pe=z.length;if(pe===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(j=0;j<E-h;++j)this[j+h]=z[j%pe]}return this};const D={};function q(w,f,h){D[w]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(w,f){return`The "${w}" argument must be of type number. Received type ${typeof f}`},TypeError),q("ERR_OUT_OF_RANGE",function(w,f,h){let E=`The value of "${w}" is out of range.`,A=h;return Number.isInteger(h)&&Math.abs(h)>2**32?A=Z(String(h)):typeof h=="bigint"&&(A=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(A=Z(A)),A+="n"),E+=` It must be ${f}. Received ${A}`,E},RangeError);function Z(w){let f="",h=w.length;const E=w[0]==="-"?1:0;for(;h>=E+4;h-=3)f=`_${w.slice(h-3,h)}${f}`;return`${w.slice(0,h)}${f}`}function X(w,f,h){V(f,"offset"),(w[f]===void 0||w[f+h]===void 0)&&re(f,w.length-(h+1))}function F(w,f,h,E,A,j){if(w>h||w<f){const z=typeof f=="bigint"?"n":"";let pe;throw f===0||f===BigInt(0)?pe=`>= 0${z} and < 2${z} ** ${(j+1)*8}${z}`:pe=`>= -(2${z} ** ${(j+1)*8-1}${z}) and < 2 ** ${(j+1)*8-1}${z}`,new D.ERR_OUT_OF_RANGE("value",pe,w)}X(E,A,j)}function V(w,f){if(typeof w!="number")throw new D.ERR_INVALID_ARG_TYPE(f,"number",w)}function re(w,f,h){throw Math.floor(w)!==w?(V(w,h),new D.ERR_OUT_OF_RANGE("offset","an integer",w)):f<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,w)}const Q=/[^+/0-9A-Za-z-_]/g;function le(w){if(w=w.split("=")[0],w=w.trim().replace(Q,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function ne(w,f){f=f||1/0;let h;const E=w.length;let A=null;const j=[];for(let z=0;z<E;++z){if(h=w.charCodeAt(z),h>55295&&h<57344){if(!A){if(h>56319){(f-=3)>-1&&j.push(239,191,189);continue}else if(z+1===E){(f-=3)>-1&&j.push(239,191,189);continue}A=h;continue}if(h<56320){(f-=3)>-1&&j.push(239,191,189),A=h;continue}h=(A-55296<<10|h-56320)+65536}else A&&(f-=3)>-1&&j.push(239,191,189);if(A=null,h<128){if((f-=1)<0)break;j.push(h)}else if(h<2048){if((f-=2)<0)break;j.push(h>>6|192,h&63|128)}else if(h<65536){if((f-=3)<0)break;j.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((f-=4)<0)break;j.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return j}function ie(w){const f=[];for(let h=0;h<w.length;++h)f.push(w.charCodeAt(h)&255);return f}function Re(w,f){let h,E,A;const j=[];for(let z=0;z<w.length&&!((f-=2)<0);++z)h=w.charCodeAt(z),E=h>>8,A=h%256,j.push(A),j.push(E);return j}function Ee(w){return t.toByteArray(le(w))}function Et(w,f,h,E){let A;for(A=0;A<E&&!(A+h>=f.length||A>=w.length);++A)f[A+h]=w[A];return A}function We(w,f){return w instanceof f||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===f.name}function Ae(w){return w!==w}const se=function(){const w="0123456789abcdef",f=new Array(256);for(let h=0;h<16;++h){const E=h*16;for(let A=0;A<16;++A)f[E+A]=w[h]+w[A]}return f}();function Se(w){return typeof BigInt>"u"?Oi:w}function Oi(){throw new Error("BigInt not supported")}})(Ja);function bp(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function _p(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:bp(e)}async function vp(e,t){const r=_p(e);for(;;){const{value:n,done:i}=await r.next();if(n&&await t(n),i)break}r.return&&r.return()}async function xp(e){let t=0;const r=[];await vp(e,a=>{r.push(a),t+=a.byteLength});const n=new Uint8Array(t);let i=0;for(const a of r)n.set(a,i),i+=a.byteLength;return n}function Ep(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}async function Sp({onProgress:e,url:t,method:r="GET",headers:n={},body:i}){i&&(i=await xp(i));const a=await fetch(t,{method:r,headers:n,body:i}),o=a.body&&a.body.getReader?Ep(a.body):[new Uint8Array(await a.arrayBuffer())];n={};for(const[s,l]of a.headers.entries())n[s]=l;return{url:a.url,method:a.method,statusCode:a.status,statusMessage:a.statusText,body:o,headers:n}}var to={request:Sp},ht=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||ht.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||ht.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||ht.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=ht.DEFAULT_MAX_PENDING};ht.DEFAULT_TIMEOUT=0,ht.DEFAULT_MAX_OCCUPATION_TIME=0,ht.DEFAULT_MAX_EXECUTION_TIME=0,ht.DEFAULT_MAX_PENDING=1e3,ht.prototype.acquire=function(e,t,r,n){if(Array.isArray(e))return this._acquireBatch(e,t,r,n);if(typeof t!="function")throw new Error("You must pass a function to execute");var i=null,a=null,o=null;typeof r!="function"&&(n=r,r=null,o=new this.Promise(function(v,O){i=v,a=O})),n=n||{};var s=!1,l=null,c=null,u=null,d=this,p=function(v,O,R){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),v&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(o?O?a(O):i(R):typeof r=="function"&&r(O,R),s=!0),v&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},m=function(v){if(s)return p(v);l&&(clearTimeout(l),l=null),d.domainReentrant&&v&&(d.domains[e]=process.domain);var O=n.maxExecutionTime||d.maxExecutionTime;if(O&&(u=setTimeout(function(){d.queues[e]&&p(v,new Error("Maximum execution time is exceeded "+e))},O)),t.length===1){var R=!1;try{t(function(b,C){R||(R=!0,p(v,b,C))})}catch(b){R||(R=!0,p(v,b))}}else d._promiseTry(function(){return t()}).then(function(b){p(v,void 0,b)},function(b){p(v,b)})};d.domainReentrant&&process.domain&&(m=process.domain.bind(m));var g=n.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],m(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])m(!1);else if(d.queues[e].length>=g)p(!1,new Error("Too many pending tasks in queue "+e));else{var _=function(){m(!0)};n.skipQueue?d.queues[e].unshift(_):d.queues[e].push(_);var x=n.timeout||d.timeout;x&&(l=setTimeout(function(){l=null,p(!1,new Error("async-lock timed out in queue "+e))},x))}var y=n.maxOccupationTime||d.maxOccupationTime;if(y&&(c=setTimeout(function(){d.queues[e]&&p(!1,new Error("Maximum occupation time is exceeded in queue "+e))},y)),o)return o},ht.prototype._acquireBatch=function(e,t,r,n){typeof r!="function"&&(n=r,r=null);var i=this,a=function(s,l){return function(c){i.acquire(s,l,c,n)}},o=e.reduceRight(function(s,l){return a(l,s)},t);if(typeof r=="function")o(r);else return new this.Promise(function(s,l){o.length===1?o(function(c,u){c?l(c):s(u)}):s(o())})},ht.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},ht.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};var kp=ht,Rp=kp;const Pn=St(Rp);var ro={exports:{}};typeof Object.create=="function"?ro.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ro.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Op=ro.exports,no={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Ja,n=r.Buffer;function i(o,s){for(var l in o)s[l]=o[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a);function a(o,s,l){return n(o,s,l)}a.prototype=Object.create(n.prototype),i(n,a),a.from=function(o,s,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,s,l)},a.alloc=function(o,s,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var c=n(o);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},a.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},a.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(no,no.exports);var Tc=no.exports,Pc=Tc.Buffer;function Ai(e,t){this._block=Pc.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ai.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Pc.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,a=this._len,o=0;o<i;){for(var s=a%n,l=Math.min(i-o,n-s),c=0;c<l;c++)r[s+c]=e[o+c];a+=l,o+=l,a%n===0&&this._update(r)}return this._len+=i,this},Ai.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},Ai.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Cp=Ai,Tp=Op,Ac=Cp,Pp=Tc.Buffer,Ap=[1518500249,1859775393,-1894007588,-899497514],$p=new Array(80);function An(){this.init(),this._w=$p,Ac.call(this,64,56)}Tp(An,Ac),An.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Dp(e){return e<<1|e>>>31}function Ip(e){return e<<5|e>>>27}function jp(e){return e<<30|e>>>2}function Bp(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}An.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,o=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=Dp(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=Ip(r)+Bp(c,n,i,a)+o+t[l]+Ap[c]|0;o=a,a=i,i=jp(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0},An.prototype._hash=function(){var e=Pp.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var zp=An;const $c=St(zp);function $t(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Dc(e,t){for(var r="",n=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=s,a=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return r}function Np(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var Hr={resolve:function(){for(var t="",r=!1,n,i=arguments.length-1;i>=-1&&!r;i--){var a;i>=0?a=arguments[i]:(n===void 0&&(n=process.cwd()),a=n),$t(a),a.length!==0&&(t=a+"/"+t,r=a.charCodeAt(0)===47)}return t=Dc(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if($t(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=Dc(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return $t(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];$t(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":Hr.normalize(t)},relative:function(t,r){if($t(t),$t(r),t===r||(t=Hr.resolve(t),r=Hr.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var i=t.length,a=i-n,o=1;o<r.length&&r.charCodeAt(o)===47;++o);for(var s=r.length,l=s-o,c=a<l?a:l,u=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(r.charCodeAt(o+d)===47)return r.slice(o+d+1);if(d===0)return r.slice(o+d)}else a>c&&(t.charCodeAt(n+d)===47?u=d:d===0&&(u=0));break}var p=t.charCodeAt(n+d),m=r.charCodeAt(o+d);if(p!==m)break;p===47&&(u=d)}var g="";for(d=n+u+1;d<=i;++d)(d===i||t.charCodeAt(d)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(o+u):(o+=u,r.charCodeAt(o)===47&&++o,r.slice(o))},_makeLong:function(t){return t},dirname:function(t){if($t(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,i=-1,a=!0,o=t.length-1;o>=1;--o)if(r=t.charCodeAt(o),r===47){if(!a){i=o;break}}else a=!1;return i===-1?n?"/":".":n&&i===1?"//":t.slice(0,i)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');$t(t);var n=0,i=-1,a=!0,o;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,l=-1;for(o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(c===47){if(!a){n=o+1;break}}else l===-1&&(a=!1,l=o+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=l))}return n===i?i=l:i===-1&&(i=t.length),t.slice(n,i)}else{for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===47){if(!a){n=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?"":t.slice(n,i)}},extname:function(t){$t(t);for(var r=-1,n=0,i=-1,a=!0,o=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!a){n=s+1;break}continue}i===-1&&(a=!1,i=s+1),l===46?r===-1?r=s:o!==1&&(o=1):r!==-1&&(o=-1)}return r===-1||i===-1||o===0||o===1&&r===i-1&&r===n+1?"":t.slice(r,i)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Np("/",t)},parse:function(t){$t(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),i=n===47,a;i?(r.root="/",a=1):a=0;for(var o=-1,s=0,l=-1,c=!0,u=t.length-1,d=0;u>=a;--u){if(n=t.charCodeAt(u),n===47){if(!c){s=u+1;break}continue}l===-1&&(c=!1,l=u+1),n===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||l===-1||d===0||d===1&&o===l-1&&o===s+1?l!==-1&&(s===0&&i?r.base=r.name=t.slice(1,l):r.base=r.name=t.slice(s,l)):(s===0&&i?(r.name=t.slice(1,o),r.base=t.slice(1,l)):(r.name=t.slice(s,o),r.base=t.slice(s,l)),r.ext=t.slice(o,l)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Hr.posix=Hr;var N=Hr,Ic={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function r(){for(var S=0,P=new Array(256),$=0;$!=256;++$)S=$,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,P[$]=S;return typeof Int32Array<"u"?new Int32Array(P):P}var n=r();function i(S){var P=0,$=0,B=0,M=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(B=0;B!=256;++B)M[B]=S[B];for(B=0;B!=256;++B)for($=S[B],P=256+B;P<4096;P+=256)$=M[P]=$>>>8^S[$&255];var H=[];for(B=1;B!=16;++B)H[B-1]=typeof Int32Array<"u"?M.subarray(B*256,B*256+256):M.slice(B*256,B*256+256);return H}var a=i(n),o=a[0],s=a[1],l=a[2],c=a[3],u=a[4],d=a[5],p=a[6],m=a[7],g=a[8],_=a[9],x=a[10],y=a[11],v=a[12],O=a[13],R=a[14];function b(S,P){for(var $=P^-1,B=0,M=S.length;B<M;)$=$>>>8^n[($^S.charCodeAt(B++))&255];return~$}function C(S,P){for(var $=P^-1,B=S.length-15,M=0;M<B;)$=R[S[M++]^$&255]^O[S[M++]^$>>8&255]^v[S[M++]^$>>16&255]^y[S[M++]^$>>>24]^x[S[M++]]^_[S[M++]]^g[S[M++]]^m[S[M++]]^p[S[M++]]^d[S[M++]]^u[S[M++]]^c[S[M++]]^l[S[M++]]^s[S[M++]]^o[S[M++]]^n[S[M++]];for(B+=15;M<B;)$=$>>>8^n[($^S[M++])&255];return~$}function k(S,P){for(var $=P^-1,B=0,M=S.length,H=0,Y=0;B<M;)H=S.charCodeAt(B++),H<128?$=$>>>8^n[($^H)&255]:H<2048?($=$>>>8^n[($^(192|H>>6&31))&255],$=$>>>8^n[($^(128|H&63))&255]):H>=55296&&H<57344?(H=(H&1023)+64,Y=S.charCodeAt(B++)&1023,$=$>>>8^n[($^(240|H>>8&7))&255],$=$>>>8^n[($^(128|H>>2&63))&255],$=$>>>8^n[($^(128|Y>>6&15|(H&3)<<4))&255],$=$>>>8^n[($^(128|Y&63))&255]):($=$>>>8^n[($^(224|H>>12&15))&255],$=$>>>8^n[($^(128|H>>6&63))&255],$=$>>>8^n[($^(128|H&63))&255]);return~$}t.table=n,t.bstr=b,t.buf=C,t.str=k})})(Ic);const Mp=St(Ic);var qt={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(a,o){return Object.prototype.hasOwnProperty.call(a,o)}e.assign=function(a){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)r(s,l)&&(a[l]=s[l])}}return a},e.shrinkBuf=function(a,o){return a.length===o?a:a.subarray?a.subarray(0,o):(a.length=o,a)};var n={arraySet:function(a,o,s,l,c){if(o.subarray&&a.subarray){a.set(o.subarray(s,s+l),c);return}for(var u=0;u<l;u++)a[c+u]=o[s+u]},flattenChunks:function(a){var o,s,l,c,u,d;for(l=0,o=0,s=a.length;o<s;o++)l+=a[o].length;for(d=new Uint8Array(l),c=0,o=0,s=a.length;o<s;o++)u=a[o],d.set(u,c),c+=u.length;return d}},i={arraySet:function(a,o,s,l,c){for(var u=0;u<l;u++)a[c+u]=o[s+u]},flattenChunks:function(a){return[].concat.apply([],a)}};e.setTyped=function(a){a?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})(qt);var $n={},Dt={},Wr={},Lp=qt,Fp=4,jc=0,Bc=1,Up=2;function Gr(e){for(var t=e.length;--t>=0;)e[t]=0}var Hp=0,zc=1,Wp=2,Gp=3,qp=258,io=29,Dn=256,In=Dn+1+io,qr=30,ao=19,Nc=2*In+1,xr=15,oo=16,Yp=7,so=256,Mc=16,Lc=17,Fc=18,co=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],$i=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Xp=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Uc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Zp=512,Yt=new Array((In+2)*2);Gr(Yt);var jn=new Array(qr*2);Gr(jn);var Bn=new Array(Zp);Gr(Bn);var zn=new Array(qp-Gp+1);Gr(zn);var lo=new Array(io);Gr(lo);var Di=new Array(qr);Gr(Di);function uo(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Hc,Wc,Gc;function fo(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function qc(e){return e<256?Bn[e]:Bn[256+(e>>>7)]}function Nn(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function st(e,t,r){e.bi_valid>oo-r?(e.bi_buf|=t<<e.bi_valid&65535,Nn(e,e.bi_buf),e.bi_buf=t>>oo-e.bi_valid,e.bi_valid+=r-oo):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function It(e,t,r){st(e,r[t*2],r[t*2+1])}function Yc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Vp(e){e.bi_valid===16?(Nn(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Kp(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,p,m,g,_=0;for(p=0;p<=xr;p++)e.bl_count[p]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Nc;c++)u=e.heap[c],p=r[r[u*2+1]*2+1]+1,p>l&&(p=l,_++),r[u*2+1]=p,!(u>n)&&(e.bl_count[p]++,m=0,u>=s&&(m=o[u-s]),g=r[u*2],e.opt_len+=g*(p+m),a&&(e.static_len+=g*(i[u*2+1]+m)));if(_!==0){do{for(p=l-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,_-=2}while(_>0);for(p=l;p!==0;p--)for(u=e.bl_count[p];u!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(e.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),u--)}}function Xc(e,t,r){var n=new Array(xr+1),i=0,a,o;for(a=1;a<=xr;a++)n[a]=i=i+r[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=Yc(n[s]++,s))}}function Jp(){var e,t,r,n,i,a=new Array(xr+1);for(r=0,n=0;n<io-1;n++)for(lo[n]=r,e=0;e<1<<co[n];e++)zn[r++]=n;for(zn[r-1]=n,i=0,n=0;n<16;n++)for(Di[n]=i,e=0;e<1<<$i[n];e++)Bn[i++]=n;for(i>>=7;n<qr;n++)for(Di[n]=i<<7,e=0;e<1<<$i[n]-7;e++)Bn[256+i++]=n;for(t=0;t<=xr;t++)a[t]=0;for(e=0;e<=143;)Yt[e*2+1]=8,e++,a[8]++;for(;e<=255;)Yt[e*2+1]=9,e++,a[9]++;for(;e<=279;)Yt[e*2+1]=7,e++,a[7]++;for(;e<=287;)Yt[e*2+1]=8,e++,a[8]++;for(Xc(Yt,In+1,a),e=0;e<qr;e++)jn[e*2+1]=5,jn[e*2]=Yc(e,5);Hc=new uo(Yt,co,Dn+1,In,xr),Wc=new uo(jn,$i,0,qr,xr),Gc=new uo(new Array(0),Xp,0,ao,Yp)}function Zc(e){var t;for(t=0;t<In;t++)e.dyn_ltree[t*2]=0;for(t=0;t<qr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ao;t++)e.bl_tree[t*2]=0;e.dyn_ltree[so*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Vc(e){e.bi_valid>8?Nn(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Qp(e,t,r,n){Vc(e),Nn(e,r),Nn(e,~r),Lp.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function Kc(e,t,r,n){var i=t*2,a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function ho(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&Kc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Kc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function Jc(e,t,r){var n,i,a=0,o,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,n===0?It(e,i,t):(o=zn[i],It(e,o+Dn+1,t),s=co[o],s!==0&&(i-=lo[o],st(e,i,s)),n--,o=qc(n),It(e,o,r),s=$i[o],s!==0&&(n-=Di[o],st(e,n,s)));while(a<e.last_lit);It(e,so,t)}function po(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,l=-1,c;for(e.heap_len=0,e.heap_max=Nc,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=n[c*2+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)ho(e,r,o);c=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ho(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,ho(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Kp(e,t),Xc(r,l,e.bl_count)}function Qc(e,t,r){var n,i=-1,a,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=t[(n+1)*2+1],!(++s<l&&a===o)&&(s<c?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Mc*2]++):s<=10?e.bl_tree[Lc*2]++:e.bl_tree[Fc*2]++,s=0,i=a,o===0?(l=138,c=3):a===o?(l=6,c=3):(l=7,c=4))}function el(e,t,r){var n,i=-1,a,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),n=0;n<=r;n++)if(a=o,o=t[(n+1)*2+1],!(++s<l&&a===o)){if(s<c)do It(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(It(e,a,e.bl_tree),s--),It(e,Mc,e.bl_tree),st(e,s-3,2)):s<=10?(It(e,Lc,e.bl_tree),st(e,s-3,3)):(It(e,Fc,e.bl_tree),st(e,s-11,7));s=0,i=a,o===0?(l=138,c=3):a===o?(l=6,c=3):(l=7,c=4)}}function em(e){var t;for(Qc(e,e.dyn_ltree,e.l_desc.max_code),Qc(e,e.dyn_dtree,e.d_desc.max_code),po(e,e.bl_desc),t=ao-1;t>=3&&e.bl_tree[Uc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function tm(e,t,r,n){var i;for(st(e,t-257,5),st(e,r-1,5),st(e,n-4,4),i=0;i<n;i++)st(e,e.bl_tree[Uc[i]*2+1],3);el(e,e.dyn_ltree,t-1),el(e,e.dyn_dtree,r-1)}function rm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return jc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Bc;for(r=32;r<Dn;r++)if(e.dyn_ltree[r*2]!==0)return Bc;return jc}var tl=!1;function nm(e){tl||(Jp(),tl=!0),e.l_desc=new fo(e.dyn_ltree,Hc),e.d_desc=new fo(e.dyn_dtree,Wc),e.bl_desc=new fo(e.bl_tree,Gc),e.bi_buf=0,e.bi_valid=0,Zc(e)}function rl(e,t,r,n){st(e,(Hp<<1)+(n?1:0),3),Qp(e,t,r)}function im(e){st(e,zc<<1,3),It(e,so,Yt),Vp(e)}function am(e,t,r,n){var i,a,o=0;e.level>0?(e.strm.data_type===Up&&(e.strm.data_type=rm(e)),po(e,e.l_desc),po(e,e.d_desc),o=em(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&t!==-1?rl(e,t,r,n):e.strategy===Fp||a===i?(st(e,(zc<<1)+(n?1:0),3),Jc(e,Yt,jn)):(st(e,(Wp<<1)+(n?1:0),3),tm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Jc(e,e.dyn_ltree,e.dyn_dtree)),Zc(e),n&&Vc(e)}function om(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(zn[r]+Dn+1)*2]++,e.dyn_dtree[qc(t)*2]++),e.last_lit===e.lit_bufsize-1}Wr._tr_init=nm,Wr._tr_stored_block=rl,Wr._tr_flush_block=am,Wr._tr_tally=om,Wr._tr_align=im;function sm(e,t,r,n){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}var nl=sm;function cm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var lm=cm();function um(e,t,r,n){var i=lm,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var il=um,mo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},tt=qt,bt=Wr,al=nl,rr=il,fm=mo,Er=0,dm=1,hm=3,nr=4,ol=5,jt=0,sl=1,_t=-2,pm=-3,wo=-5,mm=-1,wm=1,Ii=2,gm=3,ym=4,bm=0,_m=2,ji=8,vm=9,xm=15,Em=8,Sm=29,km=256,go=km+1+Sm,Rm=30,Om=19,Cm=2*go+1,Tm=15,we=3,ir=258,kt=ir+we+1,Pm=32,Bi=42,yo=69,zi=73,Ni=91,Mi=103,Sr=113,Mn=666,He=1,Ln=2,kr=3,Yr=4,Am=3;function ar(e,t){return e.msg=fm[t],t}function cl(e){return(e<<1)-(e>4?9:0)}function or(e){for(var t=e.length;--t>=0;)e[t]=0}function sr(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(tt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function Ye(e,t){bt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,sr(e.strm)}function _e(e,t){e.pending_buf[e.pending++]=t}function Fn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function $m(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,tt.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=al(e.adler,t,i,r):e.state.wrap===2&&(e.adler=rr(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function ll(e,t){var r=e.max_chain_length,n=e.strstart,i,a,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-kt?e.strstart-(e.w_size-kt):0,c=e.window,u=e.w_mask,d=e.prev,p=e.strstart+ir,m=c[n+o-1],g=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(c[i+o]!==g||c[i+o-1]!==m||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=ir-(p-n),n=p-ir,a>o){if(e.match_start=t,o=a,a>=s)break;m=c[n+o-1],g=c[n+o]}}while((t=d[t&u])>l&&--r!==0);return o<=e.lookahead?o:e.lookahead}function Rr(e){var t=e.w_size,r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-kt)){tt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=$m(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=we)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+we-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<we)););}while(e.lookahead<kt&&e.strm.avail_in!==0)}function Dm(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rr(e),e.lookahead===0&&t===Er)return He;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Ye(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-kt&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):(e.strstart>e.block_start&&(Ye(e,!1),e.strm.avail_out===0),He)}function bo(e,t){for(var r,n;;){if(e.lookahead<kt){if(Rr(e),e.lookahead<kt&&t===Er)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=we&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-kt&&(e.match_length=ll(e,r)),e.match_length>=we)if(n=bt._tr_tally(e,e.strstart-e.match_start,e.match_length-we),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=we){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=bt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=e.strstart<we-1?e.strstart:we-1,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function Xr(e,t){for(var r,n,i;;){if(e.lookahead<kt){if(Rr(e),e.lookahead<kt&&t===Er)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=we&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=we-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-kt&&(e.match_length=ll(e,r),e.match_length<=5&&(e.strategy===wm||e.match_length===we&&e.strstart-e.match_start>4096)&&(e.match_length=we-1)),e.prev_length>=we&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-we,n=bt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-we),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=we-1,e.strstart++,n&&(Ye(e,!1),e.strm.avail_out===0))return He}else if(e.match_available){if(n=bt._tr_tally(e,0,e.window[e.strstart-1]),n&&Ye(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return He}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=bt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<we-1?e.strstart:we-1,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function Im(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=ir){if(Rr(e),e.lookahead<=ir&&t===Er)return He;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=we&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+ir;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=ir-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=we?(r=bt._tr_tally(e,1,e.match_length-we),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=bt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function jm(e,t){for(var r;;){if(e.lookahead===0&&(Rr(e),e.lookahead===0)){if(t===Er)return He;break}if(e.match_length=0,r=bt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function Bt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Zr;Zr=[new Bt(0,0,0,0,Dm),new Bt(4,4,8,4,bo),new Bt(4,5,16,8,bo),new Bt(4,6,32,32,bo),new Bt(4,4,16,16,Xr),new Bt(8,16,32,32,Xr),new Bt(8,16,128,128,Xr),new Bt(8,32,128,256,Xr),new Bt(32,128,258,1024,Xr),new Bt(32,258,258,4096,Xr)];function Bm(e){e.window_size=2*e.w_size,or(e.head),e.max_lazy_match=Zr[e.level].max_lazy,e.good_match=Zr[e.level].good_length,e.nice_match=Zr[e.level].nice_length,e.max_chain_length=Zr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=we-1,e.match_available=0,e.ins_h=0}function zm(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ji,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new tt.Buf16(Cm*2),this.dyn_dtree=new tt.Buf16((2*Rm+1)*2),this.bl_tree=new tt.Buf16((2*Om+1)*2),or(this.dyn_ltree),or(this.dyn_dtree),or(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new tt.Buf16(Tm+1),this.heap=new tt.Buf16(2*go+1),or(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new tt.Buf16(2*go+1),or(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ul(e){var t;return!e||!e.state?ar(e,_t):(e.total_in=e.total_out=0,e.data_type=_m,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Bi:Sr,e.adler=t.wrap===2?0:1,t.last_flush=Er,bt._tr_init(t),jt)}function fl(e){var t=ul(e);return t===jt&&Bm(e.state),t}function Nm(e,t){return!e||!e.state||e.state.wrap!==2?_t:(e.state.gzhead=t,jt)}function dl(e,t,r,n,i,a){if(!e)return _t;var o=1;if(t===mm&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>vm||r!==ji||n<8||n>15||t<0||t>9||a<0||a>ym)return ar(e,_t);n===8&&(n=9);var s=new zm;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+we-1)/we),s.window=new tt.Buf8(s.w_size*2),s.head=new tt.Buf16(s.hash_size),s.prev=new tt.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new tt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=r,fl(e)}function Mm(e,t){return dl(e,t,ji,xm,Em,bm)}function Lm(e,t){var r,n,i,a;if(!e||!e.state||t>ol||t<0)return e?ar(e,_t):_t;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Mn&&t!==nr)return ar(e,e.avail_out===0?wo:_t);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Bi)if(n.wrap===2)e.adler=0,_e(n,31),_e(n,139),_e(n,8),n.gzhead?(_e(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),_e(n,n.gzhead.time&255),_e(n,n.gzhead.time>>8&255),_e(n,n.gzhead.time>>16&255),_e(n,n.gzhead.time>>24&255),_e(n,n.level===9?2:n.strategy>=Ii||n.level<2?4:0),_e(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(_e(n,n.gzhead.extra.length&255),_e(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=rr(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yo):(_e(n,0),_e(n,0),_e(n,0),_e(n,0),_e(n,0),_e(n,n.level===9?2:n.strategy>=Ii||n.level<2?4:0),_e(n,Am),n.status=Sr);else{var o=ji+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=Ii||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,o|=s<<6,n.strstart!==0&&(o|=Pm),o+=31-o%31,n.status=Sr,Fn(n,o),n.strstart!==0&&(Fn(n,e.adler>>>16),Fn(n,e.adler&65535)),e.adler=1}if(n.status===yo)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),sr(e),i=n.pending,n.pending===n.pending_buf_size));)_e(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zi)}else n.status=zi;if(n.status===zi)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),sr(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,_e(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Ni)}else n.status=Ni;if(n.status===Ni)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),sr(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,_e(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=Mi)}else n.status=Mi;if(n.status===Mi&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&sr(e),n.pending+2<=n.pending_buf_size&&(_e(n,e.adler&255),_e(n,e.adler>>8&255),e.adler=0,n.status=Sr)):n.status=Sr),n.pending!==0){if(sr(e),e.avail_out===0)return n.last_flush=-1,jt}else if(e.avail_in===0&&cl(t)<=cl(r)&&t!==nr)return ar(e,wo);if(n.status===Mn&&e.avail_in!==0)return ar(e,wo);if(e.avail_in!==0||n.lookahead!==0||t!==Er&&n.status!==Mn){var l=n.strategy===Ii?jm(n,t):n.strategy===gm?Im(n,t):Zr[n.level].func(n,t);if((l===kr||l===Yr)&&(n.status=Mn),l===He||l===kr)return e.avail_out===0&&(n.last_flush=-1),jt;if(l===Ln&&(t===dm?bt._tr_align(n):t!==ol&&(bt._tr_stored_block(n,0,0,!1),t===hm&&(or(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),sr(e),e.avail_out===0))return n.last_flush=-1,jt}return t!==nr?jt:n.wrap<=0?sl:(n.wrap===2?(_e(n,e.adler&255),_e(n,e.adler>>8&255),_e(n,e.adler>>16&255),_e(n,e.adler>>24&255),_e(n,e.total_in&255),_e(n,e.total_in>>8&255),_e(n,e.total_in>>16&255),_e(n,e.total_in>>24&255)):(Fn(n,e.adler>>>16),Fn(n,e.adler&65535)),sr(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?jt:sl)}function Fm(e){var t;return!e||!e.state?_t:(t=e.state.status,t!==Bi&&t!==yo&&t!==zi&&t!==Ni&&t!==Mi&&t!==Sr&&t!==Mn?ar(e,_t):(e.state=null,t===Sr?ar(e,pm):jt))}function Um(e,t){var r=t.length,n,i,a,o,s,l,c,u;if(!e||!e.state||(n=e.state,o=n.wrap,o===2||o===1&&n.status!==Bi||n.lookahead))return _t;for(o===1&&(e.adler=al(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(o===0&&(or(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new tt.Buf8(n.w_size),tt.arraySet(u,t,r-n.w_size,n.w_size,0),t=u,r=n.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,Rr(n);n.lookahead>=we;){i=n.strstart,a=n.lookahead-(we-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+we-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--a);n.strstart=i,n.lookahead=we-1,Rr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=we-1,n.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,n.wrap=o,jt}Dt.deflateInit=Mm,Dt.deflateInit2=dl,Dt.deflateReset=fl,Dt.deflateResetKeep=ul,Dt.deflateSetHeader=Nm,Dt.deflate=Lm,Dt.deflateEnd=Fm,Dt.deflateSetDictionary=Um,Dt.deflateInfo="pako deflate (from Nodeca project)";var Or={},Li=qt,hl=!0,pl=!0;try{String.fromCharCode.apply(null,[0])}catch{hl=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{pl=!1}for(var Un=new Li.Buf8(256),cr=0;cr<256;cr++)Un[cr]=cr>=252?6:cr>=248?5:cr>=240?4:cr>=224?3:cr>=192?2:1;Un[254]=Un[254]=1,Or.string2buf=function(e){var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Li.Buf8(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};function ml(e,t){if(t<65534&&(e.subarray&&pl||!e.subarray&&hl))return String.fromCharCode.apply(null,Li.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Or.buf2binstring=function(e){return ml(e,e.length)},Or.binstring2buf=function(e){for(var t=new Li.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},Or.buf2string=function(e,t){var r,n,i,a,o=t||e.length,s=new Array(o*2);for(n=0,r=0;r<o;){if(i=e[r++],i<128){s[n++]=i;continue}if(a=Un[i],a>4){s[n++]=65533,r+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&r<o;)i=i<<6|e[r++]&63,a--;if(a>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return ml(s,n)},Or.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Un[e[r]]>t?r:t};function Hm(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var wl=Hm,Hn=Dt,Wn=qt,_o=Or,vo=mo,Wm=wl,gl=Object.prototype.toString,Gm=0,xo=4,Vr=0,yl=1,bl=2,qm=-1,Ym=0,Xm=8;function Cr(e){if(!(this instanceof Cr))return new Cr(e);this.options=Wn.assign({level:qm,method:Xm,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ym,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wm,this.strm.avail_out=0;var r=Hn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Vr)throw new Error(vo[r]);if(t.header&&Hn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=_o.string2buf(t.dictionary):gl.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Hn.deflateSetDictionary(this.strm,n),r!==Vr)throw new Error(vo[r]);this._dict_set=!0}}Cr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?xo:Gm,typeof e=="string"?r.input=_o.string2buf(e):gl.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Wn.Buf8(n),r.next_out=0,r.avail_out=n),i=Hn.deflate(r,a),i!==yl&&i!==Vr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(a===xo||a===bl))&&(this.options.to==="string"?this.onData(_o.buf2binstring(Wn.shrinkBuf(r.output,r.next_out))):this.onData(Wn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==yl);return a===xo?(i=Hn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Vr):(a===bl&&(this.onEnd(Vr),r.avail_out=0),!0)},Cr.prototype.onData=function(e){this.chunks.push(e)},Cr.prototype.onEnd=function(e){e===Vr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Wn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Eo(e,t){var r=new Cr(t);if(r.push(e,!0),r.err)throw r.msg||vo[r.err];return r.result}function Zm(e,t){return t=t||{},t.raw=!0,Eo(e,t)}function Vm(e,t){return t=t||{},t.gzip=!0,Eo(e,t)}$n.Deflate=Cr,$n.deflate=Eo,$n.deflateRaw=Zm,$n.gzip=Vm;var Gn={},Rt={},Fi=30,Km=12,Jm=function(t,r){var n,i,a,o,s,l,c,u,d,p,m,g,_,x,y,v,O,R,b,C,k,S,P,$,B;n=t.state,i=t.next_in,$=t.input,a=i+(t.avail_in-5),o=t.next_out,B=t.output,s=o-(r-t.avail_out),l=o+(t.avail_out-257),c=n.dmax,u=n.wsize,d=n.whave,p=n.wnext,m=n.window,g=n.hold,_=n.bits,x=n.lencode,y=n.distcode,v=(1<<n.lenbits)-1,O=(1<<n.distbits)-1;e:do{_<15&&(g+=$[i++]<<_,_+=8,g+=$[i++]<<_,_+=8),R=x[g&v];t:for(;;){if(b=R>>>24,g>>>=b,_-=b,b=R>>>16&255,b===0)B[o++]=R&65535;else if(b&16){C=R&65535,b&=15,b&&(_<b&&(g+=$[i++]<<_,_+=8),C+=g&(1<<b)-1,g>>>=b,_-=b),_<15&&(g+=$[i++]<<_,_+=8,g+=$[i++]<<_,_+=8),R=y[g&O];r:for(;;){if(b=R>>>24,g>>>=b,_-=b,b=R>>>16&255,b&16){if(k=R&65535,b&=15,_<b&&(g+=$[i++]<<_,_+=8,_<b&&(g+=$[i++]<<_,_+=8)),k+=g&(1<<b)-1,k>c){t.msg="invalid distance too far back",n.mode=Fi;break e}if(g>>>=b,_-=b,b=o-s,k>b){if(b=k-b,b>d&&n.sane){t.msg="invalid distance too far back",n.mode=Fi;break e}if(S=0,P=m,p===0){if(S+=u-b,b<C){C-=b;do B[o++]=m[S++];while(--b);S=o-k,P=B}}else if(p<b){if(S+=u+p-b,b-=p,b<C){C-=b;do B[o++]=m[S++];while(--b);if(S=0,p<C){b=p,C-=b;do B[o++]=m[S++];while(--b);S=o-k,P=B}}}else if(S+=p-b,b<C){C-=b;do B[o++]=m[S++];while(--b);S=o-k,P=B}for(;C>2;)B[o++]=P[S++],B[o++]=P[S++],B[o++]=P[S++],C-=3;C&&(B[o++]=P[S++],C>1&&(B[o++]=P[S++]))}else{S=o-k;do B[o++]=B[S++],B[o++]=B[S++],B[o++]=B[S++],C-=3;while(C>2);C&&(B[o++]=B[S++],C>1&&(B[o++]=B[S++]))}}else if(b&64){t.msg="invalid distance code",n.mode=Fi;break e}else{R=y[(R&65535)+(g&(1<<b)-1)];continue r}break}}else if(b&64)if(b&32){n.mode=Km;break e}else{t.msg="invalid literal/length code",n.mode=Fi;break e}else{R=x[(R&65535)+(g&(1<<b)-1)];continue t}break}}while(i<a&&o<l);C=_>>3,i-=C,_-=C<<3,g&=(1<<_)-1,t.next_in=i,t.next_out=o,t.avail_in=i<a?5+(a-i):5-(i-a),t.avail_out=o<l?257+(l-o):257-(o-l),n.hold=g,n.bits=_},_l=qt,Kr=15,vl=852,xl=592,El=0,So=1,Sl=2,Qm=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],e0=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],t0=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],r0=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],n0=function(t,r,n,i,a,o,s,l){var c=l.bits,u=0,d=0,p=0,m=0,g=0,_=0,x=0,y=0,v=0,O=0,R,b,C,k,S,P=null,$=0,B,M=new _l.Buf16(Kr+1),H=new _l.Buf16(Kr+1),Y=null,ue=0,Te,me,ge;for(u=0;u<=Kr;u++)M[u]=0;for(d=0;d<i;d++)M[r[n+d]]++;for(g=c,m=Kr;m>=1&&M[m]===0;m--);if(g>m&&(g=m),m===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,l.bits=1,0;for(p=1;p<m&&M[p]===0;p++);for(g<p&&(g=p),y=1,u=1;u<=Kr;u++)if(y<<=1,y-=M[u],y<0)return-1;if(y>0&&(t===El||m!==1))return-1;for(H[1]=0,u=1;u<Kr;u++)H[u+1]=H[u]+M[u];for(d=0;d<i;d++)r[n+d]!==0&&(s[H[r[n+d]]++]=d);if(t===El?(P=Y=s,B=19):t===So?(P=Qm,$-=257,Y=e0,ue-=257,B=256):(P=t0,Y=r0,B=-1),O=0,d=0,u=p,S=o,_=g,x=0,C=-1,v=1<<g,k=v-1,t===So&&v>vl||t===Sl&&v>xl)return 1;for(;;){Te=u-x,s[d]<B?(me=0,ge=s[d]):s[d]>B?(me=Y[ue+s[d]],ge=P[$+s[d]]):(me=96,ge=0),R=1<<u-x,b=1<<_,p=b;do b-=R,a[S+(O>>x)+b]=Te<<24|me<<16|ge|0;while(b!==0);for(R=1<<u-1;O&R;)R>>=1;if(R!==0?(O&=R-1,O+=R):O=0,d++,--M[u]===0){if(u===m)break;u=r[n+s[d]]}if(u>g&&(O&k)!==C){for(x===0&&(x=g),S+=p,_=u-x,y=1<<_;_+x<m&&(y-=M[_+x],!(y<=0));)_++,y<<=1;if(v+=1<<_,t===So&&v>vl||t===Sl&&v>xl)return 1;C=O&k,a[C]=g<<24|_<<16|S-o|0}}return O!==0&&(a[S+O]=u-x<<24|64<<16|0),l.bits=g,0},pt=qt,ko=nl,zt=il,i0=Jm,qn=n0,a0=0,kl=1,Rl=2,Ol=4,o0=5,Ui=6,Tr=0,s0=1,c0=2,vt=-2,Cl=-3,Tl=-4,l0=-5,Pl=8,Al=1,$l=2,Dl=3,Il=4,jl=5,Bl=6,zl=7,Nl=8,Ml=9,Ll=10,Hi=11,Xt=12,Ro=13,Fl=14,Oo=15,Ul=16,Hl=17,Wl=18,Gl=19,Wi=20,Gi=21,ql=22,Yl=23,Xl=24,Zl=25,Vl=26,Co=27,Kl=28,Jl=29,$e=30,Ql=31,u0=32,f0=852,d0=592,h0=15,p0=h0;function eu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function m0(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new pt.Buf16(320),this.work=new pt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function tu(e){var t;return!e||!e.state?vt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Al,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new pt.Buf32(f0),t.distcode=t.distdyn=new pt.Buf32(d0),t.sane=1,t.back=-1,Tr)}function ru(e){var t;return!e||!e.state?vt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,tu(e))}function nu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?vt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ru(e))}function iu(e,t){var r,n;return e?(n=new m0,e.state=n,n.window=null,r=nu(e,t),r!==Tr&&(e.state=null),r):vt}function w0(e){return iu(e,p0)}var au=!0,To,Po;function g0(e){if(au){var t;for(To=new pt.Buf32(512),Po=new pt.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(qn(kl,e.lens,0,288,To,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;qn(Rl,e.lens,0,32,Po,0,e.work,{bits:5}),au=!1}e.lencode=To,e.lenbits=9,e.distcode=Po,e.distbits=5}function ou(e,t,r,n){var i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new pt.Buf8(a.wsize)),n>=a.wsize?(pt.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),pt.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n?(pt.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function y0(e,t){var r,n,i,a,o,s,l,c,u,d,p,m,g,_,x=0,y,v,O,R,b,C,k,S,P=new pt.Buf8(4),$,B,M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return vt;r=e.state,r.mode===Xt&&(r.mode=Ro),o=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,d=s,p=l,S=Tr;e:for(;;)switch(r.mode){case Al:if(r.wrap===0){r.mode=Ro;break}for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0),c=0,u=0,r.mode=$l;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=$e;break}if((c&15)!==Pl){e.msg="unknown compression method",r.mode=$e;break}if(c>>>=4,u-=4,k=(c&15)+8,r.wbits===0)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=$e;break}r.dmax=1<<k,e.adler=r.check=1,r.mode=c&512?Ll:Xt,c=0,u=0;break;case $l:for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Pl){e.msg="unknown compression method",r.mode=$e;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0)),c=0,u=0,r.mode=Dl;case Dl:for(;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=zt(r.check,P,4,0)),c=0,u=0,r.mode=Il;case Il:for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0)),c=0,u=0,r.mode=jl;case jl:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=Bl;case Bl:if(r.flags&1024&&(m=r.length,m>s&&(m=s),m&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),pt.arraySet(r.head.extra,n,a,m,k)),r.flags&512&&(r.check=zt(r.check,n,m,a)),s-=m,a+=m,r.length-=m),r.length))break e;r.length=0,r.mode=zl;case zl:if(r.flags&2048){if(s===0)break e;m=0;do k=n[a+m++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&m<s);if(r.flags&512&&(r.check=zt(r.check,n,m,a)),s-=m,a+=m,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Nl;case Nl:if(r.flags&4096){if(s===0)break e;m=0;do k=n[a+m++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&m<s);if(r.flags&512&&(r.check=zt(r.check,n,m,a)),s-=m,a+=m,k)break e}else r.head&&(r.head.comment=null);r.mode=Ml;case Ml:if(r.flags&512){for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$e;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Xt;break;case Ll:for(;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}e.adler=r.check=eu(c),c=0,u=0,r.mode=Hi;case Hi:if(r.havedict===0)return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,c0;e.adler=r.check=1,r.mode=Xt;case Xt:if(t===o0||t===Ui)break e;case Ro:if(r.last){c>>>=u&7,u-=u&7,r.mode=Co;break}for(;u<3;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=Fl;break;case 1:if(g0(r),r.mode=Wi,t===Ui){c>>>=2,u-=2;break e}break;case 2:r.mode=Hl;break;case 3:e.msg="invalid block type",r.mode=$e}c>>>=2,u-=2;break;case Fl:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$e;break}if(r.length=c&65535,c=0,u=0,r.mode=Oo,t===Ui)break e;case Oo:r.mode=Ul;case Ul:if(m=r.length,m){if(m>s&&(m=s),m>l&&(m=l),m===0)break e;pt.arraySet(i,n,a,m,o),s-=m,a+=m,l-=m,o+=m,r.length-=m;break}r.mode=Xt;break;case Hl:for(;u<14;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$e;break}r.have=0,r.mode=Wl;case Wl:for(;r.have<r.ncode;){for(;u<3;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.lens[M[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},S=qn(a0,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,S){e.msg="invalid code lengths set",r.mode=$e;break}r.have=0,r.mode=Gl;case Gl:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[c&(1<<r.lenbits)-1],y=x>>>24,v=x>>>16&255,O=x&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(O<16)c>>>=y,u-=y,r.lens[r.have++]=O;else{if(O===16){for(B=y+2;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(c>>>=y,u-=y,r.have===0){e.msg="invalid bit length repeat",r.mode=$e;break}k=r.lens[r.have-1],m=3+(c&3),c>>>=2,u-=2}else if(O===17){for(B=y+3;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=y,u-=y,k=0,m=3+(c&7),c>>>=3,u-=3}else{for(B=y+7;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=y,u-=y,k=0,m=11+(c&127),c>>>=7,u-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$e;break}for(;m--;)r.lens[r.have++]=k}}if(r.mode===$e)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$e;break}if(r.lenbits=9,$={bits:r.lenbits},S=qn(kl,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,S){e.msg="invalid literal/lengths set",r.mode=$e;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},S=qn(Rl,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,S){e.msg="invalid distances set",r.mode=$e;break}if(r.mode=Wi,t===Ui)break e;case Wi:r.mode=Gi;case Gi:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,i0(e,p),o=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===Xt&&(r.back=-1);break}for(r.back=0;x=r.lencode[c&(1<<r.lenbits)-1],y=x>>>24,v=x>>>16&255,O=x&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(v&&!(v&240)){for(R=y,b=v,C=O;x=r.lencode[C+((c&(1<<R+b)-1)>>R)],y=x>>>24,v=x>>>16&255,O=x&65535,!(R+y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=R,u-=R,r.back+=R}if(c>>>=y,u-=y,r.back+=y,r.length=O,v===0){r.mode=Vl;break}if(v&32){r.back=-1,r.mode=Xt;break}if(v&64){e.msg="invalid literal/length code",r.mode=$e;break}r.extra=v&15,r.mode=ql;case ql:if(r.extra){for(B=r.extra;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Yl;case Yl:for(;x=r.distcode[c&(1<<r.distbits)-1],y=x>>>24,v=x>>>16&255,O=x&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(!(v&240)){for(R=y,b=v,C=O;x=r.distcode[C+((c&(1<<R+b)-1)>>R)],y=x>>>24,v=x>>>16&255,O=x&65535,!(R+y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=R,u-=R,r.back+=R}if(c>>>=y,u-=y,r.back+=y,v&64){e.msg="invalid distance code",r.mode=$e;break}r.offset=O,r.extra=v&15,r.mode=Xl;case Xl:if(r.extra){for(B=r.extra;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$e;break}r.mode=Zl;case Zl:if(l===0)break e;if(m=p-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$e;break}m>r.wnext?(m-=r.wnext,g=r.wsize-m):g=r.wnext-m,m>r.length&&(m=r.length),_=r.window}else _=i,g=o-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do i[o++]=_[g++];while(--m);r.length===0&&(r.mode=Gi);break;case Vl:if(l===0)break e;i[o++]=r.length,l--,r.mode=Gi;break;case Co:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[a++]<<u,u+=8}if(p-=l,e.total_out+=p,r.total+=p,p&&(e.adler=r.check=r.flags?zt(r.check,i,p,o-p):ko(r.check,i,p,o-p)),p=l,(r.flags?c:eu(c))!==r.check){e.msg="incorrect data check",r.mode=$e;break}c=0,u=0}r.mode=Kl;case Kl:if(r.wrap&&r.flags){for(;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$e;break}c=0,u=0}r.mode=Jl;case Jl:S=s0;break e;case $e:S=Cl;break e;case Ql:return Tl;case u0:default:return vt}return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||p!==e.avail_out&&r.mode<$e&&(r.mode<Co||t!==Ol))&&ou(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,r.wrap&&p&&(e.adler=r.check=r.flags?zt(r.check,i,p,e.next_out-p):ko(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Xt?128:0)+(r.mode===Wi||r.mode===Oo?256:0),(d===0&&p===0||t===Ol)&&S===Tr&&(S=l0),S}function b0(e){if(!e||!e.state)return vt;var t=e.state;return t.window&&(t.window=null),e.state=null,Tr}function _0(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?vt:(r.head=t,t.done=!1,Tr)}function v0(e,t){var r=t.length,n,i,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Hi)?vt:n.mode===Hi&&(i=1,i=ko(i,t,r,0),i!==n.check)?Cl:(a=ou(e,t,r,r),a?(n.mode=Ql,Tl):(n.havedict=1,Tr))}Rt.inflateReset=ru,Rt.inflateReset2=nu,Rt.inflateResetKeep=tu,Rt.inflateInit=w0,Rt.inflateInit2=iu,Rt.inflate=y0,Rt.inflateEnd=b0,Rt.inflateGetHeader=_0,Rt.inflateSetDictionary=v0,Rt.inflateInfo="pako inflate (from Nodeca project)";var su={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};function x0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var E0=x0,Jr=Rt,Yn=qt,qi=Or,Me=su,Ao=mo,S0=wl,k0=E0,cu=Object.prototype.toString;function Pr(e){if(!(this instanceof Pr))return new Pr(e);this.options=Yn.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new S0,this.strm.avail_out=0;var r=Jr.inflateInit2(this.strm,t.windowBits);if(r!==Me.Z_OK)throw new Error(Ao[r]);if(this.header=new k0,Jr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=qi.string2buf(t.dictionary):cu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Jr.inflateSetDictionary(this.strm,t.dictionary),r!==Me.Z_OK)))throw new Error(Ao[r])}Pr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s,l,c,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?Me.Z_FINISH:Me.Z_NO_FLUSH,typeof e=="string"?r.input=qi.binstring2buf(e):cu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Yn.Buf8(n),r.next_out=0,r.avail_out=n),a=Jr.inflate(r,Me.Z_NO_FLUSH),a===Me.Z_NEED_DICT&&i&&(a=Jr.inflateSetDictionary(this.strm,i)),a===Me.Z_BUF_ERROR&&u===!0&&(a=Me.Z_OK,u=!1),a!==Me.Z_STREAM_END&&a!==Me.Z_OK)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(r.avail_out===0||a===Me.Z_STREAM_END||r.avail_in===0&&(o===Me.Z_FINISH||o===Me.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=qi.utf8border(r.output,r.next_out),l=r.next_out-s,c=qi.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&Yn.arraySet(r.output,r.output,s,l,0),this.onData(c)):this.onData(Yn.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&a!==Me.Z_STREAM_END);return a===Me.Z_STREAM_END&&(o=Me.Z_FINISH),o===Me.Z_FINISH?(a=Jr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Me.Z_OK):(o===Me.Z_SYNC_FLUSH&&(this.onEnd(Me.Z_OK),r.avail_out=0),!0)},Pr.prototype.onData=function(e){this.chunks.push(e)},Pr.prototype.onEnd=function(e){e===Me.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function $o(e,t){var r=new Pr(t);if(r.push(e,!0),r.err)throw r.msg||Ao[r.err];return r.result}function R0(e,t){return t=t||{},t.raw=!0,$o(e,t)}Gn.Inflate=Pr,Gn.inflate=$o,Gn.inflateRaw=R0,Gn.ungzip=$o;var O0=qt.assign,C0=$n,T0=Gn,P0=su,lu={};O0(lu,C0,T0,P0);var A0=lu;const Do=St(A0),uu=(e,t)=>function(...r){const n=t.promiseModule;return new n((i,a)=>{t.multiArgs?r.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?r.push((o,s)=>{o?a(o):i(s)}):r.push(i),e.apply(this,r)})};var $0=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=a=>{const o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)};let i;r==="function"?i=function(...a){return t.excludeMain?e(...a):uu(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(const a in e){const o=e[a];i[a]=typeof o=="function"&&n(a)?uu(o,t):o}return i};const Io=St($0);function fu(e){return Array.isArray(e)?e:[e]}const jo="",du=" ",Bo="\\",D0=/^\s+$/,I0=/(?:[^\\]|^)\\$/,j0=/^\\!/,B0=/^\\#/,z0=/\r?\n/g,N0=/^\.*\/|^\.+$/,zo="/";let hu="node-ignore";typeof Symbol<"u"&&(hu=Symbol.for("node-ignore"));const pu=hu,M0=(e,t,r)=>Object.defineProperty(e,t,{value:r}),L0=/([0-z])-([0-z])/g,mu=()=>!1,F0=e=>e.replace(L0,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:jo),U0=e=>{const{length:t}=e;return e.slice(0,t-t%2)},H0=[[/^\uFEFF/,()=>jo],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?du:jo)],[/(\\+?)\s/g,(e,t)=>{const{length:r}=t;return t.slice(0,r-r%2)+du}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{const n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Bo],[/\\\\/g,()=>Bo],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,i)=>t===Bo?`\\[${r}${U0(n)}${i}`:i==="]"&&n.length%2===0?`[${F0(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],wu=Object.create(null),W0=(e,t)=>{let r=wu[e];return r||(r=H0.reduce((n,[i,a])=>n.replace(i,a.bind(e)),e),wu[e]=r),t?new RegExp(r,"i"):new RegExp(r)},No=e=>typeof e=="string",G0=e=>e&&No(e)&&!D0.test(e)&&!I0.test(e)&&e.indexOf("#")!==0,q0=e=>e.split(z0);class Y0{constructor(t,r,n,i){this.origin=t,this.pattern=r,this.negative=n,this.regex=i}}const X0=(e,t)=>{const r=e;let n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(j0,"!").replace(B0,"#");const i=W0(e,t);return new Y0(r,e,n,i)},Z0=(e,t)=>{throw new t(e)},Zt=(e,t,r)=>No(e)?e?Zt.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),gu=e=>N0.test(e);Zt.isNotRelative=gu,Zt.convert=e=>e;class V0{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){M0(this,pu,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[pu]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(G0(t)){const r=X0(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,fu(No(t)?q0(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,i=!1;return this._rules.forEach(a=>{const{negative:o}=a;if(i===o&&n!==i||o&&!n&&!i&&!r)return;a.regex.test(t)&&(n=!o,i=o)}),{ignored:n,unignored:i}}_test(t,r,n,i){const a=t&&Zt.convert(t);return Zt(a,t,this._allowRelativePaths?mu:Z0),this._t(a,r,n,i)}_t(t,r,n,i){if(t in r)return r[t];if(i||(i=t.split(zo)),i.pop(),!i.length)return r[t]=this._testOne(t,n);const a=this._t(i.join(zo)+zo,r,n,i);return r[t]=a.ignored?a:this._testOne(t,n)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return fu(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const Yi=e=>new V0(e),K0=e=>Zt(e&&Zt.convert(e),e,mu);Yi.isPathValid=K0,Yi.default=Yi;var J0=Yi;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Zt.convert=e;const t=/^[a-z]:\//i;Zt.isNotRelative=r=>t.test(r)||gu(r)}const Q0=St(J0);function ew(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(e,t,r){return t=t instanceof RegExp?t:new RegExp(ew(t),"g"),e.replace(t,r)}var tw={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=Nt(t,"./","/"),t=Nt(t,"..","."),t=Nt(t," ","-"),t=Nt(t,/^[~^:?*\\\-]/g,""),t=Nt(t,/[~^:?*\\]/g,"-"),t=Nt(t,/[~^:?*\\\-]$/g,""),t=Nt(t,"@{","-"),t=Nt(t,/\.$/g,""),t=Nt(t,/\/$/g,""),t=Nt(t,/\.lock$/g,""),t}},rw=tw;const Mt=St(rw);var nw=function(e,t){var r=e,n=t,i=r.length,a=n.length,o=!1,s=null,l=i+1,c=[],u=[],d=[],p="",m=-1,g=0,_=1,x,y,v=function(){i>=a&&(x=r,y=i,r=n,n=x,i=a,a=y,o=!0,l=i+1)},O=function(k,S,P){return{x:k,y:S,k:P}},R=function(k,S){return{elem:k,t:S}},b=function(k,S,P){var $,B,M;for(S>P?$=c[k-1+l]:$=c[k+1+l],M=Math.max(S,P),B=M-k;B<i&&M<a&&r[B]===n[M];)++B,++M;return c[k+l]=u.length,u[u.length]=new O(B,M,$),M},C=function(k){var S,P,$;for(S=P=0,$=k.length-1;$>=0;--$)for(;S<k[$].x||P<k[$].y;)k[$].y-k[$].x>P-S?(o?d[d.length]=new R(n[P],m):d[d.length]=new R(n[P],_),++P):k[$].y-k[$].x<P-S?(o?d[d.length]=new R(r[S],_):d[d.length]=new R(r[S],m),++S):(d[d.length]=new R(r[S],g),p+=r[S],++S,++P)};return v(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return p},getses:function(){return d},compose:function(){var k,S,P,$,B,M,H,Y;for(k=a-i,S=i+a+3,P={},H=0;H<S;++H)P[H]=-1,c[H]=-1;$=-1;do{for(++$,Y=-$;Y<=k-1;++Y)P[Y+l]=b(Y,P[Y-1+l]+1,P[Y+1+l]);for(Y=k+$;Y>=k+1;--Y)P[Y+l]=b(Y,P[Y-1+l]+1,P[Y+1+l]);P[k+l]=b(k,P[k-1+l]+1,P[k+1+l])}while(P[k+l]!==a);for(s=k+2*$,B=c[k+l],M=[];B!==-1;)M[M.length]=new O(u[B].x,u[B].y,null),B=u[B].k;C(M)}}},iw=nw;function aw(e,t){var r=new iw(e,t);r.compose();for(var n=r.getses(),i,a,o=e.length-1,s=t.length-1,l=n.length-1;l>=0;--l)n[l].t===r.SES_COMMON?(a?(a.chain={file1index:o,file2index:s,chain:null},a=a.chain):(i={file1index:o,file2index:s,chain:null},a=i),o--,s--):n[l].t===r.SES_DELETE?o--:n[l].t===r.SES_ADD&&s--;var c={file1index:-1,file2index:-1,chain:null};return a?(a.chain=c,i):c}function yu(e,t){for(var r=[],n=e.length,i=t.length,a=aw(e,t);a!==null;a=a.chain){var o=n-a.file1index-1,s=i-a.file2index-1;n=a.file1index,i=a.file2index,(o||s)&&r.push({file1:[n+1,o],file2:[i+1,s]})}return r.reverse(),r}function ow(e,t,r){var n,i=yu(t,e),a=yu(t,r),o=[];function s(H,Y){o.push([H.file1[0],Y,H.file1[1],H.file2[0],H.file2[1]])}for(n=0;n<i.length;n++)s(i[n],0);for(n=0;n<a.length;n++)s(a[n],2);o.sort(function(H,Y){return H[0]-Y[0]});var l=[],c=0;function u(H){H>c&&(l.push([1,c,H-c]),c=H)}for(var d=0;d<o.length;d++){for(var p=d,m=o[d],g=m[0],_=g+m[2];d<o.length-1;){var x=o[d+1],y=x[0];if(y>_)break;_=Math.max(_,y+x[2]),d++}if(u(g),p==d)m[4]>0&&l.push([m[1],m[3],m[4]]);else{var v={0:[e.length,-1,t.length,-1],2:[r.length,-1,t.length,-1]};for(n=p;n<=d;n++){m=o[n];var O=m[1],R=v[O],b=m[0],C=b+m[2],k=m[3],S=k+m[4];R[0]=Math.min(k,R[0]),R[1]=Math.max(S,R[1]),R[2]=Math.min(b,R[2]),R[3]=Math.max(C,R[3])}var P=v[0][0]+(g-v[0][2]),$=v[0][1]+(_-v[0][3]),B=v[2][0]+(g-v[2][2]),M=v[2][1]+(_-v[2][3]);l.push([-1,P,$-P,g,_-g,B,M-B])}c=_}return u(t.length),l}function sw(e,t,r){var n=[],i=[e,t,r],a=ow(e,t,r),o=[];function s(){o.length&&n.push({ok:o}),o=[]}function l(m){for(var g=0;g<m.length;g++)o.push(m[g])}function c(m){if(m[2]!=m[6])return!0;for(var g=m[1],_=m[5],x=0;x<m[2];x++)if(e[x+g]!=r[x+_])return!0;return!1}for(var u=0;u<a.length;u++){var d=a[u],p=d[0];p==-1?c(d)?(s(),n.push({conflict:{a:e.slice(d[1],d[1]+d[2]),aIndex:d[1],o:t.slice(d[3],d[3]+d[4]),oIndex:d[3],b:r.slice(d[5],d[5]+d[6]),bIndex:d[5]}})):l(i[0].slice(d[1],d[1]+d[2])):l(i[p].slice(d[1],d[1]+d[2]))}return s(),n}var cw=sw;const lw=St(cw);class ye extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const r=new ye(t.message);return r.code=t.code,r.data=t.data,r.caller=t.caller,r.stack=t.stack,r}get isIsomorphicGitError(){return!0}}class Xn extends ye{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=Xn.code,this.data={filepaths:t}}}Xn.code="UnmergedPathsError";class ce extends ye{constructor(t){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=ce.code,this.data={message:t}}}ce.code="InternalError";class Qr extends ye{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=Qr.code,this.data={filepath:t}}}Qr.code="UnsafeFilepathError";class Lt{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const r=this.buffer.slice(this._start,this._start+t);return this._start+=t,r}toString(t,r){const n=this.buffer.toString(t,this._start,this._start+r);return this._start+=r,n}write(t,r,n){const i=this.buffer.write(t,this._start,r,n);return this._start+=r,i}copy(t,r,n){const i=t.copy(this.buffer,this._start,r,n);return this._start+=i,i}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const r=this.buffer.writeUInt8(t,this._start);return this._start+=1,r}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const r=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,r}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const r=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,r}}function Xi(e,t){return-(e<t)||+(e>t)}function bu(e,t){return Xi(e.path,t.path)}function _u(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let r=e&511;return r&73?r=493:r=420,t!==8&&(r=0),(t<<12)+r}const Ft=2**32;function vu(e,t,r,n){if(e!==void 0&&t!==void 0)return[e,t];r===void 0&&(r=n.valueOf());const i=Math.floor(r/1e3),a=(r-i*1e3)*1e6;return[i,a]}function en(e){const[t,r]=vu(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[n,i]=vu(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%Ft,ctimeNanoseconds:r%Ft,mtimeSeconds:n%Ft,mtimeNanoseconds:i%Ft,dev:e.dev%Ft,ino:e.ino%Ft,mode:_u(e.mode%Ft),uid:e.uid%Ft,gid:e.gid%Ft,size:e.size>-1?e.size%Ft:0}}function uw(e){let t="";for(const r of new Uint8Array(e))r<16&&(t+="0"),t+=r.toString(16);return t}let Mo=null;async function Vt(e){return Mo===null&&(Mo=await dw()),Mo?xu(e):fw(e)}function fw(e){return new $c().update(e).digest("hex")}async function xu(e){const t=await crypto.subtle.digest("SHA-1",e);return uw(t)}async function dw(){try{if(await xu(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch{}return!1}function hw(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function pw(e){const t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}class Ar{constructor(t,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let r=this._entries.get(t.path);r||(this._entries.set(t.path,t),r=t),r.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return Ar.fromBuffer(t);if(t===null)return new Ar(null);throw new ce("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new ce("Index file is empty (.git/index)");const r=new Ar,n=new Lt(t),i=n.toString("utf8",4);if(i!=="DIRC")throw new ce(`Invalid dircache magic file number: ${i}`);const a=await Vt(t.slice(0,-20)),o=t.slice(-20).toString("hex");if(o!==a)throw new ce(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);const s=n.readUInt32BE();if(s!==2)throw new ce(`Unsupported dircache version: ${s}`);const l=n.readUInt32BE();let c=0;for(;!n.eof()&&c<l;){const u={};u.ctimeSeconds=n.readUInt32BE(),u.ctimeNanoseconds=n.readUInt32BE(),u.mtimeSeconds=n.readUInt32BE(),u.mtimeNanoseconds=n.readUInt32BE(),u.dev=n.readUInt32BE(),u.ino=n.readUInt32BE(),u.mode=n.readUInt32BE(),u.uid=n.readUInt32BE(),u.gid=n.readUInt32BE(),u.size=n.readUInt32BE(),u.oid=n.slice(20).toString("hex");const d=n.readUInt16BE();u.flags=hw(d);const p=t.indexOf(0,n.tell()+1)-n.tell();if(p<1)throw new ce(`Got a path length of: ${p}`);if(u.path=n.toString("utf8",p),u.path.includes("..\\")||u.path.includes("../"))throw new Qr(u.path);let m=8-(n.tell()-12)%8;for(m===0&&(m=8);m--;){const g=n.readUInt8();if(g!==0)throw new ce(`Expected 1-8 null characters but got '${g}' after ${u.path}`);if(n.eof())throw new ce("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(bu)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(r=>r):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:r,oid:n,stage:i=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=en(r);const a=Buffer.from(t),o={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:t,oid:n,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(o),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const r of this._entries.keys())r.startsWith(t+"/")&&this._entries.delete(r);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(`
10
- `)}static async _entryToBuffer(t){const r=Buffer.from(t.path),n=Math.ceil((62+r.length+1)/8)*8,i=Buffer.alloc(n),a=new Lt(i),o=en(t);return a.writeUInt32BE(o.ctimeSeconds),a.writeUInt32BE(o.ctimeNanoseconds),a.writeUInt32BE(o.mtimeSeconds),a.writeUInt32BE(o.mtimeNanoseconds),a.writeUInt32BE(o.dev),a.writeUInt32BE(o.ino),a.writeUInt32BE(o.mode),a.writeUInt32BE(o.uid),a.writeUInt32BE(o.gid),a.writeUInt32BE(o.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(pw(t)),a.write(t.path,r.length,"utf8"),i}async toObject(){const t=Buffer.alloc(12),r=new Lt(t);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let n=[];for(const s of this.entries)if(n.push(Ar._entryToBuffer(s)),s.stages.length>1)for(const l of s.stages)l&&l!==s&&n.push(Ar._entryToBuffer(l));n=await Promise.all(n);const i=Buffer.concat(n),a=Buffer.concat([t,i]),o=await Vt(a);return Buffer.concat([a,Buffer.from(o,"hex")])}}function Zi(e,t,r=!0,n=!0){const i=en(e),a=en(t);return r&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||n&&i.ino!==a.ino||i.size!==a.size}let Lo=null;const tn=Symbol("IndexCache");function mw(){return{map:new Map,stats:new Map}}async function ww(e,t,r){const n=await e.lstat(t),i=await e.read(t),a=await Ar.from(i);r.map.set(t,a),r.stats.set(t,n)}async function gw(e,t,r){const n=r.stats.get(t);if(n===void 0)return!0;const i=await e.lstat(t);return n===null||i===null?!1:Zi(n,i)}class Ge{static async acquire({fs:t,gitdir:r,cache:n,allowUnmerged:i=!0},a){n[tn]||(n[tn]=mw());const o=`${r}/index`;Lo===null&&(Lo=new Pn({maxPending:1/0}));let s,l=[];return await Lo.acquire(o,async()=>{await gw(t,o,n[tn])&&await ww(t,o,n[tn]);const c=n[tn].map.get(o);if(l=c.unmergedPaths,l.length&&!i)throw new Xn(l);if(s=await a(c),c._dirty){const u=await c.toObject();await t.write(o,u),n[tn].stats.set(o,await t.lstat(o)),c._dirty=!1}}),s}}function Vi(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function rn(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function Eu(e){const t=new Map,r=function(i){if(!t.has(i)){const a={type:"tree",fullpath:i,basename:Vi(i),metadata:{},children:[]};t.set(i,a),a.parent=r(rn(i)),a.parent&&a.parent!==a&&a.parent.children.push(a)}return t.get(i)},n=function(i,a){if(!t.has(i)){const o={type:"blob",fullpath:i,basename:Vi(i),metadata:a,parent:r(rn(i)),children:[]};o.parent&&o.parent.children.push(o),t.set(i,o)}return t.get(i)};r(".");for(const i of e)n(i.path,i);return t}function yw(e){switch(e){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new ce(`Unexpected GitTree entry mode: ${e.toString(8)}`)}class bw{constructor({fs:t,gitdir:r,cache:n}){this.treePromise=Ge.acquire({fs:t,gitdir:r,cache:n},async function(a){return Eu(a.entries)});const i=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const r=t._fullpath,i=(await this.treePromise).get(r);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);const a=i.children.map(o=>o.fullpath);return a.sort(Xi),a}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){const n=(await this.treePromise).get(t._fullpath);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const i=n.type==="tree"?{}:en(n.metadata);t._type=n.type==="tree"?"tree":yw(i.mode),t._mode=i.mode,n.type==="tree"?t._stat=void 0:t._stat=i}return t._stat}async content(t){}async oid(t){if(t._oid===!1){const n=(await this.treePromise).get(t._fullpath);t._oid=n.metadata.oid}return t._oid}}const Ki=Symbol("GitWalkSymbol");function nn(){const e=Object.create(null);return Object.defineProperty(e,Ki,{value:function({fs:t,gitdir:r,cache:n}){return new bw({fs:t,gitdir:r,cache:n})}}),Object.freeze(e),e}class Oe extends ye{constructor(t){super(`Could not find ${t}.`),this.code=this.name=Oe.code,this.data={what:t}}}Oe.code="NotFoundError";class rt extends ye{constructor(t,r,n,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${r}.`),this.code=this.name=rt.code,this.data={oid:t,actual:r,expected:n,filepath:i}}}rt.code="ObjectTypeError";class lr extends ye{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=lr.code,this.data={value:t}}}lr.code="InvalidOidError";class Zn extends ye{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
9
+ */(function(e){const t=ac,n=ff,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const D=new Uint8Array(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,Uint8Array.prototype),Object.setPrototypeOf(D,_),D.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(D){if(D>o)throw new RangeError('The value "'+D+'" is invalid for option "size"');const _=new Uint8Array(D);return Object.setPrototypeOf(_,s.prototype),_}function s(D,_,P){if(typeof D=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(D)}return l(D,_,P)}s.poolSize=8192;function l(D,_,P){if(typeof D=="string")return f(D,_);if(ArrayBuffer.isView(D))return p(D);if(D==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D);if(Ie(D,ArrayBuffer)||D&&Ie(D.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ie(D,SharedArrayBuffer)||D&&Ie(D.buffer,SharedArrayBuffer)))return m(D,_,P);if(typeof D=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const I=D.valueOf&&D.valueOf();if(I!=null&&I!==D)return s.from(I,_,P);const U=v(D);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof D[Symbol.toPrimitive]=="function")return s.from(D[Symbol.toPrimitive]("string"),_,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D)}s.from=function(D,_,P){return l(D,_,P)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(D){if(typeof D!="number")throw new TypeError('"size" argument must be of type number');if(D<0)throw new RangeError('The value "'+D+'" is invalid for option "size"')}function u(D,_,P){return c(D),D<=0?a(D):_!==void 0?typeof P=="string"?a(D).fill(_,P):a(D).fill(_):a(D)}s.alloc=function(D,_,P){return u(D,_,P)};function d(D){return c(D),a(D<0?0:w(D)|0)}s.allocUnsafe=function(D){return d(D)},s.allocUnsafeSlow=function(D){return d(D)};function f(D,_){if((typeof _!="string"||_==="")&&(_="utf8"),!s.isEncoding(_))throw new TypeError("Unknown encoding: "+_);const P=x(D,_)|0;let I=a(P);const U=I.write(D,_);return U!==P&&(I=I.slice(0,U)),I}function h(D){const _=D.length<0?0:w(D.length)|0,P=a(_);for(let I=0;I<_;I+=1)P[I]=D[I]&255;return P}function p(D){if(Ie(D,Uint8Array)){const _=new Uint8Array(D);return m(_.buffer,_.byteOffset,_.byteLength)}return h(D)}function m(D,_,P){if(_<0||D.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(D.byteLength<_+(P||0))throw new RangeError('"length" is outside of buffer bounds');let I;return _===void 0&&P===void 0?I=new Uint8Array(D):P===void 0?I=new Uint8Array(D,_):I=new Uint8Array(D,_,P),Object.setPrototypeOf(I,s.prototype),I}function v(D){if(s.isBuffer(D)){const _=w(D.length)|0,P=a(_);return P.length===0||D.copy(P,0,0,_),P}if(D.length!==void 0)return typeof D.length!="number"||Me(D.length)?a(0):h(D);if(D.type==="Buffer"&&Array.isArray(D.data))return h(D.data)}function w(D){if(D>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return D|0}function b(D){return+D!=D&&(D=0),s.alloc(+D)}s.isBuffer=function(_){return _!=null&&_._isBuffer===!0&&_!==s.prototype},s.compare=function(_,P){if(Ie(_,Uint8Array)&&(_=s.from(_,_.offset,_.byteLength)),Ie(P,Uint8Array)&&(P=s.from(P,P.offset,P.byteLength)),!s.isBuffer(_)||!s.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_===P)return 0;let I=_.length,U=P.length;for(let Q=0,ce=Math.min(I,U);Q<ce;++Q)if(_[Q]!==P[Q]){I=_[Q],U=P[Q];break}return I<U?-1:U<I?1:0},s.isEncoding=function(_){switch(String(_).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(_,P){if(!Array.isArray(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return s.alloc(0);let I;if(P===void 0)for(P=0,I=0;I<_.length;++I)P+=_[I].length;const U=s.allocUnsafe(P);let Q=0;for(I=0;I<_.length;++I){let ce=_[I];if(Ie(ce,Uint8Array))Q+ce.length>U.length?(s.isBuffer(ce)||(ce=s.from(ce)),ce.copy(U,Q)):Uint8Array.prototype.set.call(U,ce,Q);else if(s.isBuffer(ce))ce.copy(U,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=ce.length}return U};function x(D,_){if(s.isBuffer(D))return D.length;if(ArrayBuffer.isView(D)||Ie(D,ArrayBuffer))return D.byteLength;if(typeof D!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof D);const P=D.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&P===0)return 0;let U=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return pe(D).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return Re(D).length;default:if(U)return I?-1:pe(D).length;_=(""+_).toLowerCase(),U=!0}}s.byteLength=x;function S(D,_,P){let I=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,_>>>=0,P<=_))return"";for(D||(D="utf8");;)switch(D){case"hex":return ee(this,_,P);case"utf8":case"utf-8":return Y(this,_,P);case"ascii":return X(this,_,P);case"latin1":case"binary":return B(this,_,P);case"base64":return L(this,_,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,_,P);default:if(I)throw new TypeError("Unknown encoding: "+D);D=(D+"").toLowerCase(),I=!0}}s.prototype._isBuffer=!0;function C(D,_,P){const I=D[_];D[_]=D[P],D[P]=I}s.prototype.swap16=function(){const _=this.length;if(_%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<_;P+=2)C(this,P,P+1);return this},s.prototype.swap32=function(){const _=this.length;if(_%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<_;P+=4)C(this,P,P+3),C(this,P+1,P+2);return this},s.prototype.swap64=function(){const _=this.length;if(_%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<_;P+=8)C(this,P,P+7),C(this,P+1,P+6),C(this,P+2,P+5),C(this,P+3,P+4);return this},s.prototype.toString=function(){const _=this.length;return _===0?"":arguments.length===0?Y(this,0,_):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(_){if(!s.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_?!0:s.compare(this,_)===0},s.prototype.inspect=function(){let _="";const P=e.INSPECT_MAX_BYTES;return _=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(_+=" ... "),"<Buffer "+_+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(_,P,I,U,Q){if(Ie(_,Uint8Array)&&(_=s.from(_,_.offset,_.byteLength)),!s.isBuffer(_))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof _);if(P===void 0&&(P=0),I===void 0&&(I=_?_.length:0),U===void 0&&(U=0),Q===void 0&&(Q=this.length),P<0||I>_.length||U<0||Q>this.length)throw new RangeError("out of range index");if(U>=Q&&P>=I)return 0;if(U>=Q)return-1;if(P>=I)return 1;if(P>>>=0,I>>>=0,U>>>=0,Q>>>=0,this===_)return 0;let ce=Q-U,Ae=I-P;const rt=Math.min(ce,Ae),Je=this.slice(U,Q),it=_.slice(P,I);for(let Ue=0;Ue<rt;++Ue)if(Je[Ue]!==it[Ue]){ce=Je[Ue],Ae=it[Ue];break}return ce<Ae?-1:Ae<ce?1:0};function N(D,_,P,I,U){if(D.length===0)return-1;if(typeof P=="string"?(I=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Me(P)&&(P=U?0:D.length-1),P<0&&(P=D.length+P),P>=D.length){if(U)return-1;P=D.length-1}else if(P<0)if(U)P=0;else return-1;if(typeof _=="string"&&(_=s.from(_,I)),s.isBuffer(_))return _.length===0?-1:R(D,_,P,I,U);if(typeof _=="number")return _=_&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(D,_,P):Uint8Array.prototype.lastIndexOf.call(D,_,P):R(D,[_],P,I,U);throw new TypeError("val must be string, number or Buffer")}function R(D,_,P,I,U){let Q=1,ce=D.length,Ae=_.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(D.length<2||_.length<2)return-1;Q=2,ce/=2,Ae/=2,P/=2}function rt(it,Ue){return Q===1?it[Ue]:it.readUInt16BE(Ue*Q)}let Je;if(U){let it=-1;for(Je=P;Je<ce;Je++)if(rt(D,Je)===rt(_,it===-1?0:Je-it)){if(it===-1&&(it=Je),Je-it+1===Ae)return it*Q}else it!==-1&&(Je-=Je-it),it=-1}else for(P+Ae>ce&&(P=ce-Ae),Je=P;Je>=0;Je--){let it=!0;for(let Ue=0;Ue<Ae;Ue++)if(rt(D,Je+Ue)!==rt(_,Ue)){it=!1;break}if(it)return Je}return-1}s.prototype.includes=function(_,P,I){return this.indexOf(_,P,I)!==-1},s.prototype.indexOf=function(_,P,I){return N(this,_,P,I,!0)},s.prototype.lastIndexOf=function(_,P,I){return N(this,_,P,I,!1)};function T(D,_,P,I){P=Number(P)||0;const U=D.length-P;I?(I=Number(I),I>U&&(I=U)):I=U;const Q=_.length;I>Q/2&&(I=Q/2);let ce;for(ce=0;ce<I;++ce){const Ae=parseInt(_.substr(ce*2,2),16);if(Me(Ae))return ce;D[P+ce]=Ae}return ce}function M(D,_,P,I){return nt(pe(_,D.length-P),D,P,I)}function A(D,_,P,I){return nt(me(_),D,P,I)}function k(D,_,P,I){return nt(Re(_),D,P,I)}function F(D,_,P,I){return nt(_e(_,D.length-P),D,P,I)}s.prototype.write=function(_,P,I,U){if(P===void 0)U="utf8",I=this.length,P=0;else if(I===void 0&&typeof P=="string")U=P,I=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(I)?(I=I>>>0,U===void 0&&(U="utf8")):(U=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Q=this.length-P;if((I===void 0||I>Q)&&(I=Q),_.length>0&&(I<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let ce=!1;for(;;)switch(U){case"hex":return T(this,_,P,I);case"utf8":case"utf-8":return M(this,_,P,I);case"ascii":case"latin1":case"binary":return A(this,_,P,I);case"base64":return k(this,_,P,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,_,P,I);default:if(ce)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),ce=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(D,_,P){return _===0&&P===D.length?t.fromByteArray(D):t.fromByteArray(D.slice(_,P))}function Y(D,_,P){P=Math.min(D.length,P);const I=[];let U=_;for(;U<P;){const Q=D[U];let ce=null,Ae=Q>239?4:Q>223?3:Q>191?2:1;if(U+Ae<=P){let rt,Je,it,Ue;switch(Ae){case 1:Q<128&&(ce=Q);break;case 2:rt=D[U+1],(rt&192)===128&&(Ue=(Q&31)<<6|rt&63,Ue>127&&(ce=Ue));break;case 3:rt=D[U+1],Je=D[U+2],(rt&192)===128&&(Je&192)===128&&(Ue=(Q&15)<<12|(rt&63)<<6|Je&63,Ue>2047&&(Ue<55296||Ue>57343)&&(ce=Ue));break;case 4:rt=D[U+1],Je=D[U+2],it=D[U+3],(rt&192)===128&&(Je&192)===128&&(it&192)===128&&(Ue=(Q&15)<<18|(rt&63)<<12|(Je&63)<<6|it&63,Ue>65535&&Ue<1114112&&(ce=Ue))}}ce===null?(ce=65533,Ae=1):ce>65535&&(ce-=65536,I.push(ce>>>10&1023|55296),ce=56320|ce&1023),I.push(ce),U+=Ae}return q(I)}const ne=4096;function q(D){const _=D.length;if(_<=ne)return String.fromCharCode.apply(String,D);let P="",I=0;for(;I<_;)P+=String.fromCharCode.apply(String,D.slice(I,I+=ne));return P}function X(D,_,P){let I="";P=Math.min(D.length,P);for(let U=_;U<P;++U)I+=String.fromCharCode(D[U]&127);return I}function B(D,_,P){let I="";P=Math.min(D.length,P);for(let U=_;U<P;++U)I+=String.fromCharCode(D[U]);return I}function ee(D,_,P){const I=D.length;(!_||_<0)&&(_=0),(!P||P<0||P>I)&&(P=I);let U="";for(let Q=_;Q<P;++Q)U+=Ce[D[Q]];return U}function Z(D,_,P){const I=D.slice(_,P);let U="";for(let Q=0;Q<I.length-1;Q+=2)U+=String.fromCharCode(I[Q]+I[Q+1]*256);return U}s.prototype.slice=function(_,P){const I=this.length;_=~~_,P=P===void 0?I:~~P,_<0?(_+=I,_<0&&(_=0)):_>I&&(_=I),P<0?(P+=I,P<0&&(P=0)):P>I&&(P=I),P<_&&(P=_);const U=this.subarray(_,P);return Object.setPrototypeOf(U,s.prototype),U};function J(D,_,P){if(D%1!==0||D<0)throw new RangeError("offset is not uint");if(D+_>P)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(_,P,I){_=_>>>0,P=P>>>0,I||J(_,P,this.length);let U=this[_],Q=1,ce=0;for(;++ce<P&&(Q*=256);)U+=this[_+ce]*Q;return U},s.prototype.readUintBE=s.prototype.readUIntBE=function(_,P,I){_=_>>>0,P=P>>>0,I||J(_,P,this.length);let U=this[_+--P],Q=1;for(;P>0&&(Q*=256);)U+=this[_+--P]*Q;return U},s.prototype.readUint8=s.prototype.readUInt8=function(_,P){return _=_>>>0,P||J(_,1,this.length),this[_]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(_,P){return _=_>>>0,P||J(_,2,this.length),this[_]|this[_+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(_,P){return _=_>>>0,P||J(_,2,this.length),this[_]<<8|this[_+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(_,P){return _=_>>>0,P||J(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+this[_+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(_,P){return _=_>>>0,P||J(_,4,this.length),this[_]*16777216+(this[_+1]<<16|this[_+2]<<8|this[_+3])},s.prototype.readBigUInt64LE=Le(function(_){_=_>>>0,se(_,"offset");const P=this[_],I=this[_+7];(P===void 0||I===void 0)&&oe(_,this.length-8);const U=P+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24,Q=this[++_]+this[++_]*2**8+this[++_]*2**16+I*2**24;return BigInt(U)+(BigInt(Q)<<BigInt(32))}),s.prototype.readBigUInt64BE=Le(function(_){_=_>>>0,se(_,"offset");const P=this[_],I=this[_+7];(P===void 0||I===void 0)&&oe(_,this.length-8);const U=P*2**24+this[++_]*2**16+this[++_]*2**8+this[++_],Q=this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+I;return(BigInt(U)<<BigInt(32))+BigInt(Q)}),s.prototype.readIntLE=function(_,P,I){_=_>>>0,P=P>>>0,I||J(_,P,this.length);let U=this[_],Q=1,ce=0;for(;++ce<P&&(Q*=256);)U+=this[_+ce]*Q;return Q*=128,U>=Q&&(U-=Math.pow(2,8*P)),U},s.prototype.readIntBE=function(_,P,I){_=_>>>0,P=P>>>0,I||J(_,P,this.length);let U=P,Q=1,ce=this[_+--U];for(;U>0&&(Q*=256);)ce+=this[_+--U]*Q;return Q*=128,ce>=Q&&(ce-=Math.pow(2,8*P)),ce},s.prototype.readInt8=function(_,P){return _=_>>>0,P||J(_,1,this.length),this[_]&128?(255-this[_]+1)*-1:this[_]},s.prototype.readInt16LE=function(_,P){_=_>>>0,P||J(_,2,this.length);const I=this[_]|this[_+1]<<8;return I&32768?I|4294901760:I},s.prototype.readInt16BE=function(_,P){_=_>>>0,P||J(_,2,this.length);const I=this[_+1]|this[_]<<8;return I&32768?I|4294901760:I},s.prototype.readInt32LE=function(_,P){return _=_>>>0,P||J(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},s.prototype.readInt32BE=function(_,P){return _=_>>>0,P||J(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},s.prototype.readBigInt64LE=Le(function(_){_=_>>>0,se(_,"offset");const P=this[_],I=this[_+7];(P===void 0||I===void 0)&&oe(_,this.length-8);const U=this[_+4]+this[_+5]*2**8+this[_+6]*2**16+(I<<24);return(BigInt(U)<<BigInt(32))+BigInt(P+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24)}),s.prototype.readBigInt64BE=Le(function(_){_=_>>>0,se(_,"offset");const P=this[_],I=this[_+7];(P===void 0||I===void 0)&&oe(_,this.length-8);const U=(P<<24)+this[++_]*2**16+this[++_]*2**8+this[++_];return(BigInt(U)<<BigInt(32))+BigInt(this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+I)}),s.prototype.readFloatLE=function(_,P){return _=_>>>0,P||J(_,4,this.length),n.read(this,_,!0,23,4)},s.prototype.readFloatBE=function(_,P){return _=_>>>0,P||J(_,4,this.length),n.read(this,_,!1,23,4)},s.prototype.readDoubleLE=function(_,P){return _=_>>>0,P||J(_,8,this.length),n.read(this,_,!0,52,8)},s.prototype.readDoubleBE=function(_,P){return _=_>>>0,P||J(_,8,this.length),n.read(this,_,!1,52,8)};function H(D,_,P,I,U,Q){if(!s.isBuffer(D))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>U||_<Q)throw new RangeError('"value" argument is out of bounds');if(P+I>D.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(_,P,I,U){if(_=+_,P=P>>>0,I=I>>>0,!U){const Ae=Math.pow(2,8*I)-1;H(this,_,P,I,Ae,0)}let Q=1,ce=0;for(this[P]=_&255;++ce<I&&(Q*=256);)this[P+ce]=_/Q&255;return P+I},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(_,P,I,U){if(_=+_,P=P>>>0,I=I>>>0,!U){const Ae=Math.pow(2,8*I)-1;H(this,_,P,I,Ae,0)}let Q=I-1,ce=1;for(this[P+Q]=_&255;--Q>=0&&(ce*=256);)this[P+Q]=_/ce&255;return P+I},s.prototype.writeUint8=s.prototype.writeUInt8=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,1,255,0),this[P]=_&255,P+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,2,65535,0),this[P]=_&255,this[P+1]=_>>>8,P+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,2,65535,0),this[P]=_>>>8,this[P+1]=_&255,P+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,4,4294967295,0),this[P+3]=_>>>24,this[P+2]=_>>>16,this[P+1]=_>>>8,this[P]=_&255,P+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,4,4294967295,0),this[P]=_>>>24,this[P+1]=_>>>16,this[P+2]=_>>>8,this[P+3]=_&255,P+4};function O(D,_,P,I,U){z(_,I,U,D,P,7);let Q=Number(_&BigInt(4294967295));D[P++]=Q,Q=Q>>8,D[P++]=Q,Q=Q>>8,D[P++]=Q,Q=Q>>8,D[P++]=Q;let ce=Number(_>>BigInt(32)&BigInt(4294967295));return D[P++]=ce,ce=ce>>8,D[P++]=ce,ce=ce>>8,D[P++]=ce,ce=ce>>8,D[P++]=ce,P}function V(D,_,P,I,U){z(_,I,U,D,P,7);let Q=Number(_&BigInt(4294967295));D[P+7]=Q,Q=Q>>8,D[P+6]=Q,Q=Q>>8,D[P+5]=Q,Q=Q>>8,D[P+4]=Q;let ce=Number(_>>BigInt(32)&BigInt(4294967295));return D[P+3]=ce,ce=ce>>8,D[P+2]=ce,ce=ce>>8,D[P+1]=ce,ce=ce>>8,D[P]=ce,P+8}s.prototype.writeBigUInt64LE=Le(function(_,P=0){return O(this,_,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Le(function(_,P=0){return V(this,_,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(_,P,I,U){if(_=+_,P=P>>>0,!U){const rt=Math.pow(2,8*I-1);H(this,_,P,I,rt-1,-rt)}let Q=0,ce=1,Ae=0;for(this[P]=_&255;++Q<I&&(ce*=256);)_<0&&Ae===0&&this[P+Q-1]!==0&&(Ae=1),this[P+Q]=(_/ce>>0)-Ae&255;return P+I},s.prototype.writeIntBE=function(_,P,I,U){if(_=+_,P=P>>>0,!U){const rt=Math.pow(2,8*I-1);H(this,_,P,I,rt-1,-rt)}let Q=I-1,ce=1,Ae=0;for(this[P+Q]=_&255;--Q>=0&&(ce*=256);)_<0&&Ae===0&&this[P+Q+1]!==0&&(Ae=1),this[P+Q]=(_/ce>>0)-Ae&255;return P+I},s.prototype.writeInt8=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,1,127,-128),_<0&&(_=255+_+1),this[P]=_&255,P+1},s.prototype.writeInt16LE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,2,32767,-32768),this[P]=_&255,this[P+1]=_>>>8,P+2},s.prototype.writeInt16BE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,2,32767,-32768),this[P]=_>>>8,this[P+1]=_&255,P+2},s.prototype.writeInt32LE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,4,2147483647,-2147483648),this[P]=_&255,this[P+1]=_>>>8,this[P+2]=_>>>16,this[P+3]=_>>>24,P+4},s.prototype.writeInt32BE=function(_,P,I){return _=+_,P=P>>>0,I||H(this,_,P,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),this[P]=_>>>24,this[P+1]=_>>>16,this[P+2]=_>>>8,this[P+3]=_&255,P+4},s.prototype.writeBigInt64LE=Le(function(_,P=0){return O(this,_,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Le(function(_,P=0){return V(this,_,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(D,_,P,I,U,Q){if(P+I>D.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function j(D,_,P,I,U){return _=+_,P=P>>>0,U||ae(D,_,P,4),n.write(D,_,P,I,23,4),P+4}s.prototype.writeFloatLE=function(_,P,I){return j(this,_,P,!0,I)},s.prototype.writeFloatBE=function(_,P,I){return j(this,_,P,!1,I)};function G(D,_,P,I,U){return _=+_,P=P>>>0,U||ae(D,_,P,8),n.write(D,_,P,I,52,8),P+8}s.prototype.writeDoubleLE=function(_,P,I){return G(this,_,P,!0,I)},s.prototype.writeDoubleBE=function(_,P,I){return G(this,_,P,!1,I)},s.prototype.copy=function(_,P,I,U){if(!s.isBuffer(_))throw new TypeError("argument should be a Buffer");if(I||(I=0),!U&&U!==0&&(U=this.length),P>=_.length&&(P=_.length),P||(P=0),U>0&&U<I&&(U=I),U===I||_.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),_.length-P<U-I&&(U=_.length-P+I);const Q=U-I;return this===_&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,I,U):Uint8Array.prototype.set.call(_,this.subarray(I,U),P),Q},s.prototype.fill=function(_,P,I,U){if(typeof _=="string"){if(typeof P=="string"?(U=P,P=0,I=this.length):typeof I=="string"&&(U=I,I=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!s.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(_.length===1){const ce=_.charCodeAt(0);(U==="utf8"&&ce<128||U==="latin1")&&(_=ce)}}else typeof _=="number"?_=_&255:typeof _=="boolean"&&(_=Number(_));if(P<0||this.length<P||this.length<I)throw new RangeError("Out of range index");if(I<=P)return this;P=P>>>0,I=I===void 0?this.length:I>>>0,_||(_=0);let Q;if(typeof _=="number")for(Q=P;Q<I;++Q)this[Q]=_;else{const ce=s.isBuffer(_)?_:s.from(_,U),Ae=ce.length;if(Ae===0)throw new TypeError('The value "'+_+'" is invalid for argument "value"');for(Q=0;Q<I-P;++Q)this[Q+P]=ce[Q%Ae]}return this};const $={};function te(D,_,P){$[D]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${D}]`,this.stack,delete this.name}get code(){return D}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${D}]: ${this.message}`}}}te("ERR_BUFFER_OUT_OF_BOUNDS",function(D){return D?`${D} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),te("ERR_INVALID_ARG_TYPE",function(D,_){return`The "${D}" argument must be of type number. Received type ${typeof _}`},TypeError),te("ERR_OUT_OF_RANGE",function(D,_,P){let I=`The value of "${D}" is out of range.`,U=P;return Number.isInteger(P)&&Math.abs(P)>2**32?U=ie(String(P)):typeof P=="bigint"&&(U=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(U=ie(U)),U+="n"),I+=` It must be ${_}. Received ${U}`,I},RangeError);function ie(D){let _="",P=D.length;const I=D[0]==="-"?1:0;for(;P>=I+4;P-=3)_=`_${D.slice(P-3,P)}${_}`;return`${D.slice(0,P)}${_}`}function re(D,_,P){se(_,"offset"),(D[_]===void 0||D[_+P]===void 0)&&oe(_,D.length-(P+1))}function z(D,_,P,I,U,Q){if(D>P||D<_){const ce=typeof _=="bigint"?"n":"";let Ae;throw _===0||_===BigInt(0)?Ae=`>= 0${ce} and < 2${ce} ** ${(Q+1)*8}${ce}`:Ae=`>= -(2${ce} ** ${(Q+1)*8-1}${ce}) and < 2 ** ${(Q+1)*8-1}${ce}`,new $.ERR_OUT_OF_RANGE("value",Ae,D)}re(I,U,Q)}function se(D,_){if(typeof D!="number")throw new $.ERR_INVALID_ARG_TYPE(_,"number",D)}function oe(D,_,P){throw Math.floor(D)!==D?(se(D,P),new $.ERR_OUT_OF_RANGE("offset","an integer",D)):_<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${_}`,D)}const fe=/[^+/0-9A-Za-z-_]/g;function ge(D){if(D=D.split("=")[0],D=D.trim().replace(fe,""),D.length<2)return"";for(;D.length%4!==0;)D=D+"=";return D}function pe(D,_){_=_||1/0;let P;const I=D.length;let U=null;const Q=[];for(let ce=0;ce<I;++ce){if(P=D.charCodeAt(ce),P>55295&&P<57344){if(!U){if(P>56319){(_-=3)>-1&&Q.push(239,191,189);continue}else if(ce+1===I){(_-=3)>-1&&Q.push(239,191,189);continue}U=P;continue}if(P<56320){(_-=3)>-1&&Q.push(239,191,189),U=P;continue}P=(U-55296<<10|P-56320)+65536}else U&&(_-=3)>-1&&Q.push(239,191,189);if(U=null,P<128){if((_-=1)<0)break;Q.push(P)}else if(P<2048){if((_-=2)<0)break;Q.push(P>>6|192,P&63|128)}else if(P<65536){if((_-=3)<0)break;Q.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((_-=4)<0)break;Q.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return Q}function me(D){const _=[];for(let P=0;P<D.length;++P)_.push(D.charCodeAt(P)&255);return _}function _e(D,_){let P,I,U;const Q=[];for(let ce=0;ce<D.length&&!((_-=2)<0);++ce)P=D.charCodeAt(ce),I=P>>8,U=P%256,Q.push(U),Q.push(I);return Q}function Re(D){return t.toByteArray(ge(D))}function nt(D,_,P,I){let U;for(U=0;U<I&&!(U+P>=_.length||U>=D.length);++U)_[U+P]=D[U];return U}function Ie(D,_){return D instanceof _||D!=null&&D.constructor!=null&&D.constructor.name!=null&&D.constructor.name===_.name}function Me(D){return D!==D}const Ce=function(){const D="0123456789abcdef",_=new Array(256);for(let P=0;P<16;++P){const I=P*16;for(let U=0;U<16;++U)_[I+U]=D[P]+D[U]}return _}();function Le(D){return typeof BigInt>"u"?pn:D}function pn(){throw new Error("BigInt not supported")}})(uf);function ij(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function aj(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:ij(e)}async function sj(e,t){const n=aj(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function lj(e){let t=0;const n=[];await sj(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function cj(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}async function uj({onProgress:e,url:t,method:n="GET",headers:r={},body:o}){o&&(o=await lj(o));const i=await fetch(t,{method:n,headers:r,body:o}),a=i.body&&i.body.getReader?cj(i.body):[new Uint8Array(await i.arrayBuffer())];r={};for(const[s,l]of i.headers.entries())r[s]=l;return{url:i.url,method:i.method,statusCode:i.status,statusMessage:i.statusText,body:a,headers:r}}var hf={request:uj},gn=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||gn.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||gn.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||gn.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=gn.DEFAULT_MAX_PENDING};gn.DEFAULT_TIMEOUT=0,gn.DEFAULT_MAX_OCCUPATION_TIME=0,gn.DEFAULT_MAX_EXECUTION_TIME=0,gn.DEFAULT_MAX_PENDING=1e3,gn.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!="function")throw new Error("You must pass a function to execute");var o=null,i=null,a=null;typeof n!="function"&&(r=n,n=null,a=new this.Promise(function(b,x){o=b,i=x})),r=r||{};var s=!1,l=null,c=null,u=null,d=this,f=function(b,x,S){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(a?x?i(x):o(S):typeof n=="function"&&n(x,S),s=!0),b&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},h=function(b){if(s)return f(b);l&&(clearTimeout(l),l=null),d.domainReentrant&&b&&(d.domains[e]=process.domain);var x=r.maxExecutionTime||d.maxExecutionTime;if(x&&(u=setTimeout(function(){d.queues[e]&&f(b,new Error("Maximum execution time is exceeded "+e))},x)),t.length===1){var S=!1;try{t(function(C,N){S||(S=!0,f(b,C,N))})}catch(C){S||(S=!0,f(b,C))}}else d._promiseTry(function(){return t()}).then(function(C){f(b,void 0,C)},function(C){f(b,C)})};d.domainReentrant&&process.domain&&(h=process.domain.bind(h));var p=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],h(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])h(!1);else if(d.queues[e].length>=p)f(!1,new Error("Too many pending tasks in queue "+e));else{var m=function(){h(!0)};r.skipQueue?d.queues[e].unshift(m):d.queues[e].push(m);var v=r.timeout||d.timeout;v&&(l=setTimeout(function(){l=null,f(!1,new Error("async-lock timed out in queue "+e))},v))}var w=r.maxOccupationTime||d.maxOccupationTime;if(w&&(c=setTimeout(function(){d.queues[e]&&f(!1,new Error("Maximum occupation time is exceeded in queue "+e))},w)),a)return a},gn.prototype._acquireBatch=function(e,t,n,r){typeof n!="function"&&(r=n,n=null);var o=this,i=function(s,l){return function(c){o.acquire(s,l,c,r)}},a=e.reduceRight(function(s,l){return i(l,s)},t);if(typeof n=="function")a(n);else return new this.Promise(function(s,l){a.length===1?a(function(c,u){c?l(c):s(u)}):s(a())})},gn.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},gn.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};var dj=gn,fj=dj;const ts=Nn(fj);var pf={exports:{}};typeof Object.create=="function"?pf.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:pf.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var hj=pf.exports,mf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var n=uf,r=n.Buffer;function o(a,s){for(var l in a)s[l]=a[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(a,s,l){return r(a,s,l)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(a,s,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return r(a,s,l)},i.alloc=function(a,s,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=r(a);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},i.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r(a)},i.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(a)}})(mf,mf.exports);var Xv=mf.exports,Zv=Xv.Buffer;function sc(e,t){this._block=Zv.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}sc.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Zv.from(e,t));for(var n=this._block,r=this._blockSize,o=e.length,i=this._len,a=0;a<o;){for(var s=i%r,l=Math.min(o-a,r-s),c=0;c<l;c++)n[s+c]=e[a+c];i+=l,a+=l,i%r===0&&this._update(n)}return this._len+=o,this},sc.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(n&4294967295)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},sc.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var pj=sc,mj=hj,Jv=pj,gj=Xv.Buffer,wj=[1518500249,1859775393,-1894007588,-899497514],vj=new Array(80);function ns(){this.init(),this._w=vj,Jv.call(this,64,56)}mj(ns,Jv),ns.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function yj(e){return e<<1|e>>>31}function bj(e){return e<<5|e>>>27}function xj(e){return e<<30|e>>>2}function _j(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}ns.prototype._update=function(e){for(var t=this._w,n=this._a|0,r=this._b|0,o=this._c|0,i=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=yj(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=bj(n)+_j(c,r,o,i)+a+t[l]+wj[c]|0;a=i,i=o,o=xj(r),r=n,n=u}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0},ns.prototype._hash=function(){var e=gj.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Sj=ns;const Qv=Nn(Sj);function or(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function ey(e,t){for(var n="",r=0,o=-1,i=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){l===-1?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length===2||n.length===1){n="",r=0,o=s,i=0;continue}}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i!==-1?++i:i=-1}return n}function Cj(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}var bi={resolve:function(){for(var t="",n=!1,r,o=arguments.length-1;o>=-1&&!n;o--){var i;o>=0?i=arguments[o]:(r===void 0&&(r=process.cwd()),i=r),or(i),i.length!==0&&(t=i+"/"+t,n=i.charCodeAt(0)===47)}return t=ey(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(or(t),t.length===0)return".";var n=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=ey(t,!n),t.length===0&&!n&&(t="."),t.length>0&&r&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return or(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n<arguments.length;++n){var r=arguments[n];or(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":bi.normalize(t)},relative:function(t,n){if(or(t),or(n),t===n||(t=bi.resolve(t),n=bi.resolve(n),t===n))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var o=t.length,i=o-r,a=1;a<n.length&&n.charCodeAt(a)===47;++a);for(var s=n.length,l=s-a,c=i<l?i:l,u=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(n.charCodeAt(a+d)===47)return n.slice(a+d+1);if(d===0)return n.slice(a+d)}else i>c&&(t.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=t.charCodeAt(r+d),h=n.charCodeAt(a+d);if(f!==h)break;f===47&&(u=d)}var p="";for(d=r+u+1;d<=o;++d)(d===o||t.charCodeAt(d)===47)&&(p.length===0?p+="..":p+="/..");return p.length>0?p+n.slice(a+u):(a+=u,n.charCodeAt(a)===47&&++a,n.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(or(t),t.length===0)return".";for(var n=t.charCodeAt(0),r=n===47,o=-1,i=!0,a=t.length-1;a>=1;--a)if(n=t.charCodeAt(a),n===47){if(!i){o=a;break}}else i=!1;return o===-1?r?"/":".":r&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');or(t);var r=0,o=-1,i=!0,a;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var s=n.length-1,l=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!i){r=a+1;break}}else l===-1&&(i=!1,l=a+1),s>=0&&(c===n.charCodeAt(s)?--s===-1&&(o=a):(s=-1,o=l))}return r===o?o=l:o===-1&&(o=t.length),t.slice(r,o)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!i){r=a+1;break}}else o===-1&&(i=!1,o=a+1);return o===-1?"":t.slice(r,o)}},extname:function(t){or(t);for(var n=-1,r=0,o=-1,i=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!i){r=s+1;break}continue}o===-1&&(i=!1,o=s+1),l===46?n===-1?n=s:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||o===-1||a===0||a===1&&n===o-1&&n===r+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Cj("/",t)},parse:function(t){or(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var r=t.charCodeAt(0),o=r===47,i;o?(n.root="/",i=1):i=0;for(var a=-1,s=0,l=-1,c=!0,u=t.length-1,d=0;u>=i;--u){if(r=t.charCodeAt(u),r===47){if(!c){s=u+1;break}continue}l===-1&&(c=!1,l=u+1),r===46?a===-1?a=u:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||l===-1||d===0||d===1&&a===l-1&&a===s+1?l!==-1&&(s===0&&o?n.base=n.name=t.slice(1,l):n.base=n.name=t.slice(s,l)):(s===0&&o?(n.name=t.slice(1,a),n.base=t.slice(1,l)):(n.name=t.slice(s,a),n.base=t.slice(s,l)),n.ext=t.slice(a,l)),s>0?n.dir=t.slice(0,s-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};bi.posix=bi;var ue=bi,ty={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var T=0,M=new Array(256),A=0;A!=256;++A)T=A,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,M[A]=T;return typeof Int32Array<"u"?new Int32Array(M):M}var r=n();function o(T){var M=0,A=0,k=0,F=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(k=0;k!=256;++k)F[k]=T[k];for(k=0;k!=256;++k)for(A=T[k],M=256+k;M<4096;M+=256)A=F[M]=A>>>8^T[A&255];var L=[];for(k=1;k!=16;++k)L[k-1]=typeof Int32Array<"u"?F.subarray(k*256,k*256+256):F.slice(k*256,k*256+256);return L}var i=o(r),a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],f=i[6],h=i[7],p=i[8],m=i[9],v=i[10],w=i[11],b=i[12],x=i[13],S=i[14];function C(T,M){for(var A=M^-1,k=0,F=T.length;k<F;)A=A>>>8^r[(A^T.charCodeAt(k++))&255];return~A}function N(T,M){for(var A=M^-1,k=T.length-15,F=0;F<k;)A=S[T[F++]^A&255]^x[T[F++]^A>>8&255]^b[T[F++]^A>>16&255]^w[T[F++]^A>>>24]^v[T[F++]]^m[T[F++]]^p[T[F++]]^h[T[F++]]^f[T[F++]]^d[T[F++]]^u[T[F++]]^c[T[F++]]^l[T[F++]]^s[T[F++]]^a[T[F++]]^r[T[F++]];for(k+=15;F<k;)A=A>>>8^r[(A^T[F++])&255];return~A}function R(T,M){for(var A=M^-1,k=0,F=T.length,L=0,Y=0;k<F;)L=T.charCodeAt(k++),L<128?A=A>>>8^r[(A^L)&255]:L<2048?(A=A>>>8^r[(A^(192|L>>6&31))&255],A=A>>>8^r[(A^(128|L&63))&255]):L>=55296&&L<57344?(L=(L&1023)+64,Y=T.charCodeAt(k++)&1023,A=A>>>8^r[(A^(240|L>>8&7))&255],A=A>>>8^r[(A^(128|L>>2&63))&255],A=A>>>8^r[(A^(128|Y>>6&15|(L&3)<<4))&255],A=A>>>8^r[(A^(128|Y&63))&255]):(A=A>>>8^r[(A^(224|L>>12&15))&255],A=A>>>8^r[(A^(128|L>>6&63))&255],A=A>>>8^r[(A^(128|L&63))&255]);return~A}t.table=r,t.bstr=C,t.buf=N,t.str=R})})(ty);const Ej=Nn(ty);var Tr={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function n(i,a){return Object.prototype.hasOwnProperty.call(i,a)}e.assign=function(i){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var s=a.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)n(s,l)&&(i[l]=s[l])}}return i},e.shrinkBuf=function(i,a){return i.length===a?i:i.subarray?i.subarray(0,a):(i.length=a,i)};var r={arraySet:function(i,a,s,l,c){if(a.subarray&&i.subarray){i.set(a.subarray(s,s+l),c);return}for(var u=0;u<l;u++)i[c+u]=a[s+u]},flattenChunks:function(i){var a,s,l,c,u,d;for(l=0,a=0,s=i.length;a<s;a++)l+=i[a].length;for(d=new Uint8Array(l),c=0,a=0,s=i.length;a<s;a++)u=i[a],d.set(u,c),c+=u.length;return d}},o={arraySet:function(i,a,s,l,c){for(var u=0;u<l;u++)i[c+u]=a[s+u]},flattenChunks:function(i){return[].concat.apply([],i)}};e.setTyped=function(i){i?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(t)})(Tr);var rs={},ir={},xi={},Pj=Tr,Rj=4,ny=0,ry=1,Nj=2;function _i(e){for(var t=e.length;--t>=0;)e[t]=0}var Tj=0,oy=1,Mj=2,Dj=3,Aj=258,gf=29,os=256,is=os+1+gf,Si=30,wf=19,iy=2*is+1,ko=15,vf=16,kj=7,yf=256,ay=16,sy=17,ly=18,bf=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],lc=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ij=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],cy=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Oj=512,Mr=new Array((is+2)*2);_i(Mr);var as=new Array(Si*2);_i(as);var ss=new Array(Oj);_i(ss);var ls=new Array(Aj-Dj+1);_i(ls);var xf=new Array(gf);_i(xf);var cc=new Array(Si);_i(cc);function _f(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}var uy,dy,fy;function Sf(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function hy(e){return e<256?ss[e]:ss[256+(e>>>7)]}function cs(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function en(e,t,n){e.bi_valid>vf-n?(e.bi_buf|=t<<e.bi_valid&65535,cs(e,e.bi_buf),e.bi_buf=t>>vf-e.bi_valid,e.bi_valid+=n-vf):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function ar(e,t,n){en(e,n[t*2],n[t*2+1])}function py(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function jj(e){e.bi_valid===16?(cs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function $j(e,t){var n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,f,h,p,m=0;for(f=0;f<=ko;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<iy;c++)u=e.heap[c],f=n[n[u*2+1]*2+1]+1,f>l&&(f=l,m++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,h=0,u>=s&&(h=a[u-s]),p=n[u*2],e.opt_len+=p*(f+h),i&&(e.static_len+=p*(o[u*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function my(e,t,n){var r=new Array(ko+1),o=0,i,a;for(i=1;i<=ko;i++)r[i]=o=o+n[i-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=py(r[s]++,s))}}function Fj(){var e,t,n,r,o,i=new Array(ko+1);for(n=0,r=0;r<gf-1;r++)for(xf[r]=n,e=0;e<1<<bf[r];e++)ls[n++]=r;for(ls[n-1]=r,o=0,r=0;r<16;r++)for(cc[r]=o,e=0;e<1<<lc[r];e++)ss[o++]=r;for(o>>=7;r<Si;r++)for(cc[r]=o<<7,e=0;e<1<<lc[r]-7;e++)ss[256+o++]=r;for(t=0;t<=ko;t++)i[t]=0;for(e=0;e<=143;)Mr[e*2+1]=8,e++,i[8]++;for(;e<=255;)Mr[e*2+1]=9,e++,i[9]++;for(;e<=279;)Mr[e*2+1]=7,e++,i[7]++;for(;e<=287;)Mr[e*2+1]=8,e++,i[8]++;for(my(Mr,is+1,i),e=0;e<Si;e++)as[e*2+1]=5,as[e*2]=py(e,5);uy=new _f(Mr,bf,os+1,is,ko),dy=new _f(as,lc,0,Si,ko),fy=new _f(new Array(0),Ij,0,wf,kj)}function gy(e){var t;for(t=0;t<is;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Si;t++)e.dyn_dtree[t*2]=0;for(t=0;t<wf;t++)e.bl_tree[t*2]=0;e.dyn_ltree[yf*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function wy(e){e.bi_valid>8?cs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Lj(e,t,n,r){wy(e),cs(e,n),cs(e,~n),Pj.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function vy(e,t,n,r){var o=t*2,i=n*2;return e[o]<e[i]||e[o]===e[i]&&r[t]<=r[n]}function Cf(e,t,n){for(var r=e.heap[n],o=n<<1;o<=e.heap_len&&(o<e.heap_len&&vy(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!vy(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r}function yy(e,t,n){var r,o,i=0,a,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],o=e.pending_buf[e.l_buf+i],i++,r===0?ar(e,o,t):(a=ls[o],ar(e,a+os+1,t),s=bf[a],s!==0&&(o-=xf[a],en(e,o,s)),r--,a=hy(r),ar(e,a,n),s=lc[a],s!==0&&(r-=cc[a],en(e,r,s)));while(i<e.last_lit);ar(e,yf,t)}function Ef(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems,a,s,l=-1,c;for(e.heap_len=0,e.heap_max=iy,a=0;a<i;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=r[c*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)Cf(e,n,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Cf(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[c*2]=n[a*2]+n[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=c,e.heap[1]=c++,Cf(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],$j(e,t),my(n,l,e.bl_count)}function by(e,t,n){var r,o=-1,i,a=t[0*2+1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)i=a,a=t[(r+1)*2+1],!(++s<l&&i===a)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==o&&e.bl_tree[i*2]++,e.bl_tree[ay*2]++):s<=10?e.bl_tree[sy*2]++:e.bl_tree[ly*2]++,s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function xy(e,t,n){var r,o=-1,i,a=t[0*2+1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),r=0;r<=n;r++)if(i=a,a=t[(r+1)*2+1],!(++s<l&&i===a)){if(s<c)do ar(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==o&&(ar(e,i,e.bl_tree),s--),ar(e,ay,e.bl_tree),en(e,s-3,2)):s<=10?(ar(e,sy,e.bl_tree),en(e,s-3,3)):(ar(e,ly,e.bl_tree),en(e,s-11,7));s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}function zj(e){var t;for(by(e,e.dyn_ltree,e.l_desc.max_code),by(e,e.dyn_dtree,e.d_desc.max_code),Ef(e,e.bl_desc),t=wf-1;t>=3&&e.bl_tree[cy[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Bj(e,t,n,r){var o;for(en(e,t-257,5),en(e,n-1,5),en(e,r-4,4),o=0;o<r;o++)en(e,e.bl_tree[cy[o]*2+1],3);xy(e,e.dyn_ltree,t-1),xy(e,e.dyn_dtree,n-1)}function Hj(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return ny;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return ry;for(n=32;n<os;n++)if(e.dyn_ltree[n*2]!==0)return ry;return ny}var _y=!1;function Uj(e){_y||(Fj(),_y=!0),e.l_desc=new Sf(e.dyn_ltree,uy),e.d_desc=new Sf(e.dyn_dtree,dy),e.bl_desc=new Sf(e.bl_tree,fy),e.bi_buf=0,e.bi_valid=0,gy(e)}function Sy(e,t,n,r){en(e,(Tj<<1)+(r?1:0),3),Lj(e,t,n)}function Vj(e){en(e,oy<<1,3),ar(e,yf,Mr),jj(e)}function Wj(e,t,n,r){var o,i,a=0;e.level>0?(e.strm.data_type===Nj&&(e.strm.data_type=Hj(e)),Ef(e,e.l_desc),Ef(e,e.d_desc),a=zj(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=n+5,n+4<=o&&t!==-1?Sy(e,t,n,r):e.strategy===Rj||i===o?(en(e,(oy<<1)+(r?1:0),3),yy(e,Mr,as)):(en(e,(Mj<<1)+(r?1:0),3),Bj(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),yy(e,e.dyn_ltree,e.dyn_dtree)),gy(e),r&&wy(e)}function Gj(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(ls[n]+os+1)*2]++,e.dyn_dtree[hy(t)*2]++),e.last_lit===e.lit_bufsize-1}xi._tr_init=Uj,xi._tr_stored_block=Sy,xi._tr_flush_block=Wj,xi._tr_tally=Gj,xi._tr_align=Vj;function qj(e,t,n,r){for(var o=e&65535|0,i=e>>>16&65535|0,a=0;n!==0;){a=n>2e3?2e3:n,n-=a;do o=o+t[r++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}var Cy=qj;function Yj(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var Kj=Yj();function Xj(e,t,n,r){var o=Kj,i=r+n;e^=-1;for(var a=r;a<i;a++)e=e>>>8^o[(e^t[a])&255];return e^-1}var Ey=Xj,Pf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},qt=Tr,Mn=xi,Py=Cy,Yr=Ey,Zj=Pf,Io=0,Jj=1,Qj=3,Kr=4,Ry=5,sr=0,Ny=1,Dn=-2,e2=-3,Rf=-5,t2=-1,n2=1,uc=2,r2=3,o2=4,i2=0,a2=2,dc=8,s2=9,l2=15,c2=8,u2=29,d2=256,Nf=d2+1+u2,f2=30,h2=19,p2=2*Nf+1,m2=15,He=3,Xr=258,$n=Xr+He+1,g2=32,fc=42,Tf=69,hc=73,pc=91,mc=103,Oo=113,us=666,Et=1,ds=2,jo=3,Ci=4,w2=3;function Zr(e,t){return e.msg=Zj[t],t}function Ty(e){return(e<<1)-(e>4?9:0)}function Jr(e){for(var t=e.length;--t>=0;)e[t]=0}function Qr(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(qt.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Dt(e,t){Mn._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Qr(e.strm)}function Ke(e,t){e.pending_buf[e.pending++]=t}function fs(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function v2(e,t,n,r){var o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,qt.arraySet(t,e.input,e.next_in,o,n),e.state.wrap===1?e.adler=Py(e.adler,t,o,n):e.state.wrap===2&&(e.adler=Yr(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)}function My(e,t){var n=e.max_chain_length,r=e.strstart,o,i,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-$n?e.strstart-(e.w_size-$n):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Xr,h=c[r+a-1],p=c[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+a]!==p||c[o+a-1]!==h||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&r<f);if(i=Xr-(f-r),r=f-Xr,i>a){if(e.match_start=t,a=i,i>=s)break;h=c[r+a-1],p=c[r+a]}}while((t=d[t&u])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead}function $o(e){var t=e.w_size,n,r,o,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-$n)){qt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do o=e.head[--n],e.head[n]=o>=t?o-t:0;while(--r);r=t,n=r;do o=e.prev[--n],e.prev[n]=o>=t?o-t:0;while(--r);i+=t}if(e.strm.avail_in===0)break;if(r=v2(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=He)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+He-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<He)););}while(e.lookahead<$n&&e.strm.avail_in!==0)}function y2(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if($o(e),e.lookahead===0&&t===Io)return Et;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Dt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-$n&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=0,t===Kr?(Dt(e,!0),e.strm.avail_out===0?jo:Ci):(e.strstart>e.block_start&&(Dt(e,!1),e.strm.avail_out===0),Et)}function Mf(e,t){for(var n,r;;){if(e.lookahead<$n){if($o(e),e.lookahead<$n&&t===Io)return Et;if(e.lookahead===0)break}if(n=0,e.lookahead>=He&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-$n&&(e.match_length=My(e,n)),e.match_length>=He)if(r=Mn._tr_tally(e,e.strstart-e.match_start,e.match_length-He),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=He){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=Mn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=e.strstart<He-1?e.strstart:He-1,t===Kr?(Dt(e,!0),e.strm.avail_out===0?jo:Ci):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:ds}function Ei(e,t){for(var n,r,o;;){if(e.lookahead<$n){if($o(e),e.lookahead<$n&&t===Io)return Et;if(e.lookahead===0)break}if(n=0,e.lookahead>=He&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=He-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-$n&&(e.match_length=My(e,n),e.match_length<=5&&(e.strategy===n2||e.match_length===He&&e.strstart-e.match_start>4096)&&(e.match_length=He-1)),e.prev_length>=He&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-He,r=Mn._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-He),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=He-1,e.strstart++,r&&(Dt(e,!1),e.strm.avail_out===0))return Et}else if(e.match_available){if(r=Mn._tr_tally(e,0,e.window[e.strstart-1]),r&&Dt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Et}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Mn._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<He-1?e.strstart:He-1,t===Kr?(Dt(e,!0),e.strm.avail_out===0?jo:Ci):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:ds}function b2(e,t){for(var n,r,o,i,a=e.window;;){if(e.lookahead<=Xr){if($o(e),e.lookahead<=Xr&&t===Io)return Et;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=He&&e.strstart>0&&(o=e.strstart-1,r=a[o],r===a[++o]&&r===a[++o]&&r===a[++o])){i=e.strstart+Xr;do;while(r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&o<i);e.match_length=Xr-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=He?(n=Mn._tr_tally(e,1,e.match_length-He),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Mn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=0,t===Kr?(Dt(e,!0),e.strm.avail_out===0?jo:Ci):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:ds}function x2(e,t){for(var n;;){if(e.lookahead===0&&($o(e),e.lookahead===0)){if(t===Io)return Et;break}if(e.match_length=0,n=Mn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=0,t===Kr?(Dt(e,!0),e.strm.avail_out===0?jo:Ci):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:ds}function lr(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}var Pi;Pi=[new lr(0,0,0,0,y2),new lr(4,4,8,4,Mf),new lr(4,5,16,8,Mf),new lr(4,6,32,32,Mf),new lr(4,4,16,16,Ei),new lr(8,16,32,32,Ei),new lr(8,16,128,128,Ei),new lr(8,32,128,256,Ei),new lr(32,128,258,1024,Ei),new lr(32,258,258,4096,Ei)];function _2(e){e.window_size=2*e.w_size,Jr(e.head),e.max_lazy_match=Pi[e.level].max_lazy,e.good_match=Pi[e.level].good_length,e.nice_match=Pi[e.level].nice_length,e.max_chain_length=Pi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=He-1,e.match_available=0,e.ins_h=0}function S2(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new qt.Buf16(p2*2),this.dyn_dtree=new qt.Buf16((2*f2+1)*2),this.bl_tree=new qt.Buf16((2*h2+1)*2),Jr(this.dyn_ltree),Jr(this.dyn_dtree),Jr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new qt.Buf16(m2+1),this.heap=new qt.Buf16(2*Nf+1),Jr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new qt.Buf16(2*Nf+1),Jr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Dy(e){var t;return!e||!e.state?Zr(e,Dn):(e.total_in=e.total_out=0,e.data_type=a2,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?fc:Oo,e.adler=t.wrap===2?0:1,t.last_flush=Io,Mn._tr_init(t),sr)}function Ay(e){var t=Dy(e);return t===sr&&_2(e.state),t}function C2(e,t){return!e||!e.state||e.state.wrap!==2?Dn:(e.state.gzhead=t,sr)}function ky(e,t,n,r,o,i){if(!e)return Dn;var a=1;if(t===t2&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>s2||n!==dc||r<8||r>15||t<0||t>9||i<0||i>o2)return Zr(e,Dn);r===8&&(r=9);var s=new S2;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+He-1)/He),s.window=new qt.Buf8(s.w_size*2),s.head=new qt.Buf16(s.hash_size),s.prev=new qt.Buf16(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new qt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=i,s.method=n,Ay(e)}function E2(e,t){return ky(e,t,dc,l2,c2,i2)}function P2(e,t){var n,r,o,i;if(!e||!e.state||t>Ry||t<0)return e?Zr(e,Dn):Dn;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===us&&t!==Kr)return Zr(e,e.avail_out===0?Rf:Dn);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===fc)if(r.wrap===2)e.adler=0,Ke(r,31),Ke(r,139),Ke(r,8),r.gzhead?(Ke(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Ke(r,r.gzhead.time&255),Ke(r,r.gzhead.time>>8&255),Ke(r,r.gzhead.time>>16&255),Ke(r,r.gzhead.time>>24&255),Ke(r,r.level===9?2:r.strategy>=uc||r.level<2?4:0),Ke(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Ke(r,r.gzhead.extra.length&255),Ke(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Yr(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Tf):(Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,r.level===9?2:r.strategy>=uc||r.level<2?4:0),Ke(r,w2),r.status=Oo);else{var a=dc+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=uc||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=g2),a+=31-a%31,r.status=Oo,fs(r,a),r.strstart!==0&&(fs(r,e.adler>>>16),fs(r,e.adler&65535)),e.adler=1}if(r.status===Tf)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=Yr(e.adler,r.pending_buf,r.pending-o,o)),Qr(e),o=r.pending,r.pending===r.pending_buf_size));)Ke(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=Yr(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=hc)}else r.status=hc;if(r.status===hc)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=Yr(e.adler,r.pending_buf,r.pending-o,o)),Qr(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,Ke(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=Yr(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.gzindex=0,r.status=pc)}else r.status=pc;if(r.status===pc)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=Yr(e.adler,r.pending_buf,r.pending-o,o)),Qr(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,Ke(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=Yr(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.status=mc)}else r.status=mc;if(r.status===mc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Qr(e),r.pending+2<=r.pending_buf_size&&(Ke(r,e.adler&255),Ke(r,e.adler>>8&255),e.adler=0,r.status=Oo)):r.status=Oo),r.pending!==0){if(Qr(e),e.avail_out===0)return r.last_flush=-1,sr}else if(e.avail_in===0&&Ty(t)<=Ty(n)&&t!==Kr)return Zr(e,Rf);if(r.status===us&&e.avail_in!==0)return Zr(e,Rf);if(e.avail_in!==0||r.lookahead!==0||t!==Io&&r.status!==us){var l=r.strategy===uc?x2(r,t):r.strategy===r2?b2(r,t):Pi[r.level].func(r,t);if((l===jo||l===Ci)&&(r.status=us),l===Et||l===jo)return e.avail_out===0&&(r.last_flush=-1),sr;if(l===ds&&(t===Jj?Mn._tr_align(r):t!==Ry&&(Mn._tr_stored_block(r,0,0,!1),t===Qj&&(Jr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Qr(e),e.avail_out===0))return r.last_flush=-1,sr}return t!==Kr?sr:r.wrap<=0?Ny:(r.wrap===2?(Ke(r,e.adler&255),Ke(r,e.adler>>8&255),Ke(r,e.adler>>16&255),Ke(r,e.adler>>24&255),Ke(r,e.total_in&255),Ke(r,e.total_in>>8&255),Ke(r,e.total_in>>16&255),Ke(r,e.total_in>>24&255)):(fs(r,e.adler>>>16),fs(r,e.adler&65535)),Qr(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?sr:Ny)}function R2(e){var t;return!e||!e.state?Dn:(t=e.state.status,t!==fc&&t!==Tf&&t!==hc&&t!==pc&&t!==mc&&t!==Oo&&t!==us?Zr(e,Dn):(e.state=null,t===Oo?Zr(e,e2):sr))}function N2(e,t){var n=t.length,r,o,i,a,s,l,c,u;if(!e||!e.state||(r=e.state,a=r.wrap,a===2||a===1&&r.status!==fc||r.lookahead))return Dn;for(a===1&&(e.adler=Py(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(a===0&&(Jr(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new qt.Buf8(r.w_size),qt.arraySet(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=n,e.next_in=0,e.input=t,$o(r);r.lookahead>=He;){o=r.strstart,i=r.lookahead-(He-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[o+He-1])&r.hash_mask,r.prev[o&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=o,o++;while(--i);r.strstart=o,r.lookahead=He-1,$o(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=He-1,r.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,r.wrap=a,sr}ir.deflateInit=E2,ir.deflateInit2=ky,ir.deflateReset=Ay,ir.deflateResetKeep=Dy,ir.deflateSetHeader=C2,ir.deflate=P2,ir.deflateEnd=R2,ir.deflateSetDictionary=N2,ir.deflateInfo="pako deflate (from Nodeca project)";var Fo={},gc=Tr,Iy=!0,Oy=!0;try{String.fromCharCode.apply(null,[0])}catch{Iy=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Oy=!1}for(var hs=new gc.Buf8(256),eo=0;eo<256;eo++)hs[eo]=eo>=252?6:eo>=248?5:eo>=240?4:eo>=224?3:eo>=192?2:1;hs[254]=hs[254]=1,Fo.string2buf=function(e){var t,n,r,o,i,a=e.length,s=0;for(o=0;o<a;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<a&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new gc.Buf8(s),i=0,o=0;i<s;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<a&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|n&63):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|n&63):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|n&63);return t};function jy(e,t){if(t<65534&&(e.subarray&&Oy||!e.subarray&&Iy))return String.fromCharCode.apply(null,gc.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}Fo.buf2binstring=function(e){return jy(e,e.length)},Fo.binstring2buf=function(e){for(var t=new gc.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},Fo.buf2string=function(e,t){var n,r,o,i,a=t||e.length,s=new Array(a*2);for(r=0,n=0;n<a;){if(o=e[n++],o<128){s[r++]=o;continue}if(i=hs[o],i>4){s[r++]=65533,n+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&n<a;)o=o<<6|e[n++]&63,i--;if(i>1){s[r++]=65533;continue}o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|o&1023)}return jy(s,r)},Fo.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+hs[e[n]]>t?n:t};function T2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var $y=T2,ps=ir,ms=Tr,Df=Fo,Af=Pf,M2=$y,Fy=Object.prototype.toString,D2=0,kf=4,Ri=0,Ly=1,zy=2,A2=-1,k2=0,I2=8;function Lo(e){if(!(this instanceof Lo))return new Lo(e);this.options=ms.assign({level:A2,method:I2,chunkSize:16384,windowBits:15,memLevel:8,strategy:k2,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new M2,this.strm.avail_out=0;var n=ps.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Ri)throw new Error(Af[n]);if(t.header&&ps.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=Df.string2buf(t.dictionary):Fy.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=ps.deflateSetDictionary(this.strm,r),n!==Ri)throw new Error(Af[n]);this._dict_set=!0}}Lo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,o,i;if(this.ended)return!1;i=t===~~t?t:t===!0?kf:D2,typeof e=="string"?n.input=Df.string2buf(e):Fy.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new ms.Buf8(r),n.next_out=0,n.avail_out=r),o=ps.deflate(n,i),o!==Ly&&o!==Ri)return this.onEnd(o),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(i===kf||i===zy))&&(this.options.to==="string"?this.onData(Df.buf2binstring(ms.shrinkBuf(n.output,n.next_out))):this.onData(ms.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&o!==Ly);return i===kf?(o=ps.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Ri):(i===zy&&(this.onEnd(Ri),n.avail_out=0),!0)},Lo.prototype.onData=function(e){this.chunks.push(e)},Lo.prototype.onEnd=function(e){e===Ri&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ms.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function If(e,t){var n=new Lo(t);if(n.push(e,!0),n.err)throw n.msg||Af[n.err];return n.result}function O2(e,t){return t=t||{},t.raw=!0,If(e,t)}function j2(e,t){return t=t||{},t.gzip=!0,If(e,t)}rs.Deflate=Lo,rs.deflate=If,rs.deflateRaw=O2,rs.gzip=j2;var gs={},Fn={},wc=30,$2=12,F2=function(t,n){var r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b,x,S,C,N,R,T,M,A,k;r=t.state,o=t.next_in,A=t.input,i=o+(t.avail_in-5),a=t.next_out,k=t.output,s=a-(n-t.avail_out),l=a+(t.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,f=r.wnext,h=r.window,p=r.hold,m=r.bits,v=r.lencode,w=r.distcode,b=(1<<r.lenbits)-1,x=(1<<r.distbits)-1;e:do{m<15&&(p+=A[o++]<<m,m+=8,p+=A[o++]<<m,m+=8),S=v[p&b];t:for(;;){if(C=S>>>24,p>>>=C,m-=C,C=S>>>16&255,C===0)k[a++]=S&65535;else if(C&16){N=S&65535,C&=15,C&&(m<C&&(p+=A[o++]<<m,m+=8),N+=p&(1<<C)-1,p>>>=C,m-=C),m<15&&(p+=A[o++]<<m,m+=8,p+=A[o++]<<m,m+=8),S=w[p&x];n:for(;;){if(C=S>>>24,p>>>=C,m-=C,C=S>>>16&255,C&16){if(R=S&65535,C&=15,m<C&&(p+=A[o++]<<m,m+=8,m<C&&(p+=A[o++]<<m,m+=8)),R+=p&(1<<C)-1,R>c){t.msg="invalid distance too far back",r.mode=wc;break e}if(p>>>=C,m-=C,C=a-s,R>C){if(C=R-C,C>d&&r.sane){t.msg="invalid distance too far back",r.mode=wc;break e}if(T=0,M=h,f===0){if(T+=u-C,C<N){N-=C;do k[a++]=h[T++];while(--C);T=a-R,M=k}}else if(f<C){if(T+=u+f-C,C-=f,C<N){N-=C;do k[a++]=h[T++];while(--C);if(T=0,f<N){C=f,N-=C;do k[a++]=h[T++];while(--C);T=a-R,M=k}}}else if(T+=f-C,C<N){N-=C;do k[a++]=h[T++];while(--C);T=a-R,M=k}for(;N>2;)k[a++]=M[T++],k[a++]=M[T++],k[a++]=M[T++],N-=3;N&&(k[a++]=M[T++],N>1&&(k[a++]=M[T++]))}else{T=a-R;do k[a++]=k[T++],k[a++]=k[T++],k[a++]=k[T++],N-=3;while(N>2);N&&(k[a++]=k[T++],N>1&&(k[a++]=k[T++]))}}else if(C&64){t.msg="invalid distance code",r.mode=wc;break e}else{S=w[(S&65535)+(p&(1<<C)-1)];continue n}break}}else if(C&64)if(C&32){r.mode=$2;break e}else{t.msg="invalid literal/length code",r.mode=wc;break e}else{S=v[(S&65535)+(p&(1<<C)-1)];continue t}break}}while(o<i&&a<l);N=m>>3,o-=N,m-=N<<3,p&=(1<<m)-1,t.next_in=o,t.next_out=a,t.avail_in=o<i?5+(i-o):5-(o-i),t.avail_out=a<l?257+(l-a):257-(a-l),r.hold=p,r.bits=m},By=Tr,Ni=15,Hy=852,Uy=592,Vy=0,Of=1,Wy=2,L2=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],z2=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],B2=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],H2=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],U2=function(t,n,r,o,i,a,s,l){var c=l.bits,u=0,d=0,f=0,h=0,p=0,m=0,v=0,w=0,b=0,x=0,S,C,N,R,T,M=null,A=0,k,F=new By.Buf16(Ni+1),L=new By.Buf16(Ni+1),Y=null,ne=0,q,X,B;for(u=0;u<=Ni;u++)F[u]=0;for(d=0;d<o;d++)F[n[r+d]]++;for(p=c,h=Ni;h>=1&&F[h]===0;h--);if(p>h&&(p=h),h===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<h&&F[f]===0;f++);for(p<f&&(p=f),w=1,u=1;u<=Ni;u++)if(w<<=1,w-=F[u],w<0)return-1;if(w>0&&(t===Vy||h!==1))return-1;for(L[1]=0,u=1;u<Ni;u++)L[u+1]=L[u]+F[u];for(d=0;d<o;d++)n[r+d]!==0&&(s[L[n[r+d]]++]=d);if(t===Vy?(M=Y=s,k=19):t===Of?(M=L2,A-=257,Y=z2,ne-=257,k=256):(M=B2,Y=H2,k=-1),x=0,d=0,u=f,T=a,m=p,v=0,N=-1,b=1<<p,R=b-1,t===Of&&b>Hy||t===Wy&&b>Uy)return 1;for(;;){q=u-v,s[d]<k?(X=0,B=s[d]):s[d]>k?(X=Y[ne+s[d]],B=M[A+s[d]]):(X=96,B=0),S=1<<u-v,C=1<<m,f=C;do C-=S,i[T+(x>>v)+C]=q<<24|X<<16|B|0;while(C!==0);for(S=1<<u-1;x&S;)S>>=1;if(S!==0?(x&=S-1,x+=S):x=0,d++,--F[u]===0){if(u===h)break;u=n[r+s[d]]}if(u>p&&(x&R)!==N){for(v===0&&(v=p),T+=f,m=u-v,w=1<<m;m+v<h&&(w-=F[m+v],!(w<=0));)m++,w<<=1;if(b+=1<<m,t===Of&&b>Hy||t===Wy&&b>Uy)return 1;N=x&R,i[N]=p<<24|m<<16|T-a|0}}return x!==0&&(i[T+x]=u-v<<24|64<<16|0),l.bits=p,0},wn=Tr,jf=Cy,cr=Ey,V2=F2,ws=U2,W2=0,Gy=1,qy=2,Yy=4,G2=5,vc=6,zo=0,q2=1,Y2=2,An=-2,Ky=-3,Xy=-4,K2=-5,Zy=8,Jy=1,Qy=2,e0=3,t0=4,n0=5,r0=6,o0=7,i0=8,a0=9,s0=10,yc=11,Dr=12,$f=13,l0=14,Ff=15,c0=16,u0=17,d0=18,f0=19,bc=20,xc=21,h0=22,p0=23,m0=24,g0=25,w0=26,Lf=27,v0=28,y0=29,ut=30,b0=31,X2=32,Z2=852,J2=592,Q2=15,e$=Q2;function x0(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function t$(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new wn.Buf16(320),this.work=new wn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _0(e){var t;return!e||!e.state?An:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Jy,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new wn.Buf32(Z2),t.distcode=t.distdyn=new wn.Buf32(J2),t.sane=1,t.back=-1,zo)}function S0(e){var t;return!e||!e.state?An:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,_0(e))}function C0(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?An:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,S0(e))}function E0(e,t){var n,r;return e?(r=new t$,e.state=r,r.window=null,n=C0(e,t),n!==zo&&(e.state=null),n):An}function n$(e){return E0(e,e$)}var P0=!0,zf,Bf;function r$(e){if(P0){var t;for(zf=new wn.Buf32(512),Bf=new wn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ws(Gy,e.lens,0,288,zf,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ws(qy,e.lens,0,32,Bf,0,e.work,{bits:5}),P0=!1}e.lencode=zf,e.lenbits=9,e.distcode=Bf,e.distbits=5}function R0(e,t,n,r){var o,i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new wn.Buf8(i.wsize)),r>=i.wsize?(wn.arraySet(i.window,t,n-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),wn.arraySet(i.window,t,n-r,o,i.wnext),r-=o,r?(wn.arraySet(i.window,t,n-r,r,0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function o$(e,t){var n,r,o,i,a,s,l,c,u,d,f,h,p,m,v=0,w,b,x,S,C,N,R,T,M=new wn.Buf8(4),A,k,F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return An;n=e.state,n.mode===Dr&&(n.mode=$f),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,d=s,f=l,T=zo;e:for(;;)switch(n.mode){case Jy:if(n.wrap===0){n.mode=$f;break}for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.wrap&2&&c===35615){n.check=0,M[0]=c&255,M[1]=c>>>8&255,n.check=cr(n.check,M,2,0),c=0,u=0,n.mode=Qy;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=ut;break}if((c&15)!==Zy){e.msg="unknown compression method",n.mode=ut;break}if(c>>>=4,u-=4,R=(c&15)+8,n.wbits===0)n.wbits=R;else if(R>n.wbits){e.msg="invalid window size",n.mode=ut;break}n.dmax=1<<R,e.adler=n.check=1,n.mode=c&512?s0:Dr,c=0,u=0;break;case Qy:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.flags=c,(n.flags&255)!==Zy){e.msg="unknown compression method",n.mode=ut;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ut;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=cr(n.check,M,2,0)),c=0,u=0,n.mode=e0;case e0:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.time=c),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,n.check=cr(n.check,M,4,0)),c=0,u=0,n.mode=t0;case t0:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=cr(n.check,M,2,0)),c=0,u=0,n.mode=n0;case n0:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=cr(n.check,M,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=r0;case r0:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(R=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),wn.arraySet(n.head.extra,r,i,h,R)),n.flags&512&&(n.check=cr(n.check,r,h,i)),s-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=o0;case o0:if(n.flags&2048){if(s===0)break e;h=0;do R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.name+=String.fromCharCode(R));while(R&&h<s);if(n.flags&512&&(n.check=cr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=i0;case i0:if(n.flags&4096){if(s===0)break e;h=0;do R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.comment+=String.fromCharCode(R));while(R&&h<s);if(n.flags&512&&(n.check=cr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.comment=null);n.mode=a0;case a0:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=ut;break}c=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Dr;break;case s0:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}e.adler=n.check=x0(c),c=0,u=0,n.mode=yc;case yc:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,Y2;e.adler=n.check=1,n.mode=Dr;case Dr:if(t===G2||t===vc)break e;case $f:if(n.last){c>>>=u&7,u-=u&7,n.mode=Lf;break}for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}switch(n.last=c&1,c>>>=1,u-=1,c&3){case 0:n.mode=l0;break;case 1:if(r$(n),n.mode=bc,t===vc){c>>>=2,u-=2;break e}break;case 2:n.mode=u0;break;case 3:e.msg="invalid block type",n.mode=ut}c>>>=2,u-=2;break;case l0:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=ut;break}if(n.length=c&65535,c=0,u=0,n.mode=Ff,t===vc)break e;case Ff:n.mode=c0;case c0:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;wn.arraySet(o,r,i,h,a),s-=h,i+=h,l-=h,a+=h,n.length-=h;break}n.mode=Dr;break;case u0:for(;u<14;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.nlen=(c&31)+257,c>>>=5,u-=5,n.ndist=(c&31)+1,c>>>=5,u-=5,n.ncode=(c&15)+4,c>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ut;break}n.have=0,n.mode=d0;case d0:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.lens[F[n.have++]]=c&7,c>>>=3,u-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},T=ws(W2,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,T){e.msg="invalid code lengths set",n.mode=ut;break}n.have=0,n.mode=f0;case f0:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[c&(1<<n.lenbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(x<16)c>>>=w,u-=w,n.lens[n.have++]=x;else{if(x===16){for(k=w+2;u<k;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c>>>=w,u-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=ut;break}R=n.lens[n.have-1],h=3+(c&3),c>>>=2,u-=2}else if(x===17){for(k=w+3;u<k;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=w,u-=w,R=0,h=3+(c&7),c>>>=3,u-=3}else{for(k=w+7;u<k;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=w,u-=w,R=0,h=11+(c&127),c>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ut;break}for(;h--;)n.lens[n.have++]=R}}if(n.mode===ut)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ut;break}if(n.lenbits=9,A={bits:n.lenbits},T=ws(Gy,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,T){e.msg="invalid literal/lengths set",n.mode=ut;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},T=ws(qy,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,T){e.msg="invalid distances set",n.mode=ut;break}if(n.mode=bc,t===vc)break e;case bc:n.mode=xc;case xc:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,V2(e,f),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,n.mode===Dr&&(n.back=-1);break}for(n.back=0;v=n.lencode[c&(1<<n.lenbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(b&&!(b&240)){for(S=w,C=b,N=x;v=n.lencode[N+((c&(1<<S+C)-1)>>S)],w=v>>>24,b=v>>>16&255,x=v&65535,!(S+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=S,u-=S,n.back+=S}if(c>>>=w,u-=w,n.back+=w,n.length=x,b===0){n.mode=w0;break}if(b&32){n.back=-1,n.mode=Dr;break}if(b&64){e.msg="invalid literal/length code",n.mode=ut;break}n.extra=b&15,n.mode=h0;case h0:if(n.extra){for(k=n.extra;u<k;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=p0;case p0:for(;v=n.distcode[c&(1<<n.distbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(!(b&240)){for(S=w,C=b,N=x;v=n.distcode[N+((c&(1<<S+C)-1)>>S)],w=v>>>24,b=v>>>16&255,x=v&65535,!(S+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=S,u-=S,n.back+=S}if(c>>>=w,u-=w,n.back+=w,b&64){e.msg="invalid distance code",n.mode=ut;break}n.offset=x,n.extra=b&15,n.mode=m0;case m0:if(n.extra){for(k=n.extra;u<k;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ut;break}n.mode=g0;case g0:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ut;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=o,p=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do o[a++]=m[p++];while(--h);n.length===0&&(n.mode=xc);break;case w0:if(l===0)break e;o[a++]=n.length,l--,n.mode=xc;break;case Lf:if(n.wrap){for(;u<32;){if(s===0)break e;s--,c|=r[i++]<<u,u+=8}if(f-=l,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?cr(n.check,o,f,a-f):jf(n.check,o,f,a-f)),f=l,(n.flags?c:x0(c))!==n.check){e.msg="incorrect data check",n.mode=ut;break}c=0,u=0}n.mode=v0;case v0:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=ut;break}c=0,u=0}n.mode=y0;case y0:T=q2;break e;case ut:T=Ky;break e;case b0:return Xy;case X2:default:return An}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<ut&&(n.mode<Lf||t!==Yy))&&R0(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?cr(n.check,o,f,e.next_out-f):jf(n.check,o,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Dr?128:0)+(n.mode===bc||n.mode===Ff?256:0),(d===0&&f===0||t===Yy)&&T===zo&&(T=K2),T}function i$(e){if(!e||!e.state)return An;var t=e.state;return t.window&&(t.window=null),e.state=null,zo}function a$(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?An:(n.head=t,t.done=!1,zo)}function s$(e,t){var n=t.length,r,o,i;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==yc)?An:r.mode===yc&&(o=1,o=jf(o,t,n,0),o!==r.check)?Ky:(i=R0(e,t,n,n),i?(r.mode=b0,Xy):(r.havedict=1,zo))}Fn.inflateReset=S0,Fn.inflateReset2=C0,Fn.inflateResetKeep=_0,Fn.inflateInit=n$,Fn.inflateInit2=E0,Fn.inflate=o$,Fn.inflateEnd=i$,Fn.inflateGetHeader=a$,Fn.inflateSetDictionary=s$,Fn.inflateInfo="pako inflate (from Nodeca project)";var N0={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};function l$(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var c$=l$,Ti=Fn,vs=Tr,_c=Fo,yt=N0,Hf=Pf,u$=$y,d$=c$,T0=Object.prototype.toString;function Bo(e){if(!(this instanceof Bo))return new Bo(e);this.options=vs.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u$,this.strm.avail_out=0;var n=Ti.inflateInit2(this.strm,t.windowBits);if(n!==yt.Z_OK)throw new Error(Hf[n]);if(this.header=new d$,Ti.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=_c.string2buf(t.dictionary):T0.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ti.inflateSetDictionary(this.strm,t.dictionary),n!==yt.Z_OK)))throw new Error(Hf[n])}Bo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,c,u=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?yt.Z_FINISH:yt.Z_NO_FLUSH,typeof e=="string"?n.input=_c.binstring2buf(e):T0.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new vs.Buf8(r),n.next_out=0,n.avail_out=r),i=Ti.inflate(n,yt.Z_NO_FLUSH),i===yt.Z_NEED_DICT&&o&&(i=Ti.inflateSetDictionary(this.strm,o)),i===yt.Z_BUF_ERROR&&u===!0&&(i=yt.Z_OK,u=!1),i!==yt.Z_STREAM_END&&i!==yt.Z_OK)return this.onEnd(i),this.ended=!0,!1;n.next_out&&(n.avail_out===0||i===yt.Z_STREAM_END||n.avail_in===0&&(a===yt.Z_FINISH||a===yt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=_c.utf8border(n.output,n.next_out),l=n.next_out-s,c=_c.buf2string(n.output,s),n.next_out=l,n.avail_out=r-l,l&&vs.arraySet(n.output,n.output,s,l,0),this.onData(c)):this.onData(vs.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&i!==yt.Z_STREAM_END);return i===yt.Z_STREAM_END&&(a=yt.Z_FINISH),a===yt.Z_FINISH?(i=Ti.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===yt.Z_OK):(a===yt.Z_SYNC_FLUSH&&(this.onEnd(yt.Z_OK),n.avail_out=0),!0)},Bo.prototype.onData=function(e){this.chunks.push(e)},Bo.prototype.onEnd=function(e){e===yt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=vs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Uf(e,t){var n=new Bo(t);if(n.push(e,!0),n.err)throw n.msg||Hf[n.err];return n.result}function f$(e,t){return t=t||{},t.raw=!0,Uf(e,t)}gs.Inflate=Bo,gs.inflate=Uf,gs.inflateRaw=f$,gs.ungzip=Uf;var h$=Tr.assign,p$=rs,m$=gs,g$=N0,M0={};h$(M0,p$,m$,g$);var w$=M0;const Vf=Nn(w$),D0=(e,t)=>function(...n){const r=t.promiseModule;return new r((o,i)=>{t.multiArgs?n.push((...a)=>{t.errorFirst?a[0]?i(a):(a.shift(),o(a)):o(a)}):t.errorFirst?n.push((a,s)=>{a?i(a):o(s)}):n.push(o),e.apply(this,n)})};var v$=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=i=>{const a=s=>typeof s=="string"?i===s:s.test(i);return t.include?t.include.some(a):!t.exclude.some(a)};let o;n==="function"?o=function(...i){return t.excludeMain?e(...i):D0(e,t).apply(this,i)}:o=Object.create(Object.getPrototypeOf(e));for(const i in e){const a=e[i];o[i]=typeof a=="function"&&r(i)?D0(a,t):a}return o};const Wf=Nn(v$);function A0(e){return Array.isArray(e)?e:[e]}const Gf="",k0=" ",qf="\\",y$=/^\s+$/,b$=/(?:[^\\]|^)\\$/,x$=/^\\!/,_$=/^\\#/,S$=/\r?\n/g,C$=/^\.*\/|^\.+$/,Yf="/";let I0="node-ignore";typeof Symbol<"u"&&(I0=Symbol.for("node-ignore"));const O0=I0,E$=(e,t,n)=>Object.defineProperty(e,t,{value:n}),P$=/([0-z])-([0-z])/g,j0=()=>!1,R$=e=>e.replace(P$,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:Gf),N$=e=>{const{length:t}=e;return e.slice(0,t-t%2)},T$=[[/^\uFEFF/,()=>Gf],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?k0:Gf)],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+k0}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>{const r=n.replace(/\\\*/g,"[^\\/]*");return t+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>qf],[/\\\\/g,()=>qf],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,o)=>t===qf?`\\[${n}${N$(r)}${o}`:o==="]"&&r.length%2===0?`[${R$(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],$0=Object.create(null),M$=(e,t)=>{let n=$0[e];return n||(n=T$.reduce((r,[o,i])=>r.replace(o,i.bind(e)),e),$0[e]=n),t?new RegExp(n,"i"):new RegExp(n)},Kf=e=>typeof e=="string",D$=e=>e&&Kf(e)&&!y$.test(e)&&!b$.test(e)&&e.indexOf("#")!==0,A$=e=>e.split(S$);let k$=class{constructor(t,n,r,o){this.origin=t,this.pattern=n,this.negative=r,this.regex=o}};const I$=(e,t)=>{const n=e;let r=!1;e.indexOf("!")===0&&(r=!0,e=e.substr(1)),e=e.replace(x$,"!").replace(_$,"#");const o=M$(e,t);return new k$(n,e,r,o)},O$=(e,t)=>{throw new t(e)},Ar=(e,t,n)=>Kf(e)?e?Ar.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),F0=e=>C$.test(e);Ar.isNotRelative=F0,Ar.convert=e=>e;let j$=class{constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){E$(this,O0,!0),this._rules=[],this._ignoreCase=n,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[O0]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(D$(t)){const n=I$(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,A0(Kf(t)?A$(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,n){let r=!1,o=!1;return this._rules.forEach(i=>{const{negative:a}=i;if(o===a&&r!==o||a&&!r&&!o&&!n)return;i.regex.test(t)&&(r=!a,o=a)}),{ignored:r,unignored:o}}_test(t,n,r,o){const i=t&&Ar.convert(t);return Ar(i,t,this._allowRelativePaths?j0:O$),this._t(i,n,r,o)}_t(t,n,r,o){if(t in n)return n[t];if(o||(o=t.split(Yf)),o.pop(),!o.length)return n[t]=this._testOne(t,r);const i=this._t(o.join(Yf)+Yf,n,r,o);return n[t]=i.ignored?i:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return A0(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}};const Sc=e=>new j$(e),$$=e=>Ar(e&&Ar.convert(e),e,j0);Sc.isPathValid=$$,Sc.default=Sc;var F$=Sc;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");Ar.convert=e;const t=/^[a-z]:\//i;Ar.isNotRelative=n=>t.test(n)||F0(n)}const L$=Nn(F$);function z$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ur(e,t,n){return t=t instanceof RegExp?t:new RegExp(z$(t),"g"),e.replace(t,n)}var B$={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=ur(t,"./","/"),t=ur(t,"..","."),t=ur(t," ","-"),t=ur(t,/^[~^:?*\\\-]/g,""),t=ur(t,/[~^:?*\\]/g,"-"),t=ur(t,/[~^:?*\\\-]$/g,""),t=ur(t,"@{","-"),t=ur(t,/\.$/g,""),t=ur(t,/\/$/g,""),t=ur(t,/\.lock$/g,""),t}},H$=B$;const dr=Nn(H$);var U$=function(e,t){var n=e,r=t,o=n.length,i=r.length,a=!1,s=null,l=o+1,c=[],u=[],d=[],f="",h=-1,p=0,m=1,v,w,b=function(){o>=i&&(v=n,w=o,n=r,r=v,o=i,i=w,a=!0,l=o+1)},x=function(R,T,M){return{x:R,y:T,k:M}},S=function(R,T){return{elem:R,t:T}},C=function(R,T,M){var A,k,F;for(T>M?A=c[R-1+l]:A=c[R+1+l],F=Math.max(T,M),k=F-R;k<o&&F<i&&n[k]===r[F];)++k,++F;return c[R+l]=u.length,u[u.length]=new x(k,F,A),F},N=function(R){var T,M,A;for(T=M=0,A=R.length-1;A>=0;--A)for(;T<R[A].x||M<R[A].y;)R[A].y-R[A].x>M-T?(a?d[d.length]=new S(r[M],h):d[d.length]=new S(r[M],m),++M):R[A].y-R[A].x<M-T?(a?d[d.length]=new S(n[T],m):d[d.length]=new S(n[T],h),++T):(d[d.length]=new S(n[T],p),f+=n[T],++T,++M)};return b(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return f},getses:function(){return d},compose:function(){var R,T,M,A,k,F,L,Y;for(R=i-o,T=o+i+3,M={},L=0;L<T;++L)M[L]=-1,c[L]=-1;A=-1;do{for(++A,Y=-A;Y<=R-1;++Y)M[Y+l]=C(Y,M[Y-1+l]+1,M[Y+1+l]);for(Y=R+A;Y>=R+1;--Y)M[Y+l]=C(Y,M[Y-1+l]+1,M[Y+1+l]);M[R+l]=C(R,M[R-1+l]+1,M[R+1+l])}while(M[R+l]!==i);for(s=R+2*A,k=c[R+l],F=[];k!==-1;)F[F.length]=new x(u[k].x,u[k].y,null),k=u[k].k;N(F)}}},V$=U$;function W$(e,t){var n=new V$(e,t);n.compose();for(var r=n.getses(),o,i,a=e.length-1,s=t.length-1,l=r.length-1;l>=0;--l)r[l].t===n.SES_COMMON?(i?(i.chain={file1index:a,file2index:s,chain:null},i=i.chain):(o={file1index:a,file2index:s,chain:null},i=o),a--,s--):r[l].t===n.SES_DELETE?a--:r[l].t===n.SES_ADD&&s--;var c={file1index:-1,file2index:-1,chain:null};return i?(i.chain=c,o):c}function L0(e,t){for(var n=[],r=e.length,o=t.length,i=W$(e,t);i!==null;i=i.chain){var a=r-i.file1index-1,s=o-i.file2index-1;r=i.file1index,o=i.file2index,(a||s)&&n.push({file1:[r+1,a],file2:[o+1,s]})}return n.reverse(),n}function G$(e,t,n){var r,o=L0(t,e),i=L0(t,n),a=[];function s(L,Y){a.push([L.file1[0],Y,L.file1[1],L.file2[0],L.file2[1]])}for(r=0;r<o.length;r++)s(o[r],0);for(r=0;r<i.length;r++)s(i[r],2);a.sort(function(L,Y){return L[0]-Y[0]});var l=[],c=0;function u(L){L>c&&(l.push([1,c,L-c]),c=L)}for(var d=0;d<a.length;d++){for(var f=d,h=a[d],p=h[0],m=p+h[2];d<a.length-1;){var v=a[d+1],w=v[0];if(w>m)break;m=Math.max(m,w+v[2]),d++}if(u(p),f==d)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[e.length,-1,t.length,-1],2:[n.length,-1,t.length,-1]};for(r=f;r<=d;r++){h=a[r];var x=h[1],S=b[x],C=h[0],N=C+h[2],R=h[3],T=R+h[4];S[0]=Math.min(R,S[0]),S[1]=Math.max(T,S[1]),S[2]=Math.min(C,S[2]),S[3]=Math.max(N,S[3])}var M=b[0][0]+(p-b[0][2]),A=b[0][1]+(m-b[0][3]),k=b[2][0]+(p-b[2][2]),F=b[2][1]+(m-b[2][3]);l.push([-1,M,A-M,p,m-p,k,F-k])}c=m}return u(t.length),l}function q$(e,t,n){var r=[],o=[e,t,n],i=G$(e,t,n),a=[];function s(){a.length&&r.push({ok:a}),a=[]}function l(h){for(var p=0;p<h.length;p++)a.push(h[p])}function c(h){if(h[2]!=h[6])return!0;for(var p=h[1],m=h[5],v=0;v<h[2];v++)if(e[v+p]!=n[v+m])return!0;return!1}for(var u=0;u<i.length;u++){var d=i[u],f=d[0];f==-1?c(d)?(s(),r.push({conflict:{a:e.slice(d[1],d[1]+d[2]),aIndex:d[1],o:t.slice(d[3],d[3]+d[4]),oIndex:d[3],b:n.slice(d[5],d[5]+d[6]),bIndex:d[5]}})):l(o[0].slice(d[1],d[1]+d[2])):l(o[f].slice(d[1],d[1]+d[2]))}return s(),r}var Y$=q$;const K$=Nn(Y$);class Ge extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const n=new Ge(t.message);return n.code=t.code,n.data=t.data,n.caller=t.caller,n.stack=t.stack,n}get isIsomorphicGitError(){return!0}}class ys extends Ge{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=ys.code,this.data={filepaths:t}}}ys.code="UnmergedPathsError";class De extends Ge{constructor(t){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=De.code,this.data={message:t}}}De.code="InternalError";class Mi extends Ge{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=Mi.code,this.data={filepath:t}}}Mi.code="UnsafeFilepathError";class fr{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const n=this.buffer.slice(this._start,this._start+t);return this._start+=t,n}toString(t,n){const r=this.buffer.toString(t,this._start,this._start+n);return this._start+=n,r}write(t,n,r){const o=this.buffer.write(t,this._start,n,r);return this._start+=n,o}copy(t,n,r){const o=t.copy(this.buffer,this._start,n,r);return this._start+=o,o}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const n=this.buffer.writeUInt8(t,this._start);return this._start+=1,n}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const n=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,n}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const n=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,n}}function Cc(e,t){return-(e<t)||+(e>t)}function z0(e,t){return Cc(e.path,t.path)}function B0(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let n=e&511;return n&73?n=493:n=420,t!==8&&(n=0),(t<<12)+n}const hr=2**32;function H0(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];n===void 0&&(n=r.valueOf());const o=Math.floor(n/1e3),i=(n-o*1e3)*1e6;return[o,i]}function Di(e){const[t,n]=H0(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,o]=H0(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%hr,ctimeNanoseconds:n%hr,mtimeSeconds:r%hr,mtimeNanoseconds:o%hr,dev:e.dev%hr,ino:e.ino%hr,mode:B0(e.mode%hr),uid:e.uid%hr,gid:e.gid%hr,size:e.size>-1?e.size%hr:0}}function X$(e){let t="";for(const n of new Uint8Array(e))n<16&&(t+="0"),t+=n.toString(16);return t}let Xf=null;async function kr(e){return Xf===null&&(Xf=await J$()),Xf?U0(e):Z$(e)}function Z$(e){return new Qv().update(e).digest("hex")}async function U0(e){const t=await crypto.subtle.digest("SHA-1",e);return X$(t)}async function J$(){try{if(await U0(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch{}return!1}function Q$(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function eF(e){const t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}class Ho{constructor(t,n){this._dirty=!1,this._unmergedPaths=n||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let n=this._entries.get(t.path);n||(this._entries.set(t.path,t),n=t),n.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return Ho.fromBuffer(t);if(t===null)return new Ho(null);throw new De("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new De("Index file is empty (.git/index)");const n=new Ho,r=new fr(t),o=r.toString("utf8",4);if(o!=="DIRC")throw new De(`Invalid dircache magic file number: ${o}`);const i=await kr(t.slice(0,-20)),a=t.slice(-20).toString("hex");if(a!==i)throw new De(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${i}`);const s=r.readUInt32BE();if(s!==2)throw new De(`Unsupported dircache version: ${s}`);const l=r.readUInt32BE();let c=0;for(;!r.eof()&&c<l;){const u={};u.ctimeSeconds=r.readUInt32BE(),u.ctimeNanoseconds=r.readUInt32BE(),u.mtimeSeconds=r.readUInt32BE(),u.mtimeNanoseconds=r.readUInt32BE(),u.dev=r.readUInt32BE(),u.ino=r.readUInt32BE(),u.mode=r.readUInt32BE(),u.uid=r.readUInt32BE(),u.gid=r.readUInt32BE(),u.size=r.readUInt32BE(),u.oid=r.slice(20).toString("hex");const d=r.readUInt16BE();u.flags=Q$(d);const f=t.indexOf(0,r.tell()+1)-r.tell();if(f<1)throw new De(`Got a path length of: ${f}`);if(u.path=r.toString("utf8",f),u.path.includes("..\\")||u.path.includes("../"))throw new Mi(u.path);let h=8-(r.tell()-12)%8;for(h===0&&(h=8);h--;){const p=r.readUInt8();if(p!==0)throw new De(`Expected 1-8 null characters but got '${p}' after ${u.path}`);if(r.eof())throw new De("Unexpected end of file")}u.stages=[],n._addEntry(u),c++}return n}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(z0)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(n=>n):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:n,oid:r,stage:o=0}){n||(n={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),n=Di(n);const i=Buffer.from(t),a={ctimeSeconds:n.ctimeSeconds,ctimeNanoseconds:n.ctimeNanoseconds,mtimeSeconds:n.mtimeSeconds,mtimeNanoseconds:n.mtimeNanoseconds,dev:n.dev,ino:n.ino,mode:n.mode||33188,uid:n.uid,gid:n.gid,size:n.size,path:t,oid:r,flags:{assumeValid:!1,extended:!1,stage:o,nameLength:i.length<4095?i.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const n of this._entries.keys())n.startsWith(t+"/")&&this._entries.delete(n);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(`
10
+ `)}static async _entryToBuffer(t){const n=Buffer.from(t.path),r=Math.ceil((62+n.length+1)/8)*8,o=Buffer.alloc(r),i=new fr(o),a=Di(t);return i.writeUInt32BE(a.ctimeSeconds),i.writeUInt32BE(a.ctimeNanoseconds),i.writeUInt32BE(a.mtimeSeconds),i.writeUInt32BE(a.mtimeNanoseconds),i.writeUInt32BE(a.dev),i.writeUInt32BE(a.ino),i.writeUInt32BE(a.mode),i.writeUInt32BE(a.uid),i.writeUInt32BE(a.gid),i.writeUInt32BE(a.size),i.write(t.oid,20,"hex"),i.writeUInt16BE(eF(t)),i.write(t.path,n.length,"utf8"),o}async toObject(){const t=Buffer.alloc(12),n=new fr(t);n.write("DIRC",4,"utf8"),n.writeUInt32BE(2),n.writeUInt32BE(this.entriesFlat.length);let r=[];for(const s of this.entries)if(r.push(Ho._entryToBuffer(s)),s.stages.length>1)for(const l of s.stages)l&&l!==s&&r.push(Ho._entryToBuffer(l));r=await Promise.all(r);const o=Buffer.concat(r),i=Buffer.concat([t,o]),a=await kr(i);return Buffer.concat([i,Buffer.from(a,"hex")])}}function Ec(e,t,n=!0,r=!0){const o=Di(e),i=Di(t);return n&&o.mode!==i.mode||o.mtimeSeconds!==i.mtimeSeconds||o.ctimeSeconds!==i.ctimeSeconds||o.uid!==i.uid||o.gid!==i.gid||r&&o.ino!==i.ino||o.size!==i.size}let Zf=null;const Ai=Symbol("IndexCache");function tF(){return{map:new Map,stats:new Map}}async function nF(e,t,n){const r=await e.lstat(t),o=await e.read(t),i=await Ho.from(o);n.map.set(t,i),n.stats.set(t,r)}async function rF(e,t,n){const r=n.stats.get(t);if(r===void 0)return!0;const o=await e.lstat(t);return r===null||o===null?!1:Ec(r,o)}class Rt{static async acquire({fs:t,gitdir:n,cache:r,allowUnmerged:o=!0},i){r[Ai]||(r[Ai]=tF());const a=`${n}/index`;Zf===null&&(Zf=new ts({maxPending:1/0}));let s,l=[];return await Zf.acquire(a,async()=>{await rF(t,a,r[Ai])&&await nF(t,a,r[Ai]);const c=r[Ai].map.get(a);if(l=c.unmergedPaths,l.length&&!o)throw new ys(l);if(s=await i(c),c._dirty){const u=await c.toObject();await t.write(a,u),r[Ai].stats.set(a,await t.lstat(a)),c._dirty=!1}}),s}}function Pc(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function ki(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function V0(e){const t=new Map,n=function(o){if(!t.has(o)){const i={type:"tree",fullpath:o,basename:Pc(o),metadata:{},children:[]};t.set(o,i),i.parent=n(ki(o)),i.parent&&i.parent!==i&&i.parent.children.push(i)}return t.get(o)},r=function(o,i){if(!t.has(o)){const a={type:"blob",fullpath:o,basename:Pc(o),metadata:i,parent:n(ki(o)),children:[]};a.parent&&a.parent.children.push(a),t.set(o,a)}return t.get(o)};n(".");for(const o of e)r(o.path,o);return t}function oF(e){switch(e){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new De(`Unexpected GitTree entry mode: ${e.toString(8)}`)}class iF{constructor({fs:t,gitdir:n,cache:r}){this.treePromise=Rt.acquire({fs:t,gitdir:n,cache:r},async function(i){return V0(i.entries)});const o=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}}}async readdir(t){const n=t._fullpath,o=(await this.treePromise).get(n);if(!o||o.type==="blob")return null;if(o.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${n}'`);const i=o.children.map(a=>a.fullpath);return i.sort(Cc),i}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){const r=(await this.treePromise).get(t._fullpath);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const o=r.type==="tree"?{}:Di(r.metadata);t._type=r.type==="tree"?"tree":oF(o.mode),t._mode=o.mode,r.type==="tree"?t._stat=void 0:t._stat=o}return t._stat}async content(t){}async oid(t){if(t._oid===!1){const r=(await this.treePromise).get(t._fullpath);t._oid=r.metadata.oid}return t._oid}}const Rc=Symbol("GitWalkSymbol");function Ii(){const e=Object.create(null);return Object.defineProperty(e,Rc,{value:function({fs:t,gitdir:n,cache:r}){return new iF({fs:t,gitdir:n,cache:r})}}),Object.freeze(e),e}class ot extends Ge{constructor(t){super(`Could not find ${t}.`),this.code=this.name=ot.code,this.data={what:t}}}ot.code="NotFoundError";class Yt extends Ge{constructor(t,n,r,o){super(`Object ${t} ${o?`at ${o}`:""}was anticipated to be a ${r} but it is a ${n}.`),this.code=this.name=Yt.code,this.data={oid:t,actual:n,expected:r,filepath:o}}}Yt.code="ObjectTypeError";class to extends Ge{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=to.code,this.data={value:t}}}to.code="InvalidOidError";class bs extends Ge{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
11
11
  [remote "${t}"]
12
12
  fetch = +refs/heads/*:refs/remotes/origin/*
13
- `),this.code=this.name=Zn.code,this.data={remote:t}}}Zn.code="NoRefspecError";class Ji{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let r=null;this.parsedConfig=t.trim().split(`
14
- `).map(n=>{if(/^\s*#/.test(n))return{line:n,comment:!0};const i=n.indexOf(" ");if(n.startsWith("^")){const a=n.slice(1);return this.refs.set(r+"^{}",a),{line:n,ref:r,peeled:a}}else{const a=n.slice(0,i);return r=n.slice(i+1),this.refs.set(r,a),{line:n,ref:r,oid:a}}})}return this}static from(t){return new Ji(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join(`
13
+ `),this.code=this.name=bs.code,this.data={remote:t}}}bs.code="NoRefspecError";class Nc{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let n=null;this.parsedConfig=t.trim().split(`
14
+ `).map(r=>{if(/^\s*#/.test(r))return{line:r,comment:!0};const o=r.indexOf(" ");if(r.startsWith("^")){const i=r.slice(1);return this.refs.set(n+"^{}",i),{line:r,ref:n,peeled:i}}else{const i=r.slice(0,o);return n=r.slice(o+1),this.refs.set(n,i),{line:r,ref:n,oid:i}}})}return this}static from(t){return new Nc(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(n=>n.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join(`
15
15
  `)+`
16
- `}}class Qi{constructor({remotePath:t,localPath:r,force:n,matchPrefix:i}){Object.assign(this,{remotePath:t,localPath:r,force:n,matchPrefix:i})}static from(t){const[r,n,i,a,o]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s=r==="+",l=i==="*";if(l!==(o==="*"))throw new ce("Invalid refspec");return new Qi({remotePath:n,localPath:a,force:s,matchPrefix:l})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class Fo{constructor(t=[]){this.rules=t}static from(t){const r=[];for(const n of t)r.push(Qi.from(n));return new Fo(r)}add(t){const r=Qi.from(t);this.rules.push(r)}translate(t){const r=[];for(const n of this.rules)for(const i of t){const a=n.translate(i);a&&r.push([i,a])}return r}translateOne(t){let r=null;for(const n of this.rules){const i=n.translate(t);i&&(r=i)}return r}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function _w(e,t){const r=e.replace(/\^\{\}$/,""),n=t.replace(/\^\{\}$/,""),i=-(r<n)||+(r>n);return i===0?e.endsWith("^{}")?1:-1:i}const vw=e=>{e=e.toLowerCase();let t=parseInt(e);return e.endsWith("k")&&(t*=1024),e.endsWith("m")&&(t*=1024*1024),e.endsWith("g")&&(t*=1024*1024*1024),t},Vn=e=>{if(e=e.trim().toLowerCase(),e==="true"||e==="yes"||e==="on")return!0;if(e==="false"||e==="no"||e==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},Su={core:{filemode:Vn,bare:Vn,logallrefupdates:Vn,symlinks:Vn,ignorecase:Vn,bigFileThreshold:vw}},xw=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,Ew=/^[A-Za-z0-9-.]+$/,Sw=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,kw=/^[A-Za-z][A-Za-z-]*$/,Rw=/^(.*?)( *[#;].*)$/,Ow=e=>{const t=xw.exec(e);if(t!=null){const[r,n]=t.slice(1);return[r,n]}return null},Cw=e=>{const t=Sw.exec(e);if(t!=null){const[r,n="true"]=t.slice(1),i=Tw(n),a=Pw(i);return[r,a]}return null},Tw=e=>{const t=Rw.exec(e);if(t==null)return e;const[r,n]=t.slice(1);return ku(r)&&ku(n)?`${r}${n}`:r},ku=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!==0,Pw=e=>e.split("").reduce((t,r,n,i)=>{const a=r==='"'&&i[n-1]!=="\\",o=r==="\\"&&i[n+1]==='"';return a||o?t:t+r},""),Ru=e=>e!=null?e.toLowerCase():null,Uo=(e,t,r)=>[Ru(e),t,Ru(r)].filter(n=>n!=null).join("."),Ou=e=>{const t=e.split("."),r=t.shift(),n=t.pop(),i=t.length?t.join("."):void 0;return{section:r,subsection:i,name:n,path:Uo(r,i,n),sectionPath:Uo(r,i,null)}},Aw=(e,t)=>e.reduce((r,n,i)=>t(n)?i:r,-1);class Ho{constructor(t){let r=null,n=null;this.parsedConfig=t?t.split(`
17
- `).map(i=>{let a=null,o=null;const s=i.trim(),l=Ow(s),c=l!=null;if(c)[r,n]=l;else{const d=Cw(s);d!=null&&([a,o]=d)}const u=Uo(r,n,a);return{line:i,isSection:c,section:r,subsection:n,name:a,value:o,path:u}}):[]}static from(t){return new Ho(t)}async get(t,r=!1){const n=Ou(t).path,i=this.parsedConfig.filter(a=>a.path===n).map(({section:a,name:o,value:s})=>{const l=Su[a]&&Su[a][o];return l?l(s):s});return r?i:i.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(r=>r.section===t&&r.isSection).map(r=>r.subsection)}async deleteSection(t,r){this.parsedConfig=this.parsedConfig.filter(n=>!(n.section===t&&n.subsection===r))}async append(t,r){return this.set(t,r,!0)}async set(t,r,n=!1){const{section:i,subsection:a,name:o,path:s,sectionPath:l}=Ou(t),c=Aw(this.parsedConfig,u=>u.path===s);if(r==null)c!==-1&&this.parsedConfig.splice(c,1);else if(c!==-1){const u=this.parsedConfig[c],d=Object.assign({},u,{name:o,value:r,modified:!0});n?this.parsedConfig.splice(c+1,0,d):this.parsedConfig[c]=d}else{const u=this.parsedConfig.findIndex(p=>p.path===l),d={section:i,subsection:a,name:o,value:r,modified:!0,path:s};if(Ew.test(i)&&kw.test(o))if(u>=0)this.parsedConfig.splice(u+1,0,d);else{const p={section:i,subsection:a,modified:!0,path:l};this.parsedConfig.push(p,d)}}}toString(){return this.parsedConfig.map(({line:t,section:r,subsection:n,name:i,value:a,modified:o=!1})=>o?i!=null&&a!=null?typeof a=="string"&&/[#;]/.test(a)?` ${i} = "${a}"`:` ${i} = ${a}`:n!=null?`[${r} "${n}"]`:`[${r}]`:t).join(`
18
- `)}}class Le{static async get({fs:t,gitdir:r}){const n=await t.read(`${r}/config`,{encoding:"utf8"});return Ho.from(n)}static async save({fs:t,gitdir:r,config:n}){await t.write(`${r}/config`,n.toString(),{encoding:"utf8"})}}const ea=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],$w=["config","description","index","shallow","commondir"];let Wo;async function ur(e,t){return Wo===void 0&&(Wo=new Pn),Wo.acquire(e,t)}class U{static async updateRemoteRefs({fs:t,gitdir:r,remote:n,refs:i,symrefs:a,tags:o,refspecs:s=void 0,prune:l=!1,pruneTags:c=!1}){for(const x of i.values())if(!x.match(/[0-9a-f]{40}/))throw new lr(x);const u=await Le.get({fs:t,gitdir:r});if(!s){if(s=await u.getall(`remote.${n}.fetch`),s.length===0)throw new Zn(n);s.unshift(`+HEAD:refs/remotes/${n}/HEAD`)}const d=Fo.from(s),p=new Map;if(c){const x=await U.listRefs({fs:t,gitdir:r,filepath:"refs/tags"});await U.deleteRefs({fs:t,gitdir:r,refs:x.map(y=>`refs/tags/${y}`)})}if(o){for(const x of i.keys())if(x.startsWith("refs/tags")&&!x.endsWith("^{}")&&!await U.exists({fs:t,gitdir:r,ref:x})){const y=i.get(x);p.set(x,y)}}const m=d.translate([...i.keys()]);for(const[x,y]of m){const v=i.get(x);p.set(y,v)}const g=d.translate([...a.keys()]);for(const[x,y]of g){const v=a.get(x),O=d.translateOne(v);O&&p.set(y,`ref: ${O}`)}const _=[];if(l){for(const x of d.localNamespaces()){const y=(await U.listRefs({fs:t,gitdir:r,filepath:x})).map(v=>`${x}/${v}`);for(const v of y)p.has(v)||_.push(v)}_.length>0&&await U.deleteRefs({fs:t,gitdir:r,refs:_})}for(const[x,y]of p)await ur(x,async()=>t.write(N.join(r,x),`${y.trim()}
19
- `,"utf8"));return{pruned:_}}static async writeRef({fs:t,gitdir:r,ref:n,value:i}){if(!i.match(/[0-9a-f]{40}/))throw new lr(i);await ur(n,async()=>t.write(N.join(r,n),`${i.trim()}
20
- `,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:r,ref:n,value:i}){await ur(n,async()=>t.write(N.join(r,n),`ref: ${i.trim()}
21
- `,"utf8"))}static async deleteRef({fs:t,gitdir:r,ref:n}){return U.deleteRefs({fs:t,gitdir:r,refs:[n]})}static async deleteRefs({fs:t,gitdir:r,refs:n}){await Promise.all(n.map(s=>t.rm(N.join(r,s))));let i=await ur("packed-refs",async()=>t.read(`${r}/packed-refs`,{encoding:"utf8"}));const a=Ji.from(i),o=a.refs.size;for(const s of n)a.refs.has(s)&&a.delete(s);a.refs.size<o&&(i=a.toString(),await ur("packed-refs",async()=>t.write(`${r}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:r,ref:n,depth:i=void 0}){if(i!==void 0&&(i--,i===-1))return n;if(n.startsWith("ref: "))return n=n.slice(5),U.resolve({fs:t,gitdir:r,ref:n,depth:i});if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;const a=await U.packedRefs({fs:t,gitdir:r}),o=ea(n).filter(s=>!$w.includes(s));for(const s of o){const l=await ur(s,async()=>await t.read(`${r}/${s}`,{encoding:"utf8"})||a.get(s));if(l)return U.resolve({fs:t,gitdir:r,ref:l.trim(),depth:i})}throw new Oe(n)}static async exists({fs:t,gitdir:r,ref:n}){try{return await U.expand({fs:t,gitdir:r,ref:n}),!0}catch{return!1}}static async expand({fs:t,gitdir:r,ref:n}){if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;const i=await U.packedRefs({fs:t,gitdir:r}),a=ea(n);for(const o of a)if(await ur(o,async()=>t.exists(`${r}/${o}`))||i.has(o))return o;throw new Oe(n)}static async expandAgainstMap({ref:t,map:r}){const n=ea(t);for(const i of n)if(await r.has(i))return i;throw new Oe(t)}static resolveAgainstMap({ref:t,fullref:r=t,depth:n=void 0,map:i}){if(n!==void 0&&(n--,n===-1))return{fullref:r,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),U.resolveAgainstMap({ref:t,fullref:r,depth:n,map:i});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:r,oid:t};const a=ea(t);for(const o of a){const s=i.get(o);if(s)return U.resolveAgainstMap({ref:s.trim(),fullref:o,depth:n,map:i})}throw new Oe(t)}static async packedRefs({fs:t,gitdir:r}){const n=await ur("packed-refs",async()=>t.read(`${r}/packed-refs`,{encoding:"utf8"}));return Ji.from(n).refs}static async listRefs({fs:t,gitdir:r,filepath:n}){const i=U.packedRefs({fs:t,gitdir:r});let a=null;try{a=await t.readdirDeep(`${r}/${n}`),a=a.map(o=>o.replace(`${r}/${n}/`,""))}catch{a=[]}for(let o of(await i).keys())o.startsWith(n)&&(o=o.replace(n+"/",""),a.includes(o)||a.push(o));return a.sort(_w),a}static async listBranches({fs:t,gitdir:r,remote:n}){return n?U.listRefs({fs:t,gitdir:r,filepath:`refs/remotes/${n}`}):U.listRefs({fs:t,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:r}){return(await U.listRefs({fs:t,gitdir:r,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}}function Dw(e,t){return Xi(Cu(e),Cu(t))}function Cu(e){return e.mode==="040000"?e.path+"/":e.path}function Tu(e){switch(e){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new ce(`Unexpected GitTree entry mode: ${e}`)}function Iw(e){const t=[];let r=0;for(;r<e.length;){const n=e.indexOf(32,r);if(n===-1)throw new ce(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);const i=e.indexOf(0,r);if(i===-1)throw new ce(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let a=e.slice(r,n).toString("utf8");a==="40000"&&(a="040000");const o=Tu(a),s=e.slice(n+1,i).toString("utf8");if(s.includes("\\")||s.includes("/"))throw new Qr(s);const l=e.slice(i+1,i+21).toString("hex");r=i+21,t.push({mode:a,path:s,oid:l,type:o})}return t}function jw(e){if(typeof e=="number"&&(e=e.toString(8)),e.match(/^0?4.*/))return"040000";if(e.match(/^1006.*/))return"100644";if(e.match(/^1007.*/))return"100755";if(e.match(/^120.*/))return"120000";if(e.match(/^160.*/))return"160000";throw new ce(`Could not understand file mode: ${e}`)}function Bw(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=jw(e.mode),e.type||(e.type=Tu(e.mode)),e}class ct{constructor(t){if(Buffer.isBuffer(t))this._entries=Iw(t);else if(Array.isArray(t))this._entries=t.map(Bw);else throw new ce("invalid type passed to GitTree constructor");this._entries.sort(bu)}static from(t){return new ct(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join(`
22
- `)}toObject(){const t=[...this._entries];return t.sort(Dw),Buffer.concat(t.map(r=>{const n=Buffer.from(r.mode.replace(/^0/,"")),i=Buffer.from(" "),a=Buffer.from(r.path,"utf8"),o=Buffer.from([0]),s=Buffer.from(r.oid,"hex");return Buffer.concat([n,i,a,o,s])}))}entries(){return this._entries}*[Symbol.iterator](){for(const t of this._entries)yield t}}class an{static wrap({type:t,object:r}){return Buffer.concat([Buffer.from(`${t} ${r.byteLength.toString()}\0`),Buffer.from(r)])}static unwrap(t){const r=t.indexOf(32),n=t.indexOf(0),i=t.slice(0,r).toString("utf8"),a=t.slice(r+1,n).toString("utf8"),o=t.length-(n+1);if(parseInt(a)!==o)throw new ce(`Length mismatch: expected ${a} bytes but got ${o} instead.`);return{type:i,object:Buffer.from(t.slice(n+1))}}}async function Pu({fs:e,gitdir:t,oid:r}){const n=`objects/${r.slice(0,2)}/${r.slice(2)}`,i=await e.read(`${t}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function zw(e,t){const r=new Lt(e),n=Au(r);if(n!==t.byteLength)throw new ce(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${t.length} bytes`);const i=Au(r);let a;const o=Du(r,t);if(o.byteLength===i)a=o;else{a=Buffer.alloc(i);const s=new Lt(a);for(s.copy(o);!r.eof();)s.copy(Du(r,t));const l=s.tell();if(i!==l)throw new ce(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return a}function Au(e){let t=0,r=0,n=null;do n=e.readUInt8(),t|=(n&127)<<r,r+=7;while(n&128);return t}function $u(e,t,r){let n=0,i=0;for(;r--;)t&1&&(n|=e.readUInt8()<<i),t>>=1,i+=8;return n}function Du(e,t){const r=e.readUInt8(),n=128,i=15,a=112;if(r&n){const o=$u(e,r&i,4);let s=$u(e,(r&a)>>4,3);return s===0&&(s=65536),t.slice(o,o+s)}else return e.slice(r)}function Nw(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function Iu(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:Nw(e)}class ju{constructor(t){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=Iu(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:r}=await this.stream.next();return t&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;const r=[this.buffer];for(;this.cursor+t>Mw(r);){const n=await this._next();if(this._ended)break;r.push(n)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}}function Mw(e){return e.reduce((t,r)=>t+r.length,0)}async function Lw(e,t){const r=new ju(e);let n=await r.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new ce(`Invalid PACK header '${n}'`);let i=await r.read(4);if(i=i.readUInt32BE(0),i!==2)throw new ce(`Invalid packfile version: ${i}`);let a=await r.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!r.eof()&&a--;){const o=r.tell(),{type:s,length:l,ofs:c,reference:u}=await Fw(r),d=new Do.Inflate;for(;!d.result;){const p=await r.chunk();if(!p)break;if(d.push(p,!1),d.err)throw new ce(`Pako error: ${d.msg}`);if(d.result){if(d.result.length!==l)throw new ce("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(p.length-d.strm.avail_in);const m=r.tell();await t({data:d.result,type:s,num:a,offset:o,end:m,reference:u,ofs:c})}}}}async function Fw(e){let t=await e.byte();const r=t>>4&7;let n=t&15;if(t&128){let o=4;do t=await e.byte(),n|=(t&127)<<o,o+=7;while(t&128)}let i,a;if(r===6){let o=0;i=0;const s=[];do t=await e.byte(),i|=(t&127)<<o,o+=7,s.push(t);while(t&128);a=Buffer.from(s)}return r===7&&(a=await e.read(20)),{type:r,length:n,ofs:i,reference:a}}async function Bu(e){return Do.inflate(e)}function Uw(e){const t=[];let r=0,n=0;do{r=e.readUInt8();const i=r&127;t.push(i),n=r&128}while(n);return t.reduce((i,a)=>i+1<<7|a,-1)}function Hw(e,t){let r=t,n=4,i=null;do i=e.readUInt8(),r|=(i&127)<<n,n+=7;while(i&128);return r}class on{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:r}){const n=new Lt(t);if(n.slice(4).toString("hex")!=="ff744f63")return;const a=n.readUInt32BE();if(a!==2)throw new ce(`Unable to read version ${a} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2048*1024*1024)throw new ce("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");n.seek(n.tell()+4*255);const o=n.readUInt32BE(),s=[];for(let u=0;u<o;u++){const d=n.slice(20).toString("hex");s[u]=d}n.seek(n.tell()+4*o);const l=new Map;for(let u=0;u<o;u++)l.set(s[u],n.readUInt32BE());const c=n.slice(20).toString("hex");return new on({hashes:s,crcs:{},offsets:l,packfileSha:c,getExternalRefDelta:r})}static async fromPack({pack:t,getExternalRefDelta:r,onProgress:n}){const i={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},a={},o=t.slice(-20).toString("hex"),s=[],l={},c=new Map;let u=null,d=null;await Lw([t],async({data:x,type:y,reference:v,offset:O,num:R})=>{u===null&&(u=R);const b=Math.floor((u-R)*100/u);b!==d&&n&&await n({phase:"Receiving objects",loaded:u-R,total:u}),d=b,y=i[y],["commit","tree","blob","tag"].includes(y)?a[O]={type:y,offset:O}:y==="ofs-delta"?a[O]={type:y,offset:O}:y==="ref-delta"&&(a[O]={type:y,offset:O})});const p=Object.keys(a).map(Number);for(const[x,y]of p.entries()){const v=x+1===p.length?t.byteLength-20:p[x+1],O=a[y],R=Mp.buf(t.slice(y,v))>>>0;O.end=v,O.crc=R}const m=new on({pack:Promise.resolve(t),packfileSha:o,crcs:l,hashes:s,offsets:c,getExternalRefDelta:r});d=null;let g=0;const _=[0,0,0,0,0,0,0,0,0,0,0,0];for(let x in a){x=Number(x);const y=Math.floor(g*100/u);y!==d&&n&&await n({phase:"Resolving deltas",loaded:g,total:u}),g++,d=y;const v=a[x];if(!v.oid)try{m.readDepth=0,m.externalReadDepth=0;const{type:O,object:R}=await m.readSlice({start:x});_[m.readDepth]+=1;const b=await Vt(an.wrap({type:O,object:R}));v.oid=b,s.push(b),c.set(b,x),l[b]=v.crc}catch{continue}}return s.sort(),m}async toBuffer(){const t=[],r=(c,u)=>{t.push(Buffer.from(c,u))};r("ff744f63","hex"),r("00000002","hex");const n=new Lt(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(const d of this.hashes)parseInt(d.slice(0,2),16)<=c&&u++;n.writeUInt32BE(u)}t.push(n.buffer);for(const c of this.hashes)r(c,"hex");const i=new Lt(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)i.writeUInt32BE(this.crcs[c]);t.push(i.buffer);const a=new Lt(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)a.writeUInt32BE(this.offsets.get(c));t.push(a.buffer),r(this.packfileSha,"hex");const o=Buffer.concat(t),s=await Vt(o),l=Buffer.alloc(20);return l.write(s,"hex"),Buffer.concat([o,l])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new ce(`Could not read object ${t} from packfile`)}const r=this.offsets.get(t);return this.readSlice({start:r})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;const r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new ce("Tried to read from a GitPackIndex with no packfile loaded into memory");const n=(await this.pack).slice(t),i=new Lt(n),a=i.readUInt8(),o=a&112;let s=r[o];if(s===void 0)throw new ce("Unrecognized type: 0b"+o.toString(2));const l=a&15;let c=l;a&128&&(c=Hw(i,l));let d=null,p=null;if(s==="ofs_delta"){const g=Uw(i),_=t-g;({object:d,type:s}=await this.readSlice({start:_}))}if(s==="ref_delta"){const g=i.slice(20).toString("hex");({object:d,type:s}=await this.read({oid:g}))}const m=n.slice(i.tell());if(p=Buffer.from(await Bu(m)),p.byteLength!==c)throw new ce(`Packfile told us object would have length ${c} but it had length ${p.byteLength}`);return d&&(p=Buffer.from(zw(p,d))),this.readDepth>3&&(this.offsetCache[t]={type:s,object:p}),{type:s,format:"content",object:p}}}const ta=Symbol("PackfileCache");async function Ww({fs:e,filename:t,getExternalRefDelta:r,emitter:n,emitterPrefix:i}){const a=await e.read(t);return on.fromIdx({idx:a,getExternalRefDelta:r})}function Go({fs:e,cache:t,filename:r,getExternalRefDelta:n,emitter:i,emitterPrefix:a}){t[ta]||(t[ta]=new Map);let o=t[ta].get(r);return o||(o=Ww({fs:e,filename:r,getExternalRefDelta:n,emitter:i,emitterPrefix:a}),t[ta].set(r,o)),o}async function Gw({fs:e,cache:t,gitdir:r,oid:n,format:i="content",getExternalRefDelta:a}){let o=await e.readdir(N.join(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(const s of o){const l=`${r}/objects/pack/${s}`,c=await Go({fs:e,cache:t,filename:l,getExternalRefDelta:a});if(c.error)throw new ce(c.error);if(c.offsets.has(n)){if(!c.pack){const d=l.replace(/idx$/,"pack");c.pack=e.read(d)}const u=await c.read({oid:n,getExternalRefDelta:a});return u.format="content",u.source=`objects/pack/${s.replace(/idx$/,"pack")}`,u}}return null}async function De({fs:e,cache:t,gitdir:r,oid:n,format:i="content"}){const a=u=>De({fs:e,cache:t,gitdir:r,oid:u});let o;if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(o={format:"wrapped",object:Buffer.from("tree 0\0")}),o||(o=await Pu({fs:e,gitdir:r,oid:n})),!o){if(o=await Gw({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:a}),!o)throw new Oe(n);return o}if(i==="deflated"||(o.format==="deflated"&&(o.object=Buffer.from(await Bu(o.object)),o.format="wrapped"),i==="wrapped"))return o;const s=await Vt(o.object);if(s!==n)throw new ce(`SHA check failed! Expected ${n}, computed ${s}`);const{object:l,type:c}=an.unwrap(o.object);if(o.type=c,o.object=l,o.format="content",i==="content")return o;throw new ce(`invalid requested format "${i}"`)}class Ot extends ye{constructor(t,r,n=!0){super(`Failed to create ${t} at ${r} because it already exists.${n?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=Ot.code,this.data={noun:t,where:r,canForce:n}}}Ot.code="AlreadyExistsError";class Kn extends ye{constructor(t,r,n){super(`Found multiple ${t} matching "${r}" (${n.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=Kn.code,this.data={nouns:t,short:r,matches:n}}}Kn.code="AmbiguousError";class Jn extends ye{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=Jn.code,this.data={filepaths:t}}}Jn.code="CheckoutConflictError";class Qn extends ye{constructor(t,r){super(`Failed to checkout "${t}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Qn.code,this.data={ref:t,oid:r}}}Qn.code="CommitNotFetchedError";class ei extends ye{constructor(){super("Empty response from git server."),this.code=this.name=ei.code,this.data={}}}ei.code="EmptyServerResponseError";class ti extends ye{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=ti.code,this.data={}}}ti.code="FastForwardError";class ri extends ye{constructor(t,r){super(`One or more branches were not updated: ${t}`),this.code=this.name=ri.code,this.data={prettyDetails:t,result:r}}}ri.code="GitPushError";class sn extends ye{constructor(t,r,n){super(`HTTP Error: ${t} ${r}`),this.code=this.name=sn.code,this.data={statusCode:t,statusMessage:r,response:n}}}sn.code="HttpError";class fr extends ye{constructor(t){let r="invalid filepath";t==="leading-slash"||t==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=fr.code,this.data={reason:t}}}fr.code="InvalidFilepathError";class Ct extends ye{constructor(t,r){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=Ct.code,this.data={ref:t,suggestion:r}}}Ct.code="InvalidRefNameError";class ni extends ye{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=ni.code,this.data={depth:t}}}ni.code="MaxDepthError";class cn extends ye{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=cn.code,this.data={}}}cn.code="MergeNotSupportedError";class ln extends ye{constructor(t,r,n,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=ln.code,this.data={filepaths:t,bothModified:r,deleteByUs:n,deleteByTheirs:i}}}ln.code="MergeConflictError";class Ke extends ye{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=Ke.code,this.data={role:t}}}Ke.code="MissingNameError";class lt extends ye{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=lt.code,this.data={parameter:t}}}lt.code="MissingParameterError";class ii extends ye{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=ii.code,this.data={errors:t},this.errors=t}}ii.code="MultipleGitError";class $r extends ye{constructor(t,r){super(`Expected "${t}" but received "${r}".`),this.code=this.name=$r.code,this.data={expected:t,actual:r}}}$r.code="ParseError";class un extends ye{constructor(t){let r="";t==="not-fast-forward"?r=" because it was not a simple fast-forward":t==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=un.code,this.data={reason:t}}}un.code="PushRejectedError";class dr extends ye{constructor(t,r){super(`Remote does not support the "${t}" so the "${r}" parameter cannot be used.`),this.code=this.name=dr.code,this.data={capability:t,parameter:r}}}dr.code="RemoteCapabilityError";class ai extends ye{constructor(t,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=ai.code,this.data={preview:t,response:r}}}ai.code="SmartHttpError";class oi extends ye{constructor(t,r,n){super(`Git remote "${t}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=oi.code,this.data={url:t,transport:r,suggestion:n}}}oi.code="UnknownTransportError";class si extends ye{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=si.code,this.data={url:t}}}si.code="UrlParseError";class fn extends ye{constructor(){super("The operation was canceled."),this.code=this.name=fn.code,this.data={}}}fn.code="UserCanceledError";class ci extends ye{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=ci.code,this.data={filepath:t}}}ci.code="IndexResetError";class li extends ye{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=li.code,this.data={ref:t}}}li.code="NoCommitError";var qw=Object.freeze({__proto__:null,AlreadyExistsError:Ot,AmbiguousError:Kn,CheckoutConflictError:Jn,CommitNotFetchedError:Qn,EmptyServerResponseError:ei,FastForwardError:ti,GitPushError:ri,HttpError:sn,InternalError:ce,InvalidFilepathError:fr,InvalidOidError:lr,InvalidRefNameError:Ct,MaxDepthError:ni,MergeNotSupportedError:cn,MergeConflictError:ln,MissingNameError:Ke,MissingParameterError:lt,MultipleGitError:ii,NoRefspecError:Zn,NotFoundError:Oe,ObjectTypeError:rt,ParseError:$r,PushRejectedError:un,RemoteCapabilityError:dr,SmartHttpError:ai,UnknownTransportError:oi,UnsafeFilepathError:Qr,UrlParseError:si,UserCanceledError:fn,UnmergedPathsError:Xn,IndexResetError:ci,NoCommitError:li});function qo({name:e,email:t,timestamp:r,timezoneOffset:n}){return n=Yw(n),`${e} <${t}> ${r} ${n}`}function Yw(e){const t=Xw(Zw(e));e=Math.abs(e);const r=Math.floor(e/60);e-=r*60;let n=String(r),i=String(e);return n.length<2&&(n="0"+n),i.length<2&&(i="0"+i),(t===-1?"-":"+")+n+i}function Xw(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function Zw(e){return e===0?e:-e}function Kt(e){return e=e.replace(/\r/g,""),e=e.replace(/^\n+/,""),e=e.replace(/\n+$/,"")+`
23
- `,e}function ra(e){const[,t,r,n,i]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:r,timestamp:Number(n),timezoneOffset:Vw(i)}}function Vw(e){let[,t,r,n]=e.match(/(\+|-)(\d\d)(\d\d)/);return n=(t==="+"?1:-1)*(Number(r)*60+Number(n)),Kw(n)}function Kw(e){return e===0?e:-e}class nt{constructor(t){if(typeof t=="string")this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else if(typeof t=="object")this._tag=nt.render(t);else throw new ce("invalid type passed to GitAnnotatedTag constructor")}static from(t){return new nt(t)}static render(t){return`object ${t.object}
16
+ `}}class Tc{constructor({remotePath:t,localPath:n,force:r,matchPrefix:o}){Object.assign(this,{remotePath:t,localPath:n,force:r,matchPrefix:o})}static from(t){const[n,r,o,i,a]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s=n==="+",l=o==="*";if(l!==(a==="*"))throw new De("Invalid refspec");return new Tc({remotePath:r,localPath:i,force:s,matchPrefix:l})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class Jf{constructor(t=[]){this.rules=t}static from(t){const n=[];for(const r of t)n.push(Tc.from(r));return new Jf(n)}add(t){const n=Tc.from(t);this.rules.push(n)}translate(t){const n=[];for(const r of this.rules)for(const o of t){const i=r.translate(o);i&&n.push([o,i])}return n}translateOne(t){let n=null;for(const r of this.rules){const o=r.translate(t);o&&(n=o)}return n}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function aF(e,t){const n=e.replace(/\^\{\}$/,""),r=t.replace(/\^\{\}$/,""),o=-(n<r)||+(n>r);return o===0?e.endsWith("^{}")?1:-1:o}const sF=e=>{e=e.toLowerCase();let t=parseInt(e);return e.endsWith("k")&&(t*=1024),e.endsWith("m")&&(t*=1024*1024),e.endsWith("g")&&(t*=1024*1024*1024),t},xs=e=>{if(e=e.trim().toLowerCase(),e==="true"||e==="yes"||e==="on")return!0;if(e==="false"||e==="no"||e==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},W0={core:{filemode:xs,bare:xs,logallrefupdates:xs,symlinks:xs,ignorecase:xs,bigFileThreshold:sF}},lF=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,cF=/^[A-Za-z0-9-.]+$/,uF=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,dF=/^[A-Za-z][A-Za-z-]*$/,fF=/^(.*?)( *[#;].*)$/,hF=e=>{const t=lF.exec(e);if(t!=null){const[n,r]=t.slice(1);return[n,r]}return null},pF=e=>{const t=uF.exec(e);if(t!=null){const[n,r="true"]=t.slice(1),o=mF(r),i=gF(o);return[n,i]}return null},mF=e=>{const t=fF.exec(e);if(t==null)return e;const[n,r]=t.slice(1);return G0(n)&&G0(r)?`${n}${r}`:n},G0=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!==0,gF=e=>e.split("").reduce((t,n,r,o)=>{const i=n==='"'&&o[r-1]!=="\\",a=n==="\\"&&o[r+1]==='"';return i||a?t:t+n},""),q0=e=>e!=null?e.toLowerCase():null,Qf=(e,t,n)=>[q0(e),t,q0(n)].filter(r=>r!=null).join("."),Y0=e=>{const t=e.split("."),n=t.shift(),r=t.pop(),o=t.length?t.join("."):void 0;return{section:n,subsection:o,name:r,path:Qf(n,o,r),sectionPath:Qf(n,o,null)}},wF=(e,t)=>e.reduce((n,r,o)=>t(r)?o:n,-1);class eh{constructor(t){let n=null,r=null;this.parsedConfig=t?t.split(`
17
+ `).map(o=>{let i=null,a=null;const s=o.trim(),l=hF(s),c=l!=null;if(c)[n,r]=l;else{const d=pF(s);d!=null&&([i,a]=d)}const u=Qf(n,r,i);return{line:o,isSection:c,section:n,subsection:r,name:i,value:a,path:u}}):[]}static from(t){return new eh(t)}async get(t,n=!1){const r=Y0(t).path,o=this.parsedConfig.filter(i=>i.path===r).map(({section:i,name:a,value:s})=>{const l=W0[i]&&W0[i][a];return l?l(s):s});return n?o:o.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(n=>n.section===t&&n.isSection).map(n=>n.subsection)}async deleteSection(t,n){this.parsedConfig=this.parsedConfig.filter(r=>!(r.section===t&&r.subsection===n))}async append(t,n){return this.set(t,n,!0)}async set(t,n,r=!1){const{section:o,subsection:i,name:a,path:s,sectionPath:l}=Y0(t),c=wF(this.parsedConfig,u=>u.path===s);if(n==null)c!==-1&&this.parsedConfig.splice(c,1);else if(c!==-1){const u=this.parsedConfig[c],d=Object.assign({},u,{name:a,value:n,modified:!0});r?this.parsedConfig.splice(c+1,0,d):this.parsedConfig[c]=d}else{const u=this.parsedConfig.findIndex(f=>f.path===l),d={section:o,subsection:i,name:a,value:n,modified:!0,path:s};if(cF.test(o)&&dF.test(a))if(u>=0)this.parsedConfig.splice(u+1,0,d);else{const f={section:o,subsection:i,modified:!0,path:l};this.parsedConfig.push(f,d)}}}toString(){return this.parsedConfig.map(({line:t,section:n,subsection:r,name:o,value:i,modified:a=!1})=>a?o!=null&&i!=null?typeof i=="string"&&/[#;]/.test(i)?` ${o} = "${i}"`:` ${o} = ${i}`:r!=null?`[${n} "${r}"]`:`[${n}]`:t).join(`
18
+ `)}}class bt{static async get({fs:t,gitdir:n}){const r=await t.read(`${n}/config`,{encoding:"utf8"});return eh.from(r)}static async save({fs:t,gitdir:n,config:r}){await t.write(`${n}/config`,r.toString(),{encoding:"utf8"})}}const Mc=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],vF=["config","description","index","shallow","commondir"];let th;async function no(e,t){return th===void 0&&(th=new ts),th.acquire(e,t)}class de{static async updateRemoteRefs({fs:t,gitdir:n,remote:r,refs:o,symrefs:i,tags:a,refspecs:s=void 0,prune:l=!1,pruneTags:c=!1}){for(const v of o.values())if(!v.match(/[0-9a-f]{40}/))throw new to(v);const u=await bt.get({fs:t,gitdir:n});if(!s){if(s=await u.getall(`remote.${r}.fetch`),s.length===0)throw new bs(r);s.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}const d=Jf.from(s),f=new Map;if(c){const v=await de.listRefs({fs:t,gitdir:n,filepath:"refs/tags"});await de.deleteRefs({fs:t,gitdir:n,refs:v.map(w=>`refs/tags/${w}`)})}if(a){for(const v of o.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await de.exists({fs:t,gitdir:n,ref:v})){const w=o.get(v);f.set(v,w)}}const h=d.translate([...o.keys()]);for(const[v,w]of h){const b=o.get(v);f.set(w,b)}const p=d.translate([...i.keys()]);for(const[v,w]of p){const b=i.get(v),x=d.translateOne(b);x&&f.set(w,`ref: ${x}`)}const m=[];if(l){for(const v of d.localNamespaces()){const w=(await de.listRefs({fs:t,gitdir:n,filepath:v})).map(b=>`${v}/${b}`);for(const b of w)f.has(b)||m.push(b)}m.length>0&&await de.deleteRefs({fs:t,gitdir:n,refs:m})}for(const[v,w]of f)await no(v,async()=>t.write(ue.join(n,v),`${w.trim()}
19
+ `,"utf8"));return{pruned:m}}static async writeRef({fs:t,gitdir:n,ref:r,value:o}){if(!o.match(/[0-9a-f]{40}/))throw new to(o);await no(r,async()=>t.write(ue.join(n,r),`${o.trim()}
20
+ `,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:n,ref:r,value:o}){await no(r,async()=>t.write(ue.join(n,r),`ref: ${o.trim()}
21
+ `,"utf8"))}static async deleteRef({fs:t,gitdir:n,ref:r}){return de.deleteRefs({fs:t,gitdir:n,refs:[r]})}static async deleteRefs({fs:t,gitdir:n,refs:r}){await Promise.all(r.map(s=>t.rm(ue.join(n,s))));let o=await no("packed-refs",async()=>t.read(`${n}/packed-refs`,{encoding:"utf8"}));const i=Nc.from(o),a=i.refs.size;for(const s of r)i.refs.has(s)&&i.delete(s);i.refs.size<a&&(o=i.toString(),await no("packed-refs",async()=>t.write(`${n}/packed-refs`,o,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:n,ref:r,depth:o=void 0}){if(o!==void 0&&(o--,o===-1))return r;if(r.startsWith("ref: "))return r=r.slice(5),de.resolve({fs:t,gitdir:n,ref:r,depth:o});if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;const i=await de.packedRefs({fs:t,gitdir:n}),a=Mc(r).filter(s=>!vF.includes(s));for(const s of a){const l=await no(s,async()=>await t.read(`${n}/${s}`,{encoding:"utf8"})||i.get(s));if(l)return de.resolve({fs:t,gitdir:n,ref:l.trim(),depth:o})}throw new ot(r)}static async exists({fs:t,gitdir:n,ref:r}){try{return await de.expand({fs:t,gitdir:n,ref:r}),!0}catch{return!1}}static async expand({fs:t,gitdir:n,ref:r}){if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;const o=await de.packedRefs({fs:t,gitdir:n}),i=Mc(r);for(const a of i)if(await no(a,async()=>t.exists(`${n}/${a}`))||o.has(a))return a;throw new ot(r)}static async expandAgainstMap({ref:t,map:n}){const r=Mc(t);for(const o of r)if(await n.has(o))return o;throw new ot(t)}static resolveAgainstMap({ref:t,fullref:n=t,depth:r=void 0,map:o}){if(r!==void 0&&(r--,r===-1))return{fullref:n,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),de.resolveAgainstMap({ref:t,fullref:n,depth:r,map:o});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:n,oid:t};const i=Mc(t);for(const a of i){const s=o.get(a);if(s)return de.resolveAgainstMap({ref:s.trim(),fullref:a,depth:r,map:o})}throw new ot(t)}static async packedRefs({fs:t,gitdir:n}){const r=await no("packed-refs",async()=>t.read(`${n}/packed-refs`,{encoding:"utf8"}));return Nc.from(r).refs}static async listRefs({fs:t,gitdir:n,filepath:r}){const o=de.packedRefs({fs:t,gitdir:n});let i=null;try{i=await t.readdirDeep(`${n}/${r}`),i=i.map(a=>a.replace(`${n}/${r}/`,""))}catch{i=[]}for(let a of(await o).keys())a.startsWith(r)&&(a=a.replace(r+"/",""),i.includes(a)||i.push(a));return i.sort(aF),i}static async listBranches({fs:t,gitdir:n,remote:r}){return r?de.listRefs({fs:t,gitdir:n,filepath:`refs/remotes/${r}`}):de.listRefs({fs:t,gitdir:n,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:n}){return(await de.listRefs({fs:t,gitdir:n,filepath:"refs/tags"})).filter(o=>!o.endsWith("^{}"))}}function yF(e,t){return Cc(K0(e),K0(t))}function K0(e){return e.mode==="040000"?e.path+"/":e.path}function X0(e){switch(e){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new De(`Unexpected GitTree entry mode: ${e}`)}function bF(e){const t=[];let n=0;for(;n<e.length;){const r=e.indexOf(32,n);if(r===-1)throw new De(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next space character.`);const o=e.indexOf(0,n);if(o===-1)throw new De(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next null character.`);let i=e.slice(n,r).toString("utf8");i==="40000"&&(i="040000");const a=X0(i),s=e.slice(r+1,o).toString("utf8");if(s.includes("\\")||s.includes("/"))throw new Mi(s);const l=e.slice(o+1,o+21).toString("hex");n=o+21,t.push({mode:i,path:s,oid:l,type:a})}return t}function xF(e){if(typeof e=="number"&&(e=e.toString(8)),e.match(/^0?4.*/))return"040000";if(e.match(/^1006.*/))return"100644";if(e.match(/^1007.*/))return"100755";if(e.match(/^120.*/))return"120000";if(e.match(/^160.*/))return"160000";throw new De(`Could not understand file mode: ${e}`)}function _F(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=xF(e.mode),e.type||(e.type=X0(e.mode)),e}class tn{constructor(t){if(Buffer.isBuffer(t))this._entries=bF(t);else if(Array.isArray(t))this._entries=t.map(_F);else throw new De("invalid type passed to GitTree constructor");this._entries.sort(z0)}static from(t){return new tn(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join(`
22
+ `)}toObject(){const t=[...this._entries];return t.sort(yF),Buffer.concat(t.map(n=>{const r=Buffer.from(n.mode.replace(/^0/,"")),o=Buffer.from(" "),i=Buffer.from(n.path,"utf8"),a=Buffer.from([0]),s=Buffer.from(n.oid,"hex");return Buffer.concat([r,o,i,a,s])}))}entries(){return this._entries}*[Symbol.iterator](){for(const t of this._entries)yield t}}class Oi{static wrap({type:t,object:n}){return Buffer.concat([Buffer.from(`${t} ${n.byteLength.toString()}\0`),Buffer.from(n)])}static unwrap(t){const n=t.indexOf(32),r=t.indexOf(0),o=t.slice(0,n).toString("utf8"),i=t.slice(n+1,r).toString("utf8"),a=t.length-(r+1);if(parseInt(i)!==a)throw new De(`Length mismatch: expected ${i} bytes but got ${a} instead.`);return{type:o,object:Buffer.from(t.slice(r+1))}}}async function Z0({fs:e,gitdir:t,oid:n}){const r=`objects/${n.slice(0,2)}/${n.slice(2)}`,o=await e.read(`${t}/${r}`);return o?{object:o,format:"deflated",source:r}:null}function SF(e,t){const n=new fr(e),r=J0(n);if(r!==t.byteLength)throw new De(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${t.length} bytes`);const o=J0(n);let i;const a=eb(n,t);if(a.byteLength===o)i=a;else{i=Buffer.alloc(o);const s=new fr(i);for(s.copy(a);!n.eof();)s.copy(eb(n,t));const l=s.tell();if(o!==l)throw new De(`applyDelta expected target buffer to be ${o} bytes but the resulting buffer was ${l} bytes`)}return i}function J0(e){let t=0,n=0,r=null;do r=e.readUInt8(),t|=(r&127)<<n,n+=7;while(r&128);return t}function Q0(e,t,n){let r=0,o=0;for(;n--;)t&1&&(r|=e.readUInt8()<<o),t>>=1,o+=8;return r}function eb(e,t){const n=e.readUInt8(),r=128,o=15,i=112;if(n&r){const a=Q0(e,n&o,4);let s=Q0(e,(n&i)>>4,3);return s===0&&(s=65536),t.slice(a,a+s)}else return e.slice(n)}function CF(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function tb(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:CF(e)}class nb{constructor(t){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=tb(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:n}=await this.stream.next();return t&&(this._ended=!0,!n)?Buffer.alloc(0):(n&&(n=Buffer.from(n)),n)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;const n=[this.buffer];for(;this.cursor+t>EF(n);){const r=await this._next();if(this._ended)break;n.push(r)}this.buffer=Buffer.concat(n)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}}function EF(e){return e.reduce((t,n)=>t+n.length,0)}async function PF(e,t){const n=new nb(e);let r=await n.read(4);if(r=r.toString("utf8"),r!=="PACK")throw new De(`Invalid PACK header '${r}'`);let o=await n.read(4);if(o=o.readUInt32BE(0),o!==2)throw new De(`Invalid packfile version: ${o}`);let i=await n.read(4);if(i=i.readUInt32BE(0),!(i<1))for(;!n.eof()&&i--;){const a=n.tell(),{type:s,length:l,ofs:c,reference:u}=await RF(n),d=new Vf.Inflate;for(;!d.result;){const f=await n.chunk();if(!f)break;if(d.push(f,!1),d.err)throw new De(`Pako error: ${d.msg}`);if(d.result){if(d.result.length!==l)throw new De("Inflated object size is different from that stated in packfile.");await n.undo(),await n.read(f.length-d.strm.avail_in);const h=n.tell();await t({data:d.result,type:s,num:i,offset:a,end:h,reference:u,ofs:c})}}}}async function RF(e){let t=await e.byte();const n=t>>4&7;let r=t&15;if(t&128){let a=4;do t=await e.byte(),r|=(t&127)<<a,a+=7;while(t&128)}let o,i;if(n===6){let a=0;o=0;const s=[];do t=await e.byte(),o|=(t&127)<<a,a+=7,s.push(t);while(t&128);i=Buffer.from(s)}return n===7&&(i=await e.read(20)),{type:n,length:r,ofs:o,reference:i}}async function rb(e){return Vf.inflate(e)}function NF(e){const t=[];let n=0,r=0;do{n=e.readUInt8();const o=n&127;t.push(o),r=n&128}while(r);return t.reduce((o,i)=>o+1<<7|i,-1)}function TF(e,t){let n=t,r=4,o=null;do o=e.readUInt8(),n|=(o&127)<<r,r+=7;while(o&128);return n}class ji{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:n}){const r=new fr(t);if(r.slice(4).toString("hex")!=="ff744f63")return;const i=r.readUInt32BE();if(i!==2)throw new De(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2048*1024*1024)throw new De("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");r.seek(r.tell()+4*255);const a=r.readUInt32BE(),s=[];for(let u=0;u<a;u++){const d=r.slice(20).toString("hex");s[u]=d}r.seek(r.tell()+4*a);const l=new Map;for(let u=0;u<a;u++)l.set(s[u],r.readUInt32BE());const c=r.slice(20).toString("hex");return new ji({hashes:s,crcs:{},offsets:l,packfileSha:c,getExternalRefDelta:n})}static async fromPack({pack:t,getExternalRefDelta:n,onProgress:r}){const o={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},i={},a=t.slice(-20).toString("hex"),s=[],l={},c=new Map;let u=null,d=null;await PF([t],async({data:v,type:w,reference:b,offset:x,num:S})=>{u===null&&(u=S);const C=Math.floor((u-S)*100/u);C!==d&&r&&await r({phase:"Receiving objects",loaded:u-S,total:u}),d=C,w=o[w],["commit","tree","blob","tag"].includes(w)?i[x]={type:w,offset:x}:w==="ofs-delta"?i[x]={type:w,offset:x}:w==="ref-delta"&&(i[x]={type:w,offset:x})});const f=Object.keys(i).map(Number);for(const[v,w]of f.entries()){const b=v+1===f.length?t.byteLength-20:f[v+1],x=i[w],S=Ej.buf(t.slice(w,b))>>>0;x.end=b,x.crc=S}const h=new ji({pack:Promise.resolve(t),packfileSha:a,crcs:l,hashes:s,offsets:c,getExternalRefDelta:n});d=null;let p=0;const m=[0,0,0,0,0,0,0,0,0,0,0,0];for(let v in i){v=Number(v);const w=Math.floor(p*100/u);w!==d&&r&&await r({phase:"Resolving deltas",loaded:p,total:u}),p++,d=w;const b=i[v];if(!b.oid)try{h.readDepth=0,h.externalReadDepth=0;const{type:x,object:S}=await h.readSlice({start:v});m[h.readDepth]+=1;const C=await kr(Oi.wrap({type:x,object:S}));b.oid=C,s.push(C),c.set(C,v),l[C]=b.crc}catch{continue}}return s.sort(),h}async toBuffer(){const t=[],n=(c,u)=>{t.push(Buffer.from(c,u))};n("ff744f63","hex"),n("00000002","hex");const r=new fr(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(const d of this.hashes)parseInt(d.slice(0,2),16)<=c&&u++;r.writeUInt32BE(u)}t.push(r.buffer);for(const c of this.hashes)n(c,"hex");const o=new fr(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)o.writeUInt32BE(this.crcs[c]);t.push(o.buffer);const i=new fr(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)i.writeUInt32BE(this.offsets.get(c));t.push(i.buffer),n(this.packfileSha,"hex");const a=Buffer.concat(t),s=await kr(a),l=Buffer.alloc(20);return l.write(s,"hex"),Buffer.concat([a,l])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new De(`Could not read object ${t} from packfile`)}const n=this.offsets.get(t);return this.readSlice({start:n})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;const n={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new De("Tried to read from a GitPackIndex with no packfile loaded into memory");const r=(await this.pack).slice(t),o=new fr(r),i=o.readUInt8(),a=i&112;let s=n[a];if(s===void 0)throw new De("Unrecognized type: 0b"+a.toString(2));const l=i&15;let c=l;i&128&&(c=TF(o,l));let d=null,f=null;if(s==="ofs_delta"){const p=NF(o),m=t-p;({object:d,type:s}=await this.readSlice({start:m}))}if(s==="ref_delta"){const p=o.slice(20).toString("hex");({object:d,type:s}=await this.read({oid:p}))}const h=r.slice(o.tell());if(f=Buffer.from(await rb(h)),f.byteLength!==c)throw new De(`Packfile told us object would have length ${c} but it had length ${f.byteLength}`);return d&&(f=Buffer.from(SF(f,d))),this.readDepth>3&&(this.offsetCache[t]={type:s,object:f}),{type:s,format:"content",object:f}}}const Dc=Symbol("PackfileCache");async function MF({fs:e,filename:t,getExternalRefDelta:n,emitter:r,emitterPrefix:o}){const i=await e.read(t);return ji.fromIdx({idx:i,getExternalRefDelta:n})}function nh({fs:e,cache:t,filename:n,getExternalRefDelta:r,emitter:o,emitterPrefix:i}){t[Dc]||(t[Dc]=new Map);let a=t[Dc].get(n);return a||(a=MF({fs:e,filename:n,getExternalRefDelta:r,emitter:o,emitterPrefix:i}),t[Dc].set(n,a)),a}async function DF({fs:e,cache:t,gitdir:n,oid:r,format:o="content",getExternalRefDelta:i}){let a=await e.readdir(ue.join(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(const s of a){const l=`${n}/objects/pack/${s}`,c=await nh({fs:e,cache:t,filename:l,getExternalRefDelta:i});if(c.error)throw new De(c.error);if(c.offsets.has(r)){if(!c.pack){const d=l.replace(/idx$/,"pack");c.pack=e.read(d)}const u=await c.read({oid:r,getExternalRefDelta:i});return u.format="content",u.source=`objects/pack/${s.replace(/idx$/,"pack")}`,u}}return null}async function dt({fs:e,cache:t,gitdir:n,oid:r,format:o="content"}){const i=u=>dt({fs:e,cache:t,gitdir:n,oid:u});let a;if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(a={format:"wrapped",object:Buffer.from("tree 0\0")}),a||(a=await Z0({fs:e,gitdir:n,oid:r})),!a){if(a=await DF({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i}),!a)throw new ot(r);return a}if(o==="deflated"||(a.format==="deflated"&&(a.object=Buffer.from(await rb(a.object)),a.format="wrapped"),o==="wrapped"))return a;const s=await kr(a.object);if(s!==r)throw new De(`SHA check failed! Expected ${r}, computed ${s}`);const{object:l,type:c}=Oi.unwrap(a.object);if(a.type=c,a.object=l,a.format="content",o==="content")return a;throw new De(`invalid requested format "${o}"`)}class Ln extends Ge{constructor(t,n,r=!0){super(`Failed to create ${t} at ${n} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=Ln.code,this.data={noun:t,where:n,canForce:r}}}Ln.code="AlreadyExistsError";class _s extends Ge{constructor(t,n,r){super(`Found multiple ${t} matching "${n}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=_s.code,this.data={nouns:t,short:n,matches:r}}}_s.code="AmbiguousError";class Ss extends Ge{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=Ss.code,this.data={filepaths:t}}}Ss.code="CheckoutConflictError";class Cs extends Ge{constructor(t,n){super(`Failed to checkout "${t}" because commit ${n} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Cs.code,this.data={ref:t,oid:n}}}Cs.code="CommitNotFetchedError";class Es extends Ge{constructor(){super("Empty response from git server."),this.code=this.name=Es.code,this.data={}}}Es.code="EmptyServerResponseError";class Ps extends Ge{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=Ps.code,this.data={}}}Ps.code="FastForwardError";class Rs extends Ge{constructor(t,n){super(`One or more branches were not updated: ${t}`),this.code=this.name=Rs.code,this.data={prettyDetails:t,result:n}}}Rs.code="GitPushError";class $i extends Ge{constructor(t,n,r){super(`HTTP Error: ${t} ${n}`),this.code=this.name=$i.code,this.data={statusCode:t,statusMessage:n,response:r}}}$i.code="HttpError";class ro extends Ge{constructor(t){let n="invalid filepath";t==="leading-slash"||t==="trailing-slash"?n='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(n='"filepath" should not be a directory.'),super(n),this.code=this.name=ro.code,this.data={reason:t}}}ro.code="InvalidFilepathError";class zn extends Ge{constructor(t,n){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`),this.code=this.name=zn.code,this.data={ref:t,suggestion:n}}}zn.code="InvalidRefNameError";class Ns extends Ge{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=Ns.code,this.data={depth:t}}}Ns.code="MaxDepthError";class Fi extends Ge{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=Fi.code,this.data={}}}Fi.code="MergeNotSupportedError";class Li extends Ge{constructor(t,n,r,o){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=Li.code,this.data={filepaths:t,bothModified:n,deleteByUs:r,deleteByTheirs:o}}}Li.code="MergeConflictError";class Ot extends Ge{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=Ot.code,this.data={role:t}}}Ot.code="MissingNameError";class nn extends Ge{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=nn.code,this.data={parameter:t}}}nn.code="MissingParameterError";class Ts extends Ge{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=Ts.code,this.data={errors:t},this.errors=t}}Ts.code="MultipleGitError";class Uo extends Ge{constructor(t,n){super(`Expected "${t}" but received "${n}".`),this.code=this.name=Uo.code,this.data={expected:t,actual:n}}}Uo.code="ParseError";class zi extends Ge{constructor(t){let n="";t==="not-fast-forward"?n=" because it was not a simple fast-forward":t==="tag-exists"&&(n=" because tag already exists"),super(`Push rejected${n}. Use "force: true" to override.`),this.code=this.name=zi.code,this.data={reason:t}}}zi.code="PushRejectedError";class oo extends Ge{constructor(t,n){super(`Remote does not support the "${t}" so the "${n}" parameter cannot be used.`),this.code=this.name=oo.code,this.data={capability:t,parameter:n}}}oo.code="RemoteCapabilityError";class Ms extends Ge{constructor(t,n){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=Ms.code,this.data={preview:t,response:n}}}Ms.code="SmartHttpError";class Ds extends Ge{constructor(t,n,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${n}"`),this.code=this.name=Ds.code,this.data={url:t,transport:n,suggestion:r}}}Ds.code="UnknownTransportError";class As extends Ge{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=As.code,this.data={url:t}}}As.code="UrlParseError";class Bi extends Ge{constructor(){super("The operation was canceled."),this.code=this.name=Bi.code,this.data={}}}Bi.code="UserCanceledError";class ks extends Ge{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=ks.code,this.data={filepath:t}}}ks.code="IndexResetError";class Is extends Ge{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Is.code,this.data={ref:t}}}Is.code="NoCommitError";var AF=Object.freeze({__proto__:null,AlreadyExistsError:Ln,AmbiguousError:_s,CheckoutConflictError:Ss,CommitNotFetchedError:Cs,EmptyServerResponseError:Es,FastForwardError:Ps,GitPushError:Rs,HttpError:$i,InternalError:De,InvalidFilepathError:ro,InvalidOidError:to,InvalidRefNameError:zn,MaxDepthError:Ns,MergeNotSupportedError:Fi,MergeConflictError:Li,MissingNameError:Ot,MissingParameterError:nn,MultipleGitError:Ts,NoRefspecError:bs,NotFoundError:ot,ObjectTypeError:Yt,ParseError:Uo,PushRejectedError:zi,RemoteCapabilityError:oo,SmartHttpError:Ms,UnknownTransportError:Ds,UnsafeFilepathError:Mi,UrlParseError:As,UserCanceledError:Bi,UnmergedPathsError:ys,IndexResetError:ks,NoCommitError:Is});function rh({name:e,email:t,timestamp:n,timezoneOffset:r}){return r=kF(r),`${e} <${t}> ${n} ${r}`}function kF(e){const t=IF(OF(e));e=Math.abs(e);const n=Math.floor(e/60);e-=n*60;let r=String(n),o=String(e);return r.length<2&&(r="0"+r),o.length<2&&(o="0"+o),(t===-1?"-":"+")+r+o}function IF(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function OF(e){return e===0?e:-e}function Ir(e){return e=e.replace(/\r/g,""),e=e.replace(/^\n+/,""),e=e.replace(/\n+$/,"")+`
23
+ `,e}function Ac(e){const[,t,n,r,o]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:n,timestamp:Number(r),timezoneOffset:jF(o)}}function jF(e){let[,t,n,r]=e.match(/(\+|-)(\d\d)(\d\d)/);return r=(t==="+"?1:-1)*(Number(n)*60+Number(r)),$F(r)}function $F(e){return e===0?e:-e}class Kt{constructor(t){if(typeof t=="string")this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else if(typeof t=="object")this._tag=Kt.render(t);else throw new De("invalid type passed to GitAnnotatedTag constructor")}static from(t){return new Kt(t)}static render(t){return`object ${t.object}
24
24
  type ${t.type}
25
25
  tag ${t.tag}
26
- tagger ${qo(t.tagger)}
26
+ tagger ${rh(t.tagger)}
27
27
 
28
28
  ${t.message}
29
29
  ${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
@@ -31,93 +31,94 @@ ${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexO
31
31
  `))}message(){const t=this.withoutSignature();return t.slice(t.indexOf(`
32
32
 
33
33
  `)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){const t=this.justHeaders().split(`
34
- `),r=[];for(const i of t)i[0]===" "?r[r.length-1]+=`
35
- `+i.slice(1):r.push(i);const n={};for(const i of r){const a=i.slice(0,i.indexOf(" ")),o=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(o):n[a]=o}return n.tagger&&(n.tagger=ra(n.tagger)),n.committer&&(n.committer=ra(n.committer)),n}withoutSignature(){const t=Kt(this._tag);return t.indexOf(`
34
+ `),n=[];for(const o of t)o[0]===" "?n[n.length-1]+=`
35
+ `+o.slice(1):n.push(o);const r={};for(const o of n){const i=o.slice(0,o.indexOf(" ")),a=o.slice(o.indexOf(" ")+1);Array.isArray(r[i])?r[i].push(a):r[i]=a}return r.tagger&&(r.tagger=Ac(r.tagger)),r.committer&&(r.committer=Ac(r.committer)),r}withoutSignature(){const t=Ir(this._tag);return t.indexOf(`
36
36
  -----BEGIN PGP SIGNATURE-----`)===-1?t:t.slice(0,t.lastIndexOf(`
37
37
  -----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
38
- -----BEGIN PGP SIGNATURE-----`)===-1)return;const t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return Kt(t)}payload(){return this.withoutSignature()+`
39
- `}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,r,n){const i=t.payload();let{signature:a}=await r({payload:i,secretKey:n});a=Kt(a);const o=i+a;return nt.from(o)}}function Yo(e){return e.trim().split(`
38
+ -----BEGIN PGP SIGNATURE-----`)===-1)return;const t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return Ir(t)}payload(){return this.withoutSignature()+`
39
+ `}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,n,r){const o=t.payload();let{signature:i}=await n({payload:o,secretKey:r});i=Ir(i);const a=o+i;return Kt.from(a)}}function oh(e){return e.trim().split(`
40
40
  `).map(t=>" "+t).join(`
41
41
  `)+`
42
- `}function Jw(e){return e.split(`
42
+ `}function FF(e){return e.split(`
43
43
  `).map(t=>t.replace(/^ /,"")).join(`
44
- `)}class Ie{constructor(t){if(typeof t=="string")this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else if(typeof t=="object")this._commit=Ie.render(t);else throw new ce("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:t,signature:r}){const n=Ie.justHeaders(t),i=Ie.justMessage(t),a=Kt(n+`
45
- gpgsig`+Yo(r)+`
46
- `+i);return new Ie(a)}static from(t){return new Ie(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return Ie.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Kt(t.slice(t.indexOf(`
44
+ `)}class ft{constructor(t){if(typeof t=="string")this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else if(typeof t=="object")this._commit=ft.render(t);else throw new De("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:t,signature:n}){const r=ft.justHeaders(t),o=ft.justMessage(t),i=Ir(r+`
45
+ gpgsig`+oh(n)+`
46
+ `+o);return new ft(i)}static from(t){return new ft(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return ft.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Ir(t.slice(t.indexOf(`
47
47
 
48
48
  `)+2))}static justHeaders(t){return t.slice(0,t.indexOf(`
49
49
 
50
- `))}parseHeaders(){const t=Ie.justHeaders(this._commit).split(`
51
- `),r=[];for(const i of t)i[0]===" "?r[r.length-1]+=`
52
- `+i.slice(1):r.push(i);const n={parent:[]};for(const i of r){const a=i.slice(0,i.indexOf(" ")),o=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(o):n[a]=o}return n.author&&(n.author=ra(n.author)),n.committer&&(n.committer=ra(n.committer)),n}static renderHeaders(t){let r="";if(t.tree?r+=`tree ${t.tree}
53
- `:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
54
- `,t.parent){if(t.parent.length===void 0)throw new ce("commit 'parent' property should be an array");for(const a of t.parent)r+=`parent ${a}
55
- `}const n=t.author;r+=`author ${qo(n)}
56
- `;const i=t.committer||t.author;return r+=`committer ${qo(i)}
57
- `,t.gpgsig&&(r+="gpgsig"+Yo(t.gpgsig)),r}static render(t){return Ie.renderHeaders(t)+`
58
- `+Kt(t.message)}render(){return this._commit}withoutSignature(){const t=Kt(this._commit);if(t.indexOf(`
59
- gpgsig`)===-1)return t;const r=t.slice(0,t.indexOf(`
60
- gpgsig`)),n=t.slice(t.indexOf(`-----END PGP SIGNATURE-----
61
- `)+28);return Kt(r+`
62
- `+n)}isolateSignature(){const t=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return Jw(t)}static async sign(t,r,n){const i=t.withoutSignature(),a=Ie.justMessage(t._commit);let{signature:o}=await r({payload:i,secretKey:n});o=Kt(o);const l=Ie.justHeaders(t._commit)+`
63
- gpgsig`+Yo(o)+`
64
- `+a;return Ie.from(l)}}async function dn({fs:e,cache:t,gitdir:r,oid:n}){if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:ct.from([]),oid:n};const{type:i,object:a}=await De({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=nt.from(a).parse().object,dn({fs:e,cache:t,gitdir:r,oid:n});if(i==="commit")return n=Ie.from(a).parse().tree,dn({fs:e,cache:t,gitdir:r,oid:n});if(i!=="tree")throw new rt(n,i,"tree");return{tree:ct.from(a),oid:n}}class Qw{constructor({fs:t,gitdir:r,ref:n,cache:i}){this.fs=t,this.cache=i,this.gitdir=r,this.mapPromise=(async()=>{const o=new Map;let s;try{s=await U.resolve({fs:t,gitdir:r,ref:n})}catch(c){c instanceof Oe&&(s="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}const l=await dn({fs:t,cache:this.cache,gitdir:r,oid:s});return l.type="tree",l.mode="40000",o.set(".",l),o})();const a=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){const r=t._fullpath,{fs:n,cache:i,gitdir:a}=this,o=await this.mapPromise,s=o.get(r);if(!s)throw new Error(`No obj for ${r}`);const l=s.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(s)}`);if(s.type!=="tree")return null;const{type:c,object:u}=await De({fs:n,cache:i,gitdir:a,oid:l});if(c!==s.type)throw new rt(l,c,s.type);const d=ct.from(u);for(const p of d)o.set(N.join(r,p.path),p);return d.entries().map(p=>N.join(r,p.path))}async type(t){if(t._type===!1){const r=await this.mapPromise,{type:n}=r.get(t._fullpath);t._type=n}return t._type}async mode(t){if(t._mode===!1){const r=await this.mapPromise,{mode:n}=r.get(t._fullpath);t._mode=_u(parseInt(n,8))}return t._mode}async stat(t){}async content(t){if(t._content===!1){const r=await this.mapPromise,{fs:n,cache:i,gitdir:a}=this,s=r.get(t._fullpath).oid,{type:l,object:c}=await De({fs:n,cache:i,gitdir:a,oid:s});l!=="blob"?t._content=void 0:t._content=new Uint8Array(c)}return t._content}async oid(t){if(t._oid===!1){const n=(await this.mapPromise).get(t._fullpath);t._oid=n.oid}return t._oid}}function xt({ref:e="HEAD"}={}){const t=Object.create(null);return Object.defineProperty(t,Ki,{value:function({fs:r,gitdir:n,cache:i}){return new Qw({fs:r,gitdir:n,ref:e,cache:i})}}),Object.freeze(t),t}class eg{constructor({fs:t,dir:r,gitdir:n,cache:i}){this.fs=t,this.cache=i,this.dir=r,this.gitdir=n;const a=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){const r=t._fullpath,{fs:n,dir:i}=this,a=await n.readdir(N.join(i,r));return a===null?null:a.map(o=>N.join(r,o))}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){const{fs:r,dir:n}=this;let i=await r.lstat(`${n}/${t._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let a=i.isDirectory()?"tree":"blob";a==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(a="special"),t._type=a,i=en(i),t._mode=i.mode,i.size===-1&&t._actualSize&&(i.size=t._actualSize),t._stat=i}return t._stat}async content(t){if(t._content===!1){const{fs:r,dir:n,gitdir:i}=this;if(await t.type()==="tree")t._content=void 0;else{const o=await(await Le.get({fs:r,gitdir:i})).get("core.autocrlf"),s=await r.read(`${n}/${t._fullpath}`,{autocrlf:o});t._actualSize=s.length,t._stat&&t._stat.size===-1&&(t._stat.size=t._actualSize),t._content=new Uint8Array(s)}}return t._content}async oid(t){if(t._oid===!1){const{fs:r,gitdir:n,cache:i}=this;let a;await Ge.acquire({fs:r,gitdir:n,cache:i},async function(o){const s=o.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await Le.get({fs:r,gitdir:n})).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;!s||Zi(l,s,u,d)?await t.content()===void 0?a=void 0:(a=await Vt(an.wrap({type:"blob",object:await t.content()})),s&&a===s.oid&&(!u||l.mode===s.mode)&&Zi(l,s,u,d)&&o.insert({filepath:t._fullpath,stats:l,oid:a})):a=s.oid}),t._oid=a}return t._oid}}function ui(){const e=Object.create(null);return Object.defineProperty(e,Ki,{value:function({fs:t,dir:r,gitdir:n,cache:i}){return new eg({fs:t,dir:r,gitdir:n,cache:i})}}),Object.freeze(e),e}function tg(e,t){const r=t-e;return Array.from({length:r},(n,i)=>e+i)}const zu=typeof Array.prototype.flat>"u"?e=>e.reduce((t,r)=>t.concat(r),[]):e=>e.flat();class rg{constructor(){this.value=null}consider(t){t!=null&&(this.value===null?this.value=t:t<this.value&&(this.value=t))}reset(){this.value=null}}function*ng(e){const t=new rg;let r;const n=[],i=e.length;for(let a=0;a<i;a++)n[a]=e[a].next().value,n[a]!==void 0&&t.consider(n[a]);if(t.value!==null)for(;;){const a=[];r=t.value,t.reset();for(let o=0;o<i;o++)n[o]!==void 0&&n[o]===r?(a[o]=n[o],n[o]=e[o].next().value):a[o]=null,n[o]!==void 0&&t.consider(n[o]);if(yield a,t.value===null)return}}async function hr({fs:e,cache:t,dir:r,gitdir:n,trees:i,map:a=async(l,c)=>c,reduce:o=async(l,c)=>{const u=zu(c);return l!==void 0&&u.unshift(l),u},iterate:s=(l,c)=>Promise.all([...c].map(l))}){const l=i.map(m=>m[Ki]({fs:e,dir:r,gitdir:n,cache:t})),c=new Array(l.length).fill("."),u=tg(0,l.length),d=async m=>{u.map(x=>{m[x]=m[x]&&new l[x].ConstructEntry(m[x])});const _=(await Promise.all(u.map(x=>m[x]?l[x].readdir(m[x]):[]))).map(x=>x===null?[]:x).map(x=>x[Symbol.iterator]());return{entries:m,children:ng(_)}},p=async m=>{const{entries:g,children:_}=await d(m),x=g.find(v=>v&&v._fullpath)._fullpath,y=await a(x,g);if(y!==null){let v=await s(p,_);return v=v.filter(O=>O!==void 0),o(y,v)}};return p(c)}async function Xo(e,t){const r=await e.readdir(t);r==null?await e.rm(t):r.length?await Promise.all(r.map(n=>{const i=N.join(t,n);return e.lstat(i).then(a=>{if(a)return a.isDirectory()?Xo(e,i):e.rm(i)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function ig(e){return ag(e)&&Nu(e.then)&&Nu(e.catch)}function ag(e){return e&&typeof e=="object"}function Nu(e){return typeof e=="function"}function Mu(e){return ig((r=>{try{return r.readFile().catch(n=>n)}catch(n){return n}})(e))}const Lu=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function Fu(e,t){if(Mu(t))for(const r of Lu)e[`_${r}`]=t[r].bind(t);else for(const r of Lu)e[`_${r}`]=Io(t[r].bind(t));Mu(t)?t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=Xo.bind(null,e):t.rm?e._rm=Io(t.rm.bind(t)):t.rmdir.length>2?e._rm=Io(t.rmdir.bind(t)):e._rm=Xo.bind(null,e)}class J{constructor(t){if(typeof t._original_unwrapped_fs<"u")return t;const r=Object.getOwnPropertyDescriptor(t,"promises");r&&r.enumerable?Fu(this,t.promises):Fu(this,t),this._original_unwrapped_fs=t}async exists(t,r={}){try{return await this._stat(t),!0}catch(n){if(n.code==="ENOENT"||n.code==="ENOTDIR"||(n.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',n),n}}async read(t,r={}){try{let n=await this._readFile(t,r);if(r.autocrlf==="true")try{n=new TextDecoder("utf8",{fatal:!0}).decode(n),n=n.replace(/\r\n/g,`
65
- `),n=new TextEncoder().encode(n)}catch{}return typeof n!="string"&&(n=Buffer.from(n)),n}catch{return null}}async write(t,r,n={}){try{await this._writeFile(t,r,n);return}catch{await this.mkdir(rn(t)),await this._writeFile(t,r,n)}}async mkdir(t,r=!1){try{await this._mkdir(t);return}catch(n){if(n===null||n.code==="EEXIST")return;if(r)throw n;if(n.code==="ENOENT"){const i=rn(t);if(i==="."||i==="/"||i===t)throw n;await this.mkdir(i),await this.mkdir(t,!0)}}}async rm(t){try{await this._unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(t,r){try{r&&r.recursive?await this._rm(t,r):await this._rmdir(t)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(t){try{const r=await this._readdir(t);return r.sort(Xi),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(t){const r=await this._readdir(t);return(await Promise.all(r.map(async i=>{const a=t+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(t){try{return await this._lstat(t)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(t,r={encoding:"buffer"}){try{const n=await this._readlink(t,r);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(n){if(n.code==="ENOENT"||(n.code||"").includes("ENS"))return null;throw n}}async writelink(t,r){return this._symlink(r.toString("utf8"),t)}}function T(e,t){if(t===void 0)throw new lt(e)}async function na(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()==="tree"&&await t.type()==="tree"||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function og({fs:e,dir:t,gitdir:r=N.join(t,".git"),commit:n="HEAD",cache:i={}}){try{T("fs",e),T("dir",t),T("gitdir",r);const a=new J(e),o=[xt({ref:n}),ui(),nn()];let s=[];await Ge.acquire({fs:a,gitdir:r,cache:i},async function(c){s=c.unmergedPaths});const l=await hr({fs:a,cache:i,dir:t,gitdir:r,trees:o,map:async function(c,[u,d,p]){const m=!await na(d,p),g=s.includes(c),_=!await na(p,u);if(m||g)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(_)return!1;throw new ci(c)}});await Ge.acquire({fs:a,gitdir:r,cache:i},async function(c){for(const u of l)if(u!==!1){if(!u){await a.rmdir(`${t}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){const d=new TextDecoder().decode(u.content);await a.write(`${t}/${u.path}`,d,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}class hn{static async isIgnored({fs:t,dir:r,gitdir:n=N.join(r,".git"),filepath:i}){if(Vi(i)===".git")return!0;if(i===".")return!1;let a="";const o=N.join(n,"info","exclude");await t.exists(o)&&(a=await t.read(o,"utf8"));const s=[{gitignore:N.join(r,".gitignore"),filepath:i}],l=i.split("/").filter(Boolean);for(let u=1;u<l.length;u++){const d=l.slice(0,u).join("/"),p=l.slice(u).join("/");s.push({gitignore:N.join(r,d,".gitignore"),filepath:p})}let c=!1;for(const u of s){let d;try{d=await t.read(u.gitignore,"utf8")}catch(g){if(g.code==="NOENT")continue}const p=Q0().add(a);p.add(d);const m=rn(u.filepath);if(m!=="."&&p.ignores(m))return!0;c?c=!p.test(u.filepath).unignored:c=p.test(u.filepath).ignored}return c}}async function sg({fs:e,gitdir:t,object:r,format:n,oid:i}){if(n!=="deflated")throw new ce("GitObjectStoreLoose expects objects to write to be in deflated format");const a=`objects/${i.slice(0,2)}/${i.slice(2)}`,o=`${t}/${a}`;await e.exists(o)||await e.write(o,r)}let Zo=null;async function Uu(e){return Zo===null&&(Zo=lg()),Zo?cg(e):Do.deflate(e)}async function cg(e){const t=new CompressionStream("deflate"),r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}function lg(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function ut({fs:e,gitdir:t,type:r,object:n,format:i="content",oid:a=void 0,dryRun:o=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=an.wrap({type:r,object:n})),a=await Vt(n),n=Buffer.from(await Uu(n))),o||await sg({fs:e,gitdir:t,object:n,format:"deflated",oid:a}),a}function Hu(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function ug({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n,cache:i={},force:a=!1,parallel:o=!0}){try{T("fs",e),T("dir",t),T("gitdir",r),T("filepath",n);const s=new J(e);await Ge.acquire({fs:s,gitdir:r,cache:i},async l=>Vo({dir:t,gitdir:r,fs:s,filepath:n,index:l,force:a,parallel:o}))}catch(s){throw s.caller="git.add",s}}async function Vo({dir:e,gitdir:t,fs:r,filepath:n,index:i,force:a,parallel:o}){n=Array.isArray(n)?n:[n];const s=n.map(async d=>{if(!a&&await hn.isIgnored({fs:r,dir:e,gitdir:t,filepath:d}))return;const p=await r.lstat(N.join(e,d));if(!p)throw new Oe(d);if(p.isDirectory()){const m=await r.readdir(N.join(e,d));if(o){const g=m.map(_=>Vo({dir:e,gitdir:t,fs:r,filepath:[N.join(d,_)],index:i,force:a,parallel:o}));await Promise.all(g)}else for(const g of m)await Vo({dir:e,gitdir:t,fs:r,filepath:[N.join(d,g)],index:i,force:a,parallel:o})}else{const g=await(await Le.get({fs:r,gitdir:t})).get("core.autocrlf"),_=p.isSymbolicLink()?await r.readlink(N.join(e,d)).then(Hu):await r.read(N.join(e,d),{autocrlf:g});if(_===null)throw new Oe(d);const x=await ut({fs:r,gitdir:t,type:"blob",object:_});i.insert({filepath:d,stats:p,oid:x})}}),l=await Promise.allSettled(s),c=l.filter(d=>d.status==="rejected").map(d=>d.reason);if(c.length>1)throw new ii(c);if(c.length===1)throw c[0];return l.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function fi({fs:e,gitdir:t,path:r}){return(await Le.get({fs:e,gitdir:t})).get(r)}function Wu(e,...t){for(const r of t)if(r)for(const n of Object.keys(r)){const i=r[n];i!==void 0&&(e[n]=i)}return e}async function pr({fs:e,gitdir:t,author:r,commit:n}){const i=Math.floor(Date.now()/1e3),a={name:await fi({fs:e,gitdir:t,path:"user.name"}),email:await fi({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},o=Wu({},a,n?n.author:void 0,r);if(o.name!==void 0)return o}async function pn({fs:e,gitdir:t,author:r,committer:n,commit:i}){const a=Math.floor(Date.now()/1e3),o={name:await fi({fs:e,gitdir:t,path:"user.name"}),email:await fi({fs:e,gitdir:t,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(a*1e3).getTimezoneOffset()},s=Wu({},o,i?i.committer:void 0,r,n);if(s.name!==void 0)return s}async function Gu({fs:e,cache:t,gitdir:r,oid:n}){const{type:i,object:a}=await De({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=nt.from(a).parse().object,Gu({fs:e,cache:t,gitdir:r,oid:n});if(i!=="commit")throw new rt(n,i,"commit");return{commit:Ie.from(a),oid:n}}async function mn({fs:e,cache:t,gitdir:r,oid:n}){const{commit:i,oid:a}=await Gu({fs:e,cache:t,gitdir:r,oid:n});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}async function ia({fs:e,cache:t,onSign:r,gitdir:n,message:i,author:a,committer:o,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:p,tree:m}){let g=!1;d||(d=await U.resolve({fs:e,gitdir:n,ref:"HEAD",depth:2}));let _,x;try{_=await U.resolve({fs:e,gitdir:n,ref:d}),x=await mn({fs:e,gitdir:n,oid:_,cache:{}})}catch{g=!0}if(l&&g)throw new li(d);const y=l?await pr({fs:e,gitdir:n,author:a,commit:x.commit}):await pr({fs:e,gitdir:n,author:a});if(!y)throw new Ke("author");const v=l?await pn({fs:e,gitdir:n,author:y,committer:o,commit:x.commit}):await pn({fs:e,gitdir:n,author:y,committer:o});if(!v)throw new Ke("committer");return Ge.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async function(O){const b=Eu(O.entries).get(".");if(m||(m=await qu({fs:e,gitdir:n,inode:b,dryRun:c})),p?p=await Promise.all(p.map(S=>U.resolve({fs:e,gitdir:n,ref:S}))):l?p=x.commit.parent:p=_?[_]:[],!i)if(l)i=x.commit.message;else throw new lt("message");let C=Ie.from({tree:m,parent:p,author:y,committer:v,message:i});s&&(C=await Ie.sign(C,r,s));const k=await ut({fs:e,gitdir:n,type:"commit",object:C.toObject(),dryRun:c});return!u&&!c&&await U.writeRef({fs:e,gitdir:n,ref:d,value:k}),k})}async function qu({fs:e,gitdir:t,inode:r,dryRun:n}){const i=r.children;for(const l of i)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await qu({fs:e,gitdir:t,inode:l,dryRun:n}));const a=i.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),o=ct.from(a);return await ut({fs:e,gitdir:t,type:"tree",object:o.toObject(),dryRun:n})}async function di({fs:e,cache:t,gitdir:r,oid:n,filepath:i}){if(i.startsWith("/"))throw new fr("leading-slash");if(i.endsWith("/"))throw new fr("trailing-slash");const a=n,o=await dn({fs:e,cache:t,gitdir:r,oid:n}),s=o.tree;if(i==="")n=o.oid;else{const l=i.split("/");n=await Yu({fs:e,cache:t,gitdir:r,tree:s,pathArray:l,oid:a,filepath:i})}return n}async function Yu({fs:e,cache:t,gitdir:r,tree:n,pathArray:i,oid:a,filepath:o}){const s=i.shift();for(const l of n)if(l.path===s){if(i.length===0)return l.oid;{const{type:c,object:u}=await De({fs:e,cache:t,gitdir:r,oid:l.oid});if(c!=="tree")throw new rt(a,c,"tree",o);return n=ct.from(u),Yu({fs:e,cache:t,gitdir:r,tree:n,pathArray:i,oid:a,filepath:o})}}throw new Oe(`file or directory found at "${a}:${o}"`)}async function wn({fs:e,cache:t,gitdir:r,oid:n,filepath:i=void 0}){i!==void 0&&(n=await di({fs:e,cache:t,gitdir:r,oid:n,filepath:i}));const{tree:a,oid:o}=await dn({fs:e,cache:t,gitdir:r,oid:n});return{oid:o,tree:a.entries()}}async function hi({fs:e,gitdir:t,tree:r}){const n=ct.from(r).toObject();return await ut({fs:e,gitdir:t,type:"tree",object:n,format:"content"})}async function fg({fs:e,cache:t,onSign:r,gitdir:n,ref:i,oid:a,note:o,force:s,author:l,committer:c,signingKey:u}){let d;try{d=await U.resolve({gitdir:n,fs:e,ref:i})}catch(y){if(!(y instanceof Oe))throw y}let m=(await wn({fs:e,cache:t,gitdir:n,oid:d||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(s)m=m.filter(y=>y.path!==a);else for(const y of m)if(y.path===a)throw new Ot("note",a);typeof o=="string"&&(o=Buffer.from(o,"utf8"));const g=await ut({fs:e,gitdir:n,type:"blob",object:o,format:"content"});m.push({mode:"100644",path:a,oid:g,type:"blob"});const _=await hi({fs:e,gitdir:n,tree:m});return await ia({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tree:_,parent:d&&[d],message:`Note added by 'isomorphic-git addNote'
66
- `,author:l,committer:c,signingKey:u})}async function dg({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),ref:i="refs/notes/commits",oid:a,note:o,force:s,author:l,committer:c,signingKey:u,cache:d={}}){try{T("fs",e),T("gitdir",n),T("oid",a),T("note",o),u&&T("onSign",t);const p=new J(e),m=await pr({fs:p,gitdir:n,author:l});if(!m)throw new Ke("author");const g=await pn({fs:p,gitdir:n,author:m,committer:c});if(!g)throw new Ke("committer");return await fg({fs:new J(p),cache:d,onSign:t,gitdir:n,ref:i,oid:a,note:o,force:s,author:m,committer:g,signingKey:u})}catch(p){throw p.caller="git.addNote",p}}async function Xu({fs:e,gitdir:t,remote:r,url:n,force:i}){if(r!==Mt.clean(r))throw new Ct(r,Mt.clean(r));const a=await Le.get({fs:e,gitdir:t});if(!i&&(await a.getSubsections("remote")).includes(r)&&n!==await a.get(`remote.${r}.url`))throw new Ot("remote",r);await a.set(`remote.${r}.url`,n),await a.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await Le.save({fs:e,gitdir:t,config:a})}async function hg({fs:e,dir:t,gitdir:r=N.join(t,".git"),remote:n,url:i,force:a=!1}){try{return T("fs",e),T("gitdir",r),T("remote",n),T("url",i),await Xu({fs:new J(e),gitdir:r,remote:n,url:i,force:a})}catch(o){throw o.caller="git.addRemote",o}}async function pg({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tagger:a,message:o=i,gpgsig:s,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await U.exists({fs:e,gitdir:n,ref:i}))throw new Ot("tag",i);const d=await U.resolve({fs:e,gitdir:n,ref:l||"HEAD"}),{type:p}=await De({fs:e,cache:t,gitdir:n,oid:d});let m=nt.from({object:d,type:p,tag:i.replace("refs/tags/",""),tagger:a,message:o,gpgsig:s});c&&(m=await nt.sign(m,r,c));const g=await ut({fs:e,gitdir:n,type:"tag",object:m.toObject()});await U.writeRef({fs:e,gitdir:n,ref:i,value:g})}async function mg({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),ref:i,tagger:a,message:o=i,gpgsig:s,object:l,signingKey:c,force:u=!1,cache:d={}}){try{T("fs",e),T("gitdir",n),T("ref",i),c&&T("onSign",t);const p=new J(e),m=await pr({fs:p,gitdir:n,author:a});if(!m)throw new Ke("tagger");return await pg({fs:p,cache:d,onSign:t,gitdir:n,ref:i,tagger:m,message:o,gpgsig:s,object:l,signingKey:c,force:u})}catch(p){throw p.caller="git.annotatedTag",p}}async function wg({fs:e,gitdir:t,ref:r,object:n,checkout:i=!1,force:a=!1}){if(r!==Mt.clean(r))throw new Ct(r,Mt.clean(r));const o=`refs/heads/${r}`;if(!a&&await U.exists({fs:e,gitdir:t,ref:o}))throw new Ot("branch",r,!1);let s;try{s=await U.resolve({fs:e,gitdir:t,ref:n||"HEAD"})}catch{}s&&await U.writeRef({fs:e,gitdir:t,ref:o,value:s}),i&&await U.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:o})}async function gg({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,object:i,checkout:a=!1,force:o=!1}){try{return T("fs",e),T("gitdir",r),T("ref",n),await wg({fs:new J(e),gitdir:r,ref:n,object:i,checkout:a,force:o})}catch(s){throw s.caller="git.branch",s}}const Zu=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function Ko({fs:e,cache:t,onProgress:r,onPostCheckout:n,dir:i,gitdir:a,remote:o,ref:s,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:d,force:p,track:m=!0}){let g;if(n)try{g=await U.resolve({fs:e,gitdir:a,ref:"HEAD"})}catch{g="0000000000000000000000000000000000000000"}let _;try{_=await U.resolve({fs:e,gitdir:a,ref:s})}catch(x){if(s==="HEAD")throw x;const y=`${o}/${s}`;if(_=await U.resolve({fs:e,gitdir:a,ref:y}),m){const v=await Le.get({fs:e,gitdir:a});await v.set(`branch.${s}.remote`,o),await v.set(`branch.${s}.merge`,`refs/heads/${s}`),await Le.save({fs:e,gitdir:a,config:v})}await U.writeRef({fs:e,gitdir:a,ref:`refs/heads/${s}`,value:_})}if(!c){let x;try{x=await yg({fs:e,cache:t,onProgress:r,dir:i,gitdir:a,ref:s,force:p,filepaths:l})}catch(b){throw b instanceof Oe&&b.data.what===_?new Qn(s,_):b}const y=x.filter(([b])=>b==="conflict").map(([b,C])=>C);if(y.length>0)throw new Jn(y);const v=x.filter(([b])=>b==="error").map(([b,C])=>C);if(v.length>0)throw new ce(v.join(", "));if(d){n&&await n({previousHead:g,newHead:_,type:l!=null&&l.length>0?"file":"branch"});return}let O=0;const R=x.length;await Ge.acquire({fs:e,gitdir:a,cache:t},async function(b){await Promise.all(x.filter(([C])=>C==="delete"||C==="delete-index").map(async function([C,k]){const S=`${i}/${k}`;C==="delete"&&await e.rm(S),b.delete({filepath:k}),r&&await r({phase:"Updating workdir",loaded:++O,total:R})}))}),await Ge.acquire({fs:e,gitdir:a,cache:t},async function(b){for(const[C,k]of x)if(C==="rmdir"||C==="rmdir-index"){const S=`${i}/${k}`;try{C==="rmdir-index"&&b.delete({filepath:k}),await e.rmdir(S),r&&await r({phase:"Updating workdir",loaded:++O,total:R})}catch(P){if(P.code==="ENOTEMPTY")console.log(`Did not delete ${k} because directory is not empty`);else throw P}}}),await Promise.all(x.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,C]){const k=`${i}/${C}`;await e.mkdir(k),r&&await r({phase:"Updating workdir",loaded:++O,total:R})})),await Ge.acquire({fs:e,gitdir:a,cache:t},async function(b){await Promise.all(x.filter(([C])=>C==="create"||C==="create-index"||C==="update"||C==="mkdir-index").map(async function([C,k,S,P,$]){const B=`${i}/${k}`;try{if(C!=="create-index"&&C!=="mkdir-index"){const{object:H}=await De({fs:e,cache:t,gitdir:a,oid:S});if($&&await e.rm(B),P===33188)await e.write(B,H);else if(P===33261)await e.write(B,H,{mode:511});else if(P===40960)await e.writelink(B,H);else throw new ce(`Invalid mode 0o${P.toString(8)} detected in blob ${S}`)}const M=await e.lstat(B);P===33261&&(M.mode=493),C==="mkdir-index"&&(M.mode=57344),b.insert({filepath:k,stats:M,oid:S}),r&&await r({phase:"Updating workdir",loaded:++O,total:R})}catch(M){console.log(M)}}))}),n&&await n({previousHead:g,newHead:_,type:l!=null&&l.length>0?"file":"branch"})}if(!u){const x=await U.expand({fs:e,gitdir:a,ref:s});x.startsWith("refs/heads")?await U.writeSymbolicRef({fs:e,gitdir:a,ref:"HEAD",value:x}):await U.writeRef({fs:e,gitdir:a,ref:"HEAD",value:_})}}async function yg({fs:e,cache:t,onProgress:r,dir:n,gitdir:i,ref:a,force:o,filepaths:s}){let l=0;return hr({fs:e,cache:t,dir:n,gitdir:i,trees:[xt({ref:a}),ui(),nn()],map:async function(c,[u,d,p]){if(c===".")return;if(s&&!s.some(g=>Zu(c,g)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!p,!!u,!!d].map(Number).join("")){case"000":return;case"001":return o&&s&&s.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await d.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await d.oid()?o?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]:await u.mode()!==await d.mode()?o?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await p.type()){case"tree":return["rmdir",c];case"blob":return await p.oid()!==await d.oid()?o?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await p.type()}`]}case"110":case"111":switch(`${await p.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await p.oid()===await u.oid()&&await p.mode()===await u.mode()&&!o)return;if(d){if(await d.oid()!==await p.oid()&&await d.oid()!==await u.oid())return o?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]}else if(o)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await p.mode()];return await u.mode()!==await p.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await p.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await p.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=zu(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function Vu({fs:e,onProgress:t,onPostCheckout:r,dir:n,gitdir:i=N.join(n,".git"),remote:a="origin",ref:o,filepaths:s,noCheckout:l=!1,noUpdateHead:c=o===void 0,dryRun:u=!1,force:d=!1,track:p=!0,cache:m={}}){try{T("fs",e),T("dir",n),T("gitdir",i);const g=o||"HEAD";return await Ko({fs:new J(e),cache:m,onProgress:t,onPostCheckout:r,dir:n,gitdir:i,remote:a,ref:g,filepaths:s,noCheckout:l,noUpdateHead:c,dryRun:u,force:d,track:p})}catch(g){throw g.caller="git.checkout",g}}const bg=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Dr(e){const t=bg.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function mr({fs:e,gitdir:t,fullname:r=!1,test:n=!1}){const i=await U.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(n)try{await U.resolve({fs:e,gitdir:t,ref:i})}catch{return}if(i.startsWith("refs/"))return r?i:Dr(i)}function _g(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function Ku({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function pi(e,t){const r=Iu(e);for(;;){const{value:n,done:i}=await r.next();if(n&&await t(n),i)break}r.return&&r.return()}async function aa(e){let t=0;const r=[];await pi(e,a=>{r.push(a),t+=a.byteLength});const n=new Uint8Array(t);let i=0;for(const a of r)n.set(a,i),i+=a.byteLength;return n}function Ju(e){let t=e.match(/^https?:\/\/([^/]+)@/);if(t==null)return{url:e,auth:{}};t=t[1];const[r,n]=t.split(":");return e=e.replace(`${t}@`,""),{url:e,auth:{username:r,password:n}}}function Jo(e,t){const r=t.toString(16);return"0".repeat(e-r.length)+r}class Fe{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){typeof t=="string"&&(t=Buffer.from(t));const r=t.length+4,n=Jo(4,r);return Buffer.concat([Buffer.from(n,"utf8"),t])}static streamReader(t){const r=new ju(t);return async function(){try{let i=await r.read(4);if(i==null)return!0;if(i=parseInt(i.toString("utf8"),16),i===0||i===1)return null;const a=await r.read(i-4);return a??!0}catch(i){return t.error=i,!0}}}}async function Qu(e){const t={};let r;for(;r=await e(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");const n=r.indexOf("=");if(n>-1){const i=r.slice(0,n),a=r.slice(n+1);t[i]=a}else t[r]=!0}return{protocolVersion:2,capabilities2:t}}async function ef(e,{service:t}){const r=new Set,n=new Map,i=new Map,a=Fe.streamReader(e);let o=await a();for(;o===null;)o=await a();if(o===!0)throw new ei;if(o.includes("version 2"))return Qu(a);if(o.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new $r(`# service=${t}\\n`,o.toString("utf8"));let s=await a();for(;s===null;)s=await a();if(s===!0)return{capabilities:r,refs:n,symrefs:i};if(s=s.toString("utf8"),s.includes("version 2"))return Qu(a);const[l,c]=Qo(s,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){const[u,d]=Qo(l," "," ");for(n.set(d,u);;){const p=await a();if(p===!0)break;if(p!==null){const[m,g]=Qo(p.toString("utf8")," "," ");n.set(g,m)}}}for(const u of r)if(u.startsWith("symref=")){const d=u.match(/symref=([^:]+):(.*)/);d.length===3&&i.set(d[1],d[2])}return{protocolVersion:1,capabilities:r,refs:n,symrefs:i}}function Qo(e,t,r){const n=e.trim().split(t);if(n.length!==2)throw new $r(`Two strings separated by '${r}'`,e.toString("utf8"));return n}const tf=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,rf=(e,t)=>{(t.username||t.password)&&(e.Authorization=Ku(t)),t.headers&&Object.assign(e,t.headers)},es=async e=>{try{const t=Buffer.from(await aa(e.body)),r=t.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:t}}catch{return{}}};class oa{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:r,onAuth:n,onAuthSuccess:i,onAuthFailure:a,corsProxy:o,service:s,url:l,headers:c,protocolVersion:u}){let{url:d,auth:p}=Ju(l);const m=o?tf(o,d):d;(p.username||p.password)&&(c.Authorization=Ku(p)),u===2&&(c["Git-Protocol"]="version=2");let g,_,x=!1;do if(g=await t.request({onProgress:r,method:"GET",url:`${m}/info/refs?service=${s}`,headers:c}),_=!1,g.statusCode===401||g.statusCode===203){const y=x?a:n;if(y){if(p=await y(d,{...p,headers:{...c}}),p&&p.cancel)throw new fn;p&&(rf(c,p),x=!0,_=!0)}}else g.statusCode===200&&x&&i&&await i(d,p);while(_);if(g.statusCode!==200){const{response:y}=await es(g);throw new sn(g.statusCode,g.statusMessage,y)}if(g.headers["content-type"]===`application/x-${s}-advertisement`){const y=await ef(g.body,{service:s});return y.auth=p,y}else{const{preview:y,response:v,data:O}=await es(g);try{const R=await ef([O],{service:s});return R.auth=p,R}catch{throw new ai(y,v)}}}static async connect({http:t,onProgress:r,corsProxy:n,service:i,url:a,auth:o,body:s,headers:l}){const c=Ju(a);c&&(a=c.url),n&&(a=tf(n,a)),l["content-type"]=`application/x-${i}-request`,l.accept=`application/x-${i}-result`,rf(l,o);const u=await t.request({onProgress:r,method:"POST",url:`${a}/${i}`,body:s,headers:l});if(u.statusCode!==200){const{response:d}=es(u);throw new sn(u.statusCode,u.statusMessage,d)}return u}}function vg({url:e}){if(e.startsWith("git@"))return{transport:"ssh",address:e};const t=e.match(/(\w+)(:\/\/|::)(.*)/);if(t!==null){if(t[2]==="://")return{transport:t[1],address:t[0]};if(t[2]==="::")return{transport:t[1],address:t[3]}}}class sa{static getRemoteHelperFor({url:t}){const r=new Map;r.set("http",oa),r.set("https",oa);const n=vg({url:t});if(!n)throw new si(t);if(r.has(n.transport))return r.get(n.transport);throw new oi(t,n.transport,n.transport==="ssh"?_g(t):void 0)}}let Ir=null;class mi{static async read({fs:t,gitdir:r}){Ir===null&&(Ir=new Pn);const n=N.join(r,"shallow"),i=new Set;return await Ir.acquire(n,async function(){const a=await t.read(n,{encoding:"utf8"});if(a===null||a.trim()==="")return i;a.trim().split(`
67
- `).map(o=>i.add(o))}),i}static async write({fs:t,gitdir:r,oids:n}){Ir===null&&(Ir=new Pn);const i=N.join(r,"shallow");if(n.size>0){const a=[...n].join(`
50
+ `))}parseHeaders(){const t=ft.justHeaders(this._commit).split(`
51
+ `),n=[];for(const o of t)o[0]===" "?n[n.length-1]+=`
52
+ `+o.slice(1):n.push(o);const r={parent:[]};for(const o of n){const i=o.slice(0,o.indexOf(" ")),a=o.slice(o.indexOf(" ")+1);Array.isArray(r[i])?r[i].push(a):r[i]=a}return r.author&&(r.author=Ac(r.author)),r.committer&&(r.committer=Ac(r.committer)),r}static renderHeaders(t){let n="";if(t.tree?n+=`tree ${t.tree}
53
+ `:n+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
54
+ `,t.parent){if(t.parent.length===void 0)throw new De("commit 'parent' property should be an array");for(const i of t.parent)n+=`parent ${i}
55
+ `}const r=t.author;n+=`author ${rh(r)}
56
+ `;const o=t.committer||t.author;return n+=`committer ${rh(o)}
57
+ `,t.gpgsig&&(n+="gpgsig"+oh(t.gpgsig)),n}static render(t){return ft.renderHeaders(t)+`
58
+ `+Ir(t.message)}render(){return this._commit}withoutSignature(){const t=Ir(this._commit);if(t.indexOf(`
59
+ gpgsig`)===-1)return t;const n=t.slice(0,t.indexOf(`
60
+ gpgsig`)),r=t.slice(t.indexOf(`-----END PGP SIGNATURE-----
61
+ `)+28);return Ir(n+`
62
+ `+r)}isolateSignature(){const t=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return FF(t)}static async sign(t,n,r){const o=t.withoutSignature(),i=ft.justMessage(t._commit);let{signature:a}=await n({payload:o,secretKey:r});a=Ir(a);const l=ft.justHeaders(t._commit)+`
63
+ gpgsig`+oh(a)+`
64
+ `+i;return ft.from(l)}}async function Hi({fs:e,cache:t,gitdir:n,oid:r}){if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:tn.from([]),oid:r};const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=Kt.from(i).parse().object,Hi({fs:e,cache:t,gitdir:n,oid:r});if(o==="commit")return r=ft.from(i).parse().tree,Hi({fs:e,cache:t,gitdir:n,oid:r});if(o!=="tree")throw new Yt(r,o,"tree");return{tree:tn.from(i),oid:r}}class LF{constructor({fs:t,gitdir:n,ref:r,cache:o}){this.fs=t,this.cache=o,this.gitdir=n,this.mapPromise=(async()=>{const a=new Map;let s;try{s=await de.resolve({fs:t,gitdir:n,ref:r})}catch(c){c instanceof ot&&(s="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}const l=await Hi({fs:t,cache:this.cache,gitdir:n,oid:s});return l.type="tree",l.mode="40000",a.set(".",l),a})();const i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const n=t._fullpath,{fs:r,cache:o,gitdir:i}=this,a=await this.mapPromise,s=a.get(n);if(!s)throw new Error(`No obj for ${n}`);const l=s.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(s)}`);if(s.type!=="tree")return null;const{type:c,object:u}=await dt({fs:r,cache:o,gitdir:i,oid:l});if(c!==s.type)throw new Yt(l,c,s.type);const d=tn.from(u);for(const f of d)a.set(ue.join(n,f.path),f);return d.entries().map(f=>ue.join(n,f.path))}async type(t){if(t._type===!1){const n=await this.mapPromise,{type:r}=n.get(t._fullpath);t._type=r}return t._type}async mode(t){if(t._mode===!1){const n=await this.mapPromise,{mode:r}=n.get(t._fullpath);t._mode=B0(parseInt(r,8))}return t._mode}async stat(t){}async content(t){if(t._content===!1){const n=await this.mapPromise,{fs:r,cache:o,gitdir:i}=this,s=n.get(t._fullpath).oid,{type:l,object:c}=await dt({fs:r,cache:o,gitdir:i,oid:s});l!=="blob"?t._content=void 0:t._content=new Uint8Array(c)}return t._content}async oid(t){if(t._oid===!1){const r=(await this.mapPromise).get(t._fullpath);t._oid=r.oid}return t._oid}}function kn({ref:e="HEAD"}={}){const t=Object.create(null);return Object.defineProperty(t,Rc,{value:function({fs:n,gitdir:r,cache:o}){return new LF({fs:n,gitdir:r,ref:e,cache:o})}}),Object.freeze(t),t}class zF{constructor({fs:t,dir:n,gitdir:r,cache:o}){this.fs=t,this.cache=o,this.dir=n,this.gitdir=r;const i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const n=t._fullpath,{fs:r,dir:o}=this,i=await r.readdir(ue.join(o,n));return i===null?null:i.map(a=>ue.join(n,a))}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){const{fs:n,dir:r}=this;let o=await n.lstat(`${r}/${t._fullpath}`);if(!o)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let i=o.isDirectory()?"tree":"blob";i==="blob"&&!o.isFile()&&!o.isSymbolicLink()&&(i="special"),t._type=i,o=Di(o),t._mode=o.mode,o.size===-1&&t._actualSize&&(o.size=t._actualSize),t._stat=o}return t._stat}async content(t){if(t._content===!1){const{fs:n,dir:r,gitdir:o}=this;if(await t.type()==="tree")t._content=void 0;else{const a=await(await bt.get({fs:n,gitdir:o})).get("core.autocrlf"),s=await n.read(`${r}/${t._fullpath}`,{autocrlf:a});t._actualSize=s.length,t._stat&&t._stat.size===-1&&(t._stat.size=t._actualSize),t._content=new Uint8Array(s)}}return t._content}async oid(t){if(t._oid===!1){const{fs:n,gitdir:r,cache:o}=this;let i;await Rt.acquire({fs:n,gitdir:r,cache:o},async function(a){const s=a.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await bt.get({fs:n,gitdir:r})).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;!s||Ec(l,s,u,d)?await t.content()===void 0?i=void 0:(i=await kr(Oi.wrap({type:"blob",object:await t.content()})),s&&i===s.oid&&(!u||l.mode===s.mode)&&Ec(l,s,u,d)&&a.insert({filepath:t._fullpath,stats:l,oid:i})):i=s.oid}),t._oid=i}return t._oid}}function Os(){const e=Object.create(null);return Object.defineProperty(e,Rc,{value:function({fs:t,dir:n,gitdir:r,cache:o}){return new zF({fs:t,dir:n,gitdir:r,cache:o})}}),Object.freeze(e),e}function BF(e,t){const n=t-e;return Array.from({length:n},(r,o)=>e+o)}const ob=typeof Array.prototype.flat>"u"?e=>e.reduce((t,n)=>t.concat(n),[]):e=>e.flat();class HF{constructor(){this.value=null}consider(t){t!=null&&(this.value===null?this.value=t:t<this.value&&(this.value=t))}reset(){this.value=null}}function*UF(e){const t=new HF;let n;const r=[],o=e.length;for(let i=0;i<o;i++)r[i]=e[i].next().value,r[i]!==void 0&&t.consider(r[i]);if(t.value!==null)for(;;){const i=[];n=t.value,t.reset();for(let a=0;a<o;a++)r[a]!==void 0&&r[a]===n?(i[a]=r[a],r[a]=e[a].next().value):i[a]=null,r[a]!==void 0&&t.consider(r[a]);if(yield i,t.value===null)return}}async function io({fs:e,cache:t,dir:n,gitdir:r,trees:o,map:i=async(l,c)=>c,reduce:a=async(l,c)=>{const u=ob(c);return l!==void 0&&u.unshift(l),u},iterate:s=(l,c)=>Promise.all([...c].map(l))}){const l=o.map(h=>h[Rc]({fs:e,dir:n,gitdir:r,cache:t})),c=new Array(l.length).fill("."),u=BF(0,l.length),d=async h=>{u.map(v=>{h[v]=h[v]&&new l[v].ConstructEntry(h[v])});const m=(await Promise.all(u.map(v=>h[v]?l[v].readdir(h[v]):[]))).map(v=>v===null?[]:v).map(v=>v[Symbol.iterator]());return{entries:h,children:UF(m)}},f=async h=>{const{entries:p,children:m}=await d(h),v=p.find(b=>b&&b._fullpath)._fullpath,w=await i(v,p);if(w!==null){let b=await s(f,m);return b=b.filter(x=>x!==void 0),a(w,b)}};return f(c)}async function ih(e,t){const n=await e.readdir(t);n==null?await e.rm(t):n.length?await Promise.all(n.map(r=>{const o=ue.join(t,r);return e.lstat(o).then(i=>{if(i)return i.isDirectory()?ih(e,o):e.rm(o)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function VF(e){return WF(e)&&ib(e.then)&&ib(e.catch)}function WF(e){return e&&typeof e=="object"}function ib(e){return typeof e=="function"}function ab(e){return VF((n=>{try{return n.readFile().catch(r=>r)}catch(r){return r}})(e))}const sb=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function lb(e,t){if(ab(t))for(const n of sb)e[`_${n}`]=t[n].bind(t);else for(const n of sb)e[`_${n}`]=Wf(t[n].bind(t));ab(t)?t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=ih.bind(null,e):t.rm?e._rm=Wf(t.rm.bind(t)):t.rmdir.length>2?e._rm=Wf(t.rmdir.bind(t)):e._rm=ih.bind(null,e)}class be{constructor(t){if(typeof t._original_unwrapped_fs<"u")return t;const n=Object.getOwnPropertyDescriptor(t,"promises");n&&n.enumerable?lb(this,t.promises):lb(this,t),this._original_unwrapped_fs=t}async exists(t,n={}){try{return await this._stat(t),!0}catch(r){if(r.code==="ENOENT"||r.code==="ENOTDIR"||(r.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',r),r}}async read(t,n={}){try{let r=await this._readFile(t,n);if(n.autocrlf==="true")try{r=new TextDecoder("utf8",{fatal:!0}).decode(r),r=r.replace(/\r\n/g,`
65
+ `),r=new TextEncoder().encode(r)}catch{}return typeof r!="string"&&(r=Buffer.from(r)),r}catch{return null}}async write(t,n,r={}){try{await this._writeFile(t,n,r);return}catch{await this.mkdir(ki(t)),await this._writeFile(t,n,r)}}async mkdir(t,n=!1){try{await this._mkdir(t);return}catch(r){if(r===null||r.code==="EEXIST")return;if(n)throw r;if(r.code==="ENOENT"){const o=ki(t);if(o==="."||o==="/"||o===t)throw r;await this.mkdir(o),await this.mkdir(t,!0)}}}async rm(t){try{await this._unlink(t)}catch(n){if(n.code!=="ENOENT")throw n}}async rmdir(t,n){try{n&&n.recursive?await this._rm(t,n):await this._rmdir(t)}catch(r){if(r.code!=="ENOENT")throw r}}async readdir(t){try{const n=await this._readdir(t);return n.sort(Cc),n}catch(n){return n.code==="ENOTDIR"?null:[]}}async readdirDeep(t){const n=await this._readdir(t);return(await Promise.all(n.map(async o=>{const i=t+"/"+o;return(await this._stat(i)).isDirectory()?this.readdirDeep(i):i}))).reduce((o,i)=>o.concat(i),[])}async lstat(t){try{return await this._lstat(t)}catch(n){if(n.code==="ENOENT"||(n.code||"").includes("ENS"))return null;throw n}}async readlink(t,n={encoding:"buffer"}){try{const r=await this._readlink(t,n);return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async writelink(t,n){return this._symlink(n.toString("utf8"),t)}}function W(e,t){if(t===void 0)throw new nn(e)}async function kc(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()==="tree"&&await t.type()==="tree"||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function GF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),commit:r="HEAD",cache:o={}}){try{W("fs",e),W("dir",t),W("gitdir",n);const i=new be(e),a=[kn({ref:r}),Os(),Ii()];let s=[];await Rt.acquire({fs:i,gitdir:n,cache:o},async function(c){s=c.unmergedPaths});const l=await io({fs:i,cache:o,dir:t,gitdir:n,trees:a,map:async function(c,[u,d,f]){const h=!await kc(d,f),p=s.includes(c),m=!await kc(f,u);if(h||p)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(m)return!1;throw new ks(c)}});await Rt.acquire({fs:i,gitdir:n,cache:o},async function(c){for(const u of l)if(u!==!1){if(!u){await i.rmdir(`${t}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){const d=new TextDecoder().decode(u.content);await i.write(`${t}/${u.path}`,d,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(i){throw i.caller="git.abortMerge",i}}class Ui{static async isIgnored({fs:t,dir:n,gitdir:r=ue.join(n,".git"),filepath:o}){if(Pc(o)===".git")return!0;if(o===".")return!1;let i="";const a=ue.join(r,"info","exclude");await t.exists(a)&&(i=await t.read(a,"utf8"));const s=[{gitignore:ue.join(n,".gitignore"),filepath:o}],l=o.split("/").filter(Boolean);for(let u=1;u<l.length;u++){const d=l.slice(0,u).join("/"),f=l.slice(u).join("/");s.push({gitignore:ue.join(n,d,".gitignore"),filepath:f})}let c=!1;for(const u of s){let d;try{d=await t.read(u.gitignore,"utf8")}catch(p){if(p.code==="NOENT")continue}const f=L$().add(i);f.add(d);const h=ki(u.filepath);if(h!=="."&&f.ignores(h))return!0;c?c=!f.test(u.filepath).unignored:c=f.test(u.filepath).ignored}return c}}async function qF({fs:e,gitdir:t,object:n,format:r,oid:o}){if(r!=="deflated")throw new De("GitObjectStoreLoose expects objects to write to be in deflated format");const i=`objects/${o.slice(0,2)}/${o.slice(2)}`,a=`${t}/${i}`;await e.exists(a)||await e.write(a,n)}let ah=null;async function cb(e){return ah===null&&(ah=KF()),ah?YF(e):Vf.deflate(e)}async function YF(e){const t=new CompressionStream("deflate"),n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}function KF(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function rn({fs:e,gitdir:t,type:n,object:r,format:o="content",oid:i=void 0,dryRun:a=!1}){return o!=="deflated"&&(o!=="wrapped"&&(r=Oi.wrap({type:n,object:r})),i=await kr(r),r=Buffer.from(await cb(r))),a||await qF({fs:e,gitdir:t,object:r,format:"deflated",oid:i}),i}function ub(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function XF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,cache:o={},force:i=!1,parallel:a=!0}){try{W("fs",e),W("dir",t),W("gitdir",n),W("filepath",r);const s=new be(e);await Rt.acquire({fs:s,gitdir:n,cache:o},async l=>sh({dir:t,gitdir:n,fs:s,filepath:r,index:l,force:i,parallel:a}))}catch(s){throw s.caller="git.add",s}}async function sh({dir:e,gitdir:t,fs:n,filepath:r,index:o,force:i,parallel:a}){r=Array.isArray(r)?r:[r];const s=r.map(async d=>{if(!i&&await Ui.isIgnored({fs:n,dir:e,gitdir:t,filepath:d}))return;const f=await n.lstat(ue.join(e,d));if(!f)throw new ot(d);if(f.isDirectory()){const h=await n.readdir(ue.join(e,d));if(a){const p=h.map(m=>sh({dir:e,gitdir:t,fs:n,filepath:[ue.join(d,m)],index:o,force:i,parallel:a}));await Promise.all(p)}else for(const p of h)await sh({dir:e,gitdir:t,fs:n,filepath:[ue.join(d,p)],index:o,force:i,parallel:a})}else{const p=await(await bt.get({fs:n,gitdir:t})).get("core.autocrlf"),m=f.isSymbolicLink()?await n.readlink(ue.join(e,d)).then(ub):await n.read(ue.join(e,d),{autocrlf:p});if(m===null)throw new ot(d);const v=await rn({fs:n,gitdir:t,type:"blob",object:m});o.insert({filepath:d,stats:f,oid:v})}}),l=await Promise.allSettled(s),c=l.filter(d=>d.status==="rejected").map(d=>d.reason);if(c.length>1)throw new Ts(c);if(c.length===1)throw c[0];return l.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function js({fs:e,gitdir:t,path:n}){return(await bt.get({fs:e,gitdir:t})).get(n)}function db(e,...t){for(const n of t)if(n)for(const r of Object.keys(n)){const o=n[r];o!==void 0&&(e[r]=o)}return e}async function ao({fs:e,gitdir:t,author:n,commit:r}){const o=Math.floor(Date.now()/1e3),i={name:await js({fs:e,gitdir:t,path:"user.name"}),email:await js({fs:e,gitdir:t,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},a=db({},i,r?r.author:void 0,n);if(a.name!==void 0)return a}async function Vi({fs:e,gitdir:t,author:n,committer:r,commit:o}){const i=Math.floor(Date.now()/1e3),a={name:await js({fs:e,gitdir:t,path:"user.name"}),email:await js({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},s=db({},a,o?o.committer:void 0,n,r);if(s.name!==void 0)return s}async function fb({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=Kt.from(i).parse().object,fb({fs:e,cache:t,gitdir:n,oid:r});if(o!=="commit")throw new Yt(r,o,"commit");return{commit:ft.from(i),oid:r}}async function Wi({fs:e,cache:t,gitdir:n,oid:r}){const{commit:o,oid:i}=await fb({fs:e,cache:t,gitdir:n,oid:r});return{oid:i,commit:o.parse(),payload:o.withoutSignature()}}async function Ic({fs:e,cache:t,onSign:n,gitdir:r,message:o,author:i,committer:a,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:f,tree:h}){let p=!1;d||(d=await de.resolve({fs:e,gitdir:r,ref:"HEAD",depth:2}));let m,v;try{m=await de.resolve({fs:e,gitdir:r,ref:d}),v=await Wi({fs:e,gitdir:r,oid:m,cache:{}})}catch{p=!0}if(l&&p)throw new Is(d);const w=l?await ao({fs:e,gitdir:r,author:i,commit:v.commit}):await ao({fs:e,gitdir:r,author:i});if(!w)throw new Ot("author");const b=l?await Vi({fs:e,gitdir:r,author:w,committer:a,commit:v.commit}):await Vi({fs:e,gitdir:r,author:w,committer:a});if(!b)throw new Ot("committer");return Rt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async function(x){const C=V0(x.entries).get(".");if(h||(h=await hb({fs:e,gitdir:r,inode:C,dryRun:c})),f?f=await Promise.all(f.map(T=>de.resolve({fs:e,gitdir:r,ref:T}))):l?f=v.commit.parent:f=m?[m]:[],!o)if(l)o=v.commit.message;else throw new nn("message");let N=ft.from({tree:h,parent:f,author:w,committer:b,message:o});s&&(N=await ft.sign(N,n,s));const R=await rn({fs:e,gitdir:r,type:"commit",object:N.toObject(),dryRun:c});return!u&&!c&&await de.writeRef({fs:e,gitdir:r,ref:d,value:R}),R})}async function hb({fs:e,gitdir:t,inode:n,dryRun:r}){const o=n.children;for(const l of o)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await hb({fs:e,gitdir:t,inode:l,dryRun:r}));const i=o.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),a=tn.from(i);return await rn({fs:e,gitdir:t,type:"tree",object:a.toObject(),dryRun:r})}async function $s({fs:e,cache:t,gitdir:n,oid:r,filepath:o}){if(o.startsWith("/"))throw new ro("leading-slash");if(o.endsWith("/"))throw new ro("trailing-slash");const i=r,a=await Hi({fs:e,cache:t,gitdir:n,oid:r}),s=a.tree;if(o==="")r=a.oid;else{const l=o.split("/");r=await pb({fs:e,cache:t,gitdir:n,tree:s,pathArray:l,oid:i,filepath:o})}return r}async function pb({fs:e,cache:t,gitdir:n,tree:r,pathArray:o,oid:i,filepath:a}){const s=o.shift();for(const l of r)if(l.path===s){if(o.length===0)return l.oid;{const{type:c,object:u}=await dt({fs:e,cache:t,gitdir:n,oid:l.oid});if(c!=="tree")throw new Yt(i,c,"tree",a);return r=tn.from(u),pb({fs:e,cache:t,gitdir:n,tree:r,pathArray:o,oid:i,filepath:a})}}throw new ot(`file or directory found at "${i}:${a}"`)}async function Gi({fs:e,cache:t,gitdir:n,oid:r,filepath:o=void 0}){o!==void 0&&(r=await $s({fs:e,cache:t,gitdir:n,oid:r,filepath:o}));const{tree:i,oid:a}=await Hi({fs:e,cache:t,gitdir:n,oid:r});return{oid:a,tree:i.entries()}}async function Fs({fs:e,gitdir:t,tree:n}){const r=tn.from(n).toObject();return await rn({fs:e,gitdir:t,type:"tree",object:r,format:"content"})}async function ZF({fs:e,cache:t,onSign:n,gitdir:r,ref:o,oid:i,note:a,force:s,author:l,committer:c,signingKey:u}){let d;try{d=await de.resolve({gitdir:r,fs:e,ref:o})}catch(w){if(!(w instanceof ot))throw w}let h=(await Gi({fs:e,cache:t,gitdir:r,oid:d||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(s)h=h.filter(w=>w.path!==i);else for(const w of h)if(w.path===i)throw new Ln("note",i);typeof a=="string"&&(a=Buffer.from(a,"utf8"));const p=await rn({fs:e,gitdir:r,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:i,oid:p,type:"blob"});const m=await Fs({fs:e,gitdir:r,tree:h});return await Ic({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tree:m,parent:d&&[d],message:`Note added by 'isomorphic-git addNote'
66
+ `,author:l,committer:c,signingKey:u})}async function JF({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ref:o="refs/notes/commits",oid:i,note:a,force:s,author:l,committer:c,signingKey:u,cache:d={}}){try{W("fs",e),W("gitdir",r),W("oid",i),W("note",a),u&&W("onSign",t);const f=new be(e),h=await ao({fs:f,gitdir:r,author:l});if(!h)throw new Ot("author");const p=await Vi({fs:f,gitdir:r,author:h,committer:c});if(!p)throw new Ot("committer");return await ZF({fs:new be(f),cache:d,onSign:t,gitdir:r,ref:o,oid:i,note:a,force:s,author:h,committer:p,signingKey:u})}catch(f){throw f.caller="git.addNote",f}}async function mb({fs:e,gitdir:t,remote:n,url:r,force:o}){if(n!==dr.clean(n))throw new zn(n,dr.clean(n));const i=await bt.get({fs:e,gitdir:t});if(!o&&(await i.getSubsections("remote")).includes(n)&&r!==await i.get(`remote.${n}.url`))throw new Ln("remote",n);await i.set(`remote.${n}.url`,r),await i.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await bt.save({fs:e,gitdir:t,config:i})}async function QF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),remote:r,url:o,force:i=!1}){try{return W("fs",e),W("gitdir",n),W("remote",r),W("url",o),await mb({fs:new be(e),gitdir:n,remote:r,url:o,force:i})}catch(a){throw a.caller="git.addRemote",a}}async function eL({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1}){if(o=o.startsWith("refs/tags/")?o:`refs/tags/${o}`,!u&&await de.exists({fs:e,gitdir:r,ref:o}))throw new Ln("tag",o);const d=await de.resolve({fs:e,gitdir:r,ref:l||"HEAD"}),{type:f}=await dt({fs:e,cache:t,gitdir:r,oid:d});let h=Kt.from({object:d,type:f,tag:o.replace("refs/tags/",""),tagger:i,message:a,gpgsig:s});c&&(h=await Kt.sign(h,n,c));const p=await rn({fs:e,gitdir:r,type:"tag",object:h.toObject()});await de.writeRef({fs:e,gitdir:r,ref:o,value:p})}async function tL({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1,cache:d={}}){try{W("fs",e),W("gitdir",r),W("ref",o),c&&W("onSign",t);const f=new be(e),h=await ao({fs:f,gitdir:r,author:i});if(!h)throw new Ot("tagger");return await eL({fs:f,cache:d,onSign:t,gitdir:r,ref:o,tagger:h,message:a,gpgsig:s,object:l,signingKey:c,force:u})}catch(f){throw f.caller="git.annotatedTag",f}}async function nL({fs:e,gitdir:t,ref:n,object:r,checkout:o=!1,force:i=!1}){if(n!==dr.clean(n))throw new zn(n,dr.clean(n));const a=`refs/heads/${n}`;if(!i&&await de.exists({fs:e,gitdir:t,ref:a}))throw new Ln("branch",n,!1);let s;try{s=await de.resolve({fs:e,gitdir:t,ref:r||"HEAD"})}catch{}s&&await de.writeRef({fs:e,gitdir:t,ref:a,value:s}),o&&await de.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function rL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,object:o,checkout:i=!1,force:a=!1}){try{return W("fs",e),W("gitdir",n),W("ref",r),await nL({fs:new be(e),gitdir:n,ref:r,object:o,checkout:i,force:a})}catch(s){throw s.caller="git.branch",s}}const gb=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function lh({fs:e,cache:t,onProgress:n,onPostCheckout:r,dir:o,gitdir:i,remote:a,ref:s,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:d,force:f,track:h=!0}){let p;if(r)try{p=await de.resolve({fs:e,gitdir:i,ref:"HEAD"})}catch{p="0000000000000000000000000000000000000000"}let m;try{m=await de.resolve({fs:e,gitdir:i,ref:s})}catch(v){if(s==="HEAD")throw v;const w=`${a}/${s}`;if(m=await de.resolve({fs:e,gitdir:i,ref:w}),h){const b=await bt.get({fs:e,gitdir:i});await b.set(`branch.${s}.remote`,a),await b.set(`branch.${s}.merge`,`refs/heads/${s}`),await bt.save({fs:e,gitdir:i,config:b})}await de.writeRef({fs:e,gitdir:i,ref:`refs/heads/${s}`,value:m})}if(!c){let v;try{v=await oL({fs:e,cache:t,onProgress:n,dir:o,gitdir:i,ref:s,force:f,filepaths:l})}catch(C){throw C instanceof ot&&C.data.what===m?new Cs(s,m):C}const w=v.filter(([C])=>C==="conflict").map(([C,N])=>N);if(w.length>0)throw new Ss(w);const b=v.filter(([C])=>C==="error").map(([C,N])=>N);if(b.length>0)throw new De(b.join(", "));if(d){r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"});return}let x=0;const S=v.length;await Rt.acquire({fs:e,gitdir:i,cache:t},async function(C){await Promise.all(v.filter(([N])=>N==="delete"||N==="delete-index").map(async function([N,R]){const T=`${o}/${R}`;N==="delete"&&await e.rm(T),C.delete({filepath:R}),n&&await n({phase:"Updating workdir",loaded:++x,total:S})}))}),await Rt.acquire({fs:e,gitdir:i,cache:t},async function(C){for(const[N,R]of v)if(N==="rmdir"||N==="rmdir-index"){const T=`${o}/${R}`;try{N==="rmdir-index"&&C.delete({filepath:R}),await e.rmdir(T),n&&await n({phase:"Updating workdir",loaded:++x,total:S})}catch(M){if(M.code==="ENOTEMPTY")console.log(`Did not delete ${R} because directory is not empty`);else throw M}}}),await Promise.all(v.filter(([C])=>C==="mkdir"||C==="mkdir-index").map(async function([C,N]){const R=`${o}/${N}`;await e.mkdir(R),n&&await n({phase:"Updating workdir",loaded:++x,total:S})})),await Rt.acquire({fs:e,gitdir:i,cache:t},async function(C){await Promise.all(v.filter(([N])=>N==="create"||N==="create-index"||N==="update"||N==="mkdir-index").map(async function([N,R,T,M,A]){const k=`${o}/${R}`;try{if(N!=="create-index"&&N!=="mkdir-index"){const{object:L}=await dt({fs:e,cache:t,gitdir:i,oid:T});if(A&&await e.rm(k),M===33188)await e.write(k,L);else if(M===33261)await e.write(k,L,{mode:511});else if(M===40960)await e.writelink(k,L);else throw new De(`Invalid mode 0o${M.toString(8)} detected in blob ${T}`)}const F=await e.lstat(k);M===33261&&(F.mode=493),N==="mkdir-index"&&(F.mode=57344),C.insert({filepath:R,stats:F,oid:T}),n&&await n({phase:"Updating workdir",loaded:++x,total:S})}catch(F){console.log(F)}}))}),r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"})}if(!u){const v=await de.expand({fs:e,gitdir:i,ref:s});v.startsWith("refs/heads")?await de.writeSymbolicRef({fs:e,gitdir:i,ref:"HEAD",value:v}):await de.writeRef({fs:e,gitdir:i,ref:"HEAD",value:m})}}async function oL({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,ref:i,force:a,filepaths:s}){let l=0;return io({fs:e,cache:t,dir:r,gitdir:o,trees:[kn({ref:i}),Os(),Ii()],map:async function(c,[u,d,f]){if(c===".")return;if(s&&!s.some(p=>gb(c,p)))return null;switch(n&&await n({phase:"Analyzing workdir",loaded:++l}),[!!f,!!u,!!d].map(Number).join("")){case"000":return;case"001":return a&&s&&s.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await d.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await d.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]:await u.mode()!==await d.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await f.type()){case"tree":return["rmdir",c];case"blob":return await f.oid()!==await d.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await f.type()}`]}case"110":case"111":switch(`${await f.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await f.oid()===await u.oid()&&await f.mode()===await u.mode()&&!a)return;if(d){if(await d.oid()!==await f.oid()&&await d.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()];return await u.mode()!==await f.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await f.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await f.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=ob(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function wb({fs:e,onProgress:t,onPostCheckout:n,dir:r,gitdir:o=ue.join(r,".git"),remote:i="origin",ref:a,filepaths:s,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:d=!1,track:f=!0,cache:h={}}){try{W("fs",e),W("dir",r),W("gitdir",o);const p=a||"HEAD";return await lh({fs:new be(e),cache:h,onProgress:t,onPostCheckout:n,dir:r,gitdir:o,remote:i,ref:p,filepaths:s,noCheckout:l,noUpdateHead:c,dryRun:u,force:d,track:f})}catch(p){throw p.caller="git.checkout",p}}const iL=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Vo(e){const t=iL.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function so({fs:e,gitdir:t,fullname:n=!1,test:r=!1}){const o=await de.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(r)try{await de.resolve({fs:e,gitdir:t,ref:o})}catch{return}if(o.startsWith("refs/"))return n?o:Vo(o)}function aL(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function vb({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function Ls(e,t){const n=tb(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function Oc(e){let t=0;const n=[];await Ls(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function yb(e){let t=e.match(/^https?:\/\/([^/]+)@/);if(t==null)return{url:e,auth:{}};t=t[1];const[n,r]=t.split(":");return e=e.replace(`${t}@`,""),{url:e,auth:{username:n,password:r}}}function ch(e,t){const n=t.toString(16);return"0".repeat(e-n.length)+n}class xt{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){typeof t=="string"&&(t=Buffer.from(t));const n=t.length+4,r=ch(4,n);return Buffer.concat([Buffer.from(r,"utf8"),t])}static streamReader(t){const n=new nb(t);return async function(){try{let o=await n.read(4);if(o==null)return!0;if(o=parseInt(o.toString("utf8"),16),o===0||o===1)return null;const i=await n.read(o-4);return i??!0}catch(o){return t.error=o,!0}}}}async function bb(e){const t={};let n;for(;n=await e(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");const r=n.indexOf("=");if(r>-1){const o=n.slice(0,r),i=n.slice(r+1);t[o]=i}else t[n]=!0}return{protocolVersion:2,capabilities2:t}}async function xb(e,{service:t}){const n=new Set,r=new Map,o=new Map,i=xt.streamReader(e);let a=await i();for(;a===null;)a=await i();if(a===!0)throw new Es;if(a.includes("version 2"))return bb(i);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new Uo(`# service=${t}\\n`,a.toString("utf8"));let s=await i();for(;s===null;)s=await i();if(s===!0)return{capabilities:n,refs:r,symrefs:o};if(s=s.toString("utf8"),s.includes("version 2"))return bb(i);const[l,c]=uh(s,"\0","\\x00");if(c.split(" ").map(u=>n.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){const[u,d]=uh(l," "," ");for(r.set(d,u);;){const f=await i();if(f===!0)break;if(f!==null){const[h,p]=uh(f.toString("utf8")," "," ");r.set(p,h)}}}for(const u of n)if(u.startsWith("symref=")){const d=u.match(/symref=([^:]+):(.*)/);d.length===3&&o.set(d[1],d[2])}return{protocolVersion:1,capabilities:n,refs:r,symrefs:o}}function uh(e,t,n){const r=e.trim().split(t);if(r.length!==2)throw new Uo(`Two strings separated by '${n}'`,e.toString("utf8"));return r}const _b=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,Sb=(e,t)=>{(t.username||t.password)&&(e.Authorization=vb(t)),t.headers&&Object.assign(e,t.headers)},dh=async e=>{try{const t=Buffer.from(await Oc(e.body)),n=t.toString("utf8");return{preview:n.length<256?n:n.slice(0,256)+"...",response:n,data:t}}catch{return{}}};class jc{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:n,onAuth:r,onAuthSuccess:o,onAuthFailure:i,corsProxy:a,service:s,url:l,headers:c,protocolVersion:u}){let{url:d,auth:f}=yb(l);const h=a?_b(a,d):d;(f.username||f.password)&&(c.Authorization=vb(f)),u===2&&(c["Git-Protocol"]="version=2");let p,m,v=!1;do if(p=await t.request({onProgress:n,method:"GET",url:`${h}/info/refs?service=${s}`,headers:c}),m=!1,p.statusCode===401||p.statusCode===203){const w=v?i:r;if(w){if(f=await w(d,{...f,headers:{...c}}),f&&f.cancel)throw new Bi;f&&(Sb(c,f),v=!0,m=!0)}}else p.statusCode===200&&v&&o&&await o(d,f);while(m);if(p.statusCode!==200){const{response:w}=await dh(p);throw new $i(p.statusCode,p.statusMessage,w)}if(p.headers["content-type"]===`application/x-${s}-advertisement`){const w=await xb(p.body,{service:s});return w.auth=f,w}else{const{preview:w,response:b,data:x}=await dh(p);try{const S=await xb([x],{service:s});return S.auth=f,S}catch{throw new Ms(w,b)}}}static async connect({http:t,onProgress:n,corsProxy:r,service:o,url:i,auth:a,body:s,headers:l}){const c=yb(i);c&&(i=c.url),r&&(i=_b(r,i)),l["content-type"]=`application/x-${o}-request`,l.accept=`application/x-${o}-result`,Sb(l,a);const u=await t.request({onProgress:n,method:"POST",url:`${i}/${o}`,body:s,headers:l});if(u.statusCode!==200){const{response:d}=dh(u);throw new $i(u.statusCode,u.statusMessage,d)}return u}}function sL({url:e}){if(e.startsWith("git@"))return{transport:"ssh",address:e};const t=e.match(/(\w+)(:\/\/|::)(.*)/);if(t!==null){if(t[2]==="://")return{transport:t[1],address:t[0]};if(t[2]==="::")return{transport:t[1],address:t[3]}}}class $c{static getRemoteHelperFor({url:t}){const n=new Map;n.set("http",jc),n.set("https",jc);const r=sL({url:t});if(!r)throw new As(t);if(n.has(r.transport))return n.get(r.transport);throw new Ds(t,r.transport,r.transport==="ssh"?aL(t):void 0)}}let Wo=null;class zs{static async read({fs:t,gitdir:n}){Wo===null&&(Wo=new ts);const r=ue.join(n,"shallow"),o=new Set;return await Wo.acquire(r,async function(){const i=await t.read(r,{encoding:"utf8"});if(i===null||i.trim()==="")return o;i.trim().split(`
67
+ `).map(a=>o.add(a))}),o}static async write({fs:t,gitdir:n,oids:r}){Wo===null&&(Wo=new ts);const o=ue.join(n,"shallow");if(r.size>0){const i=[...r].join(`
68
68
  `)+`
69
- `;await Ir.acquire(i,async function(){await t.write(i,a,{encoding:"utf8"})})}else await Ir.acquire(i,async function(){await t.rm(i)})}}async function xg({fs:e,gitdir:t,oid:r}){const n=`objects/${r.slice(0,2)}/${r.slice(2)}`;return e.exists(`${t}/${n}`)}async function Eg({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i}){let a=await e.readdir(N.join(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(const o of a){const s=`${r}/objects/pack/${o}`,l=await Go({fs:e,cache:t,filename:s,getExternalRefDelta:i});if(l.error)throw new ce(l.error);if(l.offsets.has(n))return!0}return!1}async function nf({fs:e,cache:t,gitdir:r,oid:n,format:i="content"}){const a=s=>De({fs:e,cache:t,gitdir:r,oid:s});let o=await xg({fs:e,gitdir:r,oid:n});return o||(o=await Eg({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:a})),o}function Sg(e){const i="5041434b"+"00000002"+"00000000";return e.slice(0,12).toString("hex")===i}function af(e,t){const r=e.map(n=>n.split("=",1)[0]);return t.filter(n=>{const i=n.split("=",1)[0];return r.includes(i)})}const ca={name:"isomorphic-git",version:"1.29.0",agent:"git/isomorphic-git@1.29.0"};class la{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){const r=this._waiting;this._waiting=null,r({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){const t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}}function kg(e){const t=e.indexOf("\r"),r=e.indexOf(`
70
- `);return t===-1&&r===-1?-1:t===-1?r+1:r===-1?t+1:r===t+1?r+1:Math.min(t,r)+1}function of(e){const t=new la;let r="";return(async()=>(await pi(e,n=>{for(n=n.toString("utf8"),r+=n;;){const i=kg(r);if(i===-1)break;t.write(r.slice(0,i)),r=r.slice(i)}}),r.length>0&&t.write(r),t.end()))(),t}class sf{static demux(t){const r=Fe.streamReader(t),n=new la,i=new la,a=new la,o=async function(){const s=await r();if(s===null)return o();if(s===!0){n.end(),a.end(),t.error?i.destroy(t.error):i.end();return}switch(s[0]){case 1:{i.write(s.slice(1));break}case 2:{a.write(s.slice(1));break}case 3:{const l=s.slice(1);a.write(l),n.end(),a.end(),i.destroy(new Error(l.toString("utf8")));return}default:n.write(s)}o()};return o(),{packetlines:n,packfile:i,progress:a}}}async function Rg(e){const{packetlines:t,packfile:r,progress:n}=sf.demux(e),i=[],a=[],o=[];let s=!1,l=!1;return new Promise((c,u)=>{pi(t,d=>{const p=d.toString("utf8").trim();if(p.startsWith("shallow")){const m=p.slice(-41).trim();m.length!==40&&u(new lr(m)),i.push(m)}else if(p.startsWith("unshallow")){const m=p.slice(-41).trim();m.length!==40&&u(new lr(m)),a.push(m)}else if(p.startsWith("ACK")){const[,m,g]=p.split(" ");o.push({oid:m,status:g}),g||(l=!0)}else p.startsWith("NAK")?(s=!0,l=!0):(l=!0,s=!0);l&&(e.error?u(e.error):c({shallows:i,unshallows:a,acks:o,nak:s,packfile:r,progress:n}))}).finally(()=>{l||(e.error?u(e.error):c({shallows:i,unshallows:a,acks:o,nak:s,packfile:r,progress:n}))})})}function Og({capabilities:e=[],wants:t=[],haves:r=[],shallows:n=[],depth:i=null,since:a=null,exclude:o=[]}){const s=[];t=[...new Set(t)];let l=` ${e.join(" ")}`;for(const c of t)s.push(Fe.encode(`want ${c}${l}
71
- `)),l="";for(const c of n)s.push(Fe.encode(`shallow ${c}
72
- `));i!==null&&s.push(Fe.encode(`deepen ${i}
73
- `)),a!==null&&s.push(Fe.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)}
74
- `));for(const c of o)s.push(Fe.encode(`deepen-not ${c}
75
- `));s.push(Fe.flush());for(const c of r)s.push(Fe.encode(`have ${c}
76
- `));return s.push(Fe.encode(`done
77
- `)),s}async function ts({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:l,ref:c,remoteRef:u,remote:d,url:p,corsProxy:m,depth:g=null,since:_=null,exclude:x=[],relative:y=!1,tags:v=!1,singleBranch:O=!1,headers:R={},prune:b=!1,pruneTags:C=!1}){const k=c||await mr({fs:e,gitdir:l,test:!0}),S=await Le.get({fs:e,gitdir:l}),P=d||k&&await S.get(`branch.${k}.remote`)||"origin",$=p||await S.get(`remote.${P}.url`);if(typeof $>"u")throw new lt("remote OR url");const B=u||k&&await S.get(`branch.${k}.merge`)||c||"HEAD";m===void 0&&(m=await S.get("http.corsProxy"));const M=sa.getRemoteHelperFor({url:$}),H=await M.discover({http:r,onAuth:a,onAuthSuccess:o,onAuthFailure:s,corsProxy:m,service:"git-upload-pack",url:$,headers:R,protocolVersion:1}),Y=H.auth,ue=H.refs;if(ue.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(g!==null&&!H.capabilities.has("shallow"))throw new dr("shallow","depth");if(_!==null&&!H.capabilities.has("deepen-since"))throw new dr("deepen-since","since");if(x.length>0&&!H.capabilities.has("deepen-not"))throw new dr("deepen-not","exclude");if(y===!0&&!H.capabilities.has("deepen-relative"))throw new dr("deepen-relative","relative");const{oid:Te,fullref:me}=U.resolveAgainstMap({ref:B,map:ue});for(const F of ue.keys())F===me||F==="HEAD"||F.startsWith("refs/heads/")||v&&F.startsWith("refs/tags/")||ue.delete(F);const ge=af([...H.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${ca.agent}`]);y&&ge.push("deepen-relative");const Pe=O?[Te]:ue.values(),Ue=O?[k]:await U.listRefs({fs:e,gitdir:l,filepath:"refs"});let oe=[];for(let F of Ue)try{F=await U.expand({fs:e,gitdir:l,ref:F});const V=await U.resolve({fs:e,gitdir:l,ref:F});await nf({fs:e,cache:t,gitdir:l,oid:V})&&oe.push(V)}catch{}oe=[...new Set(oe)];const L=await mi.read({fs:e,gitdir:l}),W=H.capabilities.has("shallow")?[...L]:[],G=Og({capabilities:ge,wants:Pe,haves:oe,shallows:W,depth:g,since:_,exclude:x}),te=Buffer.from(await aa(G)),I=await M.connect({http:r,onProgress:n,corsProxy:m,service:"git-upload-pack",url:$,auth:Y,body:[te],headers:R}),ee=await Rg(I.body);I.headers&&(ee.headers=I.headers);for(const F of ee.shallows)if(!L.has(F))try{const{object:V}=await De({fs:e,cache:t,gitdir:l,oid:F}),re=new Ie(V),Q=await Promise.all(re.headers().parent.map(ne=>nf({fs:e,cache:t,gitdir:l,oid:ne})));Q.length===0||Q.every(ne=>ne)||L.add(F)}catch{L.add(F)}for(const F of ee.unshallows)L.delete(F);if(await mi.write({fs:e,gitdir:l,oids:L}),O){const F=new Map([[me,Te]]),V=new Map;let re=10,Q=me;for(;re--;){const ie=H.symrefs.get(Q);if(ie===void 0)break;V.set(Q,ie),Q=ie}const le=ue.get(Q);le&&F.set(Q,le);const{pruned:ne}=await U.updateRemoteRefs({fs:e,gitdir:l,remote:P,refs:F,symrefs:V,tags:v,prune:b});b&&(ee.pruned=ne)}else{const{pruned:F}=await U.updateRemoteRefs({fs:e,gitdir:l,remote:P,refs:ue,symrefs:H.symrefs,tags:v,prune:b,pruneTags:C});b&&(ee.pruned=F)}if(ee.HEAD=H.symrefs.get("HEAD"),ee.HEAD===void 0){const{oid:F}=U.resolveAgainstMap({ref:"HEAD",map:ue});for(const[V,re]of ue.entries())if(V!=="HEAD"&&re===F){ee.HEAD=V;break}}const D=me.startsWith("refs/tags")?"tag":"branch";if(ee.FETCH_HEAD={oid:Te,description:`${D} '${Dr(me)}' of ${$}`},n||i){const F=of(ee.progress);pi(F,async V=>{if(i&&await i(V),n){const re=V.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);re&&await n({phase:re[1].trim(),loaded:parseInt(re[2],10),total:parseInt(re[3],10)})}})}const q=Buffer.from(await aa(ee.packfile));if(I.body.error)throw I.body.error;const Z=q.slice(-20).toString("hex"),X={defaultBranch:ee.HEAD,fetchHead:ee.FETCH_HEAD.oid,fetchHeadDescription:ee.FETCH_HEAD.description};if(ee.headers&&(X.headers=ee.headers),b&&(X.pruned=ee.pruned),Z!==""&&!Sg(q)){X.packfile=`objects/pack/pack-${Z}.pack`;const F=N.join(l,X.packfile);await e.write(F,q);const V=Q=>De({fs:e,cache:t,gitdir:l,oid:Q}),re=await on.fromPack({pack:q,getExternalRefDelta:V,onProgress:n});await e.write(F.replace(/\.pack$/,".idx"),await re.toBuffer())}return X}async function cf({fs:e,bare:t=!1,dir:r,gitdir:n=t?r:N.join(r,".git"),defaultBranch:i="master"}){if(await e.exists(n+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(o=>n+"/"+o);for(const o of a)await e.mkdir(o);await e.write(n+"/config",`[core]
69
+ `;await Wo.acquire(o,async function(){await t.write(o,i,{encoding:"utf8"})})}else await Wo.acquire(o,async function(){await t.rm(o)})}}async function lL({fs:e,gitdir:t,oid:n}){const r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return e.exists(`${t}/${r}`)}async function cL({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o}){let i=await e.readdir(ue.join(n,"objects/pack"));i=i.filter(a=>a.endsWith(".idx"));for(const a of i){const s=`${n}/objects/pack/${a}`,l=await nh({fs:e,cache:t,filename:s,getExternalRefDelta:o});if(l.error)throw new De(l.error);if(l.offsets.has(r))return!0}return!1}async function Cb({fs:e,cache:t,gitdir:n,oid:r,format:o="content"}){const i=s=>dt({fs:e,cache:t,gitdir:n,oid:s});let a=await lL({fs:e,gitdir:n,oid:r});return a||(a=await cL({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i})),a}function uL(e){const o="5041434b"+"00000002"+"00000000";return e.slice(0,12).toString("hex")===o}function Eb(e,t){const n=e.map(r=>r.split("=",1)[0]);return t.filter(r=>{const o=r.split("=",1)[0];return n.includes(o)})}const Fc={name:"isomorphic-git",version:"1.29.0",agent:"git/isomorphic-git@1.29.0"};class Lc{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){const n=this._waiting;this._waiting=null,n({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){const t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}}function dL(e){const t=e.indexOf("\r"),n=e.indexOf(`
70
+ `);return t===-1&&n===-1?-1:t===-1?n+1:n===-1?t+1:n===t+1?n+1:Math.min(t,n)+1}function Pb(e){const t=new Lc;let n="";return(async()=>(await Ls(e,r=>{for(r=r.toString("utf8"),n+=r;;){const o=dL(n);if(o===-1)break;t.write(n.slice(0,o)),n=n.slice(o)}}),n.length>0&&t.write(n),t.end()))(),t}class Rb{static demux(t){const n=xt.streamReader(t),r=new Lc,o=new Lc,i=new Lc,a=async function(){const s=await n();if(s===null)return a();if(s===!0){r.end(),i.end(),t.error?o.destroy(t.error):o.end();return}switch(s[0]){case 1:{o.write(s.slice(1));break}case 2:{i.write(s.slice(1));break}case 3:{const l=s.slice(1);i.write(l),r.end(),i.end(),o.destroy(new Error(l.toString("utf8")));return}default:r.write(s)}a()};return a(),{packetlines:r,packfile:o,progress:i}}}async function fL(e){const{packetlines:t,packfile:n,progress:r}=Rb.demux(e),o=[],i=[],a=[];let s=!1,l=!1;return new Promise((c,u)=>{Ls(t,d=>{const f=d.toString("utf8").trim();if(f.startsWith("shallow")){const h=f.slice(-41).trim();h.length!==40&&u(new to(h)),o.push(h)}else if(f.startsWith("unshallow")){const h=f.slice(-41).trim();h.length!==40&&u(new to(h)),i.push(h)}else if(f.startsWith("ACK")){const[,h,p]=f.split(" ");a.push({oid:h,status:p}),p||(l=!0)}else f.startsWith("NAK")?(s=!0,l=!0):(l=!0,s=!0);l&&(e.error?u(e.error):c({shallows:o,unshallows:i,acks:a,nak:s,packfile:n,progress:r}))}).finally(()=>{l||(e.error?u(e.error):c({shallows:o,unshallows:i,acks:a,nak:s,packfile:n,progress:r}))})})}function hL({capabilities:e=[],wants:t=[],haves:n=[],shallows:r=[],depth:o=null,since:i=null,exclude:a=[]}){const s=[];t=[...new Set(t)];let l=` ${e.join(" ")}`;for(const c of t)s.push(xt.encode(`want ${c}${l}
71
+ `)),l="";for(const c of r)s.push(xt.encode(`shallow ${c}
72
+ `));o!==null&&s.push(xt.encode(`deepen ${o}
73
+ `)),i!==null&&s.push(xt.encode(`deepen-since ${Math.floor(i.valueOf()/1e3)}
74
+ `));for(const c of a)s.push(xt.encode(`deepen-not ${c}
75
+ `));s.push(xt.flush());for(const c of n)s.push(xt.encode(`have ${c}
76
+ `));return s.push(xt.encode(`done
77
+ `)),s}async function fh({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:l,ref:c,remoteRef:u,remote:d,url:f,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:x=!1,headers:S={},prune:C=!1,pruneTags:N=!1}){const R=c||await so({fs:e,gitdir:l,test:!0}),T=await bt.get({fs:e,gitdir:l}),M=d||R&&await T.get(`branch.${R}.remote`)||"origin",A=f||await T.get(`remote.${M}.url`);if(typeof A>"u")throw new nn("remote OR url");const k=u||R&&await T.get(`branch.${R}.merge`)||c||"HEAD";h===void 0&&(h=await T.get("http.corsProxy"));const F=$c.getRemoteHelperFor({url:A}),L=await F.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:h,service:"git-upload-pack",url:A,headers:S,protocolVersion:1}),Y=L.auth,ne=L.refs;if(ne.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!L.capabilities.has("shallow"))throw new oo("shallow","depth");if(m!==null&&!L.capabilities.has("deepen-since"))throw new oo("deepen-since","since");if(v.length>0&&!L.capabilities.has("deepen-not"))throw new oo("deepen-not","exclude");if(w===!0&&!L.capabilities.has("deepen-relative"))throw new oo("deepen-relative","relative");const{oid:q,fullref:X}=de.resolveAgainstMap({ref:k,map:ne});for(const z of ne.keys())z===X||z==="HEAD"||z.startsWith("refs/heads/")||b&&z.startsWith("refs/tags/")||ne.delete(z);const B=Eb([...L.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Fc.agent}`]);w&&B.push("deepen-relative");const ee=x?[q]:ne.values(),Z=x?[R]:await de.listRefs({fs:e,gitdir:l,filepath:"refs"});let J=[];for(let z of Z)try{z=await de.expand({fs:e,gitdir:l,ref:z});const se=await de.resolve({fs:e,gitdir:l,ref:z});await Cb({fs:e,cache:t,gitdir:l,oid:se})&&J.push(se)}catch{}J=[...new Set(J)];const H=await zs.read({fs:e,gitdir:l}),O=L.capabilities.has("shallow")?[...H]:[],V=hL({capabilities:B,wants:ee,haves:J,shallows:O,depth:p,since:m,exclude:v}),ae=Buffer.from(await Oc(V)),j=await F.connect({http:n,onProgress:r,corsProxy:h,service:"git-upload-pack",url:A,auth:Y,body:[ae],headers:S}),G=await fL(j.body);j.headers&&(G.headers=j.headers);for(const z of G.shallows)if(!H.has(z))try{const{object:se}=await dt({fs:e,cache:t,gitdir:l,oid:z}),oe=new ft(se),fe=await Promise.all(oe.headers().parent.map(pe=>Cb({fs:e,cache:t,gitdir:l,oid:pe})));fe.length===0||fe.every(pe=>pe)||H.add(z)}catch{H.add(z)}for(const z of G.unshallows)H.delete(z);if(await zs.write({fs:e,gitdir:l,oids:H}),x){const z=new Map([[X,q]]),se=new Map;let oe=10,fe=X;for(;oe--;){const me=L.symrefs.get(fe);if(me===void 0)break;se.set(fe,me),fe=me}const ge=ne.get(fe);ge&&z.set(fe,ge);const{pruned:pe}=await de.updateRemoteRefs({fs:e,gitdir:l,remote:M,refs:z,symrefs:se,tags:b,prune:C});C&&(G.pruned=pe)}else{const{pruned:z}=await de.updateRemoteRefs({fs:e,gitdir:l,remote:M,refs:ne,symrefs:L.symrefs,tags:b,prune:C,pruneTags:N});C&&(G.pruned=z)}if(G.HEAD=L.symrefs.get("HEAD"),G.HEAD===void 0){const{oid:z}=de.resolveAgainstMap({ref:"HEAD",map:ne});for(const[se,oe]of ne.entries())if(se!=="HEAD"&&oe===z){G.HEAD=se;break}}const $=X.startsWith("refs/tags")?"tag":"branch";if(G.FETCH_HEAD={oid:q,description:`${$} '${Vo(X)}' of ${A}`},r||o){const z=Pb(G.progress);Ls(z,async se=>{if(o&&await o(se),r){const oe=se.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);oe&&await r({phase:oe[1].trim(),loaded:parseInt(oe[2],10),total:parseInt(oe[3],10)})}})}const te=Buffer.from(await Oc(G.packfile));if(j.body.error)throw j.body.error;const ie=te.slice(-20).toString("hex"),re={defaultBranch:G.HEAD,fetchHead:G.FETCH_HEAD.oid,fetchHeadDescription:G.FETCH_HEAD.description};if(G.headers&&(re.headers=G.headers),C&&(re.pruned=G.pruned),ie!==""&&!uL(te)){re.packfile=`objects/pack/pack-${ie}.pack`;const z=ue.join(l,re.packfile);await e.write(z,te);const se=fe=>dt({fs:e,cache:t,gitdir:l,oid:fe}),oe=await ji.fromPack({pack:te,getExternalRefDelta:se,onProgress:r});await e.write(z.replace(/\.pack$/,".idx"),await oe.toBuffer())}return re}async function Nb({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:ue.join(n,".git"),defaultBranch:o="master"}){if(await e.exists(r+"/config"))return;let i=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];i=i.map(a=>r+"/"+a);for(const a of i)await e.mkdir(a);await e.write(r+"/config",`[core]
78
78
  repositoryformatversion = 0
79
79
  filemode = false
80
80
  bare = ${t}
81
81
  `+(t?"":` logallrefupdates = true
82
82
  `)+` symlinks = false
83
83
  ignorecase = true
84
- `),await e.write(n+"/HEAD",`ref: refs/heads/${i}
85
- `)}async function Cg({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:l,dir:c,gitdir:u,url:d,corsProxy:p,ref:m,remote:g,depth:_,since:x,exclude:y,relative:v,singleBranch:O,noCheckout:R,noTags:b,headers:C}){try{if(await cf({fs:e,gitdir:u}),await Xu({fs:e,gitdir:u,remote:g,url:d,force:!1}),p){const P=await Le.get({fs:e,gitdir:u});await P.set("http.corsProxy",p),await Le.save({fs:e,gitdir:u,config:P})}const{defaultBranch:k,fetchHead:S}=await ts({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:u,ref:m,remote:g,corsProxy:p,depth:_,since:x,exclude:y,relative:v,singleBranch:O,headers:C,tags:!b});if(S===null)return;m=m||k,m=m.replace("refs/heads/",""),await Ko({fs:e,cache:t,onProgress:n,onPostCheckout:l,dir:c,gitdir:u,ref:m,remote:g,noCheckout:R})}catch(k){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),k}}async function Tg({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:l,gitdir:c=N.join(l,".git"),url:u,corsProxy:d=void 0,ref:p=void 0,remote:m="origin",depth:g=void 0,since:_=void 0,exclude:x=[],relative:y=!1,singleBranch:v=!1,noCheckout:O=!1,noTags:R=!1,headers:b={},cache:C={}}){try{return T("fs",e),T("http",t),T("gitdir",c),O||T("dir",l),T("url",u),await Cg({fs:new J(e),cache:C,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:l,gitdir:c,url:u,corsProxy:d,ref:p,remote:m,depth:g,since:_,exclude:x,relative:y,singleBranch:v,noCheckout:O,noTags:R,headers:b})}catch(k){throw k.caller="git.clone",k}}async function Pg({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),message:i,author:a,committer:o,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:p,tree:m,cache:g={}}){try{T("fs",e),l||T("message",i),s&&T("onSign",t);const _=new J(e);return await ia({fs:_,cache:g,onSign:t,gitdir:n,message:i,author:a,committer:o,signingKey:s,amend:l,dryRun:c,noUpdateBranch:u,ref:d,parent:p,tree:m})}catch(_){throw _.caller="git.commit",_}}async function Ag({fs:e,dir:t,gitdir:r=N.join(t,".git"),fullname:n=!1,test:i=!1}){try{return T("fs",e),T("gitdir",r),await mr({fs:new J(e),gitdir:r,fullname:n,test:i})}catch(a){throw a.caller="git.currentBranch",a}}async function $g({fs:e,gitdir:t,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await U.exists({fs:e,gitdir:t,ref:r}))throw new Oe(r);const i=await U.expand({fs:e,gitdir:t,ref:r}),a=await mr({fs:e,gitdir:t,fullname:!0});if(i===a){const l=await U.resolve({fs:e,gitdir:t,ref:i});await U.writeRef({fs:e,gitdir:t,ref:"HEAD",value:l})}await U.deleteRef({fs:e,gitdir:t,ref:i});const o=Dr(r),s=await Le.get({fs:e,gitdir:t});await s.deleteSection("branch",o),await Le.save({fs:e,gitdir:t,config:s})}async function Dg({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n}){try{return T("fs",e),T("ref",n),await $g({fs:new J(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteBranch",i}}async function Ig({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n}){try{T("fs",e),T("ref",n),await U.deleteRef({fs:new J(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteRef",i}}async function jg({fs:e,gitdir:t,remote:r}){const n=await Le.get({fs:e,gitdir:t});await n.deleteSection("remote",r),await Le.save({fs:e,gitdir:t,config:n})}async function Bg({fs:e,dir:t,gitdir:r=N.join(t,".git"),remote:n}){try{return T("fs",e),T("remote",n),await jg({fs:new J(e),gitdir:r,remote:n})}catch(i){throw i.caller="git.deleteRemote",i}}async function zg({fs:e,gitdir:t,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await U.deleteRef({fs:e,gitdir:t,ref:r})}async function Ng({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n}){try{return T("fs",e),T("ref",n),await zg({fs:new J(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteTag",i}}async function Mg({fs:e,gitdir:t,oid:r}){const n=r.slice(0,2);return(await e.readdir(`${t}/objects/${n}`)).map(a=>`${n}${a}`).filter(a=>a.startsWith(r))}async function Lg({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i}){const a=[];let o=await e.readdir(N.join(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(const s of o){const l=`${r}/objects/pack/${s}`,c=await Go({fs:e,cache:t,filename:l,getExternalRefDelta:i});if(c.error)throw new ce(c.error);for(const u of c.offsets.keys())u.startsWith(n)&&a.push(u)}return a}async function Fg({fs:e,cache:t,gitdir:r,oid:n}){const i=s=>De({fs:e,cache:t,gitdir:r,oid:s}),a=await Mg({fs:e,gitdir:r,oid:n}),o=await Lg({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i});for(const s of o)a.indexOf(s)===-1&&a.push(s);if(a.length===1)return a[0];throw a.length>1?new Kn("oids",n,a):new Oe(`an object matching "${n}"`)}async function Ug({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),await Fg({fs:new J(e),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.expandOid",a}}async function Hg({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n}){try{return T("fs",e),T("gitdir",r),T("ref",n),await U.expand({fs:new J(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.expandRef",i}}async function rs({fs:e,cache:t,gitdir:r,oids:n}){const i={},a=n.length;let o=n.map((s,l)=>({index:l,oid:s}));for(;o.length;){const s=new Set;for(const{oid:c,index:u}of o)i[c]||(i[c]=new Set),i[c].add(u),i[c].size===a&&s.add(c);if(s.size>0)return[...s];const l=new Map;for(const{oid:c,index:u}of o)try{const{object:d}=await De({fs:e,cache:t,gitdir:r,oid:c}),p=Ie.from(d),{parent:m}=p.parseHeaders();for(const g of m)(!i[g]||!i[g].has(u))&&l.set(g+":"+u,{oid:g,index:u})}catch{}o=Array.from(l.values())}return[]}const ns=/^.*(\r?\n|$)/gm;function Wg({branches:e,contents:t}){const r=e[1],n=e[2],i=t[0],a=t[1],o=t[2],s=a.match(ns),l=i.match(ns),c=o.match(ns),u=lw(s,l,c),d=7;let p="",m=!0;for(const g of u)g.ok&&(p+=g.ok.join("")),g.conflict&&(m=!1,p+=`${"<".repeat(d)} ${r}
86
- `,p+=g.conflict.a.join(""),p+=`${"=".repeat(d)}
87
- `,p+=g.conflict.b.join(""),p+=`${">".repeat(d)} ${n}
88
- `);return{cleanMerge:m,mergedText:p}}async function Gg({fs:e,cache:t,dir:r,gitdir:n=N.join(r,".git"),index:i,ourOid:a,baseOid:o,theirOid:s,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:d=!1,abortOnConflict:p=!0,mergeDriver:m}){const g=xt({ref:a}),_=xt({ref:o}),x=xt({ref:s}),y=[],v=[],O=[],R=[],b=await hr({fs:e,cache:t,dir:r,gitdir:n,trees:[g,_,x],map:async function(C,[k,S,P]){const $=Vi(C),B=await na(k,S),M=await na(P,S);switch(`${B}-${M}`){case"false-false":return{mode:await S.mode(),path:$,oid:await S.oid(),type:await S.type()};case"false-true":return P?{mode:await P.mode(),path:$,oid:await P.oid(),type:await P.type()}:void 0;case"true-false":return k?{mode:await k.mode(),path:$,oid:await k.oid(),type:await k.type()}:void 0;case"true-true":{if(k&&S&&P&&await k.type()==="blob"&&await S.type()==="blob"&&await P.type()==="blob")return qg({fs:e,gitdir:n,path:$,ours:k,base:S,theirs:P,ourName:l,baseName:c,theirName:u,mergeDriver:m}).then(async H=>{if(H.cleanMerge)p||i.insert({filepath:C,oid:H.mergeResult.oid,stage:0});else if(y.push(C),v.push(C),!p){const Y=await S.oid(),ue=await k.oid(),Te=await P.oid();i.delete({filepath:C}),i.insert({filepath:C,oid:Y,stage:1}),i.insert({filepath:C,oid:ue,stage:2}),i.insert({filepath:C,oid:Te,stage:3})}return H.mergeResult});if(S&&!k&&P&&await S.type()==="blob"&&await P.type()==="blob"){if(y.push(C),O.push(C),!p){const H=await S.oid(),Y=await P.oid();i.delete({filepath:C}),i.insert({filepath:C,oid:H,stage:1}),i.insert({filepath:C,oid:Y,stage:3})}return{mode:await P.mode(),oid:await P.oid(),type:"blob",path:$}}if(S&&k&&!P&&await S.type()==="blob"&&await k.type()==="blob"){if(y.push(C),R.push(C),!p){const H=await S.oid(),Y=await k.oid();i.delete({filepath:C}),i.insert({filepath:C,oid:H,stage:1}),i.insert({filepath:C,oid:Y,stage:2})}return{mode:await k.mode(),oid:await k.oid(),type:"blob",path:$}}if(S&&!k&&!P&&await S.type()==="blob")return;throw new cn}}},reduce:y.length!==0&&(!r||p)?void 0:async(C,k)=>{const S=k.filter(Boolean);if(C&&!(C&&C.type==="tree"&&S.length===0)){if(S.length>0){const $=new ct(S).toObject(),B=await ut({fs:e,gitdir:n,type:"tree",object:$,dryRun:d});C.oid=B}return C}}});return y.length!==0?(r&&!p&&await hr({fs:e,cache:t,dir:r,gitdir:n,trees:[xt({ref:b.oid})],map:async function(C,[k]){const S=`${r}/${C}`;if(await k.type()==="blob"){const P=await k.mode(),$=new TextDecoder().decode(await k.content());await e.write(S,$,{mode:P})}return!0}}),new ln(y,v,O,R)):b.oid}async function qg({fs:e,gitdir:t,path:r,ours:n,base:i,theirs:a,ourName:o,theirName:s,baseName:l,dryRun:c,mergeDriver:u=Wg}){const d="blob",p=await i.mode()===await n.mode()?await a.mode():await n.mode();if(await n.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:p,path:r,oid:await n.oid(),type:d}};if(await n.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:p,path:r,oid:await a.oid(),type:d}};if(await a.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:p,path:r,oid:await n.oid(),type:d}};const m=Buffer.from(await n.content()).toString("utf8"),g=Buffer.from(await i.content()).toString("utf8"),_=Buffer.from(await a.content()).toString("utf8"),{mergedText:x,cleanMerge:y}=await u({branches:[l,o,s],contents:[g,m,_],path:r}),v=await ut({fs:e,gitdir:t,type:"blob",object:Buffer.from(x,"utf8"),dryRun:c});return{cleanMerge:y,mergeResult:{mode:p,path:r,oid:v,type:d}}}async function lf({fs:e,cache:t,dir:r,gitdir:n,ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:p,committer:m,signingKey:g,onSign:_,mergeDriver:x}){i===void 0&&(i=await mr({fs:e,gitdir:n,fullname:!0})),i=await U.expand({fs:e,gitdir:n,ref:i}),a=await U.expand({fs:e,gitdir:n,ref:a});const y=await U.resolve({fs:e,gitdir:n,ref:i}),v=await U.resolve({fs:e,gitdir:n,ref:a}),O=await rs({fs:e,cache:t,gitdir:n,oids:[y,v]});if(O.length!==1)throw new cn;const R=O[0];if(R===v)return{oid:y,alreadyMerged:!0};if(o&&R===y)return!l&&!c&&await U.writeRef({fs:e,gitdir:n,ref:i,value:v}),{oid:v,fastForward:!0};{if(s)throw new ti;const b=await Ge.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async k=>Gg({fs:e,cache:t,dir:r,gitdir:n,index:k,ourOid:y,theirOid:v,baseOid:R,ourName:Dr(i),baseName:"base",theirName:Dr(a),dryRun:l,abortOnConflict:u,mergeDriver:x}));if(b instanceof ln)throw b;return d||(d=`Merge branch '${Dr(a)}' into ${Dr(i)}`),{oid:await ia({fs:e,cache:t,gitdir:n,message:d,ref:i,tree:b,parent:[y,v],author:p,committer:m,signingKey:g,onSign:_,dryRun:l,noUpdateBranch:c}),tree:b,mergeCommit:!0}}}async function uf({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:c,ref:u,url:d,remote:p,remoteRef:m,prune:g,pruneTags:_,fastForward:x,fastForwardOnly:y,corsProxy:v,singleBranch:O,headers:R,author:b,committer:C,signingKey:k}){try{if(!u){const $=await mr({fs:e,gitdir:c});if(!$)throw new lt("ref");u=$}const{fetchHead:S,fetchHeadDescription:P}=await ts({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:c,corsProxy:v,ref:u,url:d,remote:p,remoteRef:m,singleBranch:O,headers:R,prune:g,pruneTags:_});await lf({fs:e,cache:t,gitdir:c,ours:u,theirs:S,fastForward:x,fastForwardOnly:y,message:`Merge ${P}`,author:b,committer:C,signingKey:k,dryRun:!1,noUpdateBranch:!1}),await Ko({fs:e,cache:t,onProgress:n,dir:l,gitdir:c,ref:u,remote:p,noCheckout:!1})}catch(S){throw S.caller="git.pull",S}}async function Yg({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l=N.join(s,".git"),ref:c,url:u,remote:d,remoteRef:p,corsProxy:m,singleBranch:g,headers:_={},cache:x={}}){try{T("fs",e),T("http",t),T("gitdir",l);const y={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await uf({fs:new J(e),cache:x,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:p,fastForwardOnly:!0,corsProxy:m,singleBranch:g,headers:_,author:y,committer:y})}catch(y){throw y.caller="git.fastForward",y}}async function Xg({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l=N.join(s,".git"),ref:c,remote:u,remoteRef:d,url:p,corsProxy:m,depth:g=null,since:_=null,exclude:x=[],relative:y=!1,tags:v=!1,singleBranch:O=!1,headers:R={},prune:b=!1,pruneTags:C=!1,cache:k={}}){try{return T("fs",e),T("http",t),T("gitdir",l),await ts({fs:new J(e),cache:k,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remote:u,remoteRef:d,url:p,corsProxy:m,depth:g,since:_,exclude:x,relative:y,tags:v,singleBranch:O,headers:R,prune:b,pruneTags:C})}catch(S){throw S.caller="git.fetch",S}}async function Zg({fs:e,dir:t,gitdir:r=N.join(t,".git"),oids:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),T("oids",n),await rs({fs:new J(e),cache:i,gitdir:r,oids:n})}catch(a){throw a.caller="git.findMergeBase",a}}async function ff({fs:e,filepath:t}){if(await e.exists(N.join(t,".git")))return t;{const r=rn(t);if(r===t)throw new Oe(`git root for ${t}`);return ff({fs:e,filepath:r})}}async function Vg({fs:e,filepath:t}){try{return T("fs",e),T("filepath",t),await ff({fs:new J(e),filepath:t})}catch(r){throw r.caller="git.findRoot",r}}async function Kg({fs:e,dir:t,gitdir:r=N.join(t,".git"),path:n}){try{return T("fs",e),T("gitdir",r),T("path",n),await fi({fs:new J(e),gitdir:r,path:n})}catch(i){throw i.caller="git.getConfig",i}}async function Jg({fs:e,gitdir:t,path:r}){return(await Le.get({fs:e,gitdir:t})).getall(r)}async function Qg({fs:e,dir:t,gitdir:r=N.join(t,".git"),path:n}){try{return T("fs",e),T("gitdir",r),T("path",n),await Jg({fs:new J(e),gitdir:r,path:n})}catch(i){throw i.caller="git.getConfigAll",i}}async function ey({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:o={},forPush:s=!1}){try{T("http",e),T("url",a);const c=await sa.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(const[d,p]of c.refs){const m=d.split("/"),g=m.pop();let _=u;for(const x of m)_[x]=_[x]||{},_=_[x];_[g]=p}for(const[d,p]of c.symrefs){const m=d.split("/"),g=m.pop();let _=u;for(const x of m)_[x]=_[x]||{},_=_[x];_[g]=p}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function df(e,t,r,n){const i=[];for(const[a,o]of e.refs){if(t&&!a.startsWith(t))continue;if(a.endsWith("^{}")){if(n){const l=a.replace("^{}",""),c=i[i.length-1],u=c.ref===l?c:i.find(d=>d.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=o}continue}const s={ref:a,oid:o};r&&e.symrefs.has(a)&&(s.target=e.symrefs.get(a)),i.push(s)}return i}async function ty({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:o={},forPush:s=!1,protocolVersion:l=2}){try{T("http",e),T("url",a);const u=await sa.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};const d={};for(const p of u.capabilities){const[m,g]=p.split("=");g?d[m]=g:d[m]=!0}return{protocolVersion:1,capabilities:d,refs:df(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function ry({type:e,object:t,format:r="content",oid:n=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(t=an.wrap({type:e,object:t})),n=await Vt(t)),{oid:n,object:t}}async function ny({object:e}){try{T("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);const t="blob",{oid:r,object:n}=await ry({type:"blob",format:"content",object:e});return{oid:r,type:t,object:new Uint8Array(n),format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function iy({fs:e,cache:t,onProgress:r,dir:n,gitdir:i,filepath:a}){try{a=N.join(n,a);const o=await e.read(a),s=c=>De({fs:e,cache:t,gitdir:i,oid:c}),l=await on.fromPack({pack:o,getExternalRefDelta:s,onProgress:r});return await e.write(a.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(o){throw o.caller="git.indexPack",o}}async function ay({fs:e,onProgress:t,dir:r,gitdir:n=N.join(r,".git"),filepath:i,cache:a={}}){try{return T("fs",e),T("dir",r),T("gitdir",r),T("filepath",i),await iy({fs:new J(e),cache:a,onProgress:t,dir:r,gitdir:n,filepath:i})}catch(o){throw o.caller="git.indexPack",o}}async function oy({fs:e,bare:t=!1,dir:r,gitdir:n=t?r:N.join(r,".git"),defaultBranch:i="master"}){try{return T("fs",e),T("gitdir",n),t||T("dir",r),await cf({fs:new J(e),bare:t,dir:r,gitdir:n,defaultBranch:i})}catch(a){throw a.caller="git.init",a}}async function hf({fs:e,cache:t,gitdir:r,oid:n,ancestor:i,depth:a}){const o=await mi.read({fs:e,gitdir:r});if(!n)throw new lt("oid");if(!i)throw new lt("ancestor");if(n===i)return!1;const s=[n],l=new Set;let c=0;for(;s.length;){if(c++===a)throw new ni(a);const u=s.shift(),{type:d,object:p}=await De({fs:e,cache:t,gitdir:r,oid:u});if(d!=="commit")throw new rt(u,d,"commit");const m=Ie.from(p).parse();for(const g of m.parent)if(g===i)return!0;if(!o.has(u))for(const g of m.parent)l.has(g)||(s.push(g),l.add(g))}return!1}async function sy({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,ancestor:i,depth:a=-1,cache:o={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),T("ancestor",i),await hf({fs:new J(e),cache:o,gitdir:r,oid:n,ancestor:i,depth:a})}catch(s){throw s.caller="git.isDescendent",s}}async function cy({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n}){try{return T("fs",e),T("dir",t),T("gitdir",r),T("filepath",n),hn.isIgnored({fs:new J(e),dir:t,gitdir:r,filepath:n})}catch(i){throw i.caller="git.isIgnored",i}}async function ly({fs:e,dir:t,gitdir:r=N.join(t,".git"),remote:n}){try{return T("fs",e),T("gitdir",r),U.listBranches({fs:new J(e),gitdir:r,remote:n})}catch(i){throw i.caller="git.listBranches",i}}async function uy({fs:e,gitdir:t,ref:r,cache:n}){if(r){const i=await U.resolve({gitdir:t,fs:e,ref:r}),a=[];return await pf({fs:e,cache:n,gitdir:t,oid:i,filenames:a,prefix:""}),a}else return Ge.acquire({fs:e,gitdir:t,cache:n},async function(i){return i.entries.map(a=>a.path)})}async function pf({fs:e,cache:t,gitdir:r,oid:n,filenames:i,prefix:a}){const{tree:o}=await wn({fs:e,cache:t,gitdir:r,oid:n});for(const s of o)s.type==="tree"?await pf({fs:e,cache:t,gitdir:r,oid:s.oid,filenames:i,prefix:N.join(a,s.path)}):i.push(N.join(a,s.path))}async function fy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),await uy({fs:new J(e),cache:i,gitdir:r,ref:n})}catch(a){throw a.caller="git.listFiles",a}}async function dy({fs:e,cache:t,gitdir:r,ref:n}){let i;try{i=await U.resolve({gitdir:r,fs:e,ref:n})}catch(s){if(s instanceof Oe)return[]}return(await wn({fs:e,cache:t,gitdir:r,oid:i})).tree.map(s=>({target:s.path,note:s.oid}))}async function hy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n="refs/notes/commits",cache:i={}}){try{return T("fs",e),T("gitdir",r),T("ref",n),await dy({fs:new J(e),cache:i,gitdir:r,ref:n})}catch(a){throw a.caller="git.listNotes",a}}async function py({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n}){try{return T("fs",e),T("gitdir",r),U.listRefs({fs:new J(e),gitdir:r,filepath:n})}catch(i){throw i.caller="git.listRefs",i}}async function my({fs:e,gitdir:t}){const r=await Le.get({fs:e,gitdir:t}),n=await r.getSubsections("remote");return Promise.all(n.map(async a=>{const o=await r.get(`remote.${a}.url`);return{remote:a,url:o}}))}async function wy({fs:e,dir:t,gitdir:r=N.join(t,".git")}){try{return T("fs",e),T("gitdir",r),await my({fs:new J(e),gitdir:r})}catch(n){throw n.caller="git.listRemotes",n}}async function gy(e){const t=Fe.streamReader(e),r=[];let n;for(;n=await t(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");const[i,a,...o]=n.split(" "),s={ref:a,oid:i};for(const l of o){const[c,u]=l.split(":");c==="symref-target"?s.target=u:c==="peeled"&&(s.peeled=u)}r.push(s)}return r}async function yy({prefix:e,symrefs:t,peelTags:r}){const n=[];return n.push(Fe.encode(`command=ls-refs
89
- `)),n.push(Fe.encode(`agent=${ca.agent}
90
- `)),(r||t||e)&&n.push(Fe.delim()),r&&n.push(Fe.encode("peel")),t&&n.push(Fe.encode("symrefs")),e&&n.push(Fe.encode(`ref-prefix ${e}`)),n.push(Fe.flush()),n}async function by({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:o={},forPush:s=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:d}){try{T("http",e),T("url",a);const p=await oa.discover({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:l});if(p.protocolVersion===1)return df(p,c,u,d);const m=await yy({prefix:c,symrefs:u,peelTags:d}),g=await oa.connect({http:e,auth:p.auth,headers:o,corsProxy:i,service:s?"git-receive-pack":"git-upload-pack",url:a,body:m});return gy(g.body)}catch(p){throw p.caller="git.listServerRefs",p}}async function _y({fs:e,dir:t,gitdir:r=N.join(t,".git")}){try{return T("fs",e),T("gitdir",r),U.listTags({fs:new J(e),gitdir:r})}catch(n){throw n.caller="git.listTags",n}}function vy(e,t){return e.committer.timestamp-t.committer.timestamp}const xy="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function mf({fs:e,cache:t,gitdir:r,oid:n,fileId:i}){if(i===xy)return;const a=n;let o;const s=await dn({fs:e,cache:t,gitdir:r,oid:n}),l=s.tree;return i===s.oid?o=s.path:(o=await wf({fs:e,cache:t,gitdir:r,tree:l,fileId:i,oid:a}),Array.isArray(o)&&(o.length===0?o=void 0:o.length===1&&(o=o[0]))),o}async function wf({fs:e,cache:t,gitdir:r,tree:n,fileId:i,oid:a,filepaths:o=[],parentPath:s=""}){const l=n.entries().map(function(c){let u;return c.oid===i?(u=N.join(s,c.path),o.push(u)):c.type==="tree"&&(u=De({fs:e,cache:t,gitdir:r,oid:c.oid}).then(function({object:d}){return wf({fs:e,cache:t,gitdir:r,tree:ct.from(d),fileId:i,oid:a,filepaths:o,parentPath:N.join(s,c.path)})})),u});return await Promise.all(l),o}async function Ey({fs:e,cache:t,gitdir:r,filepath:n,ref:i,depth:a,since:o,force:s,follow:l}){const c=typeof o>"u"?void 0:Math.floor(o.valueOf()/1e3),u=[],d=await mi.read({fs:e,gitdir:r}),p=await U.resolve({fs:e,gitdir:r,ref:i}),m=[await mn({fs:e,cache:t,gitdir:r,oid:p})];let g,_,x;function y(v){x&&n&&u.push(v)}for(;m.length>0;){const v=m.pop();if(c!==void 0&&v.commit.committer.timestamp<=c)break;if(n){let O;try{O=await di({fs:e,cache:t,gitdir:r,oid:v.commit.tree,filepath:n}),_&&g!==O&&u.push(_),g=O,_=v,x=!0}catch(R){if(R instanceof Oe){let b=l&&g;if(b&&(b=await mf({fs:e,cache:t,gitdir:r,oid:v.commit.tree,fileId:g}),b))if(Array.isArray(b)){if(_){const C=await mf({fs:e,cache:t,gitdir:r,oid:_.commit.tree,fileId:g});if(Array.isArray(C))if(b=b.filter(k=>C.indexOf(k)===-1),b.length===1)b=b[0],n=b,_&&u.push(_);else{b=!1,_&&u.push(_);break}}}else n=b,_&&u.push(_);if(!b){if(x&&g&&(u.push(_),!s))break;if(!s&&!l)throw R}_=v,x=!1}else throw R}}else u.push(v);if(a!==void 0&&u.length===a){y(v);break}if(!d.has(v.oid))for(const O of v.commit.parent){const R=await mn({fs:e,cache:t,gitdir:r,oid:O});m.map(b=>b.oid).includes(R.oid)||m.push(R)}m.length===0&&y(v),m.sort((O,R)=>vy(O.commit,R.commit))}return u}async function Sy({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n,ref:i="HEAD",depth:a,since:o,force:s,follow:l,cache:c={}}){try{return T("fs",e),T("gitdir",r),T("ref",i),await Ey({fs:new J(e),cache:c,gitdir:r,filepath:n,ref:i,depth:a,since:o,force:s,follow:l})}catch(u){throw u.caller="git.log",u}}async function ky({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:p,committer:m,signingKey:g,cache:_={},mergeDriver:x}){try{T("fs",e),g&&T("onSign",t);const y=new J(e),v=await pr({fs:y,gitdir:n,author:p});if(!v&&(!s||!o))throw new Ke("author");const O=await pn({fs:y,gitdir:n,author:v,committer:m});if(!O&&(!s||!o))throw new Ke("committer");return await lf({fs:y,cache:_,dir:r,gitdir:n,ours:i,theirs:a,fastForward:o,fastForwardOnly:s,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:d,author:v,committer:O,signingKey:g,onSign:t,mergeDriver:x})}catch(y){throw y.caller="git.merge",y}}const Ry={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function gf({fs:e,cache:t,dir:r,gitdir:n=N.join(r,".git"),oids:i}){const a=new $c,o=[];function s(u,d){const p=Buffer.from(u,d);o.push(p),a.update(p)}async function l({stype:u,object:d}){const p=Ry[u];let m=d.length,g=m>15?128:0;const _=m&15;m=m>>>4;let x=(g|p|_).toString(16);for(s(x,"hex");g;)g=m>127?128:0,x=g|m&127,s(Jo(2,x),"hex"),m=m>>>7;s(Buffer.from(await Uu(d)))}s("PACK"),s("00000002","hex"),s(Jo(8,i.length),"hex");for(const u of i){const{type:d,object:p}=await De({fs:e,cache:t,gitdir:n,oid:u});await l({write:s,object:p,stype:d})}const c=a.digest();return o.push(c),o}async function Oy({fs:e,cache:t,gitdir:r,oids:n,write:i}){const a=await gf({fs:e,cache:t,gitdir:r,oids:n}),o=Buffer.from(await aa(a)),l=`pack-${o.slice(-20).toString("hex")}.pack`;return i?(await e.write(N.join(r,`objects/pack/${l}`),o),{filename:l}):{filename:l,packfile:new Uint8Array(o)}}async function Cy({fs:e,dir:t,gitdir:r=N.join(t,".git"),oids:n,write:i=!1,cache:a={}}){try{return T("fs",e),T("gitdir",r),T("oids",n),await Oy({fs:new J(e),cache:a,gitdir:r,oids:n,write:i})}catch(o){throw o.caller="git.packObjects",o}}async function Ty({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l=N.join(s,".git"),ref:c,url:u,remote:d,remoteRef:p,prune:m=!1,pruneTags:g=!1,fastForward:_=!0,fastForwardOnly:x=!1,corsProxy:y,singleBranch:v,headers:O={},author:R,committer:b,signingKey:C,cache:k={}}){try{T("fs",e),T("gitdir",l);const S=new J(e),P=await pr({fs:S,gitdir:l,author:R});if(!P)throw new Ke("author");const $=await pn({fs:S,gitdir:l,author:P,committer:b});if(!$)throw new Ke("committer");return await uf({fs:S,cache:k,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:p,fastForward:_,fastForwardOnly:x,corsProxy:y,singleBranch:v,headers:O,author:P,committer:$,signingKey:C,prune:m,pruneTags:g})}catch(S){throw S.caller="git.pull",S}}async function Py({fs:e,cache:t,dir:r,gitdir:n=N.join(r,".git"),start:i,finish:a}){const o=await mi.read({fs:e,gitdir:n}),s=new Set,l=new Set;for(const d of i)s.add(await U.resolve({fs:e,gitdir:n,ref:d}));for(const d of a)try{const p=await U.resolve({fs:e,gitdir:n,ref:d});l.add(p)}catch{}const c=new Set;async function u(d){c.add(d);const{type:p,object:m}=await De({fs:e,cache:t,gitdir:n,oid:d});if(p==="tag"){const _=nt.from(m).headers().object;return u(_)}if(p!=="commit")throw new rt(d,p,"commit");if(!o.has(d)){const _=Ie.from(m).headers().parent;for(d of _)!l.has(d)&&!c.has(d)&&await u(d)}}for(const d of s)await u(d);return c}async function is({fs:e,cache:t,dir:r,gitdir:n=N.join(r,".git"),oids:i}){const a=new Set;async function o(s){if(a.has(s))return;a.add(s);const{type:l,object:c}=await De({fs:e,cache:t,gitdir:n,oid:s});if(l==="tag"){const d=nt.from(c).headers().object;await o(d)}else if(l==="commit"){const d=Ie.from(c).headers().tree;await o(d)}else if(l==="tree"){const u=ct.from(c);for(const d of u)d.type==="blob"&&a.add(d.oid),d.type==="tree"&&await o(d.oid)}}for(const s of i)await o(s);return a}async function Ay(e){const t={};let r="";const n=Fe.streamReader(e);let i=await n();for(;i!==!0;)i!==null&&(r+=i.toString("utf8")+`
91
- `),i=await n();const a=r.toString("utf8").split(`
92
- `);if(i=a.shift(),!i.startsWith("unpack "))throw new $r('unpack ok" or "unpack [error message]',i);t.ok=i==="unpack ok",t.ok||(t.error=i.slice(7)),t.refs={};for(const o of a){if(o.trim()==="")continue;const s=o.slice(0,2),l=o.slice(3);let c=l.indexOf(" ");c===-1&&(c=l.length);const u=l.slice(0,c),d=l.slice(c+1);t.refs[u]={ok:s==="ok",error:d}}return t}async function $y({capabilities:e=[],triplets:t=[]}){const r=[];let n=`\0 ${e.join(" ")}`;for(const i of t)r.push(Fe.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${n}
93
- `)),n="";return r.push(Fe.flush()),r}async function Dy({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPrePush:l,gitdir:c,ref:u,remoteRef:d,remote:p,url:m,force:g=!1,delete:_=!1,corsProxy:x,headers:y={}}){const v=u||await mr({fs:e,gitdir:c});if(typeof v>"u")throw new lt("ref");const O=await Le.get({fs:e,gitdir:c});p=p||await O.get(`branch.${v}.pushRemote`)||await O.get("remote.pushDefault")||await O.get(`branch.${v}.remote`)||"origin";const R=m||await O.get(`remote.${p}.pushurl`)||await O.get(`remote.${p}.url`);if(typeof R>"u")throw new lt("remote OR url");const b=d||await O.get(`branch.${v}.merge`);if(typeof R>"u")throw new lt("remoteRef");x===void 0&&(x=await O.get("http.corsProxy"));const C=await U.expand({fs:e,gitdir:c,ref:v}),k=_?"0000000000000000000000000000000000000000":await U.resolve({fs:e,gitdir:c,ref:C}),S=sa.getRemoteHelperFor({url:R}),P=await S.discover({http:r,onAuth:a,onAuthSuccess:o,onAuthFailure:s,corsProxy:x,service:"git-receive-pack",url:R,headers:y,protocolVersion:1}),$=P.auth;let B;if(!b)B=C;else try{B=await U.expandAgainstMap({ref:b,map:P.refs})}catch(L){if(L instanceof Oe)B=b.startsWith("refs/")?b:`refs/heads/${b}`;else throw L}const M=P.refs.get(B)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:p,url:R,localRef:{ref:_?"(delete)":C,oid:k},remoteRef:{ref:B,oid:M}}))throw new fn;const H=!P.capabilities.has("no-thin");let Y=new Set;if(!_){const L=[...P.refs.values()];let W=new Set;if(M!=="0000000000000000000000000000000000000000"){const G=await rs({fs:e,cache:t,gitdir:c,oids:[k,M]});for(const te of G)L.push(te);H&&(W=await is({fs:e,cache:t,gitdir:c,oids:G}))}if(!L.includes(k)){const G=await Py({fs:e,cache:t,gitdir:c,start:[k],finish:L});Y=await is({fs:e,cache:t,gitdir:c,oids:G})}if(H){try{const G=await U.resolve({fs:e,gitdir:c,ref:`refs/remotes/${p}/HEAD`,depth:2}),{oid:te}=await U.resolveAgainstMap({ref:G.replace(`refs/remotes/${p}/`,""),fullref:G,map:P.refs}),I=[te];for(const ee of await is({fs:e,cache:t,gitdir:c,oids:I}))W.add(ee)}catch{}for(const G of W)Y.delete(G)}if(k===M&&(g=!0),!g){if(C.startsWith("refs/tags")&&M!=="0000000000000000000000000000000000000000")throw new un("tag-exists");if(k!=="0000000000000000000000000000000000000000"&&M!=="0000000000000000000000000000000000000000"&&!await hf({fs:e,cache:t,gitdir:c,oid:k,ancestor:M,depth:-1}))throw new un("not-fast-forward")}}const ue=af([...P.capabilities],["report-status","side-band-64k",`agent=${ca.agent}`]),Te=await $y({capabilities:ue,triplets:[{oldoid:M,oid:k,fullRef:B}]}),me=_?[]:await gf({fs:e,cache:t,gitdir:c,oids:[...Y]}),ge=await S.connect({http:r,onProgress:n,corsProxy:x,service:"git-receive-pack",url:R,auth:$,headers:y,body:[...Te,...me]}),{packfile:Pe,progress:Ue}=await sf.demux(ge.body);if(i){const L=of(Ue);pi(L,async W=>{await i(W)})}const oe=await Ay(Pe);if(ge.headers&&(oe.headers=ge.headers),p&&oe.ok&&oe.refs[B].ok&&!C.startsWith("refs/tags")){const L=`refs/remotes/${p}/${B.replace("refs/heads","")}`;_?await U.deleteRef({fs:e,gitdir:c,ref:L}):await U.writeRef({fs:e,gitdir:c,ref:L,value:k})}if(oe.ok&&Object.values(oe.refs).every(L=>L.ok))return oe;{const L=Object.entries(oe.refs).filter(([W,G])=>!G.ok).map(([W,G])=>`
94
- - ${W}: ${G.error}`).join("");throw new ri(L,oe)}}async function Iy({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,dir:l,gitdir:c=N.join(l,".git"),ref:u,remoteRef:d,remote:p="origin",url:m,force:g=!1,delete:_=!1,corsProxy:x,headers:y={},cache:v={}}){try{return T("fs",e),T("http",t),T("gitdir",c),await Dy({fs:new J(e),cache:v,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,gitdir:c,ref:u,remoteRef:d,remote:p,url:m,force:g,delete:_,corsProxy:x,headers:y})}catch(O){throw O.caller="git.push",O}}async function yf({fs:e,cache:t,gitdir:r,oid:n}){const{type:i,object:a}=await De({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=nt.from(a).parse().object,yf({fs:e,cache:t,gitdir:r,oid:n});if(i!=="blob")throw new rt(n,i,"blob");return{oid:n,blob:new Uint8Array(a)}}async function bf({fs:e,cache:t,gitdir:r,oid:n,filepath:i=void 0}){return i!==void 0&&(n=await di({fs:e,cache:t,gitdir:r,oid:n,filepath:i})),await yf({fs:e,cache:t,gitdir:r,oid:n})}async function jy({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,filepath:i,cache:a={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),await bf({fs:new J(e),cache:a,gitdir:r,oid:n,filepath:i})}catch(o){throw o.caller="git.readBlob",o}}async function _f({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),await mn({fs:new J(e),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.readCommit",a}}async function By({fs:e,cache:t,gitdir:r,ref:n="refs/notes/commits",oid:i}){const a=await U.resolve({gitdir:r,fs:e,ref:n}),{blob:o}=await bf({fs:e,cache:t,gitdir:r,oid:a,filepath:i});return o}async function zy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n="refs/notes/commits",oid:i,cache:a={}}){try{return T("fs",e),T("gitdir",r),T("ref",n),T("oid",i),await By({fs:new J(e),cache:a,gitdir:r,ref:n,oid:i})}catch(o){throw o.caller="git.readNote",o}}async function Ny({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,format:i="parsed",filepath:a=void 0,encoding:o=void 0,cache:s={}}){try{T("fs",e),T("gitdir",r),T("oid",n);const l=new J(e);a!==void 0&&(n=await di({fs:l,cache:s,gitdir:r,oid:n,filepath:a}));const u=await De({fs:l,cache:s,gitdir:r,oid:n,format:i==="parsed"?"content":i});if(u.oid=n,i==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=Ie.from(u.object).parse();break;case"tree":u.object=ct.from(u.object).entries();break;case"blob":o?u.object=u.object.toString(o):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=nt.from(u.object).parse();break;default:throw new rt(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function My({fs:e,cache:t,gitdir:r,oid:n}){const{type:i,object:a}=await De({fs:e,cache:t,gitdir:r,oid:n,format:"content"});if(i!=="tag")throw new rt(n,i,"tag");const o=nt.from(a);return{oid:n,tag:o.parse(),payload:o.payload()}}async function Ly({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),await My({fs:new J(e),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.readTag",a}}async function Fy({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,filepath:i=void 0,cache:a={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),await wn({fs:new J(e),cache:a,gitdir:r,oid:n,filepath:i})}catch(o){throw o.caller="git.readTree",o}}async function Uy({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n,cache:i={}}){try{T("fs",e),T("gitdir",r),T("filepath",n),await Ge.acquire({fs:new J(e),gitdir:r,cache:i},async function(a){a.delete({filepath:n})})}catch(a){throw a.caller="git.remove",a}}async function Hy({fs:e,cache:t,onSign:r,gitdir:n,ref:i="refs/notes/commits",oid:a,author:o,committer:s,signingKey:l}){let c;try{c=await U.resolve({gitdir:n,fs:e,ref:i})}catch(g){if(!(g instanceof Oe))throw g}let d=(await wn({fs:e,gitdir:n,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;d=d.filter(g=>g.path!==a);const p=await hi({fs:e,gitdir:n,tree:d});return await ia({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tree:p,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
95
- `,author:o,committer:s,signingKey:l})}async function Wy({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),ref:i="refs/notes/commits",oid:a,author:o,committer:s,signingKey:l,cache:c={}}){try{T("fs",e),T("gitdir",n),T("oid",a);const u=new J(e),d=await pr({fs:u,gitdir:n,author:o});if(!d)throw new Ke("author");const p=await pn({fs:u,gitdir:n,author:d,committer:s});if(!p)throw new Ke("committer");return await Hy({fs:u,cache:c,onSign:t,gitdir:n,ref:i,oid:a,author:d,committer:p,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function Gy({fs:e,gitdir:t,oldref:r,ref:n,checkout:i=!1}){if(n!==Mt.clean(n))throw new Ct(n,Mt.clean(n));if(r!==Mt.clean(r))throw new Ct(r,Mt.clean(r));const a=`refs/heads/${r}`,o=`refs/heads/${n}`;if(await U.exists({fs:e,gitdir:t,ref:o}))throw new Ot("branch",n,!1);const l=await U.resolve({fs:e,gitdir:t,ref:a,depth:1});await U.writeRef({fs:e,gitdir:t,ref:o,value:l}),await U.deleteRef({fs:e,gitdir:t,ref:a});const u=await mr({fs:e,gitdir:t,fullname:!0})===a;(i||u)&&await U.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:o})}async function qy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,oldref:i,checkout:a=!1}){try{return T("fs",e),T("gitdir",r),T("ref",n),T("oldref",i),await Gy({fs:new J(e),gitdir:r,ref:n,oldref:i,checkout:a})}catch(o){throw o.caller="git.renameBranch",o}}async function vf({gitdir:e,type:t,object:r}){return Vt(an.wrap({type:t,object:r}))}async function Yy({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n,ref:i,cache:a={}}){try{T("fs",e),T("gitdir",r),T("filepath",n);const o=new J(e);let s,l;try{s=await U.resolve({fs:o,gitdir:r,ref:i||"HEAD"})}catch(d){if(i)throw d}if(s)try{s=await di({fs:o,cache:a,gitdir:r,oid:s,filepath:n})}catch{s=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0};const u=t&&await o.read(N.join(t,n));u&&(l=await vf({gitdir:r,type:"blob",object:u}),s===l&&(c=await o.lstat(N.join(t,n)))),await Ge.acquire({fs:o,gitdir:r,cache:a},async function(d){d.delete({filepath:n}),s&&d.insert({filepath:n,stats:c,oid:s})})}catch(o){throw o.caller="git.reset",o}}async function Xy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,depth:i}){try{return T("fs",e),T("gitdir",r),T("ref",n),await U.resolve({fs:new J(e),gitdir:r,ref:n,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function Zy({fs:e,dir:t,gitdir:r=N.join(t,".git"),path:n,value:i,append:a=!1}){try{T("fs",e),T("gitdir",r),T("path",n);const o=new J(e),s=await Le.get({fs:o,gitdir:r});a?await s.append(n,i):await s.set(n,i),await Le.save({fs:o,gitdir:r,config:s})}catch(o){throw o.caller="git.setConfig",o}}async function xf({fs:e,gitdir:t,commit:r}){const n=Ie.from(r).toObject();return await ut({fs:e,gitdir:t,type:"commit",object:n,format:"content"})}class ua{static get timezoneOffsetForRefLogEntry(){const t=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(t/60)),n=Math.abs(t%60).toString().padStart(2,"0");return`${t>0?"-":"+"}${r.toString().padStart(2,"0")}${n}`}static createStashReflogEntry(t,r,n){const i=t.name.replace(/\s/g,""),a="0000000000000000000000000000000000000000",o=Math.floor(Date.now()/1e3),s=ua.timezoneOffsetForRefLogEntry;return`${a} ${r} ${i} ${t.email} ${o} ${s} ${n}
96
- `}static getStashReflogEntry(t,r=!1){return t.split(`
97
- `).filter(a=>a).reverse().map((a,o)=>r?`stash@{${o}}: ${a.split(" ")[1]}`:a)}}const Vy={stage:nn,workdir:ui};let as;async function gn(e,t){return as===void 0&&(as=new Pn),as.acquire(e,t)}async function Ky(e,t,r,n,i=null){const a=N.join(r,n),o=await e.lstat(a);if(!o)throw new Oe(a);if(o.isDirectory())throw new ce(`${a}: file expected, but found directory`);const s=i?await Pu({fs:e,gitdir:t,oid:i}):void 0;let l=s?i:void 0;return s||await gn({fs:e,gitdir:t,currentFilepath:a},async()=>{const c=o.isSymbolicLink()?await e.readlink(a).then(Hu):await e.read(a);if(c===null)throw new Oe(a);l=await ut({fs:e,gitdir:t,type:"blob",object:c})}),l}async function Jy({fs:e,dir:t,gitdir:r,entries:n}){async function i(a){if(a.type==="tree"){if(!a.oid){const o=await Promise.all(a.children.map(i));a.oid=await hi({fs:e,gitdir:r,tree:o}),a.mode=16384}}else a.type==="blob"&&(a.oid=await Ky(e,r,t,a.path,a.oid),a.mode=33188);return a.path=a.path.split("/").pop(),a}return Promise.all(n.map(i))}async function Ef({fs:e,dir:t,gitdir:r,treePair:n}){const i=n[1]==="stage",a=n.map(m=>typeof m=="string"?Vy[m]():m),o=[],u=await hr({fs:e,cache:{},dir:t,gitdir:r,trees:a,map:async(m,[g,_])=>{if(!(m==="."||await hn.isIgnored({fs:e,dir:t,gitdir:r,filepath:m}))&&_)return(!g||await g.oid()!==await _.oid()&&await _.oid()!==void 0)&&o.push([g,_]),{mode:await _.mode(),path:m,oid:await _.oid(),type:await _.type()}},reduce:async(m,g)=>(g=g.filter(Boolean),m?(m.children=g,m):g.length>0?g:void 0),iterate:async(m,g)=>{const _=[];for(const x of g){const[y,v]=x;i?v&&(await e.exists(`${t}/${v.toString()}`)?_.push(x):o.push([null,v])):y&&(v?_.push(x):o.push([y,null]))}return _.length?Promise.all(_.map(m)):[]}});if(o.length===0||u.length===0)return null;const p=(await Jy({fs:e,dir:t,gitdir:r,entries:u})).filter(Boolean).map(m=>({mode:m.mode,path:m.path,oid:m.oid,type:m.type}));return hi({fs:e,gitdir:r,tree:p})}async function Qy({fs:e,dir:t,gitdir:r,stashCommit:n,parentCommit:i,wasStaged:a}){const o=[],s=[],l=await hr({fs:e,cache:{},dir:t,gitdir:r,trees:[xt({ref:i}),xt({ref:n})],map:async(c,[u,d])=>{if(c==="."||await hn.isIgnored({fs:e,dir:t,gitdir:r,filepath:c}))return;const p=d?await d.type():await u.type();if(p!=="tree"&&p!=="blob")return;if(!d&&u){const g=p==="tree"?"rmdir":"rm";return p==="tree"&&o.push(c),p==="blob"&&a&&s.push({filepath:c,oid:await u.oid()}),{method:g,filepath:c}}const m=await d.oid();if(!u||await u.oid()!==m)return p==="tree"?{method:"mkdir",filepath:c}:(a&&s.push({filepath:c,oid:m,stats:await e.lstat(N.join(t,c))}),{method:"write",filepath:c,oid:m})}});await gn({fs:e,gitdir:r,dirRemoved:o,ops:l},async()=>{for(const c of l){const u=N.join(t,c.filepath);switch(c.method){case"rmdir":await e.rmdir(u);break;case"mkdir":await e.mkdir(u);break;case"rm":await e.rm(u);break;case"write":if(!o.some(d=>u.startsWith(d))){const{object:d}=await De({fs:e,cache:{},gitdir:r,oid:c.oid});await e.exists(u)&&await e.rm(u),await e.write(u,d)}break}}}),await Ge.acquire({fs:e,gitdir:r,cache:{}},async c=>{s.forEach(({filepath:u,stats:d,oid:p})=>{c.insert({filepath:u,stats:d,oid:p})})})}class Jt{constructor({fs:t,dir:r,gitdir:n=N.join(r,".git")}){Object.assign(this,{fs:t,dir:r,gitdir:n,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return N.join(this.gitdir,Jt.refStash)}get refLogsStashPath(){return N.join(this.gitdir,Jt.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await pr({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Ke("author");return this._author}async getStashSHA(t,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[t].split(" ")[1]:null}async writeStashCommit({message:t,tree:r,parent:n}){return xf({fs:this.fs,gitdir:this.gitdir,commit:{message:t,tree:r,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(t){const r=await this.readStashReflogs({parsed:!1});if(t!==0&&(t<0||t>r.length-1))throw new Ct(`stash@${t}`,"number that is in range of [0, num of stash pushed]");const n=await this.getStashSHA(t,r);return n?mn({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(t){return U.writeRef({fs:this.fs,gitdir:this.gitdir,ref:Jt.refStash,value:t})}async writeStashReflogEntry({stashCommit:t,message:r}){const n=await this.getAuthor(),i=ua.createStashReflogEntry(n,t,r),a=this.refLogsStashPath;await gn({filepath:a,entry:i},async()=>{const o=await this.fs.exists(a)?await this.fs.read(a,"utf8"):"";await this.fs.write(a,o+i,"utf8")})}async readStashReflogs({parsed:t=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];const n=(await this.fs.read(this.refLogsStashPath)).toString();return ua.getStashReflogEntry(n,t)}}async function eb({fs:e,dir:t,gitdir:r,message:n=""}){const i=new Jt({fs:e,dir:t,gitdir:r});await i.getAuthor();const a=await mr({fs:e,gitdir:r,fullname:!1}),o=await U.resolve({fs:e,gitdir:r,ref:"HEAD"}),l=(await _f({fs:e,dir:t,gitdir:r,oid:o})).commit.message,c=[o];let u=null,d=xt({ref:"HEAD"});const p=await Ef({fs:e,dir:t,gitdir:r,treePair:[xt({ref:"HEAD"}),"stage"]});if(p){const x=await i.writeStashCommit({message:`stash-Index: WIP on ${a} - ${new Date().toISOString()}`,tree:p,parent:c});c.push(x),u=p,d=nn()}const m=await Ef({fs:e,dir:t,gitdir:r,treePair:[d,"workdir"]});if(m){const x=await i.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${new Date().toISOString()}`,tree:m,parent:[c[c.length-1]]});c.push(x),u=m}if(!u||!p&&!m)throw new Oe("changes, nothing to stash");const g=(n.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${l}`,_=await i.writeStashCommit({message:g,tree:u,parent:c});return await i.writeStashRef(_),await i.writeStashReflogEntry({stashCommit:_,message:g}),await Vu({fs:e,dir:t,gitdir:r,ref:a,track:!1,force:!0}),_}async function Sf({fs:e,dir:t,gitdir:r,refIdx:n=0}){const a=await new Jt({fs:e,dir:t,gitdir:r}).readStashCommit(n),{parent:o=null}=a.commit?a.commit:{};if(!(!o||!Array.isArray(o)))for(let s=0;s<o.length-1;s++){const c=(await mn({fs:e,cache:{},gitdir:r,oid:o[s+1]})).commit.message.startsWith("stash-Index");await Qy({fs:e,dir:t,gitdir:r,stashCommit:o[s+1],parentCommit:o[s],wasStaged:c})}}async function kf({fs:e,dir:t,gitdir:r,refIdx:n=0}){const i=new Jt({fs:e,dir:t,gitdir:r});if(!(await i.readStashCommit(n)).commit)return;const o=i.refStashPath;await gn(o,async()=>{await e.exists(o)&&await e.rm(o)});const s=await i.readStashReflogs({parsed:!1});if(!s.length)return;s.splice(n,1);const l=i.refLogsStashPath;await gn({reflogEntries:s,stashReflogPath:l,stashMgr:i},async()=>{if(s.length){await e.write(l,s.join(`
98
- `),"utf8");const c=s[s.length-1].split(" ")[1];await i.writeStashRef(c)}else await e.rm(l)})}async function tb({fs:e,dir:t,gitdir:r}){return new Jt({fs:e,dir:t,gitdir:r}).readStashReflogs({parsed:!0})}async function rb({fs:e,dir:t,gitdir:r}){const n=new Jt({fs:e,dir:t,gitdir:r}),i=[n.refStashPath,n.refLogsStashPath];await gn(i,async()=>{await Promise.all(i.map(async a=>{if(await e.exists(a))return e.rm(a)}))})}async function nb({fs:e,dir:t,gitdir:r,refIdx:n=0}){await Sf({fs:e,dir:t,gitdir:r,refIdx:n}),await kf({fs:e,dir:t,gitdir:r,refIdx:n})}async function ib({fs:e,dir:t,gitdir:r=N.join(t,".git"),op:n="push",message:i="",refIdx:a=0}){T("fs",e),T("dir",t),T("gitdir",r),T("op",n);const o={push:eb,apply:Sf,drop:kf,list:tb,clear:rb,pop:nb},s=["apply","drop","pop"];try{const l=new J(e);["refs","logs","logs/refs"].map(d=>N.join(r,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});const u=o[n];if(u){if(s.includes(n)&&a<0)throw new Ct(`stash@${a}`,"number that is in range of [0, num of stash pushed]");return await u({fs:l,dir:t,gitdir:r,message:i,refIdx:a})}throw new Error(`To be implemented: ${n}`)}catch(l){throw l.caller="git.stash",l}}async function ab({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n,cache:i={}}){try{T("fs",e),T("gitdir",r),T("filepath",n);const a=new J(e);if(await hn.isIgnored({fs:a,gitdir:r,dir:t,filepath:n}))return"ignored";const s=await ob({fs:a,cache:i,gitdir:r}),l=await Rf({fs:a,cache:i,gitdir:r,tree:s,path:n}),c=await Ge.acquire({fs:a,gitdir:r,cache:i},async function(_){for(const x of _)if(x.path===n)return x;return null}),u=await a.lstat(N.join(t,n)),d=l!==null,p=c!==null,m=u!==null,g=async()=>{if(p&&!Zi(c,u))return c.oid;{const _=await a.read(N.join(t,n)),x=await vf({gitdir:r,type:"blob",object:_});return p&&c.oid===x&&u.size!==-1&&Ge.acquire({fs:a,gitdir:r,cache:i},async function(y){y.insert({filepath:n,stats:u,oid:x})}),x}};if(!d&&!m&&!p)return"absent";if(!d&&!m&&p)return"*absent";if(!d&&m&&!p)return"*added";if(!d&&m&&p)return await g()===c.oid?"added":"*added";if(d&&!m&&!p)return"deleted";if(d&&!m&&p)return l===c.oid,"*deleted";if(d&&m&&!p)return await g()===l?"*undeleted":"*undeletemodified";if(d&&m&&p){const _=await g();return _===l?_===c.oid?"unmodified":"*unmodified":_===c.oid?"modified":"*modified"}}catch(a){throw a.caller="git.status",a}}async function Rf({fs:e,cache:t,gitdir:r,tree:n,path:i}){typeof i=="string"&&(i=i.split("/"));const a=i.shift();for(const o of n)if(o.path===a){if(i.length===0)return o.oid;const{type:s,object:l}=await De({fs:e,cache:t,gitdir:r,oid:o.oid});if(s==="tree"){const c=ct.from(l);return Rf({fs:e,cache:t,gitdir:r,tree:c,path:i})}if(s==="blob")throw new rt(o.oid,s,"blob",i.join("/"))}return null}async function ob({fs:e,cache:t,gitdir:r}){let n;try{n=await U.resolve({fs:e,gitdir:r,ref:"HEAD"})}catch(a){if(a instanceof Oe)return[]}const{tree:i}=await wn({fs:e,cache:t,gitdir:r,oid:n});return i}async function sb({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n="HEAD",filepaths:i=["."],filter:a,cache:o={},ignored:s=!1}){try{T("fs",e),T("gitdir",r),T("ref",n);const l=new J(e);return await hr({fs:l,cache:o,dir:t,gitdir:r,trees:[xt({ref:n}),ui(),nn()],map:async function(c,[u,d,p]){if(!u&&!p&&d&&!s&&await hn.isIgnored({fs:l,dir:t,filepath:c})||!i.some(C=>Zu(c,C)))return null;if(a&&!a(c))return;const[m,g,_]=await Promise.all([u&&u.type(),d&&d.type(),p&&p.type()]),x=[m,g,_].includes("blob");if((m==="tree"||m==="special")&&!x)return;if(m==="commit")return null;if((g==="tree"||g==="special")&&!x)return;if(_==="commit")return null;if((_==="tree"||_==="special")&&!x)return;const y=m==="blob"?await u.oid():void 0,v=_==="blob"?await p.oid():void 0;let O;m!=="blob"&&g==="blob"&&_!=="blob"?O="42":g==="blob"&&(O=await d.oid());const R=[void 0,y,O,v],b=R.map(C=>R.indexOf(C));return b.shift(),[c,...b]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function cb({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,object:i,force:a=!1}){try{T("fs",e),T("gitdir",r),T("ref",n);const o=new J(e);if(n===void 0)throw new lt("ref");n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`;const s=await U.resolve({fs:o,gitdir:r,ref:i||"HEAD"});if(!a&&await U.exists({fs:o,gitdir:r,ref:n}))throw new Ot("tag",n);await U.writeRef({fs:o,gitdir:r,ref:n,value:s})}catch(o){throw o.caller="git.tag",o}}async function lb({fs:e,dir:t,gitdir:r=N.join(t,".git"),cache:n={},filepath:i,oid:a,mode:o,add:s,remove:l,force:c}){try{T("fs",e),T("gitdir",r),T("filepath",i);const u=new J(e);if(l)return await Ge.acquire({fs:u,gitdir:r,cache:n},async function(p){let m;if(!c&&(m=await u.lstat(N.join(t,i)),m)){if(m.isDirectory())throw new fr("directory");return}p.has({filepath:i})&&p.delete({filepath:i})});let d;if(!a){if(d=await u.lstat(N.join(t,i)),!d)throw new Oe(`file at "${i}" on disk and "remove" not set`);if(d.isDirectory())throw new fr("directory")}return await Ge.acquire({fs:u,gitdir:r,cache:n},async function(p){if(!s&&!p.has({filepath:i}))throw new Oe(`file at "${i}" in index and "add" not set`);let m={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};if(!a){m=d;const g=m.isSymbolicLink()?await u.readlink(N.join(t,i)):await u.read(N.join(t,i));a=await ut({fs:u,gitdir:r,type:"blob",format:"content",object:g})}return p.insert({filepath:i,oid:a,stats:m}),a})}catch(u){throw u.caller="git.updateIndex",u}}function ub(){try{return ca.version}catch(e){throw e.caller="git.version",e}}async function fb({fs:e,dir:t,gitdir:r=N.join(t,".git"),trees:n,map:i,reduce:a,iterate:o,cache:s={}}){try{return T("fs",e),T("gitdir",r),T("trees",n),await hr({fs:new J(e),cache:s,dir:t,gitdir:r,trees:n,map:i,reduce:a,iterate:o})}catch(l){throw l.caller="git.walk",l}}async function db({fs:e,dir:t,gitdir:r=N.join(t,".git"),blob:n}){try{return T("fs",e),T("gitdir",r),T("blob",n),await ut({fs:new J(e),gitdir:r,type:"blob",object:n,format:"content"})}catch(i){throw i.caller="git.writeBlob",i}}async function hb({fs:e,dir:t,gitdir:r=N.join(t,".git"),commit:n}){try{return T("fs",e),T("gitdir",r),T("commit",n),await xf({fs:new J(e),gitdir:r,commit:n})}catch(i){throw i.caller="git.writeCommit",i}}async function pb({fs:e,dir:t,gitdir:r=N.join(t,".git"),type:n,object:i,format:a="parsed",oid:o,encoding:s=void 0}){try{const l=new J(e);if(a==="parsed"){switch(n){case"commit":i=Ie.from(i).toObject();break;case"tree":i=ct.from(i).toObject();break;case"blob":i=Buffer.from(i,s);break;case"tag":i=nt.from(i).toObject();break;default:throw new rt(o||"",n,"blob|commit|tag|tree")}a="content"}return o=await ut({fs:l,gitdir:r,type:n,object:i,oid:o,format:a}),o}catch(l){throw l.caller="git.writeObject",l}}async function mb({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,value:i,force:a=!1,symbolic:o=!1}){try{T("fs",e),T("gitdir",r),T("ref",n),T("value",i);const s=new J(e);if(n!==Mt.clean(n))throw new Ct(n,Mt.clean(n));if(!a&&await U.exists({fs:s,gitdir:r,ref:n}))throw new Ot("ref",n);o?await U.writeSymbolicRef({fs:s,gitdir:r,ref:n,value:i}):(i=await U.resolve({fs:s,gitdir:r,ref:i}),await U.writeRef({fs:s,gitdir:r,ref:n,value:i}))}catch(s){throw s.caller="git.writeRef",s}}async function wb({fs:e,gitdir:t,tag:r}){const n=nt.from(r).toObject();return await ut({fs:e,gitdir:t,type:"tag",object:n,format:"content"})}async function gb({fs:e,dir:t,gitdir:r=N.join(t,".git"),tag:n}){try{return T("fs",e),T("gitdir",r),T("tag",n),await wb({fs:new J(e),gitdir:r,tag:n})}catch(i){throw i.caller="git.writeTag",i}}async function yb({fs:e,dir:t,gitdir:r=N.join(t,".git"),tree:n}){try{return T("fs",e),T("gitdir",r),T("tree",n),await hi({fs:new J(e),gitdir:r,tree:n})}catch(i){throw i.caller="git.writeTree",i}}var it={Errors:qw,STAGE:nn,TREE:xt,WORKDIR:ui,add:ug,abortMerge:og,addNote:dg,addRemote:hg,annotatedTag:mg,branch:gg,checkout:Vu,clone:Tg,commit:Pg,getConfig:Kg,getConfigAll:Qg,setConfig:Zy,currentBranch:Ag,deleteBranch:Dg,deleteRef:Ig,deleteRemote:Bg,deleteTag:Ng,expandOid:Ug,expandRef:Hg,fastForward:Yg,fetch:Xg,findMergeBase:Zg,findRoot:Vg,getRemoteInfo:ey,getRemoteInfo2:ty,hashBlob:ny,indexPack:ay,init:oy,isDescendent:sy,isIgnored:cy,listBranches:ly,listFiles:fy,listNotes:hy,listRefs:py,listRemotes:wy,listServerRefs:by,listTags:_y,log:Sy,merge:ky,packObjects:Cy,pull:Ty,push:Iy,readBlob:jy,readCommit:_f,readNote:zy,readObject:Ny,readTag:Ly,readTree:Fy,remove:Uy,removeNote:Wy,renameBranch:qy,resetIndex:Yy,updateIndex:lb,resolveRef:Xy,status:ab,statusMatrix:sb,tag:cb,version:ub,walk:fb,writeBlob:db,writeCommit:hb,writeObject:pb,writeRef:mb,writeTag:gb,writeTree:yb,stash:ib};const bb=async e=>{try{return await(await window.pfs.stat(e)).isDirectory()}catch(t){if(t.code==="ENOENT")return!1;throw t}},Of=async e=>await window.pfs.readdir(e),Cf=async e=>{let t=window.pfs,r;try{r=await t.stat(e)}catch(n){console.debug("recursiveRm: Path does not exist",n);return}if(r.type==="file")await t.unlink(e),console.debug(`recursiveRm: Deleted file: ${e}`);else if(r.type==="dir"){const n=await t.readdir(e);for(const i of n)await Cf(`${e}/${i}`);await t.rmdir(e),console.debug(`recursiveRm: Deleted directory: ${e}`)}},_b=async e=>{const t=window.pfs,r=`${window.miDir}/${e}`,n="makeinfinite_client",i="makeinfinite_client@spaceandtime.io";await it.setConfig({fs:t,dir:r,path:"user.name",value:n}),await it.setConfig({fs:t,dir:r,path:"user.email",value:i})},vb=async(e,t)=>{const r=window.pfs,n=`${window.miDir}/${e}`;await it.clone({fs:r,http:to,dir:n,url:t,ref:"main"}),await _b(e)},xb=async(e,t)=>{const r=window.pfs,n=`${window.miDir}/${e}`;await it.pull({fs:r,http:to,dir:n,url:t,ref:"main"})},Eb=async e=>{const t=window.pfs,r=`${window.miDir}/${e}`,n=await it.resolveRef({fs:t,dir:r,ref:"refs/tags/published"});await it.checkout({fs:t,dir:r,ref:n})},Sb=async(e,t)=>{const r=window.pfs,n=`${window.miDir}/${e}`;await it.fetch({fs:r,http:to,dir:n,url:t,ref:"main",tags:!0,pruneTags:!0})};class kb{constructor(t,r,n){this.targetRef=t,this.sourceRef=r,this.opType=n}}const os=e=>{var o,s;const t=e.commit.message.trim().split(`
99
- `),r=t.find(l=>l.startsWith("Git Ref: ")),n=t.find(l=>l.startsWith("Extra Metadata: "));if(!r||!n)return null;const i=(o=r.split("Git Ref: ")[1])==null?void 0:o.trim(),a=JSON.parse(((s=n.split("Extra Metadata: ")[1])==null?void 0:s.trim())||"{}");return!i||!a?null:new kb(i,a.sourceRef,a.opType)},Rb=async e=>{const t=window.pfs,r=`${window.miDir}/${e}`;return await it.resolveRef({fs:t,dir:r,ref:"HEAD"})},Tf=async(e,t)=>{const r=window.pfs,n=`${window.miDir}/${e}`,i={fs:r,dir:n,ref:"HEAD",depth:1,filepath:t},a=(await it.log(i))[0];if(!a)throw new Error("No commit found");return a.oid},fa=async(e,t,r,n,i=new Set,a=1e3)=>{if(a<=0)throw new Error(`Maximum recursion depth reached while resolving commit: ${r}`);const o=window.pfs,s=`${window.miDir}/${e}`,l={fs:o,dir:s,ref:r,depth:1,filepath:t},c=(await it.log(l))[0];if(!c)throw new Error("No commit found");if(i.has(c.oid))throw new Error(`Circular reference detected: ${c.oid} has already been seen`);i.add(c.oid);const u=os(c);if(u&&u.opType==n)return fa(e,t,u.targetRef,n,i,a-1);if(c.commit.parent.length>1){const d=c.commit.parent[0];if(!d)throw new Error("No parent found");return fa(e,t,d,n,i,a-1)}return c},Ob=async(e,t)=>{const r=window.pfs,n=`${window.miDir}/${e}`,i=await Tf(e,t),a=await fa(e,t,i,"UNDO"),o=os(a);if(o)return[i,o.sourceRef];{let s=a.oid;const l={fs:r,dir:n,ref:s,depth:2,filepath:t},c=await it.log(l);if(!c[1])throw new Error("No previous commit found");const u=c[1].oid;return[i,u]}},Cb=async(e,t)=>{const r=await Tf(e,t),n=await fa(e,t,r,"REDO"),i=os(n);if(!i)throw new Error("No undos to redo");return[r,i.sourceRef]},Tb=async(e,t)=>{await bb(`${window.miDir}/${e}`)||await vb(e,t);try{await xb(e,t)}catch(n){throw await Cf(`${window.miDir}/${e}`).catch(i=>console.log(`recursiveRm error: ${i}`)),n}},Pf=async(e,t)=>{let r=0;const n=5;for(;r<=n;)try{await Tb(e||"",t||"");break}catch(i){if(r++,console.log(`Retrying syncGitSource (Attempt ${r})`),r>n)throw console.error(`syncGitSource failed after ${r} attempts:`,i),i}},ss=async(e,t)=>{const r=window.pfs,n=`${window.miDir}/${e}`;await Sb(e,t);const i=await it.listTags({fs:r,dir:n});return await Promise.all(i.map(async o=>{const s=await it.resolveRef({fs:r,dir:n,ref:`refs/tags/${o}`});let l=null;try{l=(await it.readTag({fs:r,dir:n,oid:s})).tag.object}catch{l=s}const{commit:c}=await it.readCommit({fs:r,dir:n,oid:s});return{tag:o,targetCommitTimestamp:c.committer.timestamp,targetCommit:l,ref:`refs/tags/${o}`}}))};var Af={exports:{}},wi={};/*
84
+ `),await e.write(r+"/HEAD",`ref: refs/heads/${o}
85
+ `)}async function pL({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:l,dir:c,gitdir:u,url:d,corsProxy:f,ref:h,remote:p,depth:m,since:v,exclude:w,relative:b,singleBranch:x,noCheckout:S,noTags:C,headers:N}){try{if(await Nb({fs:e,gitdir:u}),await mb({fs:e,gitdir:u,remote:p,url:d,force:!1}),f){const M=await bt.get({fs:e,gitdir:u});await M.set("http.corsProxy",f),await bt.save({fs:e,gitdir:u,config:M})}const{defaultBranch:R,fetchHead:T}=await fh({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:u,ref:h,remote:p,corsProxy:f,depth:m,since:v,exclude:w,relative:b,singleBranch:x,headers:N,tags:!C});if(T===null)return;h=h||R,h=h.replace("refs/heads/",""),await lh({fs:e,cache:t,onProgress:r,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:S})}catch(R){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),R}}async function mL({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPostCheckout:s,dir:l,gitdir:c=ue.join(l,".git"),url:u,corsProxy:d=void 0,ref:f=void 0,remote:h="origin",depth:p=void 0,since:m=void 0,exclude:v=[],relative:w=!1,singleBranch:b=!1,noCheckout:x=!1,noTags:S=!1,headers:C={},cache:N={}}){try{return W("fs",e),W("http",t),W("gitdir",c),x||W("dir",l),W("url",u),await pL({fs:new be(e),cache:N,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPostCheckout:s,dir:l,gitdir:c,url:u,corsProxy:d,ref:f,remote:h,depth:p,since:m,exclude:v,relative:w,singleBranch:b,noCheckout:x,noTags:S,headers:C})}catch(R){throw R.caller="git.clone",R}}async function gL({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),message:o,author:i,committer:a,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:f,tree:h,cache:p={}}){try{W("fs",e),l||W("message",o),s&&W("onSign",t);const m=new be(e);return await Ic({fs:m,cache:p,onSign:t,gitdir:r,message:o,author:i,committer:a,signingKey:s,amend:l,dryRun:c,noUpdateBranch:u,ref:d,parent:f,tree:h})}catch(m){throw m.caller="git.commit",m}}async function wL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),fullname:r=!1,test:o=!1}){try{return W("fs",e),W("gitdir",n),await so({fs:new be(e),gitdir:n,fullname:r,test:o})}catch(i){throw i.caller="git.currentBranch",i}}async function vL({fs:e,gitdir:t,ref:n}){if(n=n.startsWith("refs/heads/")?n:`refs/heads/${n}`,!await de.exists({fs:e,gitdir:t,ref:n}))throw new ot(n);const o=await de.expand({fs:e,gitdir:t,ref:n}),i=await so({fs:e,gitdir:t,fullname:!0});if(o===i){const l=await de.resolve({fs:e,gitdir:t,ref:o});await de.writeRef({fs:e,gitdir:t,ref:"HEAD",value:l})}await de.deleteRef({fs:e,gitdir:t,ref:o});const a=Vo(n),s=await bt.get({fs:e,gitdir:t});await s.deleteSection("branch",a),await bt.save({fs:e,gitdir:t,config:s})}async function yL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{return W("fs",e),W("ref",r),await vL({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteBranch",o}}async function bL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{W("fs",e),W("ref",r),await de.deleteRef({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteRef",o}}async function xL({fs:e,gitdir:t,remote:n}){const r=await bt.get({fs:e,gitdir:t});await r.deleteSection("remote",n),await bt.save({fs:e,gitdir:t,config:r})}async function _L({fs:e,dir:t,gitdir:n=ue.join(t,".git"),remote:r}){try{return W("fs",e),W("remote",r),await xL({fs:new be(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.deleteRemote",o}}async function SL({fs:e,gitdir:t,ref:n}){n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,await de.deleteRef({fs:e,gitdir:t,ref:n})}async function CL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{return W("fs",e),W("ref",r),await SL({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteTag",o}}async function EL({fs:e,gitdir:t,oid:n}){const r=n.slice(0,2);return(await e.readdir(`${t}/objects/${r}`)).map(i=>`${r}${i}`).filter(i=>i.startsWith(n))}async function PL({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o}){const i=[];let a=await e.readdir(ue.join(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(const s of a){const l=`${n}/objects/pack/${s}`,c=await nh({fs:e,cache:t,filename:l,getExternalRefDelta:o});if(c.error)throw new De(c.error);for(const u of c.offsets.keys())u.startsWith(r)&&i.push(u)}return i}async function RL({fs:e,cache:t,gitdir:n,oid:r}){const o=s=>dt({fs:e,cache:t,gitdir:n,oid:s}),i=await EL({fs:e,gitdir:n,oid:r}),a=await PL({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o});for(const s of a)i.indexOf(s)===-1&&i.push(s);if(i.length===1)return i[0];throw i.length>1?new _s("oids",r,i):new ot(`an object matching "${r}"`)}async function NL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await RL({fs:new be(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.expandOid",i}}async function TL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{return W("fs",e),W("gitdir",n),W("ref",r),await de.expand({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.expandRef",o}}async function hh({fs:e,cache:t,gitdir:n,oids:r}){const o={},i=r.length;let a=r.map((s,l)=>({index:l,oid:s}));for(;a.length;){const s=new Set;for(const{oid:c,index:u}of a)o[c]||(o[c]=new Set),o[c].add(u),o[c].size===i&&s.add(c);if(s.size>0)return[...s];const l=new Map;for(const{oid:c,index:u}of a)try{const{object:d}=await dt({fs:e,cache:t,gitdir:n,oid:c}),f=ft.from(d),{parent:h}=f.parseHeaders();for(const p of h)(!o[p]||!o[p].has(u))&&l.set(p+":"+u,{oid:p,index:u})}catch{}a=Array.from(l.values())}return[]}const ph=/^.*(\r?\n|$)/gm;function ML({branches:e,contents:t}){const n=e[1],r=e[2],o=t[0],i=t[1],a=t[2],s=i.match(ph),l=o.match(ph),c=a.match(ph),u=K$(s,l,c),d=7;let f="",h=!0;for(const p of u)p.ok&&(f+=p.ok.join("")),p.conflict&&(h=!1,f+=`${"<".repeat(d)} ${n}
86
+ `,f+=p.conflict.a.join(""),f+=`${"=".repeat(d)}
87
+ `,f+=p.conflict.b.join(""),f+=`${">".repeat(d)} ${r}
88
+ `);return{cleanMerge:h,mergedText:f}}async function DL({fs:e,cache:t,dir:n,gitdir:r=ue.join(n,".git"),index:o,ourOid:i,baseOid:a,theirOid:s,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:d=!1,abortOnConflict:f=!0,mergeDriver:h}){const p=kn({ref:i}),m=kn({ref:a}),v=kn({ref:s}),w=[],b=[],x=[],S=[],C=await io({fs:e,cache:t,dir:n,gitdir:r,trees:[p,m,v],map:async function(N,[R,T,M]){const A=Pc(N),k=await kc(R,T),F=await kc(M,T);switch(`${k}-${F}`){case"false-false":return{mode:await T.mode(),path:A,oid:await T.oid(),type:await T.type()};case"false-true":return M?{mode:await M.mode(),path:A,oid:await M.oid(),type:await M.type()}:void 0;case"true-false":return R?{mode:await R.mode(),path:A,oid:await R.oid(),type:await R.type()}:void 0;case"true-true":{if(R&&T&&M&&await R.type()==="blob"&&await T.type()==="blob"&&await M.type()==="blob")return AL({fs:e,gitdir:r,path:A,ours:R,base:T,theirs:M,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async L=>{if(L.cleanMerge)f||o.insert({filepath:N,oid:L.mergeResult.oid,stage:0});else if(w.push(N),b.push(N),!f){const Y=await T.oid(),ne=await R.oid(),q=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:Y,stage:1}),o.insert({filepath:N,oid:ne,stage:2}),o.insert({filepath:N,oid:q,stage:3})}return L.mergeResult});if(T&&!R&&M&&await T.type()==="blob"&&await M.type()==="blob"){if(w.push(N),x.push(N),!f){const L=await T.oid(),Y=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:L,stage:1}),o.insert({filepath:N,oid:Y,stage:3})}return{mode:await M.mode(),oid:await M.oid(),type:"blob",path:A}}if(T&&R&&!M&&await T.type()==="blob"&&await R.type()==="blob"){if(w.push(N),S.push(N),!f){const L=await T.oid(),Y=await R.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:L,stage:1}),o.insert({filepath:N,oid:Y,stage:2})}return{mode:await R.mode(),oid:await R.oid(),type:"blob",path:A}}if(T&&!R&&!M&&await T.type()==="blob")return;throw new Fi}}},reduce:w.length!==0&&(!n||f)?void 0:async(N,R)=>{const T=R.filter(Boolean);if(N&&!(N&&N.type==="tree"&&T.length===0)){if(T.length>0){const A=new tn(T).toObject(),k=await rn({fs:e,gitdir:r,type:"tree",object:A,dryRun:d});N.oid=k}return N}}});return w.length!==0?(n&&!f&&await io({fs:e,cache:t,dir:n,gitdir:r,trees:[kn({ref:C.oid})],map:async function(N,[R]){const T=`${n}/${N}`;if(await R.type()==="blob"){const M=await R.mode(),A=new TextDecoder().decode(await R.content());await e.write(T,A,{mode:M})}return!0}}),new Li(w,b,x,S)):C.oid}async function AL({fs:e,gitdir:t,path:n,ours:r,base:o,theirs:i,ourName:a,theirName:s,baseName:l,dryRun:c,mergeDriver:u=ML}){const d="blob",f=await o.mode()===await r.mode()?await i.mode():await r.mode();if(await r.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await r.oid(),type:d}};if(await r.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await i.oid(),type:d}};if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await r.oid(),type:d}};const h=Buffer.from(await r.content()).toString("utf8"),p=Buffer.from(await o.content()).toString("utf8"),m=Buffer.from(await i.content()).toString("utf8"),{mergedText:v,cleanMerge:w}=await u({branches:[l,a,s],contents:[p,h,m],path:n}),b=await rn({fs:e,gitdir:t,type:"blob",object:Buffer.from(v,"utf8"),dryRun:c});return{cleanMerge:w,mergeResult:{mode:f,path:n,oid:b,type:d}}}async function Tb({fs:e,cache:t,dir:n,gitdir:r,ours:o,theirs:i,fastForward:a=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:f,committer:h,signingKey:p,onSign:m,mergeDriver:v}){o===void 0&&(o=await so({fs:e,gitdir:r,fullname:!0})),o=await de.expand({fs:e,gitdir:r,ref:o}),i=await de.expand({fs:e,gitdir:r,ref:i});const w=await de.resolve({fs:e,gitdir:r,ref:o}),b=await de.resolve({fs:e,gitdir:r,ref:i}),x=await hh({fs:e,cache:t,gitdir:r,oids:[w,b]});if(x.length!==1)throw new Fi;const S=x[0];if(S===b)return{oid:w,alreadyMerged:!0};if(a&&S===w)return!l&&!c&&await de.writeRef({fs:e,gitdir:r,ref:o,value:b}),{oid:b,fastForward:!0};{if(s)throw new Ps;const C=await Rt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async R=>DL({fs:e,cache:t,dir:n,gitdir:r,index:R,ourOid:w,theirOid:b,baseOid:S,ourName:Vo(o),baseName:"base",theirName:Vo(i),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(C instanceof Li)throw C;return d||(d=`Merge branch '${Vo(i)}' into ${Vo(o)}`),{oid:await Ic({fs:e,cache:t,gitdir:r,message:d,ref:o,tree:C,parent:[w,b],author:f,committer:h,signingKey:p,onSign:m,dryRun:l,noUpdateBranch:c}),tree:C,mergeCommit:!0}}}async function Mb({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:l,gitdir:c,ref:u,url:d,remote:f,remoteRef:h,prune:p,pruneTags:m,fastForward:v,fastForwardOnly:w,corsProxy:b,singleBranch:x,headers:S,author:C,committer:N,signingKey:R}){try{if(!u){const A=await so({fs:e,gitdir:c});if(!A)throw new nn("ref");u=A}const{fetchHead:T,fetchHeadDescription:M}=await fh({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:c,corsProxy:b,ref:u,url:d,remote:f,remoteRef:h,singleBranch:x,headers:S,prune:p,pruneTags:m});await Tb({fs:e,cache:t,gitdir:c,ours:u,theirs:T,fastForward:v,fastForwardOnly:w,message:`Merge ${M}`,author:C,committer:N,signingKey:R,dryRun:!1,noUpdateBranch:!1}),await lh({fs:e,cache:t,onProgress:r,dir:l,gitdir:c,ref:u,remote:f,noCheckout:!1})}catch(T){throw T.caller="git.pull",T}}async function kL({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=ue.join(s,".git"),ref:c,url:u,remote:d,remoteRef:f,corsProxy:h,singleBranch:p,headers:m={},cache:v={}}){try{W("fs",e),W("http",t),W("gitdir",l);const w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await Mb({fs:new be(e),cache:v,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:f,fastForwardOnly:!0,corsProxy:h,singleBranch:p,headers:m,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function IL({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=ue.join(s,".git"),ref:c,remote:u,remoteRef:d,url:f,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:x=!1,headers:S={},prune:C=!1,pruneTags:N=!1,cache:R={}}){try{return W("fs",e),W("http",t),W("gitdir",l),await fh({fs:new be(e),cache:R,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,gitdir:l,ref:c,remote:u,remoteRef:d,url:f,corsProxy:h,depth:p,since:m,exclude:v,relative:w,tags:b,singleBranch:x,headers:S,prune:C,pruneTags:N})}catch(T){throw T.caller="git.fetch",T}}async function OL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oids:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oids",r),await hh({fs:new be(e),cache:o,gitdir:n,oids:r})}catch(i){throw i.caller="git.findMergeBase",i}}async function Db({fs:e,filepath:t}){if(await e.exists(ue.join(t,".git")))return t;{const n=ki(t);if(n===t)throw new ot(`git root for ${t}`);return Db({fs:e,filepath:n})}}async function jL({fs:e,filepath:t}){try{return W("fs",e),W("filepath",t),await Db({fs:new be(e),filepath:t})}catch(n){throw n.caller="git.findRoot",n}}async function $L({fs:e,dir:t,gitdir:n=ue.join(t,".git"),path:r}){try{return W("fs",e),W("gitdir",n),W("path",r),await js({fs:new be(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfig",o}}async function FL({fs:e,gitdir:t,path:n}){return(await bt.get({fs:e,gitdir:t})).getall(n)}async function LL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),path:r}){try{return W("fs",e),W("gitdir",n),W("path",r),await FL({fs:new be(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfigAll",o}}async function zL({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1}){try{W("http",e),W("url",i);const c=await $c.getRemoteHelperFor({url:i}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(const[d,f]of c.refs){const h=d.split("/"),p=h.pop();let m=u;for(const v of h)m[v]=m[v]||{},m=m[v];m[p]=f}for(const[d,f]of c.symrefs){const h=d.split("/"),p=h.pop();let m=u;for(const v of h)m[v]=m[v]||{},m=m[v];m[p]=f}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function Ab(e,t,n,r){const o=[];for(const[i,a]of e.refs){if(t&&!i.startsWith(t))continue;if(i.endsWith("^{}")){if(r){const l=i.replace("^{}",""),c=o[o.length-1],u=c.ref===l?c:o.find(d=>d.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}const s={ref:i,oid:a};n&&e.symrefs.has(i)&&(s.target=e.symrefs.get(i)),o.push(s)}return o}async function BL({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1,protocolVersion:l=2}){try{W("http",e),W("url",i);const u=await $c.getRemoteHelperFor({url:i}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};const d={};for(const f of u.capabilities){const[h,p]=f.split("=");p?d[h]=p:d[h]=!0}return{protocolVersion:1,capabilities:d,refs:Ab(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function HL({type:e,object:t,format:n="content",oid:r=void 0}){return n!=="deflated"&&(n!=="wrapped"&&(t=Oi.wrap({type:e,object:t})),r=await kr(t)),{oid:r,object:t}}async function UL({object:e}){try{W("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);const t="blob",{oid:n,object:r}=await HL({type:"blob",format:"content",object:e});return{oid:n,type:t,object:new Uint8Array(r),format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function VL({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,filepath:i}){try{i=ue.join(r,i);const a=await e.read(i),s=c=>dt({fs:e,cache:t,gitdir:o,oid:c}),l=await ji.fromPack({pack:a,getExternalRefDelta:s,onProgress:n});return await e.write(i.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function WL({fs:e,onProgress:t,dir:n,gitdir:r=ue.join(n,".git"),filepath:o,cache:i={}}){try{return W("fs",e),W("dir",n),W("gitdir",n),W("filepath",o),await VL({fs:new be(e),cache:i,onProgress:t,dir:n,gitdir:r,filepath:o})}catch(a){throw a.caller="git.indexPack",a}}async function GL({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:ue.join(n,".git"),defaultBranch:o="master"}){try{return W("fs",e),W("gitdir",r),t||W("dir",n),await Nb({fs:new be(e),bare:t,dir:n,gitdir:r,defaultBranch:o})}catch(i){throw i.caller="git.init",i}}async function kb({fs:e,cache:t,gitdir:n,oid:r,ancestor:o,depth:i}){const a=await zs.read({fs:e,gitdir:n});if(!r)throw new nn("oid");if(!o)throw new nn("ancestor");if(r===o)return!1;const s=[r],l=new Set;let c=0;for(;s.length;){if(c++===i)throw new Ns(i);const u=s.shift(),{type:d,object:f}=await dt({fs:e,cache:t,gitdir:n,oid:u});if(d!=="commit")throw new Yt(u,d,"commit");const h=ft.from(f).parse();for(const p of h.parent)if(p===o)return!0;if(!a.has(u))for(const p of h.parent)l.has(p)||(s.push(p),l.add(p))}return!1}async function qL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,ancestor:o,depth:i=-1,cache:a={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),W("ancestor",o),await kb({fs:new be(e),cache:a,gitdir:n,oid:r,ancestor:o,depth:i})}catch(s){throw s.caller="git.isDescendent",s}}async function YL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r}){try{return W("fs",e),W("dir",t),W("gitdir",n),W("filepath",r),Ui.isIgnored({fs:new be(e),dir:t,gitdir:n,filepath:r})}catch(o){throw o.caller="git.isIgnored",o}}async function KL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),remote:r}){try{return W("fs",e),W("gitdir",n),de.listBranches({fs:new be(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.listBranches",o}}async function XL({fs:e,gitdir:t,ref:n,cache:r}){if(n){const o=await de.resolve({gitdir:t,fs:e,ref:n}),i=[];return await Ib({fs:e,cache:r,gitdir:t,oid:o,filenames:i,prefix:""}),i}else return Rt.acquire({fs:e,gitdir:t,cache:r},async function(o){return o.entries.map(i=>i.path)})}async function Ib({fs:e,cache:t,gitdir:n,oid:r,filenames:o,prefix:i}){const{tree:a}=await Gi({fs:e,cache:t,gitdir:n,oid:r});for(const s of a)s.type==="tree"?await Ib({fs:e,cache:t,gitdir:n,oid:s.oid,filenames:o,prefix:ue.join(i,s.path)}):o.push(ue.join(i,s.path))}async function ZL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),await XL({fs:new be(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listFiles",i}}async function JL({fs:e,cache:t,gitdir:n,ref:r}){let o;try{o=await de.resolve({gitdir:n,fs:e,ref:r})}catch(s){if(s instanceof ot)return[]}return(await Gi({fs:e,cache:t,gitdir:n,oid:o})).tree.map(s=>({target:s.path,note:s.oid}))}async function QL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r="refs/notes/commits",cache:o={}}){try{return W("fs",e),W("gitdir",n),W("ref",r),await JL({fs:new be(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listNotes",i}}async function ez({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r}){try{return W("fs",e),W("gitdir",n),de.listRefs({fs:new be(e),gitdir:n,filepath:r})}catch(o){throw o.caller="git.listRefs",o}}async function tz({fs:e,gitdir:t}){const n=await bt.get({fs:e,gitdir:t}),r=await n.getSubsections("remote");return Promise.all(r.map(async i=>{const a=await n.get(`remote.${i}.url`);return{remote:i,url:a}}))}async function nz({fs:e,dir:t,gitdir:n=ue.join(t,".git")}){try{return W("fs",e),W("gitdir",n),await tz({fs:new be(e),gitdir:n})}catch(r){throw r.caller="git.listRemotes",r}}async function rz(e){const t=xt.streamReader(e),n=[];let r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");const[o,i,...a]=r.split(" "),s={ref:i,oid:o};for(const l of a){const[c,u]=l.split(":");c==="symref-target"?s.target=u:c==="peeled"&&(s.peeled=u)}n.push(s)}return n}async function oz({prefix:e,symrefs:t,peelTags:n}){const r=[];return r.push(xt.encode(`command=ls-refs
89
+ `)),r.push(xt.encode(`agent=${Fc.agent}
90
+ `)),(n||t||e)&&r.push(xt.delim()),n&&r.push(xt.encode("peel")),t&&r.push(xt.encode("symrefs")),e&&r.push(xt.encode(`ref-prefix ${e}`)),r.push(xt.flush()),r}async function iz({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:d}){try{W("http",e),W("url",i);const f=await jc.discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:l});if(f.protocolVersion===1)return Ab(f,c,u,d);const h=await oz({prefix:c,symrefs:u,peelTags:d}),p=await jc.connect({http:e,auth:f.auth,headers:a,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,body:h});return rz(p.body)}catch(f){throw f.caller="git.listServerRefs",f}}async function az({fs:e,dir:t,gitdir:n=ue.join(t,".git")}){try{return W("fs",e),W("gitdir",n),de.listTags({fs:new be(e),gitdir:n})}catch(r){throw r.caller="git.listTags",r}}function sz(e,t){return e.committer.timestamp-t.committer.timestamp}const lz="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function Ob({fs:e,cache:t,gitdir:n,oid:r,fileId:o}){if(o===lz)return;const i=r;let a;const s=await Hi({fs:e,cache:t,gitdir:n,oid:r}),l=s.tree;return o===s.oid?a=s.path:(a=await jb({fs:e,cache:t,gitdir:n,tree:l,fileId:o,oid:i}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function jb({fs:e,cache:t,gitdir:n,tree:r,fileId:o,oid:i,filepaths:a=[],parentPath:s=""}){const l=r.entries().map(function(c){let u;return c.oid===o?(u=ue.join(s,c.path),a.push(u)):c.type==="tree"&&(u=dt({fs:e,cache:t,gitdir:n,oid:c.oid}).then(function({object:d}){return jb({fs:e,cache:t,gitdir:n,tree:tn.from(d),fileId:o,oid:i,filepaths:a,parentPath:ue.join(s,c.path)})})),u});return await Promise.all(l),a}async function cz({fs:e,cache:t,gitdir:n,filepath:r,ref:o,depth:i,since:a,force:s,follow:l}){const c=typeof a>"u"?void 0:Math.floor(a.valueOf()/1e3),u=[],d=await zs.read({fs:e,gitdir:n}),f=await de.resolve({fs:e,gitdir:n,ref:o}),h=[await Wi({fs:e,cache:t,gitdir:n,oid:f})];let p,m,v;function w(b){v&&r&&u.push(b)}for(;h.length>0;){const b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(r){let x;try{x=await $s({fs:e,cache:t,gitdir:n,oid:b.commit.tree,filepath:r}),m&&p!==x&&u.push(m),p=x,m=b,v=!0}catch(S){if(S instanceof ot){let C=l&&p;if(C&&(C=await Ob({fs:e,cache:t,gitdir:n,oid:b.commit.tree,fileId:p}),C))if(Array.isArray(C)){if(m){const N=await Ob({fs:e,cache:t,gitdir:n,oid:m.commit.tree,fileId:p});if(Array.isArray(N))if(C=C.filter(R=>N.indexOf(R)===-1),C.length===1)C=C[0],r=C,m&&u.push(m);else{C=!1,m&&u.push(m);break}}}else r=C,m&&u.push(m);if(!C){if(v&&p&&(u.push(m),!s))break;if(!s&&!l)throw S}m=b,v=!1}else throw S}}else u.push(b);if(i!==void 0&&u.length===i){w(b);break}if(!d.has(b.oid))for(const x of b.commit.parent){const S=await Wi({fs:e,cache:t,gitdir:n,oid:x});h.map(C=>C.oid).includes(S.oid)||h.push(S)}h.length===0&&w(b),h.sort((x,S)=>sz(x.commit,S.commit))}return u}async function uz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,ref:o="HEAD",depth:i,since:a,force:s,follow:l,cache:c={}}){try{return W("fs",e),W("gitdir",n),W("ref",o),await cz({fs:new be(e),cache:c,gitdir:n,filepath:r,ref:o,depth:i,since:a,force:s,follow:l})}catch(u){throw u.caller="git.log",u}}async function dz({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ours:o,theirs:i,fastForward:a=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:f,committer:h,signingKey:p,cache:m={},mergeDriver:v}){try{W("fs",e),p&&W("onSign",t);const w=new be(e),b=await ao({fs:w,gitdir:r,author:f});if(!b&&(!s||!a))throw new Ot("author");const x=await Vi({fs:w,gitdir:r,author:b,committer:h});if(!x&&(!s||!a))throw new Ot("committer");return await Tb({fs:w,cache:m,dir:n,gitdir:r,ours:o,theirs:i,fastForward:a,fastForwardOnly:s,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:d,author:b,committer:x,signingKey:p,onSign:t,mergeDriver:v})}catch(w){throw w.caller="git.merge",w}}const fz={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function $b({fs:e,cache:t,dir:n,gitdir:r=ue.join(n,".git"),oids:o}){const i=new Qv,a=[];function s(u,d){const f=Buffer.from(u,d);a.push(f),i.update(f)}async function l({stype:u,object:d}){const f=fz[u];let h=d.length,p=h>15?128:0;const m=h&15;h=h>>>4;let v=(p|f|m).toString(16);for(s(v,"hex");p;)p=h>127?128:0,v=p|h&127,s(ch(2,v),"hex"),h=h>>>7;s(Buffer.from(await cb(d)))}s("PACK"),s("00000002","hex"),s(ch(8,o.length),"hex");for(const u of o){const{type:d,object:f}=await dt({fs:e,cache:t,gitdir:r,oid:u});await l({write:s,object:f,stype:d})}const c=i.digest();return a.push(c),a}async function hz({fs:e,cache:t,gitdir:n,oids:r,write:o}){const i=await $b({fs:e,cache:t,gitdir:n,oids:r}),a=Buffer.from(await Oc(i)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return o?(await e.write(ue.join(n,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function pz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oids:r,write:o=!1,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("oids",r),await hz({fs:new be(e),cache:i,gitdir:n,oids:r,write:o})}catch(a){throw a.caller="git.packObjects",a}}async function mz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=ue.join(s,".git"),ref:c,url:u,remote:d,remoteRef:f,prune:h=!1,pruneTags:p=!1,fastForward:m=!0,fastForwardOnly:v=!1,corsProxy:w,singleBranch:b,headers:x={},author:S,committer:C,signingKey:N,cache:R={}}){try{W("fs",e),W("gitdir",l);const T=new be(e),M=await ao({fs:T,gitdir:l,author:S});if(!M)throw new Ot("author");const A=await Vi({fs:T,gitdir:l,author:M,committer:C});if(!A)throw new Ot("committer");return await Mb({fs:T,cache:R,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:f,fastForward:m,fastForwardOnly:v,corsProxy:w,singleBranch:b,headers:x,author:M,committer:A,signingKey:N,prune:h,pruneTags:p})}catch(T){throw T.caller="git.pull",T}}async function gz({fs:e,cache:t,dir:n,gitdir:r=ue.join(n,".git"),start:o,finish:i}){const a=await zs.read({fs:e,gitdir:r}),s=new Set,l=new Set;for(const d of o)s.add(await de.resolve({fs:e,gitdir:r,ref:d}));for(const d of i)try{const f=await de.resolve({fs:e,gitdir:r,ref:d});l.add(f)}catch{}const c=new Set;async function u(d){c.add(d);const{type:f,object:h}=await dt({fs:e,cache:t,gitdir:r,oid:d});if(f==="tag"){const m=Kt.from(h).headers().object;return u(m)}if(f!=="commit")throw new Yt(d,f,"commit");if(!a.has(d)){const m=ft.from(h).headers().parent;for(d of m)!l.has(d)&&!c.has(d)&&await u(d)}}for(const d of s)await u(d);return c}async function mh({fs:e,cache:t,dir:n,gitdir:r=ue.join(n,".git"),oids:o}){const i=new Set;async function a(s){if(i.has(s))return;i.add(s);const{type:l,object:c}=await dt({fs:e,cache:t,gitdir:r,oid:s});if(l==="tag"){const d=Kt.from(c).headers().object;await a(d)}else if(l==="commit"){const d=ft.from(c).headers().tree;await a(d)}else if(l==="tree"){const u=tn.from(c);for(const d of u)d.type==="blob"&&i.add(d.oid),d.type==="tree"&&await a(d.oid)}}for(const s of o)await a(s);return i}async function wz(e){const t={};let n="";const r=xt.streamReader(e);let o=await r();for(;o!==!0;)o!==null&&(n+=o.toString("utf8")+`
91
+ `),o=await r();const i=n.toString("utf8").split(`
92
+ `);if(o=i.shift(),!o.startsWith("unpack "))throw new Uo('unpack ok" or "unpack [error message]',o);t.ok=o==="unpack ok",t.ok||(t.error=o.slice(7)),t.refs={};for(const a of i){if(a.trim()==="")continue;const s=a.slice(0,2),l=a.slice(3);let c=l.indexOf(" ");c===-1&&(c=l.length);const u=l.slice(0,c),d=l.slice(c+1);t.refs[u]={ok:s==="ok",error:d}}return t}async function vz({capabilities:e=[],triplets:t=[]}){const n=[];let r=`\0 ${e.join(" ")}`;for(const o of t)n.push(xt.encode(`${o.oldoid} ${o.oid} ${o.fullRef}${r}
93
+ `)),r="";return n.push(xt.flush()),n}async function yz({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:l,gitdir:c,ref:u,remoteRef:d,remote:f,url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:w={}}){const b=u||await so({fs:e,gitdir:c});if(typeof b>"u")throw new nn("ref");const x=await bt.get({fs:e,gitdir:c});f=f||await x.get(`branch.${b}.pushRemote`)||await x.get("remote.pushDefault")||await x.get(`branch.${b}.remote`)||"origin";const S=h||await x.get(`remote.${f}.pushurl`)||await x.get(`remote.${f}.url`);if(typeof S>"u")throw new nn("remote OR url");const C=d||await x.get(`branch.${b}.merge`);if(typeof S>"u")throw new nn("remoteRef");v===void 0&&(v=await x.get("http.corsProxy"));const N=await de.expand({fs:e,gitdir:c,ref:b}),R=m?"0000000000000000000000000000000000000000":await de.resolve({fs:e,gitdir:c,ref:N}),T=$c.getRemoteHelperFor({url:S}),M=await T.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:v,service:"git-receive-pack",url:S,headers:w,protocolVersion:1}),A=M.auth;let k;if(!C)k=N;else try{k=await de.expandAgainstMap({ref:C,map:M.refs})}catch(H){if(H instanceof ot)k=C.startsWith("refs/")?C:`refs/heads/${C}`;else throw H}const F=M.refs.get(k)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:f,url:S,localRef:{ref:m?"(delete)":N,oid:R},remoteRef:{ref:k,oid:F}}))throw new Bi;const L=!M.capabilities.has("no-thin");let Y=new Set;if(!m){const H=[...M.refs.values()];let O=new Set;if(F!=="0000000000000000000000000000000000000000"){const V=await hh({fs:e,cache:t,gitdir:c,oids:[R,F]});for(const ae of V)H.push(ae);L&&(O=await mh({fs:e,cache:t,gitdir:c,oids:V}))}if(!H.includes(R)){const V=await gz({fs:e,cache:t,gitdir:c,start:[R],finish:H});Y=await mh({fs:e,cache:t,gitdir:c,oids:V})}if(L){try{const V=await de.resolve({fs:e,gitdir:c,ref:`refs/remotes/${f}/HEAD`,depth:2}),{oid:ae}=await de.resolveAgainstMap({ref:V.replace(`refs/remotes/${f}/`,""),fullref:V,map:M.refs}),j=[ae];for(const G of await mh({fs:e,cache:t,gitdir:c,oids:j}))O.add(G)}catch{}for(const V of O)Y.delete(V)}if(R===F&&(p=!0),!p){if(N.startsWith("refs/tags")&&F!=="0000000000000000000000000000000000000000")throw new zi("tag-exists");if(R!=="0000000000000000000000000000000000000000"&&F!=="0000000000000000000000000000000000000000"&&!await kb({fs:e,cache:t,gitdir:c,oid:R,ancestor:F,depth:-1}))throw new zi("not-fast-forward")}}const ne=Eb([...M.capabilities],["report-status","side-band-64k",`agent=${Fc.agent}`]),q=await vz({capabilities:ne,triplets:[{oldoid:F,oid:R,fullRef:k}]}),X=m?[]:await $b({fs:e,cache:t,gitdir:c,oids:[...Y]}),B=await T.connect({http:n,onProgress:r,corsProxy:v,service:"git-receive-pack",url:S,auth:A,headers:w,body:[...q,...X]}),{packfile:ee,progress:Z}=await Rb.demux(B.body);if(o){const H=Pb(Z);Ls(H,async O=>{await o(O)})}const J=await wz(ee);if(B.headers&&(J.headers=B.headers),f&&J.ok&&J.refs[k].ok&&!N.startsWith("refs/tags")){const H=`refs/remotes/${f}/${k.replace("refs/heads","")}`;m?await de.deleteRef({fs:e,gitdir:c,ref:H}):await de.writeRef({fs:e,gitdir:c,ref:H,value:R})}if(J.ok&&Object.values(J.refs).every(H=>H.ok))return J;{const H=Object.entries(J.refs).filter(([O,V])=>!V.ok).map(([O,V])=>`
94
+ - ${O}: ${V.error}`).join("");throw new Rs(H,J)}}async function bz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPrePush:s,dir:l,gitdir:c=ue.join(l,".git"),ref:u,remoteRef:d,remote:f="origin",url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:w={},cache:b={}}){try{return W("fs",e),W("http",t),W("gitdir",c),await yz({fs:new be(e),cache:b,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPrePush:s,gitdir:c,ref:u,remoteRef:d,remote:f,url:h,force:p,delete:m,corsProxy:v,headers:w})}catch(x){throw x.caller="git.push",x}}async function Fb({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=Kt.from(i).parse().object,Fb({fs:e,cache:t,gitdir:n,oid:r});if(o!=="blob")throw new Yt(r,o,"blob");return{oid:r,blob:new Uint8Array(i)}}async function Lb({fs:e,cache:t,gitdir:n,oid:r,filepath:o=void 0}){return o!==void 0&&(r=await $s({fs:e,cache:t,gitdir:n,oid:r,filepath:o})),await Fb({fs:e,cache:t,gitdir:n,oid:r})}async function xz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,filepath:o,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Lb({fs:new be(e),cache:i,gitdir:n,oid:r,filepath:o})}catch(a){throw a.caller="git.readBlob",a}}async function zb({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Wi({fs:new be(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.readCommit",i}}async function _z({fs:e,cache:t,gitdir:n,ref:r="refs/notes/commits",oid:o}){const i=await de.resolve({gitdir:n,fs:e,ref:r}),{blob:a}=await Lb({fs:e,cache:t,gitdir:n,oid:i,filepath:o});return a}async function Sz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r="refs/notes/commits",oid:o,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("ref",r),W("oid",o),await _z({fs:new be(e),cache:i,gitdir:n,ref:r,oid:o})}catch(a){throw a.caller="git.readNote",a}}async function Cz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,format:o="parsed",filepath:i=void 0,encoding:a=void 0,cache:s={}}){try{W("fs",e),W("gitdir",n),W("oid",r);const l=new be(e);i!==void 0&&(r=await $s({fs:l,cache:s,gitdir:n,oid:r,filepath:i}));const u=await dt({fs:l,cache:s,gitdir:n,oid:r,format:o==="parsed"?"content":o});if(u.oid=r,o==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=ft.from(u.object).parse();break;case"tree":u.object=tn.from(u.object).entries();break;case"blob":a?u.object=u.object.toString(a):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=Kt.from(u.object).parse();break;default:throw new Yt(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function Ez({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r,format:"content"});if(o!=="tag")throw new Yt(r,o,"tag");const a=Kt.from(i);return{oid:r,tag:a.parse(),payload:a.payload()}}async function Pz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Ez({fs:new be(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.readTag",i}}async function Rz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,filepath:o=void 0,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Gi({fs:new be(e),cache:i,gitdir:n,oid:r,filepath:o})}catch(a){throw a.caller="git.readTree",a}}async function Nz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,cache:o={}}){try{W("fs",e),W("gitdir",n),W("filepath",r),await Rt.acquire({fs:new be(e),gitdir:n,cache:o},async function(i){i.delete({filepath:r})})}catch(i){throw i.caller="git.remove",i}}async function Tz({fs:e,cache:t,onSign:n,gitdir:r,ref:o="refs/notes/commits",oid:i,author:a,committer:s,signingKey:l}){let c;try{c=await de.resolve({gitdir:r,fs:e,ref:o})}catch(p){if(!(p instanceof ot))throw p}let d=(await Gi({fs:e,gitdir:r,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;d=d.filter(p=>p.path!==i);const f=await Fs({fs:e,gitdir:r,tree:d});return await Ic({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tree:f,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
95
+ `,author:a,committer:s,signingKey:l})}async function Mz({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ref:o="refs/notes/commits",oid:i,author:a,committer:s,signingKey:l,cache:c={}}){try{W("fs",e),W("gitdir",r),W("oid",i);const u=new be(e),d=await ao({fs:u,gitdir:r,author:a});if(!d)throw new Ot("author");const f=await Vi({fs:u,gitdir:r,author:d,committer:s});if(!f)throw new Ot("committer");return await Tz({fs:u,cache:c,onSign:t,gitdir:r,ref:o,oid:i,author:d,committer:f,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function Dz({fs:e,gitdir:t,oldref:n,ref:r,checkout:o=!1}){if(r!==dr.clean(r))throw new zn(r,dr.clean(r));if(n!==dr.clean(n))throw new zn(n,dr.clean(n));const i=`refs/heads/${n}`,a=`refs/heads/${r}`;if(await de.exists({fs:e,gitdir:t,ref:a}))throw new Ln("branch",r,!1);const l=await de.resolve({fs:e,gitdir:t,ref:i,depth:1});await de.writeRef({fs:e,gitdir:t,ref:a,value:l}),await de.deleteRef({fs:e,gitdir:t,ref:i});const u=await so({fs:e,gitdir:t,fullname:!0})===i;(o||u)&&await de.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function Az({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,oldref:o,checkout:i=!1}){try{return W("fs",e),W("gitdir",n),W("ref",r),W("oldref",o),await Dz({fs:new be(e),gitdir:n,ref:r,oldref:o,checkout:i})}catch(a){throw a.caller="git.renameBranch",a}}async function Bb({gitdir:e,type:t,object:n}){return kr(Oi.wrap({type:t,object:n}))}async function kz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,ref:o,cache:i={}}){try{W("fs",e),W("gitdir",n),W("filepath",r);const a=new be(e);let s,l;try{s=await de.resolve({fs:a,gitdir:n,ref:o||"HEAD"})}catch(d){if(o)throw d}if(s)try{s=await $s({fs:a,cache:i,gitdir:n,oid:s,filepath:r})}catch{s=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0};const u=t&&await a.read(ue.join(t,r));u&&(l=await Bb({gitdir:n,type:"blob",object:u}),s===l&&(c=await a.lstat(ue.join(t,r)))),await Rt.acquire({fs:a,gitdir:n,cache:i},async function(d){d.delete({filepath:r}),s&&d.insert({filepath:r,stats:c,oid:s})})}catch(a){throw a.caller="git.reset",a}}async function Iz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,depth:o}){try{return W("fs",e),W("gitdir",n),W("ref",r),await de.resolve({fs:new be(e),gitdir:n,ref:r,depth:o})}catch(i){throw i.caller="git.resolveRef",i}}async function Oz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),path:r,value:o,append:i=!1}){try{W("fs",e),W("gitdir",n),W("path",r);const a=new be(e),s=await bt.get({fs:a,gitdir:n});i?await s.append(r,o):await s.set(r,o),await bt.save({fs:a,gitdir:n,config:s})}catch(a){throw a.caller="git.setConfig",a}}async function Hb({fs:e,gitdir:t,commit:n}){const r=ft.from(n).toObject();return await rn({fs:e,gitdir:t,type:"commit",object:r,format:"content"})}class zc{static get timezoneOffsetForRefLogEntry(){const t=new Date().getTimezoneOffset(),n=Math.abs(Math.floor(t/60)),r=Math.abs(t%60).toString().padStart(2,"0");return`${t>0?"-":"+"}${n.toString().padStart(2,"0")}${r}`}static createStashReflogEntry(t,n,r){const o=t.name.replace(/\s/g,""),i="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),s=zc.timezoneOffsetForRefLogEntry;return`${i} ${n} ${o} ${t.email} ${a} ${s} ${r}
96
+ `}static getStashReflogEntry(t,n=!1){return t.split(`
97
+ `).filter(i=>i).reverse().map((i,a)=>n?`stash@{${a}}: ${i.split(" ")[1]}`:i)}}const jz={stage:Ii,workdir:Os};let gh;async function qi(e,t){return gh===void 0&&(gh=new ts),gh.acquire(e,t)}async function $z(e,t,n,r,o=null){const i=ue.join(n,r),a=await e.lstat(i);if(!a)throw new ot(i);if(a.isDirectory())throw new De(`${i}: file expected, but found directory`);const s=o?await Z0({fs:e,gitdir:t,oid:o}):void 0;let l=s?o:void 0;return s||await qi({fs:e,gitdir:t,currentFilepath:i},async()=>{const c=a.isSymbolicLink()?await e.readlink(i).then(ub):await e.read(i);if(c===null)throw new ot(i);l=await rn({fs:e,gitdir:t,type:"blob",object:c})}),l}async function Fz({fs:e,dir:t,gitdir:n,entries:r}){async function o(i){if(i.type==="tree"){if(!i.oid){const a=await Promise.all(i.children.map(o));i.oid=await Fs({fs:e,gitdir:n,tree:a}),i.mode=16384}}else i.type==="blob"&&(i.oid=await $z(e,n,t,i.path,i.oid),i.mode=33188);return i.path=i.path.split("/").pop(),i}return Promise.all(r.map(o))}async function Ub({fs:e,dir:t,gitdir:n,treePair:r}){const o=r[1]==="stage",i=r.map(h=>typeof h=="string"?jz[h]():h),a=[],u=await io({fs:e,cache:{},dir:t,gitdir:n,trees:i,map:async(h,[p,m])=>{if(!(h==="."||await Ui.isIgnored({fs:e,dir:t,gitdir:n,filepath:h}))&&m)return(!p||await p.oid()!==await m.oid()&&await m.oid()!==void 0)&&a.push([p,m]),{mode:await m.mode(),path:h,oid:await m.oid(),type:await m.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p:void 0),iterate:async(h,p)=>{const m=[];for(const v of p){const[w,b]=v;o?b&&(await e.exists(`${t}/${b.toString()}`)?m.push(v):a.push([null,b])):w&&(b?m.push(v):a.push([w,null]))}return m.length?Promise.all(m.map(h)):[]}});if(a.length===0||u.length===0)return null;const f=(await Fz({fs:e,dir:t,gitdir:n,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return Fs({fs:e,gitdir:n,tree:f})}async function Lz({fs:e,dir:t,gitdir:n,stashCommit:r,parentCommit:o,wasStaged:i}){const a=[],s=[],l=await io({fs:e,cache:{},dir:t,gitdir:n,trees:[kn({ref:o}),kn({ref:r})],map:async(c,[u,d])=>{if(c==="."||await Ui.isIgnored({fs:e,dir:t,gitdir:n,filepath:c}))return;const f=d?await d.type():await u.type();if(f!=="tree"&&f!=="blob")return;if(!d&&u){const p=f==="tree"?"rmdir":"rm";return f==="tree"&&a.push(c),f==="blob"&&i&&s.push({filepath:c,oid:await u.oid()}),{method:p,filepath:c}}const h=await d.oid();if(!u||await u.oid()!==h)return f==="tree"?{method:"mkdir",filepath:c}:(i&&s.push({filepath:c,oid:h,stats:await e.lstat(ue.join(t,c))}),{method:"write",filepath:c,oid:h})}});await qi({fs:e,gitdir:n,dirRemoved:a,ops:l},async()=>{for(const c of l){const u=ue.join(t,c.filepath);switch(c.method){case"rmdir":await e.rmdir(u);break;case"mkdir":await e.mkdir(u);break;case"rm":await e.rm(u);break;case"write":if(!a.some(d=>u.startsWith(d))){const{object:d}=await dt({fs:e,cache:{},gitdir:n,oid:c.oid});await e.exists(u)&&await e.rm(u),await e.write(u,d)}break}}}),await Rt.acquire({fs:e,gitdir:n,cache:{}},async c=>{s.forEach(({filepath:u,stats:d,oid:f})=>{c.insert({filepath:u,stats:d,oid:f})})})}class Or{constructor({fs:t,dir:n,gitdir:r=ue.join(n,".git")}){Object.assign(this,{fs:t,dir:n,gitdir:r,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return ue.join(this.gitdir,Or.refStash)}get refLogsStashPath(){return ue.join(this.gitdir,Or.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await ao({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Ot("author");return this._author}async getStashSHA(t,n){return await this.fs.exists(this.refStashPath)?(n||await this.readStashReflogs({parsed:!1}))[t].split(" ")[1]:null}async writeStashCommit({message:t,tree:n,parent:r}){return Hb({fs:this.fs,gitdir:this.gitdir,commit:{message:t,tree:n,parent:r,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(t){const n=await this.readStashReflogs({parsed:!1});if(t!==0&&(t<0||t>n.length-1))throw new zn(`stash@${t}`,"number that is in range of [0, num of stash pushed]");const r=await this.getStashSHA(t,n);return r?Wi({fs:this.fs,cache:{},gitdir:this.gitdir,oid:r}):{}}async writeStashRef(t){return de.writeRef({fs:this.fs,gitdir:this.gitdir,ref:Or.refStash,value:t})}async writeStashReflogEntry({stashCommit:t,message:n}){const r=await this.getAuthor(),o=zc.createStashReflogEntry(r,t,n),i=this.refLogsStashPath;await qi({filepath:i,entry:o},async()=>{const a=await this.fs.exists(i)?await this.fs.read(i,"utf8"):"";await this.fs.write(i,a+o,"utf8")})}async readStashReflogs({parsed:t=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];const r=(await this.fs.read(this.refLogsStashPath)).toString();return zc.getStashReflogEntry(r,t)}}async function zz({fs:e,dir:t,gitdir:n,message:r=""}){const o=new Or({fs:e,dir:t,gitdir:n});await o.getAuthor();const i=await so({fs:e,gitdir:n,fullname:!1}),a=await de.resolve({fs:e,gitdir:n,ref:"HEAD"}),l=(await zb({fs:e,dir:t,gitdir:n,oid:a})).commit.message,c=[a];let u=null,d=kn({ref:"HEAD"});const f=await Ub({fs:e,dir:t,gitdir:n,treePair:[kn({ref:"HEAD"}),"stage"]});if(f){const v=await o.writeStashCommit({message:`stash-Index: WIP on ${i} - ${new Date().toISOString()}`,tree:f,parent:c});c.push(v),u=f,d=Ii()}const h=await Ub({fs:e,dir:t,gitdir:n,treePair:[d,"workdir"]});if(h){const v=await o.writeStashCommit({message:`stash-WorkDir: WIP on ${i} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(v),u=h}if(!u||!f&&!h)throw new ot("changes, nothing to stash");const p=(r.trim()||`WIP on ${i}`)+`: ${a.substring(0,7)} ${l}`,m=await o.writeStashCommit({message:p,tree:u,parent:c});return await o.writeStashRef(m),await o.writeStashReflogEntry({stashCommit:m,message:p}),await wb({fs:e,dir:t,gitdir:n,ref:i,track:!1,force:!0}),m}async function Vb({fs:e,dir:t,gitdir:n,refIdx:r=0}){const i=await new Or({fs:e,dir:t,gitdir:n}).readStashCommit(r),{parent:a=null}=i.commit?i.commit:{};if(!(!a||!Array.isArray(a)))for(let s=0;s<a.length-1;s++){const c=(await Wi({fs:e,cache:{},gitdir:n,oid:a[s+1]})).commit.message.startsWith("stash-Index");await Lz({fs:e,dir:t,gitdir:n,stashCommit:a[s+1],parentCommit:a[s],wasStaged:c})}}async function Wb({fs:e,dir:t,gitdir:n,refIdx:r=0}){const o=new Or({fs:e,dir:t,gitdir:n});if(!(await o.readStashCommit(r)).commit)return;const a=o.refStashPath;await qi(a,async()=>{await e.exists(a)&&await e.rm(a)});const s=await o.readStashReflogs({parsed:!1});if(!s.length)return;s.splice(r,1);const l=o.refLogsStashPath;await qi({reflogEntries:s,stashReflogPath:l,stashMgr:o},async()=>{if(s.length){await e.write(l,s.join(`
98
+ `),"utf8");const c=s[s.length-1].split(" ")[1];await o.writeStashRef(c)}else await e.rm(l)})}async function Bz({fs:e,dir:t,gitdir:n}){return new Or({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function Hz({fs:e,dir:t,gitdir:n}){const r=new Or({fs:e,dir:t,gitdir:n}),o=[r.refStashPath,r.refLogsStashPath];await qi(o,async()=>{await Promise.all(o.map(async i=>{if(await e.exists(i))return e.rm(i)}))})}async function Uz({fs:e,dir:t,gitdir:n,refIdx:r=0}){await Vb({fs:e,dir:t,gitdir:n,refIdx:r}),await Wb({fs:e,dir:t,gitdir:n,refIdx:r})}async function Vz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),op:r="push",message:o="",refIdx:i=0}){W("fs",e),W("dir",t),W("gitdir",n),W("op",r);const a={push:zz,apply:Vb,drop:Wb,list:Bz,clear:Hz,pop:Uz},s=["apply","drop","pop"];try{const l=new be(e);["refs","logs","logs/refs"].map(d=>ue.join(n,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});const u=a[r];if(u){if(s.includes(r)&&i<0)throw new zn(`stash@${i}`,"number that is in range of [0, num of stash pushed]");return await u({fs:l,dir:t,gitdir:n,message:o,refIdx:i})}throw new Error(`To be implemented: ${r}`)}catch(l){throw l.caller="git.stash",l}}async function Wz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,cache:o={}}){try{W("fs",e),W("gitdir",n),W("filepath",r);const i=new be(e);if(await Ui.isIgnored({fs:i,gitdir:n,dir:t,filepath:r}))return"ignored";const s=await Gz({fs:i,cache:o,gitdir:n}),l=await Gb({fs:i,cache:o,gitdir:n,tree:s,path:r}),c=await Rt.acquire({fs:i,gitdir:n,cache:o},async function(m){for(const v of m)if(v.path===r)return v;return null}),u=await i.lstat(ue.join(t,r)),d=l!==null,f=c!==null,h=u!==null,p=async()=>{if(f&&!Ec(c,u))return c.oid;{const m=await i.read(ue.join(t,r)),v=await Bb({gitdir:n,type:"blob",object:m});return f&&c.oid===v&&u.size!==-1&&Rt.acquire({fs:i,gitdir:n,cache:o},async function(w){w.insert({filepath:r,stats:u,oid:v})}),v}};if(!d&&!h&&!f)return"absent";if(!d&&!h&&f)return"*absent";if(!d&&h&&!f)return"*added";if(!d&&h&&f)return await p()===c.oid?"added":"*added";if(d&&!h&&!f)return"deleted";if(d&&!h&&f)return l===c.oid,"*deleted";if(d&&h&&!f)return await p()===l?"*undeleted":"*undeletemodified";if(d&&h&&f){const m=await p();return m===l?m===c.oid?"unmodified":"*unmodified":m===c.oid?"modified":"*modified"}}catch(i){throw i.caller="git.status",i}}async function Gb({fs:e,cache:t,gitdir:n,tree:r,path:o}){typeof o=="string"&&(o=o.split("/"));const i=o.shift();for(const a of r)if(a.path===i){if(o.length===0)return a.oid;const{type:s,object:l}=await dt({fs:e,cache:t,gitdir:n,oid:a.oid});if(s==="tree"){const c=tn.from(l);return Gb({fs:e,cache:t,gitdir:n,tree:c,path:o})}if(s==="blob")throw new Yt(a.oid,s,"blob",o.join("/"))}return null}async function Gz({fs:e,cache:t,gitdir:n}){let r;try{r=await de.resolve({fs:e,gitdir:n,ref:"HEAD"})}catch(i){if(i instanceof ot)return[]}const{tree:o}=await Gi({fs:e,cache:t,gitdir:n,oid:r});return o}async function qz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r="HEAD",filepaths:o=["."],filter:i,cache:a={},ignored:s=!1}){try{W("fs",e),W("gitdir",n),W("ref",r);const l=new be(e);return await io({fs:l,cache:a,dir:t,gitdir:n,trees:[kn({ref:r}),Os(),Ii()],map:async function(c,[u,d,f]){if(!u&&!f&&d&&!s&&await Ui.isIgnored({fs:l,dir:t,filepath:c})||!o.some(N=>gb(c,N)))return null;if(i&&!i(c))return;const[h,p,m]=await Promise.all([u&&u.type(),d&&d.type(),f&&f.type()]),v=[h,p,m].includes("blob");if((h==="tree"||h==="special")&&!v)return;if(h==="commit")return null;if((p==="tree"||p==="special")&&!v)return;if(m==="commit")return null;if((m==="tree"||m==="special")&&!v)return;const w=h==="blob"?await u.oid():void 0,b=m==="blob"?await f.oid():void 0;let x;h!=="blob"&&p==="blob"&&m!=="blob"?x="42":p==="blob"&&(x=await d.oid());const S=[void 0,w,x,b],C=S.map(N=>S.indexOf(N));return C.shift(),[c,...C]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function Yz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,object:o,force:i=!1}){try{W("fs",e),W("gitdir",n),W("ref",r);const a=new be(e);if(r===void 0)throw new nn("ref");r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`;const s=await de.resolve({fs:a,gitdir:n,ref:o||"HEAD"});if(!i&&await de.exists({fs:a,gitdir:n,ref:r}))throw new Ln("tag",r);await de.writeRef({fs:a,gitdir:n,ref:r,value:s})}catch(a){throw a.caller="git.tag",a}}async function Kz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),cache:r={},filepath:o,oid:i,mode:a,add:s,remove:l,force:c}){try{W("fs",e),W("gitdir",n),W("filepath",o);const u=new be(e);if(l)return await Rt.acquire({fs:u,gitdir:n,cache:r},async function(f){let h;if(!c&&(h=await u.lstat(ue.join(t,o)),h)){if(h.isDirectory())throw new ro("directory");return}f.has({filepath:o})&&f.delete({filepath:o})});let d;if(!i){if(d=await u.lstat(ue.join(t,o)),!d)throw new ot(`file at "${o}" on disk and "remove" not set`);if(d.isDirectory())throw new ro("directory")}return await Rt.acquire({fs:u,gitdir:n,cache:r},async function(f){if(!s&&!f.has({filepath:o}))throw new ot(`file at "${o}" in index and "add" not set`);let h={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:a,uid:0,gid:0,size:0};if(!i){h=d;const p=h.isSymbolicLink()?await u.readlink(ue.join(t,o)):await u.read(ue.join(t,o));i=await rn({fs:u,gitdir:n,type:"blob",format:"content",object:p})}return f.insert({filepath:o,oid:i,stats:h}),i})}catch(u){throw u.caller="git.updateIndex",u}}function Xz(){try{return Fc.version}catch(e){throw e.caller="git.version",e}}async function Zz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),trees:r,map:o,reduce:i,iterate:a,cache:s={}}){try{return W("fs",e),W("gitdir",n),W("trees",r),await io({fs:new be(e),cache:s,dir:t,gitdir:n,trees:r,map:o,reduce:i,iterate:a})}catch(l){throw l.caller="git.walk",l}}async function Jz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),blob:r}){try{return W("fs",e),W("gitdir",n),W("blob",r),await rn({fs:new be(e),gitdir:n,type:"blob",object:r,format:"content"})}catch(o){throw o.caller="git.writeBlob",o}}async function Qz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),commit:r}){try{return W("fs",e),W("gitdir",n),W("commit",r),await Hb({fs:new be(e),gitdir:n,commit:r})}catch(o){throw o.caller="git.writeCommit",o}}async function eB({fs:e,dir:t,gitdir:n=ue.join(t,".git"),type:r,object:o,format:i="parsed",oid:a,encoding:s=void 0}){try{const l=new be(e);if(i==="parsed"){switch(r){case"commit":o=ft.from(o).toObject();break;case"tree":o=tn.from(o).toObject();break;case"blob":o=Buffer.from(o,s);break;case"tag":o=Kt.from(o).toObject();break;default:throw new Yt(a||"",r,"blob|commit|tag|tree")}i="content"}return a=await rn({fs:l,gitdir:n,type:r,object:o,oid:a,format:i}),a}catch(l){throw l.caller="git.writeObject",l}}async function tB({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,value:o,force:i=!1,symbolic:a=!1}){try{W("fs",e),W("gitdir",n),W("ref",r),W("value",o);const s=new be(e);if(r!==dr.clean(r))throw new zn(r,dr.clean(r));if(!i&&await de.exists({fs:s,gitdir:n,ref:r}))throw new Ln("ref",r);a?await de.writeSymbolicRef({fs:s,gitdir:n,ref:r,value:o}):(o=await de.resolve({fs:s,gitdir:n,ref:o}),await de.writeRef({fs:s,gitdir:n,ref:r,value:o}))}catch(s){throw s.caller="git.writeRef",s}}async function nB({fs:e,gitdir:t,tag:n}){const r=Kt.from(n).toObject();return await rn({fs:e,gitdir:t,type:"tag",object:r,format:"content"})}async function rB({fs:e,dir:t,gitdir:n=ue.join(t,".git"),tag:r}){try{return W("fs",e),W("gitdir",n),W("tag",r),await nB({fs:new be(e),gitdir:n,tag:r})}catch(o){throw o.caller="git.writeTag",o}}async function oB({fs:e,dir:t,gitdir:n=ue.join(t,".git"),tree:r}){try{return W("fs",e),W("gitdir",n),W("tree",r),await Fs({fs:new be(e),gitdir:n,tree:r})}catch(o){throw o.caller="git.writeTree",o}}var jt={Errors:AF,STAGE:Ii,TREE:kn,WORKDIR:Os,add:XF,abortMerge:GF,addNote:JF,addRemote:QF,annotatedTag:tL,branch:rL,checkout:wb,clone:mL,commit:gL,getConfig:$L,getConfigAll:LL,setConfig:Oz,currentBranch:wL,deleteBranch:yL,deleteRef:bL,deleteRemote:_L,deleteTag:CL,expandOid:NL,expandRef:TL,fastForward:kL,fetch:IL,findMergeBase:OL,findRoot:jL,getRemoteInfo:zL,getRemoteInfo2:BL,hashBlob:UL,indexPack:WL,init:GL,isDescendent:qL,isIgnored:YL,listBranches:KL,listFiles:ZL,listNotes:QL,listRefs:ez,listRemotes:nz,listServerRefs:iz,listTags:az,log:uz,merge:dz,packObjects:pz,pull:mz,push:bz,readBlob:xz,readCommit:zb,readNote:Sz,readObject:Cz,readTag:Pz,readTree:Rz,remove:Nz,removeNote:Mz,renameBranch:Az,resetIndex:kz,updateIndex:Kz,resolveRef:Iz,status:Wz,statusMatrix:qz,tag:Yz,version:Xz,walk:Zz,writeBlob:Jz,writeCommit:Qz,writeObject:eB,writeRef:tB,writeTag:rB,writeTree:oB,stash:Vz},wh={exports:{}};function qb(e){return Array.isArray(e)?e:[e]}const iB=void 0,vh="",Yb=" ",yh="\\",aB=/^\s+$/,sB=/(?:[^\\]|^)\\$/,lB=/^\\!/,cB=/^\\#/,uB=/\r?\n/g,dB=/^\.*\/|^\.+$/,fB=/\/$/,Yi="/";let Kb="node-ignore";typeof Symbol<"u"&&(Kb=Symbol.for("node-ignore"));const Xb=Kb,Bs=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),hB=/([0-z])-([0-z])/g,Zb=()=>!1,pB=e=>e.replace(hB,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:vh),mB=e=>{const{length:t}=e;return e.slice(0,t-t%2)},gB=[[/^\uFEFF/,()=>vh],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?Yb:vh)],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+Yb}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>{const r=n.replace(/\\\*/g,"[^\\/]*");return t+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>yh],[/\\\\/g,()=>yh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,o)=>t===yh?`\\[${n}${mB(r)}${o}`:o==="]"&&r.length%2===0?`[${pB(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],wB=/(^|\\\/)?\\\*$/,Hs="regex",Bc="checkRegex",Jb="_",vB={[Hs](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Bc](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},yB=e=>gB.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),Hc=e=>typeof e=="string",bB=e=>e&&Hc(e)&&!aB.test(e)&&!sB.test(e)&&e.indexOf("#")!==0,xB=e=>e.split(uB).filter(Boolean);class _B{constructor(t,n,r,o,i,a){this.pattern=t,this.mark=n,this.negative=i,Bs(this,"body",r),Bs(this,"ignoreCase",o),Bs(this,"regexPrefix",a)}get regex(){const t=Jb+Hs;return this[t]?this[t]:this._make(Hs,t)}get checkRegex(){const t=Jb+Bc;return this[t]?this[t]:this._make(Bc,t)}_make(t,n){const r=this.regexPrefix.replace(wB,vB[t]),o=this.ignoreCase?new RegExp(r,"i"):new RegExp(r);return Bs(this,n,o)}}const SB=({pattern:e,mark:t},n)=>{let r=!1,o=e;o.indexOf("!")===0&&(r=!0,o=o.substr(1)),o=o.replace(lB,"!").replace(cB,"#");const i=yB(o);return new _B(e,t,o,n,r,i)};class CB{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[Xb]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Hc(t)&&(t={pattern:t}),bB(t.pattern)){const n=SB(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,qb(Hc(t)?xB(t):t).forEach(this._add,this),this._added}test(t,n,r){let o=!1,i=!1,a;this._rules.forEach(l=>{const{negative:c}=l;i===c&&o!==i||c&&!o&&!i&&!n||!l[r].test(t)||(o=!c,i=c,a=c?iB:l)});const s={ignored:o,unignored:i};return a&&(s.rule=a),s}}const EB=(e,t)=>{throw new t(e)},jr=(e,t,n)=>Hc(e)?e?jr.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),Qb=e=>dB.test(e);jr.isNotRelative=Qb,jr.convert=e=>e;class PB{constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){Bs(this,Xb,!0),this._rules=new CB(n),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,n,r,o){const i=t&&jr.convert(t);return jr(i,t,this._strictPathCheck?EB:Zb),this._t(i,n,r,o)}checkIgnore(t){if(!fB.test(t))return this.test(t);const n=t.split(Yi).filter(Boolean);if(n.pop(),n.length){const r=this._t(n.join(Yi)+Yi,this._testCache,!0,n);if(r.ignored)return r}return this._rules.test(t,!1,Bc)}_t(t,n,r,o){if(t in n)return n[t];if(o||(o=t.split(Yi).filter(Boolean)),o.pop(),!o.length)return n[t]=this._rules.test(t,r,Hs);const i=this._t(o.join(Yi)+Yi,n,r,o);return n[t]=i.ignored?i:this._rules.test(t,r,Hs)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return qb(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const bh=e=>new PB(e),RB=e=>jr(e&&jr.convert(e),e,Zb);if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");jr.convert=e;const t=/^[a-z]:\//i;jr.isNotRelative=n=>t.test(n)||Qb(n)}wh.exports=bh,bh.default=bh,wh.exports.isPathValid=RB;var NB=wh.exports;const TB=Nn(NB),MB=async e=>{try{return await(await window.pfs.stat(e)).isDirectory()}catch(t){if(t.code==="ENOENT")return!1;throw t}},ex=async e=>await window.pfs.readdir(e),tx=async e=>{let t=window.pfs,n;try{n=await t.stat(e)}catch(r){console.debug("recursiveRm: Path does not exist",r);return}if(n.type==="file")await t.unlink(e),console.debug(`recursiveRm: Deleted file: ${e}`);else if(n.type==="dir"){const r=await t.readdir(e);for(const o of r)await tx(`${e}/${o}`);await t.rmdir(e),console.debug(`recursiveRm: Deleted directory: ${e}`)}};var nx={exports:{}},Us={};/*
100
99
  object-assign
101
100
  (c) Sindre Sorhus
102
101
  @license MIT
103
- */var $f=Object.getOwnPropertySymbols,Pb=Object.prototype.hasOwnProperty,Ab=Object.prototype.propertyIsEnumerable;function $b(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Db(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Db();/** @license React v17.0.2
102
+ */var rx=Object.getOwnPropertySymbols,DB=Object.prototype.hasOwnProperty,AB=Object.prototype.propertyIsEnumerable;function kB(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function IB(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}IB();/** @license React v17.0.2
104
103
  * react-jsx-runtime.production.min.js
105
104
  *
106
105
  * Copyright (c) Facebook, Inc. and its affiliates.
107
106
  *
108
107
  * This source code is licensed under the MIT license found in the
109
108
  * LICENSE file in the root directory of this source tree.
110
- */var Ib=K,Df=60103;if(wi.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var If=Symbol.for;Df=If("react.element"),wi.Fragment=If("react.fragment")}var jb=Ib.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bb=Object.prototype.hasOwnProperty,zb={key:!0,ref:!0,__self:!0,__source:!0};function jf(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Bb.call(t,n)&&!zb.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Df,type:e,key:a,ref:o,props:i,_owner:jb.current}}wi.jsx=jf,wi.jsxs=jf,Af.exports=wi;var ve=Af.exports,Bf={exports:{}},ke={};/** @license React v16.13.1
109
+ */var OB=E,ox=60103;if(Us.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var ix=Symbol.for;ox=ix("react.element"),Us.Fragment=ix("react.fragment")}var jB=OB.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$B=Object.prototype.hasOwnProperty,FB={key:!0,ref:!0,__self:!0,__source:!0};function ax(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)$B.call(t,r)&&!FB.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:ox,type:e,key:i,ref:a,props:o,_owner:jB.current}}Us.jsx=ax,Us.jsxs=ax,nx.exports=Us;var g=nx.exports;const LB=async e=>{let t=null,n=null;try{const r=e.replace(/import.*?;\n/g,""),o=Fv.transform(r,{presets:["react","typescript"],filename:"file.tsx"}).code,i=new Blob([o],{type:"text/javascript"});t=(await import(URL.createObjectURL(i))).component}catch(r){t=null,n=r.stack}return{compileError:n,compiledComponent:t}},zB=async e=>{let t=[];const n=await e.getComponentLibrary();if(n.status!==200)throw new Error("Could not load library components");let r=(await n.json()).components;for(const o in r)if(o==="example")for(const i of r[o]){let a=i.content["component.tsx"];a=a.replace(/import.*?;\n/g,"");let s=i.content["layout.json"];const l=Fv.transform(a,{presets:["react","typescript"],filename:"file.tsx"}).code,c=new Blob([l],{type:"text/javascript"}),f=(await import(URL.createObjectURL(c))).component;t.push({class:i.name,layout:JSON.parse(s),component:g.jsx(f,{})})}return t},sx=async e=>{let t=[],n=[];const r=`${window.miDir}/${e}`,o="src/ProjectComponents";let i=await ex(`${r}/${o}`);i=i.filter(a=>!(a.includes(".gitkeep")||a.includes("index.ts")));for(const a of i){let s=`${a.replace(o,"")}`,l=`${s}/component.tsx`,c=await window.pfs.readFile(`${r}/${o}/${l}`,"utf8");const{compileError:u,compiledComponent:d}=await LB(c);let f=`${s}/layout.json`;const h=await window.pfs.readFile(`${r}/${o}/${f}`,"utf8");let p={id:a,component:null};if(u){p={...p,overrides:{compileError:{message:u}}},t.push(p),n.push({...JSON.parse(h),i:a});continue}if(s.includes("Chart")){let m=`${s}/chart_config.json`;const v=await window.pfs.readFile(`${r}/${o}/${m}`,"utf8"),w=JSON.parse(v),b=d;p.component=g.jsx(b,{chartConfig:w})}else{const m=d;p.component=g.jsx(m,{})}t.push(p),n.push({...JSON.parse(h),i:a})}return{components:t,layout:n}},BB=async(e,t)=>{var u;const n={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp"},o=(await window.pfs.readdir(window.miDir)).find(d=>d.toLowerCase()===e.toLowerCase());if(!o)throw new Error(`Project "${e}" not found`);const i=`${window.miDir}/${o}/src/assets/images/${t}`,a=await window.pfs.readFile(i),s=Buffer.from(a).toString("base64"),l=((u=t.split(".").pop())==null?void 0:u.toLowerCase())||"";return`data:${n[l]??"image/jpeg"};base64,${s}`},HB=e=>{if(window.tailwind)window.tailwind.config=e;else throw new Error("Could not load tailwind theme: missing tailwind global.")},UB=(e,t)=>{const[n,r]=E.useState("");return E.useEffect(()=>{(async()=>{try{const i=await BB(e,t);r(i)}catch(i){console.error("Error fetching background image URL:",i)}})()},[e,t]),n},VB=(e,t=[])=>{const[n,r]=E.useState(null);return E.useEffect(()=>{(async()=>{r(null);try{const i=`${window.miDir}/${e}/metadata.json`;await window.pfs.readFile(i,"utf8").then(a=>{if(a instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");r(JSON.parse(a))})}catch(i){throw console.log("Error: can not read app metadata file."),i}})()},[e,...t]),n},WB=(e,t=[])=>{const[n,r]=E.useState(null);return E.useEffect(()=>{(async()=>{r(null);try{const i=`${window.miDir}/${e}/settings.json`;await window.pfs.readFile(i,"utf8").then(a=>{if(a instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");r(JSON.parse(a))})}catch(i){throw console.log("Error: can not read app settings file."),i}})()},[e,...t]),n},GB=(e,t,n=[])=>{const[r,o]=E.useState(null);return E.useEffect(()=>{(async()=>{o(null);const a=await _h(e,t);if(a){const s=a.filter(c=>c.tag==="published"),l=a.filter(c=>c.tag!=="published");o({publishedVersion:s.length?s[0]:null,versions:l})}})()},[e,t,...n]),r},qB=e=>typeof e=="string"?e:new TextDecoder("utf-8").decode(e),YB=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`,r="makeinfinite_client",o="makeinfinite_client@spaceandtime.io";await jt.setConfig({fs:t,dir:n,path:"user.name",value:r}),await jt.setConfig({fs:t,dir:n,path:"user.email",value:o})},lx=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await jt.clone({fs:n,http:hf,dir:r,url:t,ref:"main"}),await YB(e)},KB=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await jt.pull({fs:n,http:hf,dir:r,url:t,ref:"main"})},XB=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`,r=await jt.resolveRef({fs:t,dir:n,ref:"refs/tags/published"});await jt.checkout({fs:t,dir:n,ref:r})},ZB=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await jt.fetch({fs:n,http:hf,dir:r,url:t,ref:"main",tags:!0,pruneTags:!0})};class JB{constructor(t,n,r){this.targetRef=t,this.sourceRef=n,this.opType=r}}const xh=e=>{var a,s;const t=e.commit.message.trim().split(`
110
+ `),n=t.find(l=>l.startsWith("Git Ref: ")),r=t.find(l=>l.startsWith("Extra Metadata: "));if(!n||!r)return null;const o=(a=n.split("Git Ref: ")[1])==null?void 0:a.trim(),i=JSON.parse(((s=r.split("Extra Metadata: ")[1])==null?void 0:s.trim())||"{}");return!o||!i?null:new JB(o,i.sourceRef,i.opType)},QB=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`;return await jt.resolveRef({fs:t,dir:n,ref:"HEAD"})},cx=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`,o={fs:n,dir:r,ref:"HEAD",depth:1,filepath:t},i=(await jt.log(o))[0];if(!i)throw new Error("No commit found");return i.oid},Uc=async(e,t,n,r,o=new Set,i=1e3)=>{if(i<=0)throw new Error(`Maximum recursion depth reached while resolving commit: ${n}`);const a=window.pfs,s=`${window.miDir}/${e}`,l={fs:a,dir:s,ref:n,depth:1,filepath:t},c=(await jt.log(l))[0];if(!c)throw new Error("No commit found");if(o.has(c.oid))throw new Error(`Circular reference detected: ${c.oid} has already been seen`);o.add(c.oid);const u=xh(c);if(u&&u.opType==r)return Uc(e,t,u.targetRef,r,o,i-1);if(c.commit.parent.length>1){const d=c.commit.parent[0];if(!d)throw new Error("No parent found");return Uc(e,t,d,r,o,i-1)}return c},e4=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`,o=await cx(e,t),i=await Uc(e,t,o,"UNDO"),a=xh(i);if(a)return[o,a.sourceRef];{let s=i.oid;const l={fs:n,dir:r,ref:s,depth:2,filepath:t},c=await jt.log(l);if(!c[1])throw new Error("No previous commit found");const u=c[1].oid;return[o,u]}},t4=async(e,t)=>{const n=await cx(e,t),r=await Uc(e,t,n,"REDO"),o=xh(r);if(!o)throw new Error("No undos to redo");return[n,o.sourceRef]},n4=async(e,t)=>{await MB(`${window.miDir}/${e}`)||await lx(e,t);try{await KB(e,t)}catch(r){throw await tx(`${window.miDir}/${e}`).catch(o=>console.log(`recursiveRm error: ${o}`)),r}},ux=async(e,t)=>{let n=0;const r=5;for(;n<=r;)try{await n4(e||"",t||"");break}catch(o){if(n++,console.log(`Retrying syncGitSource (Attempt ${n})`),n>r)throw console.error(`syncGitSource failed after ${n} attempts:`,o),o}},_h=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await ZB(e,t);const o=await jt.listTags({fs:n,dir:r});return await Promise.all(o.map(async a=>{const s=await jt.resolveRef({fs:n,dir:r,ref:`refs/tags/${a}`});let l=null;try{l=(await jt.readTag({fs:n,dir:r,oid:s})).tag.object}catch{l=s}const{commit:c}=await jt.readCommit({fs:n,dir:r,oid:s});return{tag:a,targetCommitTimestamp:c.committer.timestamp,targetCommit:l,ref:`refs/tags/${a}`}}))},r4=async(e,t)=>{try{return await jt.listFiles({fs:e,dir:t})}catch(n){return console.error("Error listing files using git:",n),[]}},o4=async(e,t,n)=>{let r=TB();const o=await t.readFile(`${n}/.sxtignore`,"utf8"),a=qB(o).split(`
111
+ `).map(l=>l.trim()).filter(l=>l.length>0);return r.add(a),r.filter(e)},i4=async(e,t)=>{const{miDir:n,fs:r}=window,o=`${n}/${e}`;return await lx(e,t),await r4(r,o)};var dx={exports:{}},Qe={};/** @license React v16.13.1
111
112
  * react-is.production.min.js
112
113
  *
113
114
  * Copyright (c) Facebook, Inc. and its affiliates.
114
115
  *
115
116
  * This source code is licensed under the MIT license found in the
116
117
  * LICENSE file in the root directory of this source tree.
117
- */var qe=typeof Symbol=="function"&&Symbol.for,cs=qe?Symbol.for("react.element"):60103,ls=qe?Symbol.for("react.portal"):60106,da=qe?Symbol.for("react.fragment"):60107,ha=qe?Symbol.for("react.strict_mode"):60108,pa=qe?Symbol.for("react.profiler"):60114,ma=qe?Symbol.for("react.provider"):60109,wa=qe?Symbol.for("react.context"):60110,us=qe?Symbol.for("react.async_mode"):60111,ga=qe?Symbol.for("react.concurrent_mode"):60111,ya=qe?Symbol.for("react.forward_ref"):60112,ba=qe?Symbol.for("react.suspense"):60113,Nb=qe?Symbol.for("react.suspense_list"):60120,_a=qe?Symbol.for("react.memo"):60115,va=qe?Symbol.for("react.lazy"):60116,Mb=qe?Symbol.for("react.block"):60121,Lb=qe?Symbol.for("react.fundamental"):60117,Fb=qe?Symbol.for("react.responder"):60118,Ub=qe?Symbol.for("react.scope"):60119;function mt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case cs:switch(e=e.type,e){case us:case ga:case da:case pa:case ha:case ba:return e;default:switch(e=e&&e.$$typeof,e){case wa:case ya:case va:case _a:case ma:return e;default:return t}}case ls:return t}}}function zf(e){return mt(e)===ga}ke.AsyncMode=us,ke.ConcurrentMode=ga,ke.ContextConsumer=wa,ke.ContextProvider=ma,ke.Element=cs,ke.ForwardRef=ya,ke.Fragment=da,ke.Lazy=va,ke.Memo=_a,ke.Portal=ls,ke.Profiler=pa,ke.StrictMode=ha,ke.Suspense=ba,ke.isAsyncMode=function(e){return zf(e)||mt(e)===us},ke.isConcurrentMode=zf,ke.isContextConsumer=function(e){return mt(e)===wa},ke.isContextProvider=function(e){return mt(e)===ma},ke.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===cs},ke.isForwardRef=function(e){return mt(e)===ya},ke.isFragment=function(e){return mt(e)===da},ke.isLazy=function(e){return mt(e)===va},ke.isMemo=function(e){return mt(e)===_a},ke.isPortal=function(e){return mt(e)===ls},ke.isProfiler=function(e){return mt(e)===pa},ke.isStrictMode=function(e){return mt(e)===ha},ke.isSuspense=function(e){return mt(e)===ba},ke.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===da||e===ga||e===pa||e===ha||e===ba||e===Nb||typeof e=="object"&&e!==null&&(e.$$typeof===va||e.$$typeof===_a||e.$$typeof===ma||e.$$typeof===wa||e.$$typeof===ya||e.$$typeof===Lb||e.$$typeof===Fb||e.$$typeof===Ub||e.$$typeof===Mb)},ke.typeOf=mt,Bf.exports=ke;var fs=Bf.exports;function Hb(e){function t(L,W,G,te,I){for(var ee=0,D=0,q=0,Z=0,X,F,V=0,re=0,Q,le=Q=X=0,ne=0,ie=0,Re=0,Ee=0,Et=G.length,We=Et-1,Ae,se="",Se="",Oi="",w="",f;ne<Et;){if(F=G.charCodeAt(ne),ne===We&&D+Z+q+ee!==0&&(D!==0&&(F=D===47?10:47),Z=q=ee=0,Et++,We++),D+Z+q+ee===0){if(ne===We&&(0<ie&&(se=se.replace(p,"")),0<se.trim().length)){switch(F){case 32:case 9:case 59:case 13:case 10:break;default:se+=G.charAt(ne)}F=59}switch(F){case 123:for(se=se.trim(),X=se.charCodeAt(0),Q=1,Ee=++ne;ne<Et;){switch(F=G.charCodeAt(ne)){case 123:Q++;break;case 125:Q--;break;case 47:switch(F=G.charCodeAt(ne+1)){case 42:case 47:e:{for(le=ne+1;le<We;++le)switch(G.charCodeAt(le)){case 47:if(F===42&&G.charCodeAt(le-1)===42&&ne+2!==le){ne=le+1;break e}break;case 10:if(F===47){ne=le+1;break e}}ne=le}}break;case 91:F++;case 40:F++;case 34:case 39:for(;ne++<We&&G.charCodeAt(ne)!==F;);}if(Q===0)break;ne++}switch(Q=G.substring(Ee,ne),X===0&&(X=(se=se.replace(d,"").trim()).charCodeAt(0)),X){case 64:switch(0<ie&&(se=se.replace(p,"")),F=se.charCodeAt(1),F){case 100:case 109:case 115:case 45:ie=W;break;default:ie=Te}if(Q=t(W,ie,Q,F,I+1),Ee=Q.length,0<ge&&(ie=r(Te,se,Re),f=s(3,Q,ie,W,H,M,Ee,F,I,te),se=ie.join(""),f!==void 0&&(Ee=(Q=f.trim()).length)===0&&(F=0,Q="")),0<Ee)switch(F){case 115:se=se.replace(C,o);case 100:case 109:case 45:Q=se+"{"+Q+"}";break;case 107:se=se.replace(v,"$1 $2"),Q=se+"{"+Q+"}",Q=ue===1||ue===2&&a("@"+Q,3)?"@-webkit-"+Q+"@"+Q:"@"+Q;break;default:Q=se+Q,te===112&&(Q=(Se+=Q,""))}else Q="";break;default:Q=t(W,r(W,se,Re),Q,te,I+1)}Oi+=Q,Q=Re=ie=le=X=0,se="",F=G.charCodeAt(++ne);break;case 125:case 59:if(se=(0<ie?se.replace(p,""):se).trim(),1<(Ee=se.length))switch(le===0&&(X=se.charCodeAt(0),X===45||96<X&&123>X)&&(Ee=(se=se.replace(" ",":")).length),0<ge&&(f=s(1,se,W,L,H,M,Se.length,te,I,te))!==void 0&&(Ee=(se=f.trim()).length)===0&&(se="\0\0"),X=se.charCodeAt(0),F=se.charCodeAt(1),X){case 0:break;case 64:if(F===105||F===99){w+=se+G.charAt(ne);break}default:se.charCodeAt(Ee-1)!==58&&(Se+=i(se,X,F,se.charCodeAt(2)))}Re=ie=le=X=0,se="",F=G.charCodeAt(++ne)}}switch(F){case 13:case 10:D===47?D=0:1+X===0&&te!==107&&0<se.length&&(ie=1,se+="\0"),0<ge*Ue&&s(0,se,W,L,H,M,Se.length,te,I,te),M=1,H++;break;case 59:case 125:if(D+Z+q+ee===0){M++;break}default:switch(M++,Ae=G.charAt(ne),F){case 9:case 32:if(Z+ee+D===0)switch(V){case 44:case 58:case 9:case 32:Ae="";break;default:F!==32&&(Ae=" ")}break;case 0:Ae="\\0";break;case 12:Ae="\\f";break;case 11:Ae="\\v";break;case 38:Z+D+ee===0&&(ie=Re=1,Ae="\f"+Ae);break;case 108:if(Z+D+ee+Y===0&&0<le)switch(ne-le){case 2:V===112&&G.charCodeAt(ne-3)===58&&(Y=V);case 8:re===111&&(Y=re)}break;case 58:Z+D+ee===0&&(le=ne);break;case 44:D+q+Z+ee===0&&(ie=1,Ae+="\r");break;case 34:case 39:D===0&&(Z=Z===F?0:Z===0?F:Z);break;case 91:Z+D+q===0&&ee++;break;case 93:Z+D+q===0&&ee--;break;case 41:Z+D+ee===0&&q--;break;case 40:if(Z+D+ee===0){if(X===0)switch(2*V+3*re){case 533:break;default:X=1}q++}break;case 64:D+q+Z+ee+le+Q===0&&(Q=1);break;case 42:case 47:if(!(0<Z+ee+q))switch(D){case 0:switch(2*F+3*G.charCodeAt(ne+1)){case 235:D=47;break;case 220:Ee=ne,D=42}break;case 42:F===47&&V===42&&Ee+2!==ne&&(G.charCodeAt(Ee+2)===33&&(Se+=G.substring(Ee,ne+1)),Ae="",D=0)}}D===0&&(se+=Ae)}re=V,V=F,ne++}if(Ee=Se.length,0<Ee){if(ie=W,0<ge&&(f=s(2,Se,ie,L,H,M,Ee,te,I,te),f!==void 0&&(Se=f).length===0))return w+Se+Oi;if(Se=ie.join(",")+"{"+Se+"}",ue*Y!==0){switch(ue!==2||a(Se,2)||(Y=0),Y){case 111:Se=Se.replace(R,":-moz-$1")+Se;break;case 112:Se=Se.replace(O,"::-webkit-input-$1")+Se.replace(O,"::-moz-$1")+Se.replace(O,":-ms-input-$1")+Se}Y=0}}return w+Se+Oi}function r(L,W,G){var te=W.trim().split(x);W=te;var I=te.length,ee=L.length;switch(ee){case 0:case 1:var D=0;for(L=ee===0?"":L[0]+" ";D<I;++D)W[D]=n(L,W[D],G).trim();break;default:var q=D=0;for(W=[];D<I;++D)for(var Z=0;Z<ee;++Z)W[q++]=n(L[Z]+" ",te[D],G).trim()}return W}function n(L,W,G){var te=W.charCodeAt(0);switch(33>te&&(te=(W=W.trim()).charCodeAt(0)),te){case 38:return W.replace(y,"$1"+L.trim());case 58:return L.trim()+W.replace(y,"$1"+L.trim());default:if(0<1*G&&0<W.indexOf("\f"))return W.replace(y,(L.charCodeAt(0)===58?"":"$1")+L.trim())}return L+W}function i(L,W,G,te){var I=L+";",ee=2*W+3*G+4*te;if(ee===944){L=I.indexOf(":",9)+1;var D=I.substring(L,I.length-1).trim();return D=I.substring(0,L).trim()+D+";",ue===1||ue===2&&a(D,1)?"-webkit-"+D+D:D}if(ue===0||ue===2&&!a(I,1))return I;switch(ee){case 1015:return I.charCodeAt(10)===97?"-webkit-"+I+I:I;case 951:return I.charCodeAt(3)===116?"-webkit-"+I+I:I;case 963:return I.charCodeAt(5)===110?"-webkit-"+I+I:I;case 1009:if(I.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+I+I;case 978:return"-webkit-"+I+"-moz-"+I+I;case 1019:case 983:return"-webkit-"+I+"-moz-"+I+"-ms-"+I+I;case 883:if(I.charCodeAt(8)===45)return"-webkit-"+I+I;if(0<I.indexOf("image-set(",11))return I.replace(B,"$1-webkit-$2")+I;break;case 932:if(I.charCodeAt(4)===45)switch(I.charCodeAt(5)){case 103:return"-webkit-box-"+I.replace("-grow","")+"-webkit-"+I+"-ms-"+I.replace("grow","positive")+I;case 115:return"-webkit-"+I+"-ms-"+I.replace("shrink","negative")+I;case 98:return"-webkit-"+I+"-ms-"+I.replace("basis","preferred-size")+I}return"-webkit-"+I+"-ms-"+I+I;case 964:return"-webkit-"+I+"-ms-flex-"+I+I;case 1023:if(I.charCodeAt(8)!==99)break;return D=I.substring(I.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+D+"-webkit-"+I+"-ms-flex-pack"+D+I;case 1005:return g.test(I)?I.replace(m,":-webkit-")+I.replace(m,":-moz-")+I:I;case 1e3:switch(D=I.substring(13).trim(),W=D.indexOf("-")+1,D.charCodeAt(0)+D.charCodeAt(W)){case 226:D=I.replace(b,"tb");break;case 232:D=I.replace(b,"tb-rl");break;case 220:D=I.replace(b,"lr");break;default:return I}return"-webkit-"+I+"-ms-"+D+I;case 1017:if(I.indexOf("sticky",9)===-1)break;case 975:switch(W=(I=L).length-10,D=(I.charCodeAt(W)===33?I.substring(0,W):I).substring(L.indexOf(":",7)+1).trim(),ee=D.charCodeAt(0)+(D.charCodeAt(7)|0)){case 203:if(111>D.charCodeAt(8))break;case 115:I=I.replace(D,"-webkit-"+D)+";"+I;break;case 207:case 102:I=I.replace(D,"-webkit-"+(102<ee?"inline-":"")+"box")+";"+I.replace(D,"-webkit-"+D)+";"+I.replace(D,"-ms-"+D+"box")+";"+I}return I+";";case 938:if(I.charCodeAt(5)===45)switch(I.charCodeAt(6)){case 105:return D=I.replace("-items",""),"-webkit-"+I+"-webkit-box-"+D+"-ms-flex-"+D+I;case 115:return"-webkit-"+I+"-ms-flex-item-"+I.replace(S,"")+I;default:return"-webkit-"+I+"-ms-flex-line-pack"+I.replace("align-content","").replace(S,"")+I}break;case 973:case 989:if(I.charCodeAt(3)!==45||I.charCodeAt(4)===122)break;case 931:case 953:if($.test(L)===!0)return(D=L.substring(L.indexOf(":")+1)).charCodeAt(0)===115?i(L.replace("stretch","fill-available"),W,G,te).replace(":fill-available",":stretch"):I.replace(D,"-webkit-"+D)+I.replace(D,"-moz-"+D.replace("fill-",""))+I;break;case 962:if(I="-webkit-"+I+(I.charCodeAt(5)===102?"-ms-"+I:"")+I,G+te===211&&I.charCodeAt(13)===105&&0<I.indexOf("transform",10))return I.substring(0,I.indexOf(";",27)+1).replace(_,"$1-webkit-$2")+I}return I}function a(L,W){var G=L.indexOf(W===1?":":"{"),te=L.substring(0,W!==3?G:10);return G=L.substring(G+1,L.length-1),Pe(W!==2?te:te.replace(P,"$1"),G,W)}function o(L,W){var G=i(W,W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2));return G!==W+";"?G.replace(k," or ($1)").substring(4):"("+W+")"}function s(L,W,G,te,I,ee,D,q,Z,X){for(var F=0,V=W,re;F<ge;++F)switch(re=me[F].call(u,L,V,G,te,I,ee,D,q,Z,X)){case void 0:case!1:case!0:case null:break;default:V=re}if(V!==W)return V}function l(L){switch(L){case void 0:case null:ge=me.length=0;break;default:if(typeof L=="function")me[ge++]=L;else if(typeof L=="object")for(var W=0,G=L.length;W<G;++W)l(L[W]);else Ue=!!L|0}return l}function c(L){return L=L.prefix,L!==void 0&&(Pe=null,L?typeof L!="function"?ue=1:(ue=2,Pe=L):ue=0),c}function u(L,W){var G=L;if(33>G.charCodeAt(0)&&(G=G.trim()),oe=G,G=[oe],0<ge){var te=s(-1,W,G,G,H,M,0,0,0,0);te!==void 0&&typeof te=="string"&&(W=te)}var I=t(Te,G,W,0,0);return 0<ge&&(te=s(-2,I,G,G,H,M,I.length,0,0,0),te!==void 0&&(I=te)),oe="",Y=0,M=H=1,I}var d=/^\0+/g,p=/[\0\r\f]/g,m=/: */g,g=/zoo|gra/,_=/([,: ])(transform)/g,x=/,\r+?/g,y=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,O=/::(place)/g,R=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,C=/\(\s*(.*)\s*\)/g,k=/([\s\S]*?);/g,S=/-self|flex-/g,P=/[^]*?(:[rp][el]a[\w-]+)[^]*/,$=/stretch|:\s*\w+\-(?:conte|avail)/,B=/([^-])(image-set\()/,M=1,H=1,Y=0,ue=1,Te=[],me=[],ge=0,Pe=null,Ue=0,oe="";return u.use=l,u.set=c,e!==void 0&&c(e),u}var Wb={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Gb(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var qb=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Nf=Gb(function(e){return qb.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),ds=fs,Yb={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Xb={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Zb={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mf={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hs={};hs[ds.ForwardRef]=Zb,hs[ds.Memo]=Mf;function Lf(e){return ds.isMemo(e)?Mf:hs[e.$$typeof]||Yb}var Vb=Object.defineProperty,Kb=Object.getOwnPropertyNames,Ff=Object.getOwnPropertySymbols,Jb=Object.getOwnPropertyDescriptor,Qb=Object.getPrototypeOf,Uf=Object.prototype;function Hf(e,t,r){if(typeof t!="string"){if(Uf){var n=Qb(t);n&&n!==Uf&&Hf(e,n,r)}var i=Kb(t);Ff&&(i=i.concat(Ff(t)));for(var a=Lf(e),o=Lf(t),s=0;s<i.length;++s){var l=i[s];if(!Xb[l]&&!(r&&r[l])&&!(o&&o[l])&&!(a&&a[l])){var c=Jb(t,l);try{Vb(e,l,c)}catch{}}}}return e}var e_=Hf;const t_=St(e_);function Qt(){return(Qt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Wf=function(e,t){for(var r=[e[0]],n=0,i=t.length;n<i;n+=1)r.push(t[n],e[n+1]);return r},ps=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!fs.typeOf(e)},xa=Object.freeze([]),wr=Object.freeze({});function gi(e){return typeof e=="function"}function Gf(e){return e.displayName||e.name||"Component"}function ms(e){return e&&typeof e.styledComponentId=="string"}var yn=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ws=typeof window<"u"&&"HTMLElement"in window,r_=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY));function yi(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var n_=function(){function e(r){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=r}var t=e.prototype;return t.indexOfGroup=function(r){for(var n=0,i=0;i<r;i++)n+=this.groupSizes[i];return n},t.insertRules=function(r,n){if(r>=this.groupSizes.length){for(var i=this.groupSizes,a=i.length,o=a;r>=o;)(o<<=1)<0&&yi(16,""+r);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=a;s<o;s++)this.groupSizes[s]=0}for(var l=this.indexOfGroup(r+1),c=0,u=n.length;c<u;c++)this.tag.insertRule(l,n[c])&&(this.groupSizes[r]++,l++)},t.clearGroup=function(r){if(r<this.length){var n=this.groupSizes[r],i=this.indexOfGroup(r),a=i+n;this.groupSizes[r]=0;for(var o=i;o<a;o++)this.tag.deleteRule(i)}},t.getGroup=function(r){var n="";if(r>=this.length||this.groupSizes[r]===0)return n;for(var i=this.groupSizes[r],a=this.indexOfGroup(r),o=a+i,s=a;s<o;s++)n+=this.tag.getRule(s)+`/*!sc*/
118
- `;return n},e}(),Ea=new Map,Sa=new Map,bi=1,ka=function(e){if(Ea.has(e))return Ea.get(e);for(;Sa.has(bi);)bi++;var t=bi++;return Ea.set(e,t),Sa.set(t,e),t},i_=function(e){return Sa.get(e)},a_=function(e,t){t>=bi&&(bi=t+1),Ea.set(e,t),Sa.set(t,e)},o_="style["+yn+'][data-styled-version="5.3.11"]',s_=new RegExp("^"+yn+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),c_=function(e,t,r){for(var n,i=r.split(","),a=0,o=i.length;a<o;a++)(n=i[a])&&e.registerName(t,n)},l_=function(e,t){for(var r=(t.textContent||"").split(`/*!sc*/
119
- `),n=[],i=0,a=r.length;i<a;i++){var o=r[i].trim();if(o){var s=o.match(s_);if(s){var l=0|parseInt(s[1],10),c=s[2];l!==0&&(a_(c,l),c_(e,c,s[3]),e.getTag().insertRules(l,n)),n.length=0}else n.push(o)}}},u_=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},qf=function(e){var t=document.head,r=e||t,n=document.createElement("style"),i=function(s){for(var l=s.childNodes,c=l.length;c>=0;c--){var u=l[c];if(u&&u.nodeType===1&&u.hasAttribute(yn))return u}}(r),a=i!==void 0?i.nextSibling:null;n.setAttribute(yn,"active"),n.setAttribute("data-styled-version","5.3.11");var o=u_();return o&&n.setAttribute("nonce",o),r.insertBefore(n,a),n},f_=function(){function e(r){var n=this.element=qf(r);n.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var a=document.styleSheets,o=0,s=a.length;o<s;o++){var l=a[o];if(l.ownerNode===i)return l}yi(17)}(n),this.length=0}var t=e.prototype;return t.insertRule=function(r,n){try{return this.sheet.insertRule(n,r),this.length++,!0}catch{return!1}},t.deleteRule=function(r){this.sheet.deleteRule(r),this.length--},t.getRule=function(r){var n=this.sheet.cssRules[r];return n!==void 0&&typeof n.cssText=="string"?n.cssText:""},e}(),d_=function(){function e(r){var n=this.element=qf(r);this.nodes=n.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(r,n){if(r<=this.length&&r>=0){var i=document.createTextNode(n),a=this.nodes[r];return this.element.insertBefore(i,a||null),this.length++,!0}return!1},t.deleteRule=function(r){this.element.removeChild(this.nodes[r]),this.length--},t.getRule=function(r){return r<this.length?this.nodes[r].textContent:""},e}(),h_=function(){function e(r){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(r,n){return r<=this.length&&(this.rules.splice(r,0,n),this.length++,!0)},t.deleteRule=function(r){this.rules.splice(r,1),this.length--},t.getRule=function(r){return r<this.length?this.rules[r]:""},e}(),Yf=ws,p_={isServer:!ws,useCSSOMInjection:!r_},Xf=function(){function e(r,n,i){r===void 0&&(r=wr),n===void 0&&(n={}),this.options=Qt({},p_,{},r),this.gs=n,this.names=new Map(i),this.server=!!r.isServer,!this.server&&ws&&Yf&&(Yf=!1,function(a){for(var o=document.querySelectorAll(o_),s=0,l=o.length;s<l;s++){var c=o[s];c&&c.getAttribute(yn)!=="active"&&(l_(a,c),c.parentNode&&c.parentNode.removeChild(c))}}(this))}e.registerId=function(r){return ka(r)};var t=e.prototype;return t.reconstructWithOptions=function(r,n){return n===void 0&&(n=!0),new e(Qt({},this.options,{},r),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(r){return this.gs[r]=(this.gs[r]||0)+1},t.getTag=function(){return this.tag||(this.tag=(i=(n=this.options).isServer,a=n.useCSSOMInjection,o=n.target,r=i?new h_(o):a?new f_(o):new d_(o),new n_(r)));var r,n,i,a,o},t.hasNameForId=function(r,n){return this.names.has(r)&&this.names.get(r).has(n)},t.registerName=function(r,n){if(ka(r),this.names.has(r))this.names.get(r).add(n);else{var i=new Set;i.add(n),this.names.set(r,i)}},t.insertRules=function(r,n,i){this.registerName(r,n),this.getTag().insertRules(ka(r),i)},t.clearNames=function(r){this.names.has(r)&&this.names.get(r).clear()},t.clearRules=function(r){this.getTag().clearGroup(ka(r)),this.clearNames(r)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(r){for(var n=r.getTag(),i=n.length,a="",o=0;o<i;o++){var s=i_(o);if(s!==void 0){var l=r.names.get(s),c=n.getGroup(o);if(l&&c&&l.size){var u=yn+".g"+o+'[id="'+s+'"]',d="";l!==void 0&&l.forEach(function(p){p.length>0&&(d+=p+",")}),a+=""+c+u+'{content:"'+d+`"}/*!sc*/
120
- `}}}return a}(this)},e}(),m_=/(a)(d)/gi,Zf=function(e){return String.fromCharCode(e+(e>25?39:97))};function gs(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Zf(t%52)+r;return(Zf(t%52)+r).replace(m_,"$1-$2")}var bn=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Vf=function(e){return bn(5381,e)};function w_(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(gi(r)&&!ms(r))return!1}return!0}var g_=Vf("5.3.11"),y_=function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=(n===void 0||n.isStatic)&&w_(t),this.componentId=r,this.baseHash=bn(g_,r),this.baseStyle=n,Xf.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var i=this.componentId,a=[];if(this.baseStyle&&a.push(this.baseStyle.generateAndInjectStyles(t,r,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(i,this.staticRulesId))a.push(this.staticRulesId);else{var o=_n(this.rules,t,r,n).join(""),s=gs(bn(this.baseHash,o)>>>0);if(!r.hasNameForId(i,s)){var l=n(o,"."+s,void 0,i);r.insertRules(i,s,l)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=bn(this.baseHash,n.hash),d="",p=0;p<c;p++){var m=this.rules[p];if(typeof m=="string")d+=m;else if(m){var g=_n(m,t,r,n),_=Array.isArray(g)?g.join(""):g;u=bn(u,_+p),d+=_}}if(d){var x=gs(u>>>0);if(!r.hasNameForId(i,x)){var y=n(d,"."+x,void 0,i);r.insertRules(i,x,y)}a.push(x)}}return a.join(" ")},e}(),b_=/^\s*\/\/.*$/gm,__=[":","[",".","#"];function v_(e){var t,r,n,i,a=wr,o=a.options,s=o===void 0?wr:o,l=a.plugins,c=l===void 0?xa:l,u=new Hb(s),d=[],p=function(_){function x(y){if(y)try{_(y+"}")}catch{}}return function(y,v,O,R,b,C,k,S,P,$){switch(y){case 1:if(P===0&&v.charCodeAt(0)===64)return _(v+";"),"";break;case 2:if(S===0)return v+"/*|*/";break;case 3:switch(S){case 102:case 112:return _(O[0]+v),"";default:return v+($===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(x)}}}(function(_){d.push(_)}),m=function(_,x,y){return x===0&&__.indexOf(y[r.length])!==-1||y.match(i)?_:"."+t};function g(_,x,y,v){v===void 0&&(v="&");var O=_.replace(b_,""),R=x&&y?y+" "+x+" { "+O+" }":O;return t=v,r=x,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),u(y||!x?"":x,R)}return u.use([].concat(c,[function(_,x,y){_===2&&y.length&&y[0].lastIndexOf(r)>0&&(y[0]=y[0].replace(n,m))},p,function(_){if(_===-2){var x=d;return d=[],x}}])),g.hash=c.length?c.reduce(function(_,x){return x.name||yi(15),bn(_,x.name)},5381).toString():"",g}var Kf=K.createContext();Kf.Consumer;var Jf=K.createContext(),x_=(Jf.Consumer,new Xf),ys=v_();function E_(){return K.useContext(Kf)||x_}function S_(){return K.useContext(Jf)||ys}var k_=function(){function e(t,r){var n=this;this.inject=function(i,a){a===void 0&&(a=ys);var o=n.name+a.hash;i.hasNameForId(n.id,o)||i.insertRules(n.id,o,a(n.rules,o,"@keyframes"))},this.toString=function(){return yi(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=r}return e.prototype.getName=function(t){return t===void 0&&(t=ys),this.name+t.hash},e}(),R_=/([A-Z])/,O_=/([A-Z])/g,C_=/^ms-/,T_=function(e){return"-"+e.toLowerCase()};function Qf(e){return R_.test(e)?e.replace(O_,T_).replace(C_,"-ms-"):e}var ed=function(e){return e==null||e===!1||e===""};function _n(e,t,r,n){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o<s;o+=1)(i=_n(e[o],t,r,n))!==""&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));return a}if(ed(e))return"";if(ms(e))return"."+e.styledComponentId;if(gi(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return _n(l,t,r,n)}var c;return e instanceof k_?r?(e.inject(r,n),e.getName(n)):e:ps(e)?function u(d,p){var m,g,_=[];for(var x in d)d.hasOwnProperty(x)&&!ed(d[x])&&(Array.isArray(d[x])&&d[x].isCss||gi(d[x])?_.push(Qf(x)+":",d[x],";"):ps(d[x])?_.push.apply(_,u(d[x],x)):_.push(Qf(x)+": "+(m=x,(g=d[x])==null||typeof g=="boolean"||g===""?"":typeof g!="number"||g===0||m in Wb||m.startsWith("--")?String(g).trim():g+"px")+";"));return p?[p+" {"].concat(_,["}"]):_}(e):e.toString()}var td=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function P_(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return gi(e)||ps(e)?td(_n(Wf(xa,[e].concat(r)))):r.length===0&&e.length===1&&typeof e[0]=="string"?e:td(_n(Wf(e,r)))}var A_=function(e,t,r){return r===void 0&&(r=wr),e.theme!==r.theme&&e.theme||t||r.theme},$_=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,D_=/(^-|-$)/g;function bs(e){return e.replace($_,"-").replace(D_,"")}var I_=function(e){return gs(Vf(e)>>>0)};function Ra(e){return typeof e=="string"&&!0}var _s=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},j_=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function B_(e,t,r){var n=e[r];_s(t)&&_s(n)?rd(n,t):e[r]=t}function rd(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){var o=a[i];if(_s(o))for(var s in o)j_(s)&&B_(e,o[s],s)}return e}var nd=K.createContext();nd.Consumer;var vs={};function id(e,t,r){var n=ms(e),i=!Ra(e),a=t.attrs,o=a===void 0?xa:a,s=t.componentId,l=s===void 0?function(v,O){var R=typeof v!="string"?"sc":bs(v);vs[R]=(vs[R]||0)+1;var b=R+"-"+I_("5.3.11"+R+vs[R]);return O?O+"-"+b:b}(t.displayName,t.parentComponentId):s,c=t.displayName,u=c===void 0?function(v){return Ra(v)?"styled."+v:"Styled("+Gf(v)+")"}(e):c,d=t.displayName&&t.componentId?bs(t.displayName)+"-"+t.componentId:t.componentId||l,p=n&&e.attrs?Array.prototype.concat(e.attrs,o).filter(Boolean):o,m=t.shouldForwardProp;n&&e.shouldForwardProp&&(m=t.shouldForwardProp?function(v,O,R){return e.shouldForwardProp(v,O,R)&&t.shouldForwardProp(v,O,R)}:e.shouldForwardProp);var g,_=new y_(r,d,n?e.componentStyle:void 0),x=_.isStatic&&o.length===0,y=function(v,O){return function(R,b,C,k){var S=R.attrs,P=R.componentStyle,$=R.defaultProps,B=R.foldedComponentIds,M=R.shouldForwardProp,H=R.styledComponentId,Y=R.target,ue=function(te,I,ee){te===void 0&&(te=wr);var D=Qt({},I,{theme:te}),q={};return ee.forEach(function(Z){var X,F,V,re=Z;for(X in gi(re)&&(re=re(D)),re)D[X]=q[X]=X==="className"?(F=q[X],V=re[X],F&&V?F+" "+V:F||V):re[X]}),[D,q]}(A_(b,K.useContext(nd),$)||wr,b,S),Te=ue[0],me=ue[1],ge=function(te,I,ee,D){var q=E_(),Z=S_(),X=I?te.generateAndInjectStyles(wr,q,Z):te.generateAndInjectStyles(ee,q,Z);return X}(P,k,Te),Pe=C,Ue=me.$as||b.$as||me.as||b.as||Y,oe=Ra(Ue),L=me!==b?Qt({},b,{},me):b,W={};for(var G in L)G[0]!=="$"&&G!=="as"&&(G==="forwardedAs"?W.as=L[G]:(M?M(G,Nf,Ue):!oe||Nf(G))&&(W[G]=L[G]));return b.style&&me.style!==b.style&&(W.style=Qt({},b.style,{},me.style)),W.className=Array.prototype.concat(B,H,ge!==H?ge:null,b.className,me.className).filter(Boolean).join(" "),W.ref=Pe,K.createElement(Ue,W)}(g,v,O,x)};return y.displayName=u,(g=K.forwardRef(y)).attrs=p,g.componentStyle=_,g.displayName=u,g.shouldForwardProp=m,g.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):xa,g.styledComponentId=d,g.target=n?e.target:e,g.withComponent=function(v){var O=t.componentId,R=function(C,k){if(C==null)return{};var S,P,$={},B=Object.keys(C);for(P=0;P<B.length;P++)S=B[P],k.indexOf(S)>=0||($[S]=C[S]);return $}(t,["componentId"]),b=O&&O+"-"+(Ra(v)?v:bs(Gf(v)));return id(v,Qt({},R,{attrs:p,componentId:b}),r)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=n?rd({},e.defaultProps,v):v}}),Object.defineProperty(g,"toString",{value:function(){return"."+g.styledComponentId}}),i&&t_(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var gr=function(e){return function t(r,n,i){if(i===void 0&&(i=wr),!fs.isValidElementType(n))return yi(1,String(n));var a=function(){return r(n,i,P_.apply(void 0,arguments))};return a.withConfig=function(o){return t(r,n,Qt({},i,{},o))},a.attrs=function(o){return t(r,n,Qt({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(id,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){gr[e]=gr(e)});const ad=K.createContext(null),od=()=>{const e=K.useContext(ad);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},z_=({children:e})=>{const[t,r]=K.useState(0),n=K.useCallback(async a=>{r(o=>o+1);try{return await a}finally{r(o=>Math.max(0,o-1))}},[]),i=K.useCallback(async(a,o)=>(r(s=>s+1),new Promise((s,l)=>{const c=a(),u=()=>{r(d=>Math.max(0,d-1))};c.addEventListener("load",()=>{if(u(),c.status>=200&&c.status<300)try{const d=o(c);s(d)}catch(d){l(d)}else l(new Error(`Request failed with status ${c.status}`))}),c.addEventListener("error",()=>{u(),l(new Error("Network error occurred"))}),c.addEventListener("abort",()=>{u(),l(new Error("Request cancelled"))})})),[]);return ve.jsx(ad.Provider,{value:{isLoading:t>0,wrapAPICall:n,wrapXHRCall:i},children:e})},xs=e=>{const t=e;return{createProject:async(k,S)=>{const P={description:k,component_namespace:S};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async k=>await fetch(`${t}/subdomains?project_name=${k}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(k,S)=>{const P={project_name:k,subdomain:S};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},updateSubdomain:async(k,S)=>{const P={project_name:k,subdomain:S};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},releaseSubdomain:async(k,S)=>{const P={project_name:k,subdomain:S};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},publishProject:async(k,S)=>{const P={project_name:k,git_ref:S};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},unpublishProject:async k=>{const S={project_name:k};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)})},tagCommit:async(k,S,P)=>{const $={project_name:k,commit_hash:S,tag_name:P};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(k,S,P,$)=>{const B={project_name:k,component_namespace:S,component_name:P,layout_metadata:$};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},addProjectChart:async(k,S,P)=>{const $={project_name:k,visual_id:S,layout_metadata:P};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateProjectComponentLayoutMetadata:async(k,S,P)=>{const $={project_name:k,component_id:S,layout_metadata:P};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateProjectComponentSourceCode:async(k,S,P)=>{const $={project_name:k,component_id:S,source_code:P};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateApplicationMetadata:async(k,S,P,$)=>{const B={project_name:k,application_name:S,application_description:P,application_category:$};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},updateApplicationSettings:async(k,S)=>{const P={project_name:k,application_login_enabled:S};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},deleteProjectFile:async(k,S)=>{const P={project_name:k,file_path:S};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},resetProjectFile:async(k,S,P,$,B)=>{let M={project_name:k,file_path:S,git_ref:P};return $&&(M.prune=$),B&&(M.extra_metadata=B),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})},deleteProject:async k=>{const S={projects:[k]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)})},requestErrorCorrection:async(k,S,P)=>{const $={project_name:k,component_id:S,error_message:P};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},addImage:async k=>await fetch(`${t}/add_image`,{method:"POST",body:k})}},sd=e=>{const t=e;return{getQueryContent:async a=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:a,biscuits:[]})}),getVisuals:async(a,o,s,l,c,u,d,p)=>{const m=new URLSearchParams({pageNo:a.toString(),pageSize:o.toString(),scope:s,searchPattern:l,sortBy:c,sortOrder:u,visibility:d,visualType:p}).toString();return await fetch(`${t}/v2/content/visuals?${m}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},Es=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(R,b)=>await fetch(`${t}/config/secrets/${R}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),getSecret:async R=>await fetch(`${t}/config/secrets/${R}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async R=>await fetch(`${t}/config/secrets/${R}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async R=>await fetch(`${t}/config/miniapps/${R}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/tier-key-map/${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:C})}),getTierKeyMapForTier:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/tier-key-map/${b}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/tier-key-map/${b}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async R=>await fetch(`${t}/config/miniapps/${R}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/assignments/${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:C})}),getTierAssignment:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/assignments/${b}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/assignments/${b}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async R=>await fetch(`${t}/config/miniapps/${R}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(R,b,C,k)=>await fetch(`${t}/config/miniapps/${R}/rate-limits/${b}/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),getRateLimit:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/rate-limits/${b}/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/rate-limits/${b}/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:R=>async(b,C)=>{const k=b instanceof URL?b:new URL(b.toString());return await fetch(`${t}/proxy/${R.miniappName}/${k.host}${k.pathname}${k.search}${k.hash}`,C)},createProxyGetView:R=>{const b=new URL(R.gwProxyUrl).hostname;return async(C,k,S={})=>{let P=`SELECT * FROM ${C}.${k}`;S&&Object.keys(S).length>0&&(P+=`(${Object.entries(S).map(([M,H])=>`'${M}=${H}'`).join(",")})`);const $=await fetch(`${t}/proxy/${R.miniappName}/${b}/v1/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:P})});if(!$.ok)throw new Error(`Failed to fetch view: ${$.statusText}`);return await $.json()}}}};for(var Xe=[],Ss=0;Ss<256;++Ss)Xe.push((Ss+256).toString(16).slice(1));function N_(e,t=0){return(Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]).toLowerCase()}var Oa,M_=new Uint8Array(16);function L_(){if(!Oa&&(Oa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oa(M_)}var F_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const cd={randomUUID:F_};function ld(e,t,r){if(cd.randomUUID&&!e)return cd.randomUUID();e=e||{};var n=e.random||(e.rng||L_)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,N_(n)}function U_(e){return typeof e=="function"}const H_=e=>{const{wrapAPICall:t}=od(),r=xs(e);return new Proxy(r,{get:(i,a)=>{const o=i[a];return U_(o)?(...s)=>t(o.apply(i,s)):o}})},ks=K.createContext(null);ks.Consumer;const W_=e=>{const[t,r]=K.useState({projectName:null,projectURL:null}),[n,i]=K.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[a,o]=K.useState(()=>sd(e.config.GW_BASE_URL)),[s,l]=K.useState(!1),[c,u]=K.useState(""),[d,p]=K.useState(""),[m,g]=K.useState(""),[_,x]=K.useState([]),[y,v]=K.useState(ld()),O=H_(e.config.API_BASE_URL),R=xs(e.config.API_BASE_URL),b=O||R,[C,k]=K.useState(()=>Es(e.config.PROXY_API_BASE_URL)),[S,P]=K.useState(null),[$,B]=K.useState(null),[M,H]=K.useState(),[Y,ue]=K.useState(!1),Te=()=>{v(ld())},me=(ge,Pe)=>{if(!ge)return;M&&(M.close(),ue(!1));const Ue=localStorage.getItem("accessToken")||"",oe=`${n.WS_BASE_URL}/ws/chat/${ge}?token=${Ue}`;if(!oe.startsWith("ws://")&&!oe.startsWith("wss://")){Pe.onerror({customWebsocketError:"INVALID_URL"});return}const L=new WebSocket(oe);L.onopen=()=>{ue(!0),Pe.onopen()},L.onclose=W=>{ue(!1),Pe.onclose(W)},L.onerror=W=>{Pe.onerror(W)},L.onmessage=W=>{Pe.onmessage(W)},H(L)};return K.useEffect(()=>{i(e==null?void 0:e.config)},[e.config]),K.useEffect(()=>{if(!(n!=null&&n.PROXY_API_BASE_URL)||!(n!=null&&n.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}return o(sd(n.GW_BASE_URL)),k(ge=>{const Pe=Es(n.PROXY_API_BASE_URL);P(Pe.createProxyFetch({miniappName:t.projectName}));const Ue=Pe.createProxyGetView({miniappName:t.projectName,gwProxyUrl:n.GW_PROXY_URL}),oe=async(L,W,G={})=>{if(typeof L!="string"||typeof W!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof L}, viewName: ${typeof W}`);return Ue(L,W,G)};return B(()=>oe),Pe}),()=>{M&&M.close()}},[n,t]),ve.jsx(ks.Provider,{value:{config:n,projectMetadata:t,setProjectMetadata:r,handledRequestComponentIds:_,setHandledRequestComponentIds:x,syncToken:y,setSyncToken:Te,selectedComponentId:c,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:p,selectedComponentHTML:m,setSelectedComponentHTML:g,isComponentSubselected:s,setIsComponentSubselected:l,APIHandler:b,gwAPIHandler:a,proxyHandler:C,proxyFetch:S,proxyGetView:$,startChatbot:me,chatbotWebsocket:M,chatbotWebsocketConnected:Y},children:e.children})},G_=e=>ve.jsx(z_,{children:ve.jsx(W_,{...e})}),Rs=()=>{const e=K.useContext(ks);if(e===null)throw new Error("Invalid project context.");return{...e}},q_=async e=>{let t=null,r=null;try{const n=e.replace(/import.*?;\n/g,""),i=gc.transform(n,{presets:["react","typescript"],filename:"file.tsx"}).code,a=new Blob([i],{type:"text/javascript"});t=(await import(URL.createObjectURL(a))).component}catch(n){t=null,r=n.stack}return{compileError:r,compiledComponent:t}},Y_=async e=>{let t=[];const r=await e.getComponentLibrary();if(r.status!==200)throw new Error("Could not load library components");let n=(await r.json()).components;for(const i in n)if(i==="example")for(const a of n[i]){let o=a.content["component.tsx"];o=o.replace(/import.*?;\n/g,"");let s=a.content["layout.json"];const l=gc.transform(o,{presets:["react","typescript"],filename:"file.tsx"}).code,c=new Blob([l],{type:"text/javascript"}),p=(await import(URL.createObjectURL(c))).component;t.push({class:a.name,layout:JSON.parse(s),component:ve.jsx(p,{})})}return t},ud=async e=>{let t=[],r=[];const n=`${window.miDir}/${e}`,i="src/ProjectComponents";let a=await Of(`${n}/${i}`);a=a.filter(o=>!(o.includes(".gitkeep")||o.includes("index.ts")));for(const o of a){let s=`${o.replace(i,"")}`,l=`${s}/component.tsx`,c=await window.pfs.readFile(`${n}/${i}/${l}`,"utf8");const{compileError:u,compiledComponent:d}=await q_(c);let p=`${s}/layout.json`;const m=await window.pfs.readFile(`${n}/${i}/${p}`,"utf8");let g={id:o,component:null};if(u){g={...g,overrides:{compileError:{message:u}}},t.push(g),r.push({...JSON.parse(m),i:o});continue}if(s.includes("Chart")){let _=`${s}/chart_config.json`;const x=await window.pfs.readFile(`${n}/${i}/${_}`,"utf8"),y=JSON.parse(x),v=d;g.component=ve.jsx(v,{chartConfig:y})}else{const _=d;g.component=ve.jsx(_,{})}t.push(g),r.push({...JSON.parse(m),i:o})}return{components:t,layout:r}},X_=async(e,t)=>{var u;const r={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp"},i=(await window.pfs.readdir(window.miDir)).find(d=>d.toLowerCase()===e.toLowerCase());if(!i)throw new Error(`Project "${e}" not found`);const a=`${window.miDir}/${i}/src/assets/images/${t}`,o=await window.pfs.readFile(a),s=Buffer.from(o).toString("base64"),l=((u=t.split(".").pop())==null?void 0:u.toLowerCase())||"";return`data:${r[l]??"image/jpeg"};base64,${s}`},Z_=e=>{if(window.tailwind)window.tailwind.config=e;else throw new Error("Could not load tailwind theme: missing tailwind global.")},V_=(e,t)=>{const[r,n]=K.useState("");return K.useEffect(()=>{(async()=>{try{const a=await X_(e,t);n(a)}catch(a){console.error("Error fetching background image URL:",a)}})()},[e,t]),r},K_=(e,t=[])=>{const[r,n]=K.useState(null);return K.useEffect(()=>{(async()=>{n(null);try{const a=`${window.miDir}/${e}/metadata.json`;await window.pfs.readFile(a,"utf8").then(o=>{if(o instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");n(JSON.parse(o))})}catch(a){throw console.log("Error: can not read app metadata file."),a}})()},[e,...t]),r},J_=(e,t=[])=>{const[r,n]=K.useState(null);return K.useEffect(()=>{(async()=>{n(null);try{const a=`${window.miDir}/${e}/settings.json`;await window.pfs.readFile(a,"utf8").then(o=>{if(o instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");n(JSON.parse(o))})}catch(a){throw console.log("Error: can not read app settings file."),a}})()},[e,...t]),r},Q_=(e,t,r=[])=>{const[n,i]=K.useState(null);return K.useEffect(()=>{(async()=>{i(null);const o=await ss(e,t);if(o){const s=o.filter(c=>c.tag==="published"),l=o.filter(c=>c.tag!=="published");i({publishedVersion:s.length?s[0]:null,versions:l})}})()},[e,t,...r]),n},ev=gr.div`
118
+ */var Nt=typeof Symbol=="function"&&Symbol.for,Sh=Nt?Symbol.for("react.element"):60103,Ch=Nt?Symbol.for("react.portal"):60106,Vc=Nt?Symbol.for("react.fragment"):60107,Wc=Nt?Symbol.for("react.strict_mode"):60108,Gc=Nt?Symbol.for("react.profiler"):60114,qc=Nt?Symbol.for("react.provider"):60109,Yc=Nt?Symbol.for("react.context"):60110,Eh=Nt?Symbol.for("react.async_mode"):60111,Kc=Nt?Symbol.for("react.concurrent_mode"):60111,Xc=Nt?Symbol.for("react.forward_ref"):60112,Zc=Nt?Symbol.for("react.suspense"):60113,a4=Nt?Symbol.for("react.suspense_list"):60120,Jc=Nt?Symbol.for("react.memo"):60115,Qc=Nt?Symbol.for("react.lazy"):60116,s4=Nt?Symbol.for("react.block"):60121,l4=Nt?Symbol.for("react.fundamental"):60117,c4=Nt?Symbol.for("react.responder"):60118,u4=Nt?Symbol.for("react.scope"):60119;function vn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Sh:switch(e=e.type,e){case Eh:case Kc:case Vc:case Gc:case Wc:case Zc:return e;default:switch(e=e&&e.$$typeof,e){case Yc:case Xc:case Qc:case Jc:case qc:return e;default:return t}}case Ch:return t}}}function fx(e){return vn(e)===Kc}Qe.AsyncMode=Eh,Qe.ConcurrentMode=Kc,Qe.ContextConsumer=Yc,Qe.ContextProvider=qc,Qe.Element=Sh,Qe.ForwardRef=Xc,Qe.Fragment=Vc,Qe.Lazy=Qc,Qe.Memo=Jc,Qe.Portal=Ch,Qe.Profiler=Gc,Qe.StrictMode=Wc,Qe.Suspense=Zc,Qe.isAsyncMode=function(e){return fx(e)||vn(e)===Eh},Qe.isConcurrentMode=fx,Qe.isContextConsumer=function(e){return vn(e)===Yc},Qe.isContextProvider=function(e){return vn(e)===qc},Qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sh},Qe.isForwardRef=function(e){return vn(e)===Xc},Qe.isFragment=function(e){return vn(e)===Vc},Qe.isLazy=function(e){return vn(e)===Qc},Qe.isMemo=function(e){return vn(e)===Jc},Qe.isPortal=function(e){return vn(e)===Ch},Qe.isProfiler=function(e){return vn(e)===Gc},Qe.isStrictMode=function(e){return vn(e)===Wc},Qe.isSuspense=function(e){return vn(e)===Zc},Qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Vc||e===Kc||e===Gc||e===Wc||e===Zc||e===a4||typeof e=="object"&&e!==null&&(e.$$typeof===Qc||e.$$typeof===Jc||e.$$typeof===qc||e.$$typeof===Yc||e.$$typeof===Xc||e.$$typeof===l4||e.$$typeof===c4||e.$$typeof===u4||e.$$typeof===s4)},Qe.typeOf=vn,dx.exports=Qe;var Ph=dx.exports;function d4(e){function t(H,O,V,ae,j){for(var G=0,$=0,te=0,ie=0,re,z,se=0,oe=0,fe,ge=fe=re=0,pe=0,me=0,_e=0,Re=0,nt=V.length,Ie=nt-1,Me,Ce="",Le="",pn="",D="",_;pe<nt;){if(z=V.charCodeAt(pe),pe===Ie&&$+ie+te+G!==0&&($!==0&&(z=$===47?10:47),ie=te=G=0,nt++,Ie++),$+ie+te+G===0){if(pe===Ie&&(0<me&&(Ce=Ce.replace(f,"")),0<Ce.trim().length)){switch(z){case 32:case 9:case 59:case 13:case 10:break;default:Ce+=V.charAt(pe)}z=59}switch(z){case 123:for(Ce=Ce.trim(),re=Ce.charCodeAt(0),fe=1,Re=++pe;pe<nt;){switch(z=V.charCodeAt(pe)){case 123:fe++;break;case 125:fe--;break;case 47:switch(z=V.charCodeAt(pe+1)){case 42:case 47:e:{for(ge=pe+1;ge<Ie;++ge)switch(V.charCodeAt(ge)){case 47:if(z===42&&V.charCodeAt(ge-1)===42&&pe+2!==ge){pe=ge+1;break e}break;case 10:if(z===47){pe=ge+1;break e}}pe=ge}}break;case 91:z++;case 40:z++;case 34:case 39:for(;pe++<Ie&&V.charCodeAt(pe)!==z;);}if(fe===0)break;pe++}switch(fe=V.substring(Re,pe),re===0&&(re=(Ce=Ce.replace(d,"").trim()).charCodeAt(0)),re){case 64:switch(0<me&&(Ce=Ce.replace(f,"")),z=Ce.charCodeAt(1),z){case 100:case 109:case 115:case 45:me=O;break;default:me=q}if(fe=t(O,me,fe,z,j+1),Re=fe.length,0<B&&(me=n(q,Ce,_e),_=s(3,fe,me,O,L,F,Re,z,j,ae),Ce=me.join(""),_!==void 0&&(Re=(fe=_.trim()).length)===0&&(z=0,fe="")),0<Re)switch(z){case 115:Ce=Ce.replace(N,a);case 100:case 109:case 45:fe=Ce+"{"+fe+"}";break;case 107:Ce=Ce.replace(b,"$1 $2"),fe=Ce+"{"+fe+"}",fe=ne===1||ne===2&&i("@"+fe,3)?"@-webkit-"+fe+"@"+fe:"@"+fe;break;default:fe=Ce+fe,ae===112&&(fe=(Le+=fe,""))}else fe="";break;default:fe=t(O,n(O,Ce,_e),fe,ae,j+1)}pn+=fe,fe=_e=me=ge=re=0,Ce="",z=V.charCodeAt(++pe);break;case 125:case 59:if(Ce=(0<me?Ce.replace(f,""):Ce).trim(),1<(Re=Ce.length))switch(ge===0&&(re=Ce.charCodeAt(0),re===45||96<re&&123>re)&&(Re=(Ce=Ce.replace(" ",":")).length),0<B&&(_=s(1,Ce,O,H,L,F,Le.length,ae,j,ae))!==void 0&&(Re=(Ce=_.trim()).length)===0&&(Ce="\0\0"),re=Ce.charCodeAt(0),z=Ce.charCodeAt(1),re){case 0:break;case 64:if(z===105||z===99){D+=Ce+V.charAt(pe);break}default:Ce.charCodeAt(Re-1)!==58&&(Le+=o(Ce,re,z,Ce.charCodeAt(2)))}_e=me=ge=re=0,Ce="",z=V.charCodeAt(++pe)}}switch(z){case 13:case 10:$===47?$=0:1+re===0&&ae!==107&&0<Ce.length&&(me=1,Ce+="\0"),0<B*Z&&s(0,Ce,O,H,L,F,Le.length,ae,j,ae),F=1,L++;break;case 59:case 125:if($+ie+te+G===0){F++;break}default:switch(F++,Me=V.charAt(pe),z){case 9:case 32:if(ie+G+$===0)switch(se){case 44:case 58:case 9:case 32:Me="";break;default:z!==32&&(Me=" ")}break;case 0:Me="\\0";break;case 12:Me="\\f";break;case 11:Me="\\v";break;case 38:ie+$+G===0&&(me=_e=1,Me="\f"+Me);break;case 108:if(ie+$+G+Y===0&&0<ge)switch(pe-ge){case 2:se===112&&V.charCodeAt(pe-3)===58&&(Y=se);case 8:oe===111&&(Y=oe)}break;case 58:ie+$+G===0&&(ge=pe);break;case 44:$+te+ie+G===0&&(me=1,Me+="\r");break;case 34:case 39:$===0&&(ie=ie===z?0:ie===0?z:ie);break;case 91:ie+$+te===0&&G++;break;case 93:ie+$+te===0&&G--;break;case 41:ie+$+G===0&&te--;break;case 40:if(ie+$+G===0){if(re===0)switch(2*se+3*oe){case 533:break;default:re=1}te++}break;case 64:$+te+ie+G+ge+fe===0&&(fe=1);break;case 42:case 47:if(!(0<ie+G+te))switch($){case 0:switch(2*z+3*V.charCodeAt(pe+1)){case 235:$=47;break;case 220:Re=pe,$=42}break;case 42:z===47&&se===42&&Re+2!==pe&&(V.charCodeAt(Re+2)===33&&(Le+=V.substring(Re,pe+1)),Me="",$=0)}}$===0&&(Ce+=Me)}oe=se,se=z,pe++}if(Re=Le.length,0<Re){if(me=O,0<B&&(_=s(2,Le,me,H,L,F,Re,ae,j,ae),_!==void 0&&(Le=_).length===0))return D+Le+pn;if(Le=me.join(",")+"{"+Le+"}",ne*Y!==0){switch(ne!==2||i(Le,2)||(Y=0),Y){case 111:Le=Le.replace(S,":-moz-$1")+Le;break;case 112:Le=Le.replace(x,"::-webkit-input-$1")+Le.replace(x,"::-moz-$1")+Le.replace(x,":-ms-input-$1")+Le}Y=0}}return D+Le+pn}function n(H,O,V){var ae=O.trim().split(v);O=ae;var j=ae.length,G=H.length;switch(G){case 0:case 1:var $=0;for(H=G===0?"":H[0]+" ";$<j;++$)O[$]=r(H,O[$],V).trim();break;default:var te=$=0;for(O=[];$<j;++$)for(var ie=0;ie<G;++ie)O[te++]=r(H[ie]+" ",ae[$],V).trim()}return O}function r(H,O,V){var ae=O.charCodeAt(0);switch(33>ae&&(ae=(O=O.trim()).charCodeAt(0)),ae){case 38:return O.replace(w,"$1"+H.trim());case 58:return H.trim()+O.replace(w,"$1"+H.trim());default:if(0<1*V&&0<O.indexOf("\f"))return O.replace(w,(H.charCodeAt(0)===58?"":"$1")+H.trim())}return H+O}function o(H,O,V,ae){var j=H+";",G=2*O+3*V+4*ae;if(G===944){H=j.indexOf(":",9)+1;var $=j.substring(H,j.length-1).trim();return $=j.substring(0,H).trim()+$+";",ne===1||ne===2&&i($,1)?"-webkit-"+$+$:$}if(ne===0||ne===2&&!i(j,1))return j;switch(G){case 1015:return j.charCodeAt(10)===97?"-webkit-"+j+j:j;case 951:return j.charCodeAt(3)===116?"-webkit-"+j+j:j;case 963:return j.charCodeAt(5)===110?"-webkit-"+j+j:j;case 1009:if(j.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+j+j;case 978:return"-webkit-"+j+"-moz-"+j+j;case 1019:case 983:return"-webkit-"+j+"-moz-"+j+"-ms-"+j+j;case 883:if(j.charCodeAt(8)===45)return"-webkit-"+j+j;if(0<j.indexOf("image-set(",11))return j.replace(k,"$1-webkit-$2")+j;break;case 932:if(j.charCodeAt(4)===45)switch(j.charCodeAt(5)){case 103:return"-webkit-box-"+j.replace("-grow","")+"-webkit-"+j+"-ms-"+j.replace("grow","positive")+j;case 115:return"-webkit-"+j+"-ms-"+j.replace("shrink","negative")+j;case 98:return"-webkit-"+j+"-ms-"+j.replace("basis","preferred-size")+j}return"-webkit-"+j+"-ms-"+j+j;case 964:return"-webkit-"+j+"-ms-flex-"+j+j;case 1023:if(j.charCodeAt(8)!==99)break;return $=j.substring(j.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+$+"-webkit-"+j+"-ms-flex-pack"+$+j;case 1005:return p.test(j)?j.replace(h,":-webkit-")+j.replace(h,":-moz-")+j:j;case 1e3:switch($=j.substring(13).trim(),O=$.indexOf("-")+1,$.charCodeAt(0)+$.charCodeAt(O)){case 226:$=j.replace(C,"tb");break;case 232:$=j.replace(C,"tb-rl");break;case 220:$=j.replace(C,"lr");break;default:return j}return"-webkit-"+j+"-ms-"+$+j;case 1017:if(j.indexOf("sticky",9)===-1)break;case 975:switch(O=(j=H).length-10,$=(j.charCodeAt(O)===33?j.substring(0,O):j).substring(H.indexOf(":",7)+1).trim(),G=$.charCodeAt(0)+($.charCodeAt(7)|0)){case 203:if(111>$.charCodeAt(8))break;case 115:j=j.replace($,"-webkit-"+$)+";"+j;break;case 207:case 102:j=j.replace($,"-webkit-"+(102<G?"inline-":"")+"box")+";"+j.replace($,"-webkit-"+$)+";"+j.replace($,"-ms-"+$+"box")+";"+j}return j+";";case 938:if(j.charCodeAt(5)===45)switch(j.charCodeAt(6)){case 105:return $=j.replace("-items",""),"-webkit-"+j+"-webkit-box-"+$+"-ms-flex-"+$+j;case 115:return"-webkit-"+j+"-ms-flex-item-"+j.replace(T,"")+j;default:return"-webkit-"+j+"-ms-flex-line-pack"+j.replace("align-content","").replace(T,"")+j}break;case 973:case 989:if(j.charCodeAt(3)!==45||j.charCodeAt(4)===122)break;case 931:case 953:if(A.test(H)===!0)return($=H.substring(H.indexOf(":")+1)).charCodeAt(0)===115?o(H.replace("stretch","fill-available"),O,V,ae).replace(":fill-available",":stretch"):j.replace($,"-webkit-"+$)+j.replace($,"-moz-"+$.replace("fill-",""))+j;break;case 962:if(j="-webkit-"+j+(j.charCodeAt(5)===102?"-ms-"+j:"")+j,V+ae===211&&j.charCodeAt(13)===105&&0<j.indexOf("transform",10))return j.substring(0,j.indexOf(";",27)+1).replace(m,"$1-webkit-$2")+j}return j}function i(H,O){var V=H.indexOf(O===1?":":"{"),ae=H.substring(0,O!==3?V:10);return V=H.substring(V+1,H.length-1),ee(O!==2?ae:ae.replace(M,"$1"),V,O)}function a(H,O){var V=o(O,O.charCodeAt(0),O.charCodeAt(1),O.charCodeAt(2));return V!==O+";"?V.replace(R," or ($1)").substring(4):"("+O+")"}function s(H,O,V,ae,j,G,$,te,ie,re){for(var z=0,se=O,oe;z<B;++z)switch(oe=X[z].call(u,H,se,V,ae,j,G,$,te,ie,re)){case void 0:case!1:case!0:case null:break;default:se=oe}if(se!==O)return se}function l(H){switch(H){case void 0:case null:B=X.length=0;break;default:if(typeof H=="function")X[B++]=H;else if(typeof H=="object")for(var O=0,V=H.length;O<V;++O)l(H[O]);else Z=!!H|0}return l}function c(H){return H=H.prefix,H!==void 0&&(ee=null,H?typeof H!="function"?ne=1:(ne=2,ee=H):ne=0),c}function u(H,O){var V=H;if(33>V.charCodeAt(0)&&(V=V.trim()),J=V,V=[J],0<B){var ae=s(-1,O,V,V,L,F,0,0,0,0);ae!==void 0&&typeof ae=="string"&&(O=ae)}var j=t(q,V,O,0,0);return 0<B&&(ae=s(-2,j,V,V,L,F,j.length,0,0,0),ae!==void 0&&(j=ae)),J="",Y=0,F=L=1,j}var d=/^\0+/g,f=/[\0\r\f]/g,h=/: */g,p=/zoo|gra/,m=/([,: ])(transform)/g,v=/,\r+?/g,w=/([\t\r\n ])*\f?&/g,b=/@(k\w+)\s*(\S*)\s*/,x=/::(place)/g,S=/:(read-only)/g,C=/[svh]\w+-[tblr]{2}/,N=/\(\s*(.*)\s*\)/g,R=/([\s\S]*?);/g,T=/-self|flex-/g,M=/[^]*?(:[rp][el]a[\w-]+)[^]*/,A=/stretch|:\s*\w+\-(?:conte|avail)/,k=/([^-])(image-set\()/,F=1,L=1,Y=0,ne=1,q=[],X=[],B=0,ee=null,Z=0,J="";return u.use=l,u.set=c,e!==void 0&&c(e),u}var f4={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function h4(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var p4=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,hx=h4(function(e){return p4.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Rh=Ph,m4={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},g4={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},w4={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},px={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nh={};Nh[Rh.ForwardRef]=w4,Nh[Rh.Memo]=px;function mx(e){return Rh.isMemo(e)?px:Nh[e.$$typeof]||m4}var v4=Object.defineProperty,y4=Object.getOwnPropertyNames,gx=Object.getOwnPropertySymbols,b4=Object.getOwnPropertyDescriptor,x4=Object.getPrototypeOf,wx=Object.prototype;function vx(e,t,n){if(typeof t!="string"){if(wx){var r=x4(t);r&&r!==wx&&vx(e,r,n)}var o=y4(t);gx&&(o=o.concat(gx(t)));for(var i=mx(e),a=mx(t),s=0;s<o.length;++s){var l=o[s];if(!g4[l]&&!(n&&n[l])&&!(a&&a[l])&&!(i&&i[l])){var c=b4(t,l);try{v4(e,l,c)}catch{}}}}return e}var _4=vx;const S4=Nn(_4);function $r(){return($r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var yx=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},Th=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!Ph.typeOf(e)},eu=Object.freeze([]),lo=Object.freeze({});function Vs(e){return typeof e=="function"}function bx(e){return e.displayName||e.name||"Component"}function Mh(e){return e&&typeof e.styledComponentId=="string"}var Ki=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Dh=typeof window<"u"&&"HTMLElement"in window,C4=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY));function Ws(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var E4=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o<n;o++)r+=this.groupSizes[o];return r},t.insertRules=function(n,r){if(n>=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,a=i;n>=a;)(a<<=1)<0&&Ws(16,""+n);this.groupSizes=new Uint32Array(a),this.groupSizes.set(o),this.length=a;for(var s=i;s<a;s++)this.groupSizes[s]=0}for(var l=this.indexOfGroup(n+1),c=0,u=r.length;c<u;c++)this.tag.insertRule(l,r[c])&&(this.groupSizes[n]++,l++)},t.clearGroup=function(n){if(n<this.length){var r=this.groupSizes[n],o=this.indexOfGroup(n),i=o+r;this.groupSizes[n]=0;for(var a=o;a<i;a++)this.tag.deleteRule(o)}},t.getGroup=function(n){var r="";if(n>=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],i=this.indexOfGroup(n),a=i+o,s=i;s<a;s++)r+=this.tag.getRule(s)+`/*!sc*/
119
+ `;return r},e}(),tu=new Map,nu=new Map,Gs=1,ru=function(e){if(tu.has(e))return tu.get(e);for(;nu.has(Gs);)Gs++;var t=Gs++;return tu.set(e,t),nu.set(t,e),t},P4=function(e){return nu.get(e)},R4=function(e,t){t>=Gs&&(Gs=t+1),tu.set(e,t),nu.set(t,e)},N4="style["+Ki+'][data-styled-version="5.3.11"]',T4=new RegExp("^"+Ki+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),M4=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i<a;i++)(r=o[i])&&e.registerName(t,r)},D4=function(e,t){for(var n=(t.textContent||"").split(`/*!sc*/
120
+ `),r=[],o=0,i=n.length;o<i;o++){var a=n[o].trim();if(a){var s=a.match(T4);if(s){var l=0|parseInt(s[1],10),c=s[2];l!==0&&(R4(c,l),M4(e,c,s[3]),e.getTag().insertRules(l,r)),r.length=0}else r.push(a)}}},A4=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},xx=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(s){for(var l=s.childNodes,c=l.length;c>=0;c--){var u=l[c];if(u&&u.nodeType===1&&u.hasAttribute(Ki))return u}}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(Ki,"active"),r.setAttribute("data-styled-version","5.3.11");var a=A4();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},k4=function(){function e(n){var r=this.element=xx(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,a=0,s=i.length;a<s;a++){var l=i[a];if(l.ownerNode===o)return l}Ws(17)}(r),this.length=0}var t=e.prototype;return t.insertRule=function(n,r){try{return this.sheet.insertRule(r,n),this.length++,!0}catch{return!1}},t.deleteRule=function(n){this.sheet.deleteRule(n),this.length--},t.getRule=function(n){var r=this.sheet.cssRules[n];return r!==void 0&&typeof r.cssText=="string"?r.cssText:""},e}(),I4=function(){function e(n){var r=this.element=xx(n);this.nodes=r.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(n,r){if(n<=this.length&&n>=0){var o=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(o,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n<this.length?this.nodes[n].textContent:""},e}(),O4=function(){function e(n){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(n,r){return n<=this.length&&(this.rules.splice(n,0,r),this.length++,!0)},t.deleteRule=function(n){this.rules.splice(n,1),this.length--},t.getRule=function(n){return n<this.length?this.rules[n]:""},e}(),_x=Dh,j4={isServer:!Dh,useCSSOMInjection:!C4},Sx=function(){function e(n,r,o){n===void 0&&(n=lo),r===void 0&&(r={}),this.options=$r({},j4,{},n),this.gs=r,this.names=new Map(o),this.server=!!n.isServer,!this.server&&Dh&&_x&&(_x=!1,function(i){for(var a=document.querySelectorAll(N4),s=0,l=a.length;s<l;s++){var c=a[s];c&&c.getAttribute(Ki)!=="active"&&(D4(i,c),c.parentNode&&c.parentNode.removeChild(c))}}(this))}e.registerId=function(n){return ru(n)};var t=e.prototype;return t.reconstructWithOptions=function(n,r){return r===void 0&&(r=!0),new e($r({},this.options,{},n),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(n){return this.gs[n]=(this.gs[n]||0)+1},t.getTag=function(){return this.tag||(this.tag=(o=(r=this.options).isServer,i=r.useCSSOMInjection,a=r.target,n=o?new O4(a):i?new k4(a):new I4(a),new E4(n)));var n,r,o,i,a},t.hasNameForId=function(n,r){return this.names.has(n)&&this.names.get(n).has(r)},t.registerName=function(n,r){if(ru(n),this.names.has(n))this.names.get(n).add(r);else{var o=new Set;o.add(r),this.names.set(n,o)}},t.insertRules=function(n,r,o){this.registerName(n,r),this.getTag().insertRules(ru(n),o)},t.clearNames=function(n){this.names.has(n)&&this.names.get(n).clear()},t.clearRules=function(n){this.getTag().clearGroup(ru(n)),this.clearNames(n)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(n){for(var r=n.getTag(),o=r.length,i="",a=0;a<o;a++){var s=P4(a);if(s!==void 0){var l=n.names.get(s),c=r.getGroup(a);if(l&&c&&l.size){var u=Ki+".g"+a+'[id="'+s+'"]',d="";l!==void 0&&l.forEach(function(f){f.length>0&&(d+=f+",")}),i+=""+c+u+'{content:"'+d+`"}/*!sc*/
121
+ `}}}return i}(this)},e}(),$4=/(a)(d)/gi,Cx=function(e){return String.fromCharCode(e+(e>25?39:97))};function Ah(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Cx(t%52)+n;return(Cx(t%52)+n).replace($4,"$1-$2")}var Xi=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ex=function(e){return Xi(5381,e)};function F4(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Vs(n)&&!Mh(n))return!1}return!0}var L4=Ex("5.3.11"),z4=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&F4(t),this.componentId=n,this.baseHash=Xi(L4,n),this.baseStyle=r,Sx.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var o=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(t,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(o,this.staticRulesId))i.push(this.staticRulesId);else{var a=Zi(this.rules,t,n,r).join(""),s=Ah(Xi(this.baseHash,a)>>>0);if(!n.hasNameForId(o,s)){var l=r(a,"."+s,void 0,o);n.insertRules(o,s,l)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=Xi(this.baseHash,r.hash),d="",f=0;f<c;f++){var h=this.rules[f];if(typeof h=="string")d+=h;else if(h){var p=Zi(h,t,n,r),m=Array.isArray(p)?p.join(""):p;u=Xi(u,m+f),d+=m}}if(d){var v=Ah(u>>>0);if(!n.hasNameForId(o,v)){var w=r(d,"."+v,void 0,o);n.insertRules(o,v,w)}i.push(v)}}return i.join(" ")},e}(),B4=/^\s*\/\/.*$/gm,H4=[":","[",".","#"];function U4(e){var t,n,r,o,i=lo,a=i.options,s=a===void 0?lo:a,l=i.plugins,c=l===void 0?eu:l,u=new d4(s),d=[],f=function(m){function v(w){if(w)try{m(w+"}")}catch{}}return function(w,b,x,S,C,N,R,T,M,A){switch(w){case 1:if(M===0&&b.charCodeAt(0)===64)return m(b+";"),"";break;case 2:if(T===0)return b+"/*|*/";break;case 3:switch(T){case 102:case 112:return m(x[0]+b),"";default:return b+(A===0?"/*|*/":"")}case-2:b.split("/*|*/}").forEach(v)}}}(function(m){d.push(m)}),h=function(m,v,w){return v===0&&H4.indexOf(w[n.length])!==-1||w.match(o)?m:"."+t};function p(m,v,w,b){b===void 0&&(b="&");var x=m.replace(B4,""),S=v&&w?w+" "+v+" { "+x+" }":x;return t=b,n=v,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),u(w||!v?"":v,S)}return u.use([].concat(c,[function(m,v,w){m===2&&w.length&&w[0].lastIndexOf(n)>0&&(w[0]=w[0].replace(r,h))},f,function(m){if(m===-2){var v=d;return d=[],v}}])),p.hash=c.length?c.reduce(function(m,v){return v.name||Ws(15),Xi(m,v.name)},5381).toString():"",p}var Px=E.createContext();Px.Consumer;var Rx=E.createContext(),V4=(Rx.Consumer,new Sx),kh=U4();function W4(){return E.useContext(Px)||V4}function G4(){return E.useContext(Rx)||kh}var q4=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=kh);var a=r.name+i.hash;o.hasNameForId(r.id,a)||o.insertRules(r.id,a,i(r.rules,a,"@keyframes"))},this.toString=function(){return Ws(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=kh),this.name+t.hash},e}(),Y4=/([A-Z])/,K4=/([A-Z])/g,X4=/^ms-/,Z4=function(e){return"-"+e.toLowerCase()};function Nx(e){return Y4.test(e)?e.replace(K4,Z4).replace(X4,"-ms-"):e}var Tx=function(e){return e==null||e===!1||e===""};function Zi(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a<s;a+=1)(o=Zi(e[a],t,n,r))!==""&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));return i}if(Tx(e))return"";if(Mh(e))return"."+e.styledComponentId;if(Vs(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return Zi(l,t,n,r)}var c;return e instanceof q4?n?(e.inject(n,r),e.getName(r)):e:Th(e)?function u(d,f){var h,p,m=[];for(var v in d)d.hasOwnProperty(v)&&!Tx(d[v])&&(Array.isArray(d[v])&&d[v].isCss||Vs(d[v])?m.push(Nx(v)+":",d[v],";"):Th(d[v])?m.push.apply(m,u(d[v],v)):m.push(Nx(v)+": "+(h=v,(p=d[v])==null||typeof p=="boolean"||p===""?"":typeof p!="number"||p===0||h in f4||h.startsWith("--")?String(p).trim():p+"px")+";"));return f?[f+" {"].concat(m,["}"]):m}(e):e.toString()}var Mx=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function J4(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Vs(e)||Th(e)?Mx(Zi(yx(eu,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:Mx(Zi(yx(e,n)))}var Q4=function(e,t,n){return n===void 0&&(n=lo),e.theme!==n.theme&&e.theme||t||n.theme},e5=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,t5=/(^-|-$)/g;function Ih(e){return e.replace(e5,"-").replace(t5,"")}var n5=function(e){return Ah(Ex(e)>>>0)};function ou(e){return typeof e=="string"&&!0}var Oh=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},r5=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function o5(e,t,n){var r=e[n];Oh(t)&&Oh(r)?Dx(r,t):e[n]=t}function Dx(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,i=n;o<i.length;o++){var a=i[o];if(Oh(a))for(var s in a)r5(s)&&o5(e,a[s],s)}return e}var Ax=E.createContext();Ax.Consumer;var jh={};function kx(e,t,n){var r=Mh(e),o=!ou(e),i=t.attrs,a=i===void 0?eu:i,s=t.componentId,l=s===void 0?function(b,x){var S=typeof b!="string"?"sc":Ih(b);jh[S]=(jh[S]||0)+1;var C=S+"-"+n5("5.3.11"+S+jh[S]);return x?x+"-"+C:C}(t.displayName,t.parentComponentId):s,c=t.displayName,u=c===void 0?function(b){return ou(b)?"styled."+b:"Styled("+bx(b)+")"}(e):c,d=t.displayName&&t.componentId?Ih(t.displayName)+"-"+t.componentId:t.componentId||l,f=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,h=t.shouldForwardProp;r&&e.shouldForwardProp&&(h=t.shouldForwardProp?function(b,x,S){return e.shouldForwardProp(b,x,S)&&t.shouldForwardProp(b,x,S)}:e.shouldForwardProp);var p,m=new z4(n,d,r?e.componentStyle:void 0),v=m.isStatic&&a.length===0,w=function(b,x){return function(S,C,N,R){var T=S.attrs,M=S.componentStyle,A=S.defaultProps,k=S.foldedComponentIds,F=S.shouldForwardProp,L=S.styledComponentId,Y=S.target,ne=function(ae,j,G){ae===void 0&&(ae=lo);var $=$r({},j,{theme:ae}),te={};return G.forEach(function(ie){var re,z,se,oe=ie;for(re in Vs(oe)&&(oe=oe($)),oe)$[re]=te[re]=re==="className"?(z=te[re],se=oe[re],z&&se?z+" "+se:z||se):oe[re]}),[$,te]}(Q4(C,E.useContext(Ax),A)||lo,C,T),q=ne[0],X=ne[1],B=function(ae,j,G,$){var te=W4(),ie=G4(),re=j?ae.generateAndInjectStyles(lo,te,ie):ae.generateAndInjectStyles(G,te,ie);return re}(M,R,q),ee=N,Z=X.$as||C.$as||X.as||C.as||Y,J=ou(Z),H=X!==C?$r({},C,{},X):C,O={};for(var V in H)V[0]!=="$"&&V!=="as"&&(V==="forwardedAs"?O.as=H[V]:(F?F(V,hx,Z):!J||hx(V))&&(O[V]=H[V]));return C.style&&X.style!==C.style&&(O.style=$r({},C.style,{},X.style)),O.className=Array.prototype.concat(k,L,B!==L?B:null,C.className,X.className).filter(Boolean).join(" "),O.ref=ee,E.createElement(Z,O)}(p,b,x,v)};return w.displayName=u,(p=E.forwardRef(w)).attrs=f,p.componentStyle=m,p.displayName=u,p.shouldForwardProp=h,p.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):eu,p.styledComponentId=d,p.target=r?e.target:e,p.withComponent=function(b){var x=t.componentId,S=function(N,R){if(N==null)return{};var T,M,A={},k=Object.keys(N);for(M=0;M<k.length;M++)T=k[M],R.indexOf(T)>=0||(A[T]=N[T]);return A}(t,["componentId"]),C=x&&x+"-"+(ou(b)?b:Ih(bx(b)));return kx(b,$r({},S,{attrs:f,componentId:C}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=r?Dx({},e.defaultProps,b):b}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),o&&S4(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var co=function(e){return function t(n,r,o){if(o===void 0&&(o=lo),!Ph.isValidElementType(r))return Ws(1,String(r));var i=function(){return n(r,o,J4.apply(void 0,arguments))};return i.withConfig=function(a){return t(n,r,$r({},o,{},a))},i.attrs=function(a){return t(n,r,$r({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}(kx,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){co[e]=co(e)});const Ix=E.createContext(null),Ox=()=>{const e=E.useContext(Ix);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},i5=({children:e})=>{const[t,n]=E.useState(0),r=E.useCallback(async i=>{n(a=>a+1);try{return await i}finally{n(a=>Math.max(0,a-1))}},[]),o=E.useCallback(async(i,a)=>(n(s=>s+1),new Promise((s,l)=>{const c=i(),u=()=>{n(d=>Math.max(0,d-1))};c.addEventListener("load",()=>{if(u(),c.status>=200&&c.status<300)try{const d=a(c);s(d)}catch(d){l(d)}else l(new Error(`Request failed with status ${c.status}`))}),c.addEventListener("error",()=>{u(),l(new Error("Network error occurred"))}),c.addEventListener("abort",()=>{u(),l(new Error("Request cancelled"))})})),[]);return g.jsx(Ix.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:o},children:e})},$h=e=>{const t=e;return{createProject:async(M,A)=>{const k={description:M,component_namespace:A};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async M=>await fetch(`${t}/subdomains?project_name=${M}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(M,A)=>{const k={project_name:M,subdomain:A};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},updateSubdomain:async(M,A)=>{const k={project_name:M,subdomain:A};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},releaseSubdomain:async(M,A)=>{const k={project_name:M,subdomain:A};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},publishProject:async(M,A)=>{const k={project_name:M,git_ref:A};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},unpublishProject:async M=>{const A={project_name:M};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},tagCommit:async(M,A,k)=>{const F={project_name:M,commit_hash:A,tag_name:k};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(M,A,k,F)=>{const L={project_name:M,component_namespace:A,component_name:k,layout_metadata:F};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})},addProjectChart:async(M,A,k)=>{const F={project_name:M,visual_id:A,layout_metadata:k};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},updateProjectComponentLayoutMetadata:async(M,A,k)=>{const F={project_name:M,component_id:A,layout_metadata:k};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},updateProjectComponentSourceCode:async(M,A,k)=>{const F={project_name:M,component_id:A,source_code:k};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},updateApplicationMetadata:async(M,A,k,F)=>{const L={project_name:M,application_name:A,application_description:k,application_category:F};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})},updateApplicationSettings:async(M,A)=>{const k={project_name:M,application_login_enabled:A};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},updateProjectTheme:async(M,A)=>{const k={project_name:M,theme:A};return await fetch(`${t}/update_project_theme`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},deleteProjectFile:async(M,A)=>{const k={project_name:M,file_path:A};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},resetProjectFile:async(M,A,k,F,L)=>{let Y={project_name:M,file_path:A,git_ref:k};return F&&(Y.prune=F),L&&(Y.extra_metadata=L),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})},deleteProject:async M=>{const A={projects:[M]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},requestErrorCorrection:async(M,A,k)=>{const F={project_name:M,component_id:A,error_message:k};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},addImage:async M=>await fetch(`${t}/add_image`,{method:"POST",body:M}),updateProjectFile:async(M,A,k)=>{const F={file_path:M,project_name:A,source_code:k};return await fetch(`${t}/update_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})}}},jx=e=>{const t=e;return{getQueryContent:async i=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:i,biscuits:[]})}),getVisuals:async(i,a,s,l,c,u,d,f)=>{const h=new URLSearchParams({pageNo:i.toString(),pageSize:a.toString(),scope:s,searchPattern:l,sortBy:c,sortOrder:u,visibility:d,visualType:f}).toString();return await fetch(`${t}/v2/content/visuals?${h}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},Fh=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(S,C)=>await fetch(`${t}/config/secrets/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),getSecret:async S=>await fetch(`${t}/config/secrets/${S}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async S=>await fetch(`${t}/config/secrets/${S}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async S=>await fetch(`${t}/config/miniapps/${S}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/tier-key-map/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:N})}),getTierKeyMapForTier:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/tier-key-map/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/tier-key-map/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async S=>await fetch(`${t}/config/miniapps/${S}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/assignments/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:N})}),getTierAssignment:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/assignments/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/assignments/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async S=>await fetch(`${t}/config/miniapps/${S}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(S,C,N,R)=>await fetch(`${t}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),getRateLimit:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:S=>async(C,N)=>{const R=C instanceof URL?C:new URL(C.toString());return await fetch(`${t}/proxy/${S.miniappName}/${R.host}${R.pathname}${R.search}${R.hash}`,N)},createProxyGetView:S=>{const C=new URL(S.gwProxyUrl).hostname;return async(N,R,T={})=>{let M=`SELECT * FROM ${N}.${R}`;T&&Object.keys(T).length>0&&(M+=`(${Object.entries(T).map(([F,L])=>`'${F}=${L}'`).join(",")})`);const A=await fetch(`${t}/proxy/${S.miniappName}/${C}/v1/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:M})});if(!A.ok)throw new Error(`Failed to fetch view: ${A.statusText}`);return await A.json()}}}};for(var At=[],Lh=0;Lh<256;++Lh)At.push((Lh+256).toString(16).slice(1));function a5(e,t=0){return(At[e[t+0]]+At[e[t+1]]+At[e[t+2]]+At[e[t+3]]+"-"+At[e[t+4]]+At[e[t+5]]+"-"+At[e[t+6]]+At[e[t+7]]+"-"+At[e[t+8]]+At[e[t+9]]+"-"+At[e[t+10]]+At[e[t+11]]+At[e[t+12]]+At[e[t+13]]+At[e[t+14]]+At[e[t+15]]).toLowerCase()}var iu,s5=new Uint8Array(16);function l5(){if(!iu&&(iu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!iu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return iu(s5)}var c5=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const $x={randomUUID:c5};function Fx(e,t,n){if($x.randomUUID&&!e)return $x.randomUUID();e=e||{};var r=e.random||(e.rng||l5)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,a5(r)}function u5(e){return typeof e=="function"}const d5=e=>{const{wrapAPICall:t}=Ox(),n=$h(e);return new Proxy(n,{get:(o,i)=>{const a=o[i];return u5(a)?(...s)=>t(a.apply(o,s)):a}})},zh=E.createContext(null);zh.Consumer;const f5=e=>{const[t,n]=E.useState({projectName:null,projectURL:null}),[r,o]=E.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[i,a]=E.useState(()=>jx(e.config.GW_BASE_URL)),[s,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(""),[m,v]=E.useState([]),[w,b]=E.useState(Fx()),x=d5(e.config.API_BASE_URL),S=$h(e.config.API_BASE_URL),C=x||S,[N,R]=E.useState(()=>Fh(e.config.PROXY_API_BASE_URL)),[T,M]=E.useState(null),[A,k]=E.useState(null),[F,L]=E.useState(),[Y,ne]=E.useState(!1),q=()=>{b(Fx())},X=(B,ee)=>{if(!B)return;F&&(F.close(),ne(!1));const Z=localStorage.getItem("accessToken")||"",J=`${r.WS_BASE_URL}/ws/chat/${B}?token=${Z}`;if(!J.startsWith("ws://")&&!J.startsWith("wss://")){ee.onerror({customWebsocketError:"INVALID_URL"});return}const H=new WebSocket(J);H.onopen=()=>{ne(!0),ee.onopen()},H.onclose=O=>{ne(!1),ee.onclose(O)},H.onerror=O=>{ee.onerror(O)},H.onmessage=O=>{ee.onmessage(O)},L(H)};return E.useEffect(()=>{o(e==null?void 0:e.config)},[e.config]),E.useEffect(()=>{if(!(r!=null&&r.PROXY_API_BASE_URL)||!(r!=null&&r.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}return a(jx(r.GW_BASE_URL)),R(B=>{const ee=Fh(r.PROXY_API_BASE_URL);M(ee.createProxyFetch({miniappName:t.projectName}));const Z=ee.createProxyGetView({miniappName:t.projectName,gwProxyUrl:r.GW_PROXY_URL}),J=async(H,O,V={})=>{if(typeof H!="string"||typeof O!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof H}, viewName: ${typeof O}`);return Z(H,O,V)};return k(()=>J),ee}),()=>{F&&F.close()}},[r,t]),g.jsx(zh.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,handledRequestComponentIds:m,setHandledRequestComponentIds:v,syncToken:w,setSyncToken:q,selectedComponentId:c,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:f,selectedComponentHTML:h,setSelectedComponentHTML:p,isComponentSubselected:s,setIsComponentSubselected:l,APIHandler:C,gwAPIHandler:i,proxyHandler:N,proxyFetch:T,proxyGetView:A,startChatbot:X,chatbotWebsocket:F,chatbotWebsocketConnected:Y},children:e.children})},h5=e=>g.jsx(i5,{children:g.jsx(f5,{...e})}),Bh=()=>{const e=E.useContext(zh);if(e===null)throw new Error("Invalid project context.");return{...e}},p5=co.div`
121
122
  position: fixed;
122
123
  top: 0;
123
124
  left: 0;
@@ -128,7 +129,7 @@ object-assign
128
129
  justify-content: center;
129
130
  align-items: center;
130
131
  z-index: 10000; /* Increased z-index to be higher than all other components (others use 9999) */
131
- `,tv=gr.div`
132
+ `,m5=co.div`
132
133
  border: 4px solid rgba(255, 255, 255, 0.3);
133
134
  border-top: 4px solid white;
134
135
  border-radius: 50%;
@@ -144,9 +145,9 @@ object-assign
144
145
  transform: rotate(360deg);
145
146
  }
146
147
  }
147
- `,rv=({isVisible:e})=>e?ve.jsx(ev,{children:ve.jsx(tv,{})}):null;var fd={exports:{}},_i={},Os={exports:{}};(function(e,t){(function(r,n){n(t)})(Ci,function(r){function n(D){return function(Z,X,F,V,re,Q,le){return D(Z,X,le)}}function i(D){return function(Z,X,F,V){if(!Z||!X||typeof Z!="object"||typeof X!="object")return D(Z,X,F,V);var re=V.get(Z),Q=V.get(X);if(re&&Q)return re===X&&Q===Z;V.set(Z,X),V.set(X,Z);var le=D(Z,X,F,V);return V.delete(Z),V.delete(X),le}}function a(D,q){var Z={};for(var X in D)Z[X]=D[X];for(var X in q)Z[X]=q[X];return Z}function o(D){return D.constructor===Object||D.constructor==null}function s(D){return typeof D.then=="function"}function l(D,q){return D===q||D!==D&&q!==q}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",m="[object Map]",g="[object Number]",_="[object Object]",x="[object Set]",y="[object String]",v=Object.prototype.toString;function O(D){var q=D.areArraysEqual,Z=D.areDatesEqual,X=D.areMapsEqual,F=D.areObjectsEqual,V=D.areRegExpsEqual,re=D.areSetsEqual,Q=D.createIsNestedEqual,le=Q(ne);function ne(ie,Re,Ee){if(ie===Re)return!0;if(!ie||!Re||typeof ie!="object"||typeof Re!="object")return ie!==ie&&Re!==Re;if(o(ie)&&o(Re))return F(ie,Re,le,Ee);var Et=Array.isArray(ie),We=Array.isArray(Re);if(Et||We)return Et===We&&q(ie,Re,le,Ee);var Ae=v.call(ie);return Ae!==v.call(Re)?!1:Ae===d?Z(ie,Re,le,Ee):Ae===p?V(ie,Re,le,Ee):Ae===m?X(ie,Re,le,Ee):Ae===x?re(ie,Re,le,Ee):Ae===_||Ae===c?s(ie)||s(Re)?!1:F(ie,Re,le,Ee):Ae===u||Ae===g||Ae===y?l(ie.valueOf(),Re.valueOf()):!1}return ne}function R(D,q,Z,X){var F=D.length;if(q.length!==F)return!1;for(;F-- >0;)if(!Z(D[F],q[F],F,F,D,q,X))return!1;return!0}var b=i(R);function C(D,q){return l(D.valueOf(),q.valueOf())}function k(D,q,Z,X){var F=D.size===q.size;if(!F)return!1;if(!D.size)return!0;var V={},re=0;return D.forEach(function(Q,le){if(F){var ne=!1,ie=0;q.forEach(function(Re,Ee){!ne&&!V[ie]&&(ne=Z(le,Ee,re,ie,D,q,X)&&Z(Q,Re,le,Ee,D,q,X))&&(V[ie]=!0),ie++}),re++,F=ne}}),F}var S=i(k),P="_owner",$=Object.prototype.hasOwnProperty;function B(D,q,Z,X){var F=Object.keys(D),V=F.length;if(Object.keys(q).length!==V)return!1;for(var re;V-- >0;){if(re=F[V],re===P){var Q=!!D.$$typeof,le=!!q.$$typeof;if((Q||le)&&Q!==le)return!1}if(!$.call(q,re)||!Z(D[re],q[re],re,re,D,q,X))return!1}return!0}var M=i(B);function H(D,q){return D.source===q.source&&D.flags===q.flags}function Y(D,q,Z,X){var F=D.size===q.size;if(!F)return!1;if(!D.size)return!0;var V={};return D.forEach(function(re,Q){if(F){var le=!1,ne=0;q.forEach(function(ie,Re){!le&&!V[ne]&&(le=Z(re,ie,Q,Re,D,q,X))&&(V[ne]=!0),ne++}),F=le}}),F}var ue=i(Y),Te=Object.freeze({areArraysEqual:R,areDatesEqual:C,areMapsEqual:k,areObjectsEqual:B,areRegExpsEqual:H,areSetsEqual:Y,createIsNestedEqual:n}),me=Object.freeze({areArraysEqual:b,areDatesEqual:C,areMapsEqual:S,areObjectsEqual:M,areRegExpsEqual:H,areSetsEqual:ue,createIsNestedEqual:n}),ge=O(Te);function Pe(D,q){return ge(D,q,void 0)}var Ue=O(a(Te,{createIsNestedEqual:function(){return l}}));function oe(D,q){return Ue(D,q,void 0)}var L=O(me);function W(D,q){return L(D,q,new WeakMap)}var G=O(a(me,{createIsNestedEqual:function(){return l}}));function te(D,q){return G(D,q,new WeakMap)}function I(D){return O(a(Te,D(Te)))}function ee(D){var q=O(a(me,D(me)));return function(Z,X,F){return F===void 0&&(F=new WeakMap),q(Z,X,F)}}r.circularDeepEqual=W,r.circularShallowEqual=te,r.createCustomCircularEqual=ee,r.createCustomEqual=I,r.deepEqual=Pe,r.sameValueZeroEqual=l,r.shallowEqual=oe,Object.defineProperty(r,"__esModule",{value:!0})})})(Os,Os.exports);var Cs=Os.exports,Ts={exports:{}};function dd(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=dd(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function hd(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=dd(e))&&(n&&(n+=" "),n+=t);return n}Ts.exports=hd,Ts.exports.clsx=hd;var Ps=Ts.exports,he={},nv=function(t,r,n){return t===r?!0:t.className===r.className&&n(t.style,r.style)&&t.width===r.width&&t.autoSize===r.autoSize&&t.cols===r.cols&&t.draggableCancel===r.draggableCancel&&t.draggableHandle===r.draggableHandle&&n(t.verticalCompact,r.verticalCompact)&&n(t.compactType,r.compactType)&&n(t.layout,r.layout)&&n(t.margin,r.margin)&&n(t.containerPadding,r.containerPadding)&&t.rowHeight===r.rowHeight&&t.maxRows===r.maxRows&&t.isBounded===r.isBounded&&t.isDraggable===r.isDraggable&&t.isResizable===r.isResizable&&t.allowOverlap===r.allowOverlap&&t.preventCollision===r.preventCollision&&t.useCSSTransforms===r.useCSSTransforms&&t.transformScale===r.transformScale&&t.isDroppable===r.isDroppable&&n(t.resizeHandles,r.resizeHandles)&&n(t.resizeHandle,r.resizeHandle)&&t.onLayoutChange===r.onLayoutChange&&t.onDragStart===r.onDragStart&&t.onDrag===r.onDrag&&t.onDragStop===r.onDragStop&&t.onResizeStart===r.onResizeStart&&t.onResize===r.onResize&&t.onResizeStop===r.onResizeStop&&t.onDrop===r.onDrop&&n(t.droppingItem,r.droppingItem)&&n(t.innerRef,r.innerRef)};Object.defineProperty(he,"__esModule",{value:!0}),he.bottom=As,he.childrenEqual=ov,he.cloneLayout=md,he.cloneLayoutItem=jr,he.collides=Ca,he.compact=gd,he.compactItem=yd,he.compactType=wv,he.correctBounds=bd,he.fastPositionEqual=sv,he.fastRGLPropsEqual=void 0,he.getAllCollisions=_d,he.getFirstCollision=Br,he.getLayoutItem=Ds,he.getStatics=Is,he.modifyLayout=wd,he.moveElement=xi,he.moveElementAwayFromCollision=js,he.noop=void 0,he.perc=lv,he.resizeItemInDirection=fv,he.setTopLeft=hv,he.setTransform=dv,he.sortLayoutItems=Fs,he.sortLayoutItemsByColRow=kd,he.sortLayoutItemsByRowCol=Sd,he.synchronizeLayoutWithChildren=pv,he.validateLayout=mv,he.withLayoutItem=av;var pd=Cs,vi=iv(K);function iv(e){return e&&e.__esModule?e:{default:e}}function As(e){let t=0,r;for(let n=0,i=e.length;n<i;n++)r=e[n].y+e[n].h,r>t&&(t=r);return t}function md(e){const t=Array(e.length);for(let r=0,n=e.length;r<n;r++)t[r]=jr(e[r]);return t}function wd(e,t){const r=Array(e.length);for(let n=0,i=e.length;n<i;n++)t.i===e[n].i?r[n]=t:r[n]=e[n];return r}function av(e,t,r){let n=Ds(e,t);return n?(n=r(jr(n)),e=wd(e,n),[e,n]):[e,null]}function jr(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function ov(e,t){return(0,pd.deepEqual)(vi.default.Children.map(e,r=>r==null?void 0:r.key),vi.default.Children.map(t,r=>r==null?void 0:r.key))&&(0,pd.deepEqual)(vi.default.Children.map(e,r=>r==null?void 0:r.props["data-grid"]),vi.default.Children.map(t,r=>r==null?void 0:r.props["data-grid"]))}he.fastRGLPropsEqual=nv;function sv(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ca(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function gd(e,t,r,n){const i=Is(e),a=Fs(e,t),o=Array(e.length);for(let s=0,l=a.length;s<l;s++){let c=jr(a[s]);c.static||(c=yd(i,c,t,r,a,n),i.push(c)),o[e.indexOf(a[s])]=c,c.moved=!1}return o}const cv={x:"w",y:"h"};function $s(e,t,r,n){const i=cv[n];t[n]+=1;const a=e.map(o=>o.i).indexOf(t.i);for(let o=a+1;o<e.length;o++){const s=e[o];if(!s.static){if(s.y>t.y+t.h)break;Ca(t,s)&&$s(e,s,r+t[i],n)}}t[n]=r}function yd(e,t,r,n,i,a){const o=r==="vertical",s=r==="horizontal";if(o)for(t.y=Math.min(As(e),t.y);t.y>0&&!Br(e,t);)t.y--;else if(s)for(;t.x>0&&!Br(e,t);)t.x--;let l;for(;(l=Br(e,t))&&!(r===null&&a);)if(s?$s(i,t,l.x+l.w,"x"):$s(i,t,l.y+l.h,"y"),s&&t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Br(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function bd(e,t){const r=Is(e);for(let n=0,i=e.length;n<i;n++){const a=e[n];if(a.x+a.w>t.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),!a.static)r.push(a);else for(;Br(r,a);)a.y++}return e}function Ds(e,t){for(let r=0,n=e.length;r<n;r++)if(e[r].i===t)return e[r]}function Br(e,t){for(let r=0,n=e.length;r<n;r++)if(Ca(e[r],t))return e[r]}function _d(e,t){return e.filter(r=>Ca(r,t))}function Is(e){return e.filter(t=>t.static)}function xi(e,t,r,n,i,a,o,s,l){if(t.static&&t.isDraggable!==!0||t.y===n&&t.x===r)return e;`${t.i}${String(r)}${String(n)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof r=="number"&&(t.x=r),typeof n=="number"&&(t.y=n),t.moved=!0;let d=Fs(e,o);(o==="vertical"&&typeof n=="number"?u>=n:o==="horizontal"&&typeof r=="number"?c>=r:!1)&&(d=d.reverse());const m=_d(d,t),g=m.length>0;if(g&&l)return md(e);if(g&&a)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let _=0,x=m.length;_<x;_++){const y=m[_];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=js(e,y,t,i,o):e=js(e,t,y,i,o))}return e}function js(e,t,r,n,i,a){const o=i==="horizontal",s=i==="vertical",l=t.static;if(n){n=!1;const d={x:o?Math.max(t.x-r.w,0):r.x,y:s?Math.max(t.y-r.h,0):r.y,w:r.w,h:r.h,i:"-1"},p=Br(e,d),m=p&&p.y+p.h>t.y,g=p&&t.x+t.w>p.x;if(p){if(m&&s)return xi(e,r,void 0,t.y+1,n,l,i);if(m&&i==null)return t.y=r.y,r.y=r.y+r.h,e;if(g&&o)return xi(e,t,r.x,void 0,n,l,i)}else return`${r.i}${d.x}${d.y}`,xi(e,r,o?d.x:void 0,s?d.y:void 0,n,l,i)}const c=o?r.x+1:void 0,u=s?r.y+1:void 0;return c==null&&u==null?e:xi(e,r,o?r.x+1:void 0,s?r.y+1:void 0,n,l,i)}function lv(e){return e*100+"%"}const vd=(e,t,r,n)=>e+r>n?t:r,xd=(e,t,r)=>e<0?t:r,Ed=e=>Math.max(0,e),Bs=e=>Math.max(0,e),zs=(e,t,r)=>{let{left:n,height:i,width:a}=t;const o=e.top-(i-e.height);return{left:n,width:a,height:xd(o,e.height,i),top:Bs(o)}},Ns=(e,t,r)=>{let{top:n,left:i,height:a,width:o}=t;return{top:n,height:a,width:vd(e.left,e.width,o,r),left:Ed(i)}},Ms=(e,t,r)=>{let{top:n,height:i,width:a}=t;const o=e.left-(a-e.width);return{height:i,width:o<0?e.width:vd(e.left,e.width,a,r),top:Bs(n),left:Ed(o)}},Ls=(e,t,r)=>{let{top:n,left:i,height:a,width:o}=t;return{width:o,left:i,height:xd(n,e.height,a),top:Bs(n)}},uv={n:zs,ne:function(){return zs(arguments.length<=0?void 0:arguments[0],Ns(...arguments))},e:Ns,se:function(){return Ls(arguments.length<=0?void 0:arguments[0],Ns(...arguments))},s:Ls,sw:function(){return Ls(arguments.length<=0?void 0:arguments[0],Ms(...arguments))},w:Ms,nw:function(){return zs(arguments.length<=0?void 0:arguments[0],Ms(...arguments))}};function fv(e,t,r,n){const i=uv[e];return i?i(t,{...t,...r},n):r}function dv(e){let{top:t,left:r,width:n,height:i}=e;const a=`translate(${r}px,${t}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${n}px`,height:`${i}px`,position:"absolute"}}function hv(e){let{top:t,left:r,width:n,height:i}=e;return{top:`${t}px`,left:`${r}px`,width:`${n}px`,height:`${i}px`,position:"absolute"}}function Fs(e,t){return t==="horizontal"?kd(e):t==="vertical"?Sd(e):e}function Sd(e){return e.slice(0).sort(function(t,r){return t.y>r.y||t.y===r.y&&t.x>r.x?1:t.y===r.y&&t.x===r.x?0:-1})}function kd(e){return e.slice(0).sort(function(t,r){return t.x>r.x||t.x===r.x&&t.y>r.y?1:-1})}function pv(e,t,r,n,i){e=e||[];const a=[];vi.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=Ds(e,String(s.key)),c=s.props["data-grid"];l&&c==null?a.push(jr(l)):c?a.push(jr({...c,i:s.key})):a.push(jr({w:1,h:1,x:0,y:As(a),i:String(s.key)}))});const o=bd(a,{cols:r});return i?o:gd(o,n,r)}function mv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const r=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let n=0,i=e.length;n<i;n++){const a=e[n];for(let o=0;o<r.length;o++){const s=r[o],l=a[s];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${n}].${s} must be a number! Received: ${l} (${typeof l})`)}if(typeof a.i<"u"&&typeof a.i!="string")throw new Error(`ReactGridLayout: ${t}[${n}].i must be a string! Received: ${a.i} (${typeof a.i})`)}}function wv(e){const{verticalCompact:t,compactType:r}=e||{};return t===!1?null:r}function Xx(){}const gv=()=>{};he.noop=gv;var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.calcGridColWidth=Ta,Ut.calcGridItemPosition=yv,Ut.calcGridItemWHPx=Us,Ut.calcWH=_v,Ut.calcXY=bv,Ut.clamp=zr;function Ta(e){const{margin:t,containerPadding:r,containerWidth:n,cols:i}=e;return(n-t[0]*(i-1)-r[0]*2)/i}function Us(e,t,r){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*r):e}function yv(e,t,r,n,i,a){const{margin:o,containerPadding:s,rowHeight:l}=e,c=Ta(e),u={};return a&&a.resizing?(u.width=Math.round(a.resizing.width),u.height=Math.round(a.resizing.height)):(u.width=Us(n,c,o[0]),u.height=Us(i,l,o[1])),a&&a.dragging?(u.top=Math.round(a.dragging.top),u.left=Math.round(a.dragging.left)):a&&a.resizing&&typeof a.resizing.top=="number"&&typeof a.resizing.left=="number"?(u.top=Math.round(a.resizing.top),u.left=Math.round(a.resizing.left)):(u.top=Math.round((l+o[1])*r+s[1]),u.left=Math.round((c+o[0])*t+s[0])),u}function bv(e,t,r,n,i){const{margin:a,containerPadding:o,cols:s,rowHeight:l,maxRows:c}=e,u=Ta(e);let d=Math.round((r-o[0])/(u+a[0])),p=Math.round((t-o[1])/(l+a[1]));return d=zr(d,0,s-n),p=zr(p,0,c-i),{x:d,y:p}}function _v(e,t,r,n,i,a){const{margin:o,maxRows:s,cols:l,rowHeight:c}=e,u=Ta(e);let d=Math.round((t+o[0])/(u+o[0])),p=Math.round((r+o[1])/(c+o[1])),m=zr(d,0,l-n),g=zr(p,0,s-i);return["sw","w","nw"].indexOf(a)!==-1&&(m=zr(d,0,l)),["nw","n","ne"].indexOf(a)!==-1&&(g=zr(p,0,s)),{w:m,h:g}}function zr(e,t,r){return Math.max(Math.min(e,r),t)}var Pa={},Rd={exports:{}},vv="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xv=vv,Ev=xv;function Od(){}function Cd(){}Cd.resetWarningCache=Od;var Sv=function(){function e(n,i,a,o,s,l){if(l!==Ev){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Cd,resetWarningCache:Od};return r.PropTypes=r,r};Rd.exports=Sv();var yr=Rd.exports,Aa={exports:{}},Td={};function Pd(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Pd(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ad(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Pd(e))&&(n&&(n+=" "),n+=t);return n}const kv=Xa(Object.freeze(Object.defineProperty({__proto__:null,clsx:Ad,default:Ad},Symbol.toStringTag,{value:"Module"})));var Be={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.dontSetMe=Pv,Ht.findInArray=Rv,Ht.int=Tv,Ht.isFunction=Ov,Ht.isNum=Cv;function Rv(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]}function Ov(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Cv(e){return typeof e=="number"&&!isNaN(e)}function Tv(e){return parseInt(e,10)}function Pv(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))}var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.browserPrefixToKey=Dd,Nr.browserPrefixToStyle=Av,Nr.default=void 0,Nr.getPrefix=$d;const Hs=["Moz","Webkit","O","ms"];function $d(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const r=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!r||t in r)return"";for(let n=0;n<Hs.length;n++)if(Dd(t,Hs[n])in r)return Hs[n];return""}function Dd(e,t){return t?"".concat(t).concat($v(e)):e}function Av(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function $v(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):e[n]==="-"?r=!0:t+=e[n];return t}Nr.default=$d(),Object.defineProperty(Be,"__esModule",{value:!0}),Be.addClassName=zd,Be.addEvent=jv,Be.addUserSelectStyles=qv,Be.createCSSTransform=Uv,Be.createSVGTransform=Hv,Be.getTouch=Wv,Be.getTouchIdentifier=Gv,Be.getTranslation=Ws,Be.innerHeight=Mv,Be.innerWidth=Lv,Be.matchesSelector=Bd,Be.matchesSelectorAndParentsTo=Iv,Be.offsetXYFromParent=Fv,Be.outerHeight=zv,Be.outerWidth=Nv,Be.removeClassName=Nd,Be.removeEvent=Bv,Be.removeUserSelectStyles=Yv;var wt=Ht,Id=Dv(Nr);function jd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(jd=function(n){return n?r:t})(e)}function Dv(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=jd(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}let $a="";function Bd(e,t){return $a||($a=(0,wt.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(r){return(0,wt.isFunction)(e[r])})),(0,wt.isFunction)(e[$a])?e[$a](t):!1}function Iv(e,t,r){let n=e;do{if(Bd(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1}function jv(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r}function Bv(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null}function zv(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,wt.int)(r.borderTopWidth),t+=(0,wt.int)(r.borderBottomWidth),t}function Nv(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,wt.int)(r.borderLeftWidth),t+=(0,wt.int)(r.borderRightWidth),t}function Mv(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,wt.int)(r.paddingTop),t-=(0,wt.int)(r.paddingBottom),t}function Lv(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,wt.int)(r.paddingLeft),t-=(0,wt.int)(r.paddingRight),t}function Fv(e,t,r){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),a=(e.clientX+t.scrollLeft-i.left)/r,o=(e.clientY+t.scrollTop-i.top)/r;return{x:a,y:o}}function Uv(e,t){const r=Ws(e,t,"px");return{[(0,Id.browserPrefixToKey)("transform",Id.default)]:r}}function Hv(e,t){return Ws(e,t,"")}function Ws(e,t,r){let{x:n,y:i}=e,a="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+r),s="".concat(typeof t.y=="string"?t.y:t.y+r);a="translate(".concat(o,", ").concat(s,")")+a}return a}function Wv(e,t){return e.targetTouches&&(0,wt.findInArray)(e.targetTouches,r=>t===r.identifier)||e.changedTouches&&(0,wt.findInArray)(e.changedTouches,r=>t===r.identifier)}function Gv(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function qv(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
148
+ `,g5=({isVisible:e})=>e?g.jsx(p5,{children:g.jsx(m5,{})}):null;var Lx={exports:{}},qs={},Hh={exports:{}};(function(e,t){(function(n,r){r(t)})(rc,function(n){function r($){return function(ie,re,z,se,oe,fe,ge){return $(ie,re,ge)}}function o($){return function(ie,re,z,se){if(!ie||!re||typeof ie!="object"||typeof re!="object")return $(ie,re,z,se);var oe=se.get(ie),fe=se.get(re);if(oe&&fe)return oe===re&&fe===ie;se.set(ie,re),se.set(re,ie);var ge=$(ie,re,z,se);return se.delete(ie),se.delete(re),ge}}function i($,te){var ie={};for(var re in $)ie[re]=$[re];for(var re in te)ie[re]=te[re];return ie}function a($){return $.constructor===Object||$.constructor==null}function s($){return typeof $.then=="function"}function l($,te){return $===te||$!==$&&te!==te}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",f="[object RegExp]",h="[object Map]",p="[object Number]",m="[object Object]",v="[object Set]",w="[object String]",b=Object.prototype.toString;function x($){var te=$.areArraysEqual,ie=$.areDatesEqual,re=$.areMapsEqual,z=$.areObjectsEqual,se=$.areRegExpsEqual,oe=$.areSetsEqual,fe=$.createIsNestedEqual,ge=fe(pe);function pe(me,_e,Re){if(me===_e)return!0;if(!me||!_e||typeof me!="object"||typeof _e!="object")return me!==me&&_e!==_e;if(a(me)&&a(_e))return z(me,_e,ge,Re);var nt=Array.isArray(me),Ie=Array.isArray(_e);if(nt||Ie)return nt===Ie&&te(me,_e,ge,Re);var Me=b.call(me);return Me!==b.call(_e)?!1:Me===d?ie(me,_e,ge,Re):Me===f?se(me,_e,ge,Re):Me===h?re(me,_e,ge,Re):Me===v?oe(me,_e,ge,Re):Me===m||Me===c?s(me)||s(_e)?!1:z(me,_e,ge,Re):Me===u||Me===p||Me===w?l(me.valueOf(),_e.valueOf()):!1}return pe}function S($,te,ie,re){var z=$.length;if(te.length!==z)return!1;for(;z-- >0;)if(!ie($[z],te[z],z,z,$,te,re))return!1;return!0}var C=o(S);function N($,te){return l($.valueOf(),te.valueOf())}function R($,te,ie,re){var z=$.size===te.size;if(!z)return!1;if(!$.size)return!0;var se={},oe=0;return $.forEach(function(fe,ge){if(z){var pe=!1,me=0;te.forEach(function(_e,Re){!pe&&!se[me]&&(pe=ie(ge,Re,oe,me,$,te,re)&&ie(fe,_e,ge,Re,$,te,re))&&(se[me]=!0),me++}),oe++,z=pe}}),z}var T=o(R),M="_owner",A=Object.prototype.hasOwnProperty;function k($,te,ie,re){var z=Object.keys($),se=z.length;if(Object.keys(te).length!==se)return!1;for(var oe;se-- >0;){if(oe=z[se],oe===M){var fe=!!$.$$typeof,ge=!!te.$$typeof;if((fe||ge)&&fe!==ge)return!1}if(!A.call(te,oe)||!ie($[oe],te[oe],oe,oe,$,te,re))return!1}return!0}var F=o(k);function L($,te){return $.source===te.source&&$.flags===te.flags}function Y($,te,ie,re){var z=$.size===te.size;if(!z)return!1;if(!$.size)return!0;var se={};return $.forEach(function(oe,fe){if(z){var ge=!1,pe=0;te.forEach(function(me,_e){!ge&&!se[pe]&&(ge=ie(oe,me,fe,_e,$,te,re))&&(se[pe]=!0),pe++}),z=ge}}),z}var ne=o(Y),q=Object.freeze({areArraysEqual:S,areDatesEqual:N,areMapsEqual:R,areObjectsEqual:k,areRegExpsEqual:L,areSetsEqual:Y,createIsNestedEqual:r}),X=Object.freeze({areArraysEqual:C,areDatesEqual:N,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:L,areSetsEqual:ne,createIsNestedEqual:r}),B=x(q);function ee($,te){return B($,te,void 0)}var Z=x(i(q,{createIsNestedEqual:function(){return l}}));function J($,te){return Z($,te,void 0)}var H=x(X);function O($,te){return H($,te,new WeakMap)}var V=x(i(X,{createIsNestedEqual:function(){return l}}));function ae($,te){return V($,te,new WeakMap)}function j($){return x(i(q,$(q)))}function G($){var te=x(i(X,$(X)));return function(ie,re,z){return z===void 0&&(z=new WeakMap),te(ie,re,z)}}n.circularDeepEqual=O,n.circularShallowEqual=ae,n.createCustomCircularEqual=G,n.createCustomEqual=j,n.deepEqual=ee,n.sameValueZeroEqual=l,n.shallowEqual=J,Object.defineProperty(n,"__esModule",{value:!0})})})(Hh,Hh.exports);var Uh=Hh.exports;function zx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=zx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function au(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=zx(e))&&(r&&(r+=" "),r+=t);return r}const Vh=oc(Object.freeze(Object.defineProperty({__proto__:null,clsx:au,default:au},Symbol.toStringTag,{value:"Module"})));var Fe={},w5=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.bottom=Wh,Fe.childrenEqual=b5,Fe.cloneLayout=Hx,Fe.cloneLayoutItem=Go,Fe.collides=su,Fe.compact=Vx,Fe.compactItem=Wx,Fe.compactType=M5,Fe.correctBounds=Gx,Fe.fastPositionEqual=x5,Fe.fastRGLPropsEqual=void 0,Fe.getAllCollisions=qx,Fe.getFirstCollision=qo,Fe.getLayoutItem=qh,Fe.getStatics=Yh,Fe.modifyLayout=Ux,Fe.moveElement=Ks,Fe.moveElementAwayFromCollision=Kh,Fe.noop=void 0,Fe.perc=S5,Fe.resizeItemInDirection=E5,Fe.setTopLeft=R5,Fe.setTransform=P5,Fe.sortLayoutItems=tp,Fe.sortLayoutItemsByColRow=Jx,Fe.sortLayoutItemsByRowCol=Zx,Fe.synchronizeLayoutWithChildren=N5,Fe.validateLayout=T5,Fe.withLayoutItem=y5;var Bx=Uh,Ys=v5(E);function v5(e){return e&&e.__esModule?e:{default:e}}function Wh(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function Hx(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Go(e[n]);return t}function Ux(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function y5(e,t,n){let r=qh(e,t);return r?(r=n(Go(r)),e=Ux(e,r),[e,r]):[e,null]}function Go(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function b5(e,t){return(0,Bx.deepEqual)(Ys.default.Children.map(e,n=>n==null?void 0:n.key),Ys.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Bx.deepEqual)(Ys.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Ys.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Fe.fastRGLPropsEqual=w5;function x5(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function su(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Vx(e,t,n,r){const o=Yh(e),i=tp(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=Go(i[s]);c.static||(c=Wx(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const _5={x:"w",y:"h"};function Gh(e,t,n,r){const o=_5[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const s=e[a];if(!s.static){if(s.y>t.y+t.h)break;su(t,s)&&Gh(e,s,n+t[o],r)}}t[r]=n}function Wx(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(Wh(e),t.y);t.y>0&&!qo(e,t);)t.y--;else if(s)for(;t.x>0&&!qo(e,t);)t.x--;let l;for(;(l=qo(e,t))&&!(n===null&&i);)if(s?Gh(o,t,l.x+l.w,"x"):Gh(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!qo(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Gx(e,t){const n=Yh(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;qo(n,i);)i.y++}return e}function qh(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function qo(e,t){for(let n=0,r=e.length;n<r;n++)if(su(e[n],t))return e[n]}function qx(e,t){return e.filter(n=>su(n,t))}function Yh(e){return e.filter(t=>t.static)}function Ks(e,t,n,r,o,i,a,s,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=tp(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=qx(d,t),p=h.length>0;if(p&&l)return Hx(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,v=h.length;m<v;m++){const w=h[m];`${t.i}${t.x}${t.y}${w.i}${w.x}${w.y}`,!w.moved&&(w.static?e=Kh(e,w,t,o,a):e=Kh(e,t,w,o,a))}return e}function Kh(e,t,n,r,o,i){const a=o==="horizontal",s=o==="vertical",l=t.static;if(r){r=!1;const d={x:a?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=qo(e,d),h=f&&f.y+f.h>t.y,p=f&&t.x+t.w>f.x;if(f){if(h&&s)return Ks(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&a)return Ks(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,Ks(e,n,a?d.x:void 0,s?d.y:void 0,r,l,o)}const c=a?n.x+1:void 0,u=s?n.y+1:void 0;return c==null&&u==null?e:Ks(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function S5(e){return e*100+"%"}const Yx=(e,t,n,r)=>e+n>r?t:n,Kx=(e,t,n)=>e<0?t:n,Xx=e=>Math.max(0,e),Xh=e=>Math.max(0,e),Zh=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:Kx(a,e.height,o),top:Xh(a)}},Jh=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:Yx(e.left,e.width,a,n),left:Xx(o)}},Qh=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:Yx(e.left,e.width,i,n),top:Xh(r),left:Xx(a)}},ep=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:Kx(r,e.height,i),top:Xh(r)}},C5={n:Zh,ne:function(){return Zh(arguments.length<=0?void 0:arguments[0],Jh(...arguments))},e:Jh,se:function(){return ep(arguments.length<=0?void 0:arguments[0],Jh(...arguments))},s:ep,sw:function(){return ep(arguments.length<=0?void 0:arguments[0],Qh(...arguments))},w:Qh,nw:function(){return Zh(arguments.length<=0?void 0:arguments[0],Qh(...arguments))}};function E5(e,t,n,r){const o=C5[e];return o?o(t,{...t,...n},r):n}function P5(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function R5(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function tp(e,t){return t==="horizontal"?Jx(e):t==="vertical"?Zx(e):e}function Zx(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Jx(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function N5(e,t,n,r,o){e=e||[];const i=[];Ys.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=qh(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(Go(l)):c?i.push(Go({...c,i:s.key})):i.push(Go({w:1,h:1,x:0,y:Wh(i),i:String(s.key)}))});const a=Gx(i,{cols:n});return o?a:Vx(a,r,n)}function T5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let a=0;a<n.length;a++){const s=n[a],l=i[s];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${s} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function M5(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Gne(){}const D5=()=>{};Fe.noop=D5;var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.calcGridColWidth=lu,pr.calcGridItemPosition=A5,pr.calcGridItemWHPx=np,pr.calcWH=I5,pr.calcXY=k5,pr.clamp=Yo;function lu(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function np(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function A5(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=lu(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=np(r,c,a[0]),u.height=np(o,l,a[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+a[1])*n+s[1]),u.left=Math.round((c+a[0])*t+s[0])),u}function k5(e,t,n,r,o){const{margin:i,containerPadding:a,cols:s,rowHeight:l,maxRows:c}=e,u=lu(e);let d=Math.round((n-a[0])/(u+i[0])),f=Math.round((t-a[1])/(l+i[1]));return d=Yo(d,0,s-r),f=Yo(f,0,c-o),{x:d,y:f}}function I5(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=lu(e);let d=Math.round((t+a[0])/(u+a[0])),f=Math.round((n+a[1])/(c+a[1])),h=Yo(d,0,l-r),p=Yo(f,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Yo(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=Yo(f,0,s)),{w:h,h:p}}function Yo(e,t,n){return Math.max(Math.min(e,n),t)}var cu={},Qx={exports:{}},O5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",j5=O5,$5=j5;function e_(){}function t_(){}t_.resetWarningCache=e_;var F5=function(){function e(r,o,i,a,s,l){if(l!==$5){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:t_,resetWarningCache:e_};return n.PropTypes=n,n};Qx.exports=F5();var uo=Qx.exports,uu={exports:{}},n_={};function r_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function o_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=r_(e))&&(r&&(r+=" "),r+=t);return r}const L5=oc(Object.freeze(Object.defineProperty({__proto__:null,clsx:o_,default:o_},Symbol.toStringTag,{value:"Module"})));var wt={},mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.dontSetMe=V5,mr.findInArray=z5,mr.int=U5,mr.isFunction=B5,mr.isNum=H5;function z5(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function B5(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function H5(e){return typeof e=="number"&&!isNaN(e)}function U5(e){return parseInt(e,10)}function V5(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.browserPrefixToKey=a_,Ko.browserPrefixToStyle=W5,Ko.default=void 0,Ko.getPrefix=i_;const rp=["Moz","Webkit","O","ms"];function i_(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<rp.length;r++)if(a_(t,rp[r])in n)return rp[r];return""}function a_(e,t){return t?"".concat(t).concat(G5(e)):e}function W5(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function G5(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Ko.default=i_(),Object.defineProperty(wt,"__esModule",{value:!0}),wt.addClassName=u_,wt.addEvent=K5,wt.addUserSelectStyles=a8,wt.createCSSTransform=n8,wt.createSVGTransform=r8,wt.getTouch=o8,wt.getTouchIdentifier=i8,wt.getTranslation=op,wt.innerHeight=Q5,wt.innerWidth=e8,wt.matchesSelector=c_,wt.matchesSelectorAndParentsTo=Y5,wt.offsetXYFromParent=t8,wt.outerHeight=Z5,wt.outerWidth=J5,wt.removeClassName=d_,wt.removeEvent=X5,wt.removeUserSelectStyles=s8;var yn=mr,s_=q5(Ko);function l_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(l_=function(r){return r?n:t})(e)}function q5(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=l_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let du="";function c_(e,t){return du||(du=(0,yn.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,yn.isFunction)(e[n])})),(0,yn.isFunction)(e[du])?e[du](t):!1}function Y5(e,t,n){let r=e;do{if(c_(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function K5(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function X5(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Z5(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,yn.int)(n.borderTopWidth),t+=(0,yn.int)(n.borderBottomWidth),t}function J5(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,yn.int)(n.borderLeftWidth),t+=(0,yn.int)(n.borderRightWidth),t}function Q5(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,yn.int)(n.paddingTop),t-=(0,yn.int)(n.paddingBottom),t}function e8(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,yn.int)(n.paddingLeft),t-=(0,yn.int)(n.paddingRight),t}function t8(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,a=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:a}}function n8(e,t){const n=op(e,t,"px");return{[(0,s_.browserPrefixToKey)("transform",s_.default)]:n}}function r8(e,t){return op(e,t,"")}function op(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(a,", ").concat(s,")")+i}return i}function o8(e,t){return e.targetTouches&&(0,yn.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,yn.findInArray)(e.changedTouches,n=>t===n.identifier)}function i8(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function a8(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
148
149
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
149
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&zd(e.body,"react-draggable-transparent-selection")}function Yv(e){if(e)try{if(e.body&&Nd(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function zd(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Nd(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.canDragX=Vv,Wt.canDragY=Kv,Wt.createCoreData=Qv,Wt.createDraggableData=e1,Wt.getBoundPosition=Xv,Wt.getControlPosition=Jv,Wt.snapToGrid=Zv;var gt=Ht,vn=Be;function Xv(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:t1(n);const i=Gs(e);if(typeof n=="string"){const{ownerDocument:a}=i,o=a.defaultView;let s;if(n==="parent"?s=i.parentNode:s=a.querySelector(n),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const l=s,c=o.getComputedStyle(i),u=o.getComputedStyle(l);n={left:-i.offsetLeft+(0,gt.int)(u.paddingLeft)+(0,gt.int)(c.marginLeft),top:-i.offsetTop+(0,gt.int)(u.paddingTop)+(0,gt.int)(c.marginTop),right:(0,vn.innerWidth)(l)-(0,vn.outerWidth)(i)-i.offsetLeft+(0,gt.int)(u.paddingRight)-(0,gt.int)(c.marginRight),bottom:(0,vn.innerHeight)(l)-(0,vn.outerHeight)(i)-i.offsetTop+(0,gt.int)(u.paddingBottom)-(0,gt.int)(c.marginBottom)}}return(0,gt.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,gt.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,gt.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,gt.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function Zv(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function Vv(e){return e.props.axis==="both"||e.props.axis==="x"}function Kv(e){return e.props.axis==="both"||e.props.axis==="y"}function Jv(e,t,r){const n=typeof t=="number"?(0,vn.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=Gs(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,vn.offsetXYFromParent)(n||e,a,r.props.scale)}function Qv(e,t,r){const n=!(0,gt.isNum)(e.lastX),i=Gs(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function e1(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function t1(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Gs(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Da={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.default=r1;function r1(){}Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=void 0;var qs=i1(K),ft=Xs(yr),n1=Xs(wc),Je=Be,br=Wt,Ys=Ht,Ei=Xs(Ia);function Xs(e){return e&&e.__esModule?e:{default:e}}function Md(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Md=function(n){return n?r:t})(e)}function i1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Md(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function at(e,t,r){return t=a1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a1(e){var t=o1(e,"string");return typeof t=="symbol"?t:String(t)}function o1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Tt={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let _r=Tt.mouse,ja=class extends qs.Component{constructor(){super(...arguments),at(this,"dragging",!1),at(this,"lastX",NaN),at(this,"lastY",NaN),at(this,"touchIdentifier",null),at(this,"mounted",!1),at(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,Je.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,Je.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Je.getTouchIdentifier)(t);this.touchIdentifier=i;const a=(0,br.getControlPosition)(t,i,this);if(a==null)return;const{x:o,y:s}=a,l=(0,br.createCoreData)(this,o,s);(0,Ei.default)("DraggableCore: handleDragStart: %j",l),(0,Ei.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Je.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=s,(0,Je.addEvent)(n,_r.move,this.handleDrag),(0,Je.addEvent)(n,_r.stop,this.handleDragStop))}),at(this,"handleDrag",t=>{const r=(0,br.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let s=n-this.lastX,l=i-this.lastY;if([s,l]=(0,br.snapToGrid)(this.props.grid,s,l),!s&&!l)return;n=this.lastX+s,i=this.lastY+l}const a=(0,br.createCoreData)(this,n,i);if((0,Ei.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=n,this.lastY=i}),at(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,br.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let l=n-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,br.snapToGrid)(this.props.grid,l,c),n=this.lastX+l,i=this.lastY+c}const a=(0,br.createCoreData)(this,n,i);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Je.removeUserSelectStyles)(s.ownerDocument),(0,Ei.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Ei.default)("DraggableCore: Removing handlers"),(0,Je.removeEvent)(s.ownerDocument,_r.move,this.handleDrag),(0,Je.removeEvent)(s.ownerDocument,_r.stop,this.handleDragStop))}),at(this,"onMouseDown",t=>(_r=Tt.mouse,this.handleDragStart(t))),at(this,"onMouseUp",t=>(_r=Tt.mouse,this.handleDragStop(t))),at(this,"onTouchStart",t=>(_r=Tt.touch,this.handleDragStart(t))),at(this,"onTouchEnd",t=>(_r=Tt.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Je.addEvent)(t,Tt.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,Je.removeEvent)(r,Tt.mouse.move,this.handleDrag),(0,Je.removeEvent)(r,Tt.touch.move,this.handleDrag),(0,Je.removeEvent)(r,Tt.mouse.stop,this.handleDragStop),(0,Je.removeEvent)(r,Tt.touch.stop,this.handleDragStop),(0,Je.removeEvent)(t,Tt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Je.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:n1.default.findDOMNode(this)}render(){return qs.cloneElement(qs.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Da.default=ja,at(ja,"displayName","DraggableCore"),at(ja,"propTypes",{allowAnyClick:ft.default.bool,children:ft.default.node.isRequired,disabled:ft.default.bool,enableUserSelectHack:ft.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ft.default.arrayOf(ft.default.number),handle:ft.default.string,cancel:ft.default.string,nodeRef:ft.default.object,onStart:ft.default.func,onDrag:ft.default.func,onStop:ft.default.func,onMouseDown:ft.default.func,scale:ft.default.number,className:Ys.dontSetMe,style:Ys.dontSetMe,transform:Ys.dontSetMe}),at(ja,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(K),r=u(yr),n=u(wc),i=u(kv),a=Be,o=Wt,s=Ht,l=u(Da),c=u(Ia);function u(v){return v&&v.__esModule?v:{default:v}}function d(v){if(typeof WeakMap!="function")return null;var O=new WeakMap,R=new WeakMap;return(d=function(b){return b?R:O})(v)}function p(v,O){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var R=d(O);if(R&&R.has(v))return R.get(v);var b={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in v)if(k!=="default"&&Object.prototype.hasOwnProperty.call(v,k)){var S=C?Object.getOwnPropertyDescriptor(v,k):null;S&&(S.get||S.set)?Object.defineProperty(b,k,S):b[k]=v[k]}return b.default=v,R&&R.set(v,b),b}function m(){return m=Object.assign?Object.assign.bind():function(v){for(var O=1;O<arguments.length;O++){var R=arguments[O];for(var b in R)Object.prototype.hasOwnProperty.call(R,b)&&(v[b]=R[b])}return v},m.apply(this,arguments)}function g(v,O,R){return O=_(O),O in v?Object.defineProperty(v,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):v[O]=R,v}function _(v){var O=x(v,"string");return typeof O=="symbol"?O:String(O)}function x(v,O){if(typeof v!="object"||v===null)return v;var R=v[Symbol.toPrimitive];if(R!==void 0){var b=R.call(v,O||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(v)}class y extends t.Component{static getDerivedStateFromProps(O,R){let{position:b}=O,{prevPropsPosition:C}=R;return b&&(!C||b.x!==C.x||b.y!==C.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:b,prevPropsPosition:C}),{x:b.x,y:b.y,prevPropsPosition:{...b}}):null}constructor(O){super(O),g(this,"onDragStart",(R,b)=>{if((0,c.default)("Draggable: onDragStart: %j",b),this.props.onStart(R,(0,o.createDraggableData)(this,b))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),g(this,"onDrag",(R,b)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",b);const C=(0,o.createDraggableData)(this,b),k={x:C.x,y:C.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:$}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[B,M]=(0,o.getBoundPosition)(this,k.x,k.y);k.x=B,k.y=M,k.slackX=this.state.slackX+(P-k.x),k.slackY=this.state.slackY+($-k.y),C.x=k.x,C.y=k.y,C.deltaX=k.x-this.state.x,C.deltaY=k.y-this.state.y}if(this.props.onDrag(R,C)===!1)return!1;this.setState(k)}),g(this,"onDragStop",(R,b)=>{if(!this.state.dragging||this.props.onStop(R,(0,o.createDraggableData)(this,b))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",b);const k={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:$}=this.props.position;k.x=P,k.y=$}this.setState(k)}),this.state={dragging:!1,dragged:!1,x:O.position?O.position.x:O.defaultPosition.x,y:O.position?O.position.y:O.defaultPosition.y,prevPropsPosition:{...O.position},slackX:0,slackY:0,isElementSVG:!1},O.position&&!(O.onDrag||O.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var O,R;return(O=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&O!==void 0?O:n.default.findDOMNode(this)}render(){const{axis:O,bounds:R,children:b,defaultPosition:C,defaultClassName:k,defaultClassNameDragging:S,defaultClassNameDragged:P,position:$,positionOffset:B,scale:M,...H}=this.props;let Y={},ue=null;const me=!!!$||this.state.dragging,ge=$||C,Pe={x:(0,o.canDragX)(this)&&me?this.state.x:ge.x,y:(0,o.canDragY)(this)&&me?this.state.y:ge.y};this.state.isElementSVG?ue=(0,a.createSVGTransform)(Pe,B):Y=(0,a.createCSSTransform)(Pe,B);const Ue=(0,i.default)(b.props.className||"",k,{[S]:this.state.dragging,[P]:this.state.dragged});return t.createElement(l.default,m({},H,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(b),{className:Ue,style:{...b.props.style,...Y},transform:ue}))}}e.default=y,g(y,"displayName","Draggable"),g(y,"propTypes",{...l.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),g(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Td);const{default:Ld,DraggableCore:s1}=Td;Aa.exports=Ld,Aa.exports.default=Ld,Aa.exports.DraggableCore=s1;var Fd=Aa.exports,Ba={exports:{}},Si={},Zs={};Zs.__esModule=!0,Zs.cloneElement=h1;var c1=l1(K);function l1(e){return e&&e.__esModule?e:{default:e}}function Ud(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ud(Object(r),!0).forEach(function(n){u1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ud(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function u1(e,t,r){return t=f1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f1(e){var t=d1(e,"string");return typeof t=="symbol"?t:String(t)}function d1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h1(e,t){return t.style&&e.props.style&&(t.style=Hd(Hd({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),c1.default.cloneElement(e,t)}var ki={};ki.__esModule=!0,ki.resizableProps=void 0;var fe=p1(yr);function p1(e){return e&&e.__esModule?e:{default:e}}var m1={axis:fe.default.oneOf(["both","x","y","none"]),className:fe.default.string,children:fe.default.element.isRequired,draggableOpts:fe.default.shape({allowAnyClick:fe.default.bool,cancel:fe.default.string,children:fe.default.node,disabled:fe.default.bool,enableUserSelectHack:fe.default.bool,offsetParent:fe.default.node,grid:fe.default.arrayOf(fe.default.number),handle:fe.default.string,nodeRef:fe.default.object,onStart:fe.default.func,onDrag:fe.default.func,onStop:fe.default.func,onMouseDown:fe.default.func,scale:fe.default.number}),height:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(i.axis==="both"||i.axis==="y"){var a;return(a=fe.default.number).isRequired.apply(a,r)}return fe.default.number.apply(fe.default,r)},handle:fe.default.oneOfType([fe.default.node,fe.default.func]),handleSize:fe.default.arrayOf(fe.default.number),lockAspectRatio:fe.default.bool,maxConstraints:fe.default.arrayOf(fe.default.number),minConstraints:fe.default.arrayOf(fe.default.number),onResizeStop:fe.default.func,onResizeStart:fe.default.func,onResize:fe.default.func,resizeHandles:fe.default.arrayOf(fe.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:fe.default.number,width:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(i.axis==="both"||i.axis==="x"){var a;return(a=fe.default.number).isRequired.apply(a,r)}return fe.default.number.apply(fe.default,r)}};ki.resizableProps=m1,Si.__esModule=!0,Si.default=void 0;var Ri=_1(K),w1=Fd,g1=Zs,y1=ki,b1=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Wd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Wd=function(i){return i?r:t})(e)}function _1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Wd(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function Vs(){return Vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}function v1(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ks(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gd(Object(r),!0).forEach(function(n){x1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x1(e,t,r){return t=E1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E1(e){var t=S1(e,"string");return typeof t=="symbol"?t:String(t)}function S1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Js(e,t)}function Js(e,t){return Js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Js(e,t)}var Qs=function(e){k1(t,e);function t(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a))||this,n.handleRefs={},n.lastHandleRect=null,n.slack=null,n}var r=t.prototype;return r.componentWillUnmount=function(){this.resetData()},r.resetData=function(){this.lastHandleRect=this.slack=null},r.runConstraints=function(i,a){var o=this.props,s=o.minConstraints,l=o.maxConstraints,c=o.lockAspectRatio;if(!s&&!l&&!c)return[i,a];if(c){var u=this.props.width/this.props.height,d=i-this.props.width,p=a-this.props.height;Math.abs(d)>Math.abs(p*u)?a=i/u:i=a*u}var m=i,g=a,_=this.slack||[0,0],x=_[0],y=_[1];return i+=x,a+=y,s&&(i=Math.max(s[0],i),a=Math.max(s[1],a)),l&&(i=Math.min(l[0],i),a=Math.min(l[1],a)),this.slack=[x+(m-i),y+(g-a)],[i,a]},r.resizeHandler=function(i,a){var o=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;i==="onResizeStart"&&o.resetData();var p=(o.props.axis==="both"||o.props.axis==="x")&&a!=="n"&&a!=="s",m=(o.props.axis==="both"||o.props.axis==="y")&&a!=="e"&&a!=="w";if(!(!p&&!m)){var g=a[0],_=a[a.length-1],x=c.getBoundingClientRect();if(o.lastHandleRect!=null){if(_==="w"){var y=x.left-o.lastHandleRect.left;u+=y}if(g==="n"){var v=x.top-o.lastHandleRect.top;d+=v}}o.lastHandleRect=x,_==="w"&&(u=-u),g==="n"&&(d=-d);var O=o.props.width+(p?u/o.props.transformScale:0),R=o.props.height+(m?d/o.props.transformScale:0),b=o.runConstraints(O,R);O=b[0],R=b[1];var C=O!==o.props.width||R!==o.props.height,k=typeof o.props[i]=="function"?o.props[i]:null,S=i==="onResize"&&!C;k&&!S&&(s.persist==null||s.persist(),k(s,{node:c,size:{width:O,height:R},handle:a})),i==="onResizeStop"&&o.resetData()}}},r.renderResizeHandle=function(i,a){var o=this.props.handle;if(!o)return Ri.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:a});if(typeof o=="function")return o(i,a);var s=typeof o.type=="string",l=Ks({ref:a},s?{}:{handleAxis:i});return Ri.cloneElement(o,l)},r.render=function(){var i=this,a=this.props,o=a.children,s=a.className,l=a.draggableOpts;a.width,a.height,a.handle,a.handleSize,a.lockAspectRatio,a.axis,a.minConstraints,a.maxConstraints,a.onResize,a.onResizeStop,a.onResizeStart;var c=a.resizeHandles;a.transformScale;var u=v1(a,b1);return(0,g1.cloneElement)(o,Ks(Ks({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(o.props.children,c.map(function(d){var p,m=(p=i.handleRefs[d])!=null?p:i.handleRefs[d]=Ri.createRef();return Ri.createElement(w1.DraggableCore,Vs({},l,{nodeRef:m,key:"resizableHandle-"+d,onStop:i.resizeHandler("onResizeStop",d),onStart:i.resizeHandler("onResizeStart",d),onDrag:i.resizeHandler("onResize",d)}),i.renderResizeHandle(d,m))}))}))},t}(Ri.Component);Si.default=Qs,Qs.propTypes=y1.resizableProps,Qs.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var za={};za.__esModule=!0,za.default=void 0;var ec=P1(K),R1=qd(yr),O1=qd(Si),C1=ki,T1=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qd(e){return e&&e.__esModule?e:{default:e}}function Yd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Yd=function(i){return i?r:t})(e)}function P1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Yd(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tc.apply(this,arguments)}function Xd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xd(Object(r),!0).forEach(function(n){A1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A1(e,t,r){return t=$1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $1(e){var t=D1(e,"string");return typeof t=="symbol"?t:String(t)}function D1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I1(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function j1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rc(e,t)}function rc(e,t){return rc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rc(e,t)}var Zd=function(e){j1(t,e);function t(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a))||this,n.state={width:n.props.width,height:n.props.height,propsWidth:n.props.width,propsHeight:n.props.height},n.onResize=function(s,l){var c=l.size;n.props.onResize?(s.persist==null||s.persist(),n.setState(c,function(){return n.props.onResize&&n.props.onResize(s,l)})):n.setState(c)},n}t.getDerivedStateFromProps=function(i,a){return a.propsWidth!==i.width||a.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var r=t.prototype;return r.render=function(){var i=this.props,a=i.handle,o=i.handleSize;i.onResize;var s=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,u=i.minConstraints,d=i.maxConstraints,p=i.lockAspectRatio,m=i.axis;i.width,i.height;var g=i.resizeHandles,_=i.style,x=i.transformScale,y=I1(i,T1);return ec.createElement(O1.default,{axis:m,draggableOpts:c,handle:a,handleSize:o,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:g,transformScale:x,width:this.state.width},ec.createElement("div",tc({},y,{style:Na(Na({},_),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(ec.Component);za.default=Zd,Zd.propTypes=Na(Na({},C1.resizableProps),{},{children:R1.default.element}),Ba.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ba.exports.Resizable=Si.default,Ba.exports.ResizableBox=za.default;var B1=Ba.exports,er={};Object.defineProperty(er,"__esModule",{value:!0}),er.resizeHandleType=er.resizeHandleAxesType=er.default=void 0;var de=Vd(yr),z1=Vd(K);function Vd(e){return e&&e.__esModule?e:{default:e}}const N1=er.resizeHandleAxesType=de.default.arrayOf(de.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),M1=er.resizeHandleType=de.default.oneOfType([de.default.node,de.default.func]);er.default={className:de.default.string,style:de.default.object,width:de.default.number,autoSize:de.default.bool,cols:de.default.number,draggableCancel:de.default.string,draggableHandle:de.default.string,verticalCompact:function(e){e.verticalCompact},compactType:de.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&he.validateLayout(t,"layout")},margin:de.default.arrayOf(de.default.number),containerPadding:de.default.arrayOf(de.default.number),rowHeight:de.default.number,maxRows:de.default.number,isBounded:de.default.bool,isDraggable:de.default.bool,isResizable:de.default.bool,allowOverlap:de.default.bool,preventCollision:de.default.bool,useCSSTransforms:de.default.bool,transformScale:de.default.number,isDroppable:de.default.bool,resizeHandles:N1,resizeHandle:M1,onLayoutChange:de.default.func,onDragStart:de.default.func,onDrag:de.default.func,onDragStop:de.default.func,onResizeStart:de.default.func,onResize:de.default.func,onResizeStop:de.default.func,onDrop:de.default.func,droppingItem:de.default.shape({i:de.default.string.isRequired,w:de.default.number.isRequired,h:de.default.number.isRequired}),children:function(e,t){const r=e[t],n={};z1.default.Children.forEach(r,function(i){if((i==null?void 0:i.key)!=null){if(n[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');n[i.key]=!0}})},innerRef:de.default.any},Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.default=void 0;var xn=nc(K),xe=nc(yr),L1=Fd,F1=B1,En=he,Ze=Ut,Kd=er,U1=nc(Ps);function nc(e){return e&&e.__esModule?e:{default:e}}function Gt(e,t,r){return t=H1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H1(e){var t=W1(e,"string");return typeof t=="symbol"?t:String(t)}function W1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class ic extends xn.default.Component{constructor(){super(...arguments),Gt(this,"state",{resizing:null,dragging:null,className:""}),Gt(this,"elementRef",xn.default.createRef()),Gt(this,"onDragStart",(t,r)=>{let{node:n}=r;const{onDragStart:i,transformScale:a}=this.props;if(!i)return;const o={top:0,left:0},{offsetParent:s}=n;if(!s)return;const l=s.getBoundingClientRect(),c=n.getBoundingClientRect(),u=c.left/a,d=l.left/a,p=c.top/a,m=l.top/a;o.left=u-d+s.scrollLeft,o.top=p-m+s.scrollTop,this.setState({dragging:o});const{x:g,y:_}=(0,Ze.calcXY)(this.getPositionParams(),o.top,o.left,this.props.w,this.props.h);return i.call(this,this.props.i,g,_,{e:t,node:n,newPosition:o})}),Gt(this,"onDrag",(t,r)=>{let{node:n,deltaX:i,deltaY:a}=r;const{onDrag:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+a,l=this.state.dragging.left+i;const{isBounded:c,i:u,w:d,h:p,containerWidth:m}=this.props,g=this.getPositionParams();if(c){const{offsetParent:v}=n;if(v){const{margin:O,rowHeight:R,containerPadding:b}=this.props,C=v.clientHeight-(0,Ze.calcGridItemWHPx)(p,R,O[1]);s=(0,Ze.clamp)(s-b[1],0,C);const k=(0,Ze.calcGridColWidth)(g),S=m-(0,Ze.calcGridItemWHPx)(d,k,O[0]);l=(0,Ze.clamp)(l-b[0],0,S)}}const _={top:s,left:l};this.setState({dragging:_});const{x,y}=(0,Ze.calcXY)(g,s,l,d,p);return o.call(this,u,x,y,{e:t,node:n,newPosition:_})}),Gt(this,"onDragStop",(t,r)=>{let{node:n}=r;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:a,h:o,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:p}=(0,Ze.calcXY)(this.getPositionParams(),c,l,a,o);return i.call(this,s,d,p,{e:t,node:n,newPosition:u})}),Gt(this,"onResizeStop",(t,r,n)=>this.onResizeHandler(t,r,n,"onResizeStop")),Gt(this,"onResizeStart",(t,r,n)=>this.onResizeHandler(t,r,n,"onResizeStart")),Gt(this,"onResize",(t,r,n)=>this.onResizeHandler(t,r,n,"onResize"))}shouldComponentUpdate(t,r){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const n=(0,Ze.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Ze.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,r);return!(0,En.fastPositionEqual)(n,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:r}=this.props;if(!r)return;const n=this.elementRef.current;if(!n)return;const i=t.droppingPosition||{left:0,top:0},{dragging:a}=this.state,o=a&&r.left!==i.left||r.top!==i.top;if(!a)this.onDragStart(r.e,{node:n,deltaX:r.left,deltaY:r.top});else if(o){const s=r.left-a.left,l=r.top-a.top;this.onDrag(r.e,{node:n,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:r,containerWidth:n,useCSSTransforms:i}=this.props;let a;return i?a=(0,En.setTransform)(t):(a=(0,En.setTopLeft)(t),r&&(a.left=(0,En.perc)(t.left/n),a.width=(0,En.perc)(t.width/n))),a}mixinDraggable(t,r){return xn.default.createElement(L1.DraggableCore,{disabled:!r,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,r){return(n,i)=>r(n,i,t)}mixinResizable(t,r,n){const{cols:i,minW:a,minH:o,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,p=this.getPositionParams(),m=(0,Ze.calcGridItemPosition)(p,0,0,i,0).width,g=(0,Ze.calcGridItemPosition)(p,0,0,a,o),_=(0,Ze.calcGridItemPosition)(p,0,0,s,l),x=[g.width,g.height],y=[Math.min(_.width,m),Math.min(_.height,1/0)];return xn.default.createElement(F1.Resizable,{draggableOpts:{disabled:!n},className:n?void 0:"react-resizable-hide",width:r.width,height:r.height,minConstraints:x,maxConstraints:y,onResizeStop:this.curryResizeHandler(r,this.onResizeStop),onResizeStart:this.curryResizeHandler(r,this.onResizeStart),onResize:this.curryResizeHandler(r,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,r,n,i){let{node:a,size:o,handle:s}=r;const l=this.props[i];if(!l)return;const{x:c,y:u,i:d,maxH:p,minH:m,containerWidth:g}=this.props,{minW:_,maxW:x}=this.props;let y=o;a&&(y=(0,En.resizeItemInDirection)(s,n,o,g),this.setState({resizing:i==="onResizeStop"?null:y}));let{w:v,h:O}=(0,Ze.calcWH)(this.getPositionParams(),y.width,y.height,c,u,s);v=(0,Ze.clamp)(v,Math.max(_,1),x),O=(0,Ze.clamp)(O,m,p),l.call(this,d,v,O,{e:t,node:a,size:y,handle:s})}render(){const{x:t,y:r,w:n,h:i,isDraggable:a,isResizable:o,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,Ze.calcGridItemPosition)(this.getPositionParams(),t,r,n,i,this.state),u=xn.default.Children.only(this.props.children);let d=xn.default.cloneElement(u,{ref:this.elementRef,className:(0,U1.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,o),d=this.mixinDraggable(d,a),d}}Pa.default=ic,Gt(ic,"propTypes",{children:xe.default.element,cols:xe.default.number.isRequired,containerWidth:xe.default.number.isRequired,rowHeight:xe.default.number.isRequired,margin:xe.default.array.isRequired,maxRows:xe.default.number.isRequired,containerPadding:xe.default.array.isRequired,x:xe.default.number.isRequired,y:xe.default.number.isRequired,w:xe.default.number.isRequired,h:xe.default.number.isRequired,minW:function(e,t){const r=e[t];if(typeof r!="number")return new Error("minWidth not Number");if(r>e.w||r>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const r=e[t];if(typeof r!="number")return new Error("maxWidth not Number");if(r<e.w||r<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const r=e[t];if(typeof r!="number")return new Error("minHeight not Number");if(r>e.h||r>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const r=e[t];if(typeof r!="number")return new Error("maxHeight not Number");if(r<e.h||r<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:xe.default.string.isRequired,resizeHandles:Kd.resizeHandleAxesType,resizeHandle:Kd.resizeHandleType,onDragStop:xe.default.func,onDragStart:xe.default.func,onDrag:xe.default.func,onResizeStop:xe.default.func,onResizeStart:xe.default.func,onResize:xe.default.func,isDraggable:xe.default.bool.isRequired,isResizable:xe.default.bool.isRequired,isBounded:xe.default.bool.isRequired,static:xe.default.bool,useCSSTransforms:xe.default.bool.isRequired,transformScale:xe.default.number,className:xe.default.string,handle:xe.default.string,cancel:xe.default.string,droppingPosition:xe.default.shape({e:xe.default.object.isRequired,left:xe.default.number.isRequired,top:xe.default.number.isRequired})}),Gt(ic,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var Mr=X1(K),ac=Cs,G1=oc(Ps),ae=he,q1=Ut,Jd=oc(Pa),Y1=oc(er);function oc(e){return e&&e.__esModule?e:{default:e}}function Qd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Qd=function(n){return n?r:t})(e)}function X1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Qd(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function Qe(e,t,r){return t=Z1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z1(e){var t=V1(e,"string");return typeof t=="symbol"?t:String(t)}function V1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const eh="react-grid-layout";let th=!1;try{th=/firefox/i.test(navigator.userAgent)}catch{}class Ma extends Mr.Component{constructor(){super(...arguments),Qe(this,"state",{activeDrag:null,layout:(0,ae.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,ae.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Qe(this,"dragEnterCounter",0),Qe(this,"onDragStart",(t,r,n,i)=>{let{e:a,node:o}=i;const{layout:s}=this.state,l=(0,ae.getLayoutItem)(s,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,ae.cloneLayoutItem)(l),oldLayout:s,activeDrag:c}),this.props.onDragStart(s,l,l,null,a,o)}),Qe(this,"onDrag",(t,r,n,i)=>{let{e:a,node:o}=i;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,p=(0,ae.getLayoutItem)(l,t);if(!p)return;const m={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};l=(0,ae.moveElement)(l,p,r,n,!0,d,(0,ae.compactType)(this.props),c,u),this.props.onDrag(l,s,p,m,a,o),this.setState({layout:u?l:(0,ae.compact)(l,(0,ae.compactType)(this.props),c),activeDrag:m})}),Qe(this,"onDragStop",(t,r,n,i)=>{let{e:a,node:o}=i;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,p=(0,ae.getLayoutItem)(l,t);if(!p)return;l=(0,ae.moveElement)(l,p,r,n,!0,u,(0,ae.compactType)(this.props),c,d);const g=d?l:(0,ae.compact)(l,(0,ae.compactType)(this.props),c);this.props.onDragStop(g,s,p,null,a,o);const{oldLayout:_}=this.state;this.setState({activeDrag:null,layout:g,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(g,_)}),Qe(this,"onResizeStart",(t,r,n,i)=>{let{e:a,node:o}=i;const{layout:s}=this.state,l=(0,ae.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,ae.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,a,o))}),Qe(this,"onResize",(t,r,n,i)=>{let{e:a,node:o,size:s,handle:l}=i;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:m}=this.props;let g=!1,_,x,y;const[v,O]=(0,ae.withLayoutItem)(u,t,b=>{let C;return x=b.x,y=b.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=b.x+(b.w-r),r=b.x!==x&&x<0?b.w:r,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(y=b.y+(b.h-n),n=b.y!==y&&y<0?b.h:n,y=y<0?0:y),g=!0),p&&!m&&(C=(0,ae.getAllCollisions)(u,{...b,w:r,h:n,x,y}).filter(S=>S.i!==b.i).length>0,C&&(y=b.y,n=b.h,x=b.x,r=b.w,g=!1)),b.w=r,b.h=n,b});if(!O)return;_=v,g&&(_=(0,ae.moveElement)(v,O,x,y,!0,this.props.preventCollision,(0,ae.compactType)(this.props),d,m));const R={w:O.w,h:O.h,x:O.x,y:O.y,static:!0,i:t};this.props.onResize(_,c,O,R,a,o),this.setState({layout:m?_:(0,ae.compact)(_,(0,ae.compactType)(this.props),d),activeDrag:R})}),Qe(this,"onResizeStop",(t,r,n,i)=>{let{e:a,node:o}=i;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,ae.getLayoutItem)(s,t),p=u?s:(0,ae.compact)(s,(0,ae.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,a,o);const{oldLayout:m}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,m)}),Qe(this,"onDragOver",t=>{var v;if(t.preventDefault(),t.stopPropagation(),th&&!((v=t.nativeEvent.target)!=null&&v.classList.contains(eh)))return!1;const{droppingItem:r,onDropDragOver:n,margin:i,cols:a,rowHeight:o,maxRows:s,width:l,containerPadding:c,transformScale:u}=this.props,d=n==null?void 0:n(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...d},{layout:m}=this.state,g=t.currentTarget.getBoundingClientRect(),_=t.clientX-g.left,x=t.clientY-g.top,y={left:_/u,top:x/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:O,top:R}=this.state.droppingPosition;(O!=_||R!=x)&&this.setState({droppingPosition:y})}}else{const O={cols:a,margin:i,maxRows:s,rowHeight:o,containerWidth:l,containerPadding:c||i},R=(0,q1.calcXY)(O,x,_,p.w,p.h);this.setState({droppingDOMNode:Mr.createElement("div",{key:p.i}),droppingPosition:y,layout:[...m,{...p,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),Qe(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:r}=this.props,{layout:n}=this.state,i=(0,ae.compact)(n.filter(a=>a.i!==t.i),(0,ae.compactType)(this.props),r,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Qe(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Qe(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Qe(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:r}=this.props,{layout:n}=this.state,i=n.find(a=>a.i===r.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(n,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,r){let n;return r.activeDrag?null:(!(0,ac.deepEqual)(t.layout,r.propsLayout)||t.compactType!==r.compactType?n=t.layout:(0,ae.childrenEqual)(t.children,r.children)||(n=r.layout),n?{layout:(0,ae.synchronizeLayoutWithChildren)(n,t.children,t.cols,(0,ae.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,r){return this.props.children!==t.children||!(0,ae.fastRGLPropsEqual)(this.props,t,ac.deepEqual)||this.state.activeDrag!==r.activeDrag||this.state.mounted!==r.mounted||this.state.droppingPosition!==r.droppingPosition}componentDidUpdate(t,r){if(!this.state.activeDrag){const n=this.state.layout,i=r.layout;this.onLayoutMaybeChanged(n,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,ae.bottom)(this.state.layout),r=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+r*2+"px"}onLayoutMaybeChanged(t,r){r||(r=this.state.layout),(0,ac.deepEqual)(r,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:r,cols:n,margin:i,containerPadding:a,rowHeight:o,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return Mr.createElement(Jd.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:r,cols:n,margin:i,containerPadding:a||i,maxRows:s,rowHeight:o,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Mr.createElement("div",null))}processGridItem(t,r){if(!t||!t.key)return;const n=(0,ae.getLayoutItem)(this.state.layout,String(t.key));if(!n)return null;const{width:i,cols:a,margin:o,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:p,useCSSTransforms:m,transformScale:g,draggableCancel:_,draggableHandle:x,resizeHandles:y,resizeHandle:v}=this.props,{mounted:O,droppingPosition:R}=this.state,b=typeof n.isDraggable=="boolean"?n.isDraggable:!n.static&&u,C=typeof n.isResizable=="boolean"?n.isResizable:!n.static&&d,k=n.resizeHandles||y,S=b&&p&&n.isBounded!==!1;return Mr.createElement(Jd.default,{containerWidth:i,cols:a,margin:o,containerPadding:s||o,maxRows:c,rowHeight:l,cancel:_,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:b,isResizable:C,isBounded:S,useCSSTransforms:m&&O,usePercentages:!O,transformScale:g,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:r?R:void 0,resizeHandles:k,resizeHandle:v},t)}render(){const{className:t,style:r,isDroppable:n,innerRef:i}=this.props,a=(0,G1.default)(eh,t),o={height:this.containerHeight(),...r};return Mr.createElement("div",{ref:i,className:a,style:o,onDrop:n?this.onDrop:ae.noop,onDragLeave:n?this.onDragLeave:ae.noop,onDragEnter:n?this.onDragEnter:ae.noop,onDragOver:n?this.onDragOver:ae.noop},Mr.Children.map(this.props.children,s=>this.processGridItem(s)),n&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}_i.default=Ma,Qe(Ma,"displayName","ReactGridLayout"),Qe(Ma,"propTypes",Y1.default),Qe(Ma,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:ae.noop,onDragStart:ae.noop,onDrag:ae.noop,onDragStop:ae.noop,onResizeStart:ae.noop,onResize:ae.noop,onResizeStop:ae.noop,onDrop:ae.noop,onDropDragOver:ae.noop});var La={},Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.findOrGenerateResponsiveLayout=Q1,Lr.getBreakpointFromWidth=K1,Lr.getColsFromBreakpoint=J1,Lr.sortBreakpoints=sc;var Fa=he;function K1(e,t){const r=sc(e);let n=r[0];for(let i=1,a=r.length;i<a;i++){const o=r[i];t>e[o]&&(n=o)}return n}function J1(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Q1(e,t,r,n,i,a){if(e[r])return(0,Fa.cloneLayout)(e[r]);let o=e[n];const s=sc(t),l=s.slice(s.indexOf(r));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){o=e[d];break}}return o=(0,Fa.cloneLayout)(o||[]),(0,Fa.compact)((0,Fa.correctBounds)(o,{cols:i}),a,i)}function sc(e){return Object.keys(e).sort(function(r,n){return e[r]-e[n]})}Object.defineProperty(La,"__esModule",{value:!0}),La.default=void 0;var rh=tx(K),dt=nh(yr),cc=Cs,Sn=he,Fr=Lr,ex=nh(_i);function nh(e){return e&&e.__esModule?e:{default:e}}function ih(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(ih=function(n){return n?r:t})(e)}function tx(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=ih(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function lc(){return lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lc.apply(this,arguments)}function Ua(e,t,r){return t=rx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rx(e){var t=nx(e,"string");return typeof t=="symbol"?t:String(t)}function nx(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const ah=e=>Object.prototype.toString.call(e);function Ha(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class uc extends rh.Component{constructor(){super(...arguments),Ua(this,"state",this.generateInitialState()),Ua(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:r,layouts:n,cols:i}=this.props,a=(0,Fr.getBreakpointFromWidth)(r,t),o=(0,Fr.getColsFromBreakpoint)(a,i),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Fr.findOrGenerateResponsiveLayout)(n,r,a,a,o,s),breakpoint:a,cols:o}}static getDerivedStateFromProps(t,r){if(!(0,cc.deepEqual)(t.layouts,r.layouts)){const{breakpoint:n,cols:i}=r;return{layout:(0,Fr.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,n,n,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,cc.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,cc.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:r,cols:n,layouts:i,compactType:a}=this.props,o=this.props.breakpoint||(0,Fr.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,Fr.getColsFromBreakpoint)(o,n),c={...i};if(s!==o||t.breakpoints!==r||t.cols!==n){s in c||(c[s]=(0,Sn.cloneLayout)(this.state.layout));let p=(0,Fr.findOrGenerateResponsiveLayout)(c,r,o,s,l,a);p=(0,Sn.synchronizeLayoutWithChildren)(p,this.props.children,l,a,this.props.allowOverlap),c[o]=p,this.props.onBreakpointChange(o,l),this.props.onLayoutChange(p,c),this.setState({breakpoint:o,layout:p,cols:l})}const u=Ha(this.props.margin,o),d=Ha(this.props.containerPadding,o);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:r,cols:n,layouts:i,margin:a,containerPadding:o,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return rh.createElement(ex.default,lc({},u,{margin:Ha(a,this.state.breakpoint),containerPadding:Ha(o,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}La.default=uc,Ua(uc,"propTypes",{breakpoint:dt.default.string,breakpoints:dt.default.object,allowOverlap:dt.default.bool,cols:dt.default.object,margin:dt.default.oneOfType([dt.default.array,dt.default.object]),containerPadding:dt.default.oneOfType([dt.default.array,dt.default.object]),layouts(e,t){if(ah(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+ah(e[t]));Object.keys(e[t]).forEach(r=>{if(!(r in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Sn.validateLayout)(e.layouts[r],"layouts."+r)})},width:dt.default.number.isRequired,onBreakpointChange:dt.default.func,onLayoutChange:dt.default.func,onWidthChange:dt.default.func}),Ua(uc,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Sn.noop,onLayoutChange:Sn.noop,onWidthChange:Sn.noop});var fc={},oh=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(i,a){return i[0]===r?(n=a,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(r,n){var i=e(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,i=e(n,r);~i&&n.splice(i,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,a=this.__entries__;i<a.length;i++){var o=a[i];r.call(n,o[1],o[0])}},t}()}(),dc=typeof window<"u"&&typeof document<"u"&&window.document===document,Wa=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),ix=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Wa):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ax=2;function ox(e,t){var r=!1,n=!1,i=0;function a(){r&&(r=!1,e()),n&&s()}function o(){ix(a)}function s(){var l=Date.now();if(r){if(l-i<ax)return;n=!0}else r=!0,n=!1,setTimeout(o,t);i=l}return s}var sx=20,cx=["top","right","bottom","left","width","height","size","weight"],lx=typeof MutationObserver<"u",ux=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ox(this.refresh.bind(this),sx)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!dc||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),lx?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!dc||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,i=cx.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),sh=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},kn=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Wa},ch=qa(0,0,0,0);function Ga(e){return parseFloat(e)||0}function lh(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,i){var a=e["border-"+i+"-width"];return n+Ga(a)},0)}function fx(e){for(var t=["top","right","bottom","left"],r={},n=0,i=t;n<i.length;n++){var a=i[n],o=e["padding-"+a];r[a]=Ga(o)}return r}function dx(e){var t=e.getBBox();return qa(0,0,t.width,t.height)}function hx(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return ch;var n=kn(e).getComputedStyle(e),i=fx(n),a=i.left+i.right,o=i.top+i.bottom,s=Ga(n.width),l=Ga(n.height);if(n.boxSizing==="border-box"&&(Math.round(s+a)!==t&&(s-=lh(n,"left","right")+a),Math.round(l+o)!==r&&(l-=lh(n,"top","bottom")+o)),!mx(e)){var c=Math.round(s+a)-t,u=Math.round(l+o)-r;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return qa(i.left,i.top,s,l)}var px=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof kn(e).SVGGraphicsElement}:function(e){return e instanceof kn(e).SVGElement&&typeof e.getBBox=="function"}}();function mx(e){return e===kn(e).document.documentElement}function wx(e){return dc?px(e)?dx(e):hx(e):ch}function gx(e){var t=e.x,r=e.y,n=e.width,i=e.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(a.prototype);return sh(o,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),o}function qa(e,t,r,n){return{x:e,y:t,width:r,height:n}}var yx=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=qa(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=wx(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),bx=function(){function e(t,r){var n=gx(r);sh(this,{target:t,contentRect:n})}return e}(),_x=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new oh,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof kn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new yx(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof kn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new bx(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),uh=typeof WeakMap<"u"?new WeakMap:new oh,fh=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=ux.getInstance(),n=new _x(t,r,this);uh.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){fh.prototype[e]=function(){var t;return(t=uh.get(this))[e].apply(t,arguments)}});var vx=function(){return typeof Wa.ResizeObserver<"u"?Wa.ResizeObserver:fh}();const xx=Xa(Object.freeze(Object.defineProperty({__proto__:null,default:vx},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(fc,"__esModule",{value:!0}),fc.default=Px;var Ya=Rx(K),Ex=hc(yr),Sx=hc(xx),kx=hc(Ps);function hc(e){return e&&e.__esModule?e:{default:e}}function dh(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(dh=function(n){return n?r:t})(e)}function Rx(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=dh(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pc.apply(this,arguments)}function Rn(e,t,r){return t=Ox(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ox(e){var t=Cx(e,"string");return typeof t=="symbol"?t:String(t)}function Cx(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Tx="react-grid-layout";function Px(e){var t;return t=class extends Ya.Component{constructor(){super(...arguments),Rn(this,"state",{width:1280}),Rn(this,"elementRef",Ya.createRef()),Rn(this,"mounted",!1),Rn(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Sx.default(i=>{if(this.elementRef.current instanceof HTMLElement){const o=i[0].contentRect.width;this.setState({width:o})}});const n=this.elementRef.current;n instanceof HTMLElement&&this.resizeObserver.observe(n)}componentWillUnmount(){this.mounted=!1;const n=this.elementRef.current;n instanceof HTMLElement&&this.resizeObserver.unobserve(n),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:n,...i}=this.props;return n&&!this.mounted?Ya.createElement("div",{className:(0,kx.default)(this.props.className,Tx),style:this.props.style,ref:this.elementRef}):Ya.createElement(e,pc({innerRef:this.elementRef},i,this.state))}},Rn(t,"defaultProps",{measureBeforeMount:!1}),Rn(t,"propTypes",{measureBeforeMount:Ex.default.bool}),t}(function(e){e.exports=_i.default,e.exports.utils=he,e.exports.calculateUtils=Ut,e.exports.Responsive=La.default,e.exports.Responsive.utils=Lr,e.exports.WidthProvider=fc.default})(fd);var mc=fd.exports;const hh=St(mc),Ax=mc.WidthProvider(hh),$x=gr.div`
150
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&u_(e.body,"react-draggable-transparent-selection")}function s8(e){if(e)try{if(e.body&&d_(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function u_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function d_(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.canDragX=u8,gr.canDragY=d8,gr.createCoreData=h8,gr.createDraggableData=p8,gr.getBoundPosition=l8,gr.getControlPosition=f8,gr.snapToGrid=c8;var bn=mr,Ji=wt;function l8(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:m8(r);const o=ip(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let s;if(r==="parent"?s=o.parentNode:s=i.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(o),u=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,bn.int)(u.paddingLeft)+(0,bn.int)(c.marginLeft),top:-o.offsetTop+(0,bn.int)(u.paddingTop)+(0,bn.int)(c.marginTop),right:(0,Ji.innerWidth)(l)-(0,Ji.outerWidth)(o)-o.offsetLeft+(0,bn.int)(u.paddingRight)-(0,bn.int)(c.marginRight),bottom:(0,Ji.innerHeight)(l)-(0,Ji.outerHeight)(o)-o.offsetTop+(0,bn.int)(u.paddingBottom)-(0,bn.int)(c.marginBottom)}}return(0,bn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,bn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,bn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,bn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function c8(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function u8(e){return e.props.axis==="both"||e.props.axis==="x"}function d8(e){return e.props.axis==="both"||e.props.axis==="y"}function f8(e,t,n){const r=typeof t=="number"?(0,Ji.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=ip(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Ji.offsetXYFromParent)(r||e,i,n.props.scale)}function h8(e,t,n){const r=!(0,bn.isNum)(e.lastX),o=ip(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function p8(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function m8(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ip(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var fu={},hu={};Object.defineProperty(hu,"__esModule",{value:!0}),hu.default=g8;function g8(){}Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=void 0;var ap=v8(E),on=lp(uo),w8=lp(tr),$t=wt,fo=gr,sp=mr,Xs=lp(hu);function lp(e){return e&&e.__esModule?e:{default:e}}function f_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(f_=function(r){return r?n:t})(e)}function v8(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=f_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Xt(e,t,n){return t=y8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y8(e){var t=b8(e,"string");return typeof t=="symbol"?t:String(t)}function b8(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Bn={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ho=Bn.mouse,pu=class extends ap.Component{constructor(){super(...arguments),Xt(this,"dragging",!1),Xt(this,"lastX",NaN),Xt(this,"lastY",NaN),Xt(this,"touchIdentifier",null),Xt(this,"mounted",!1),Xt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,$t.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,$t.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,$t.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,fo.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,fo.createCoreData)(this,a,s);(0,Xs.default)("DraggableCore: handleDragStart: %j",l),(0,Xs.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,$t.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,$t.addEvent)(r,ho.move,this.handleDrag),(0,$t.addEvent)(r,ho.stop,this.handleDragStop))}),Xt(this,"handleDrag",t=>{const n=(0,fo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=o-this.lastY;if([s,l]=(0,fo.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,fo.createCoreData)(this,r,o);if((0,Xs.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Xt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,fo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,fo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,fo.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,$t.removeUserSelectStyles)(s.ownerDocument),(0,Xs.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Xs.default)("DraggableCore: Removing handlers"),(0,$t.removeEvent)(s.ownerDocument,ho.move,this.handleDrag),(0,$t.removeEvent)(s.ownerDocument,ho.stop,this.handleDragStop))}),Xt(this,"onMouseDown",t=>(ho=Bn.mouse,this.handleDragStart(t))),Xt(this,"onMouseUp",t=>(ho=Bn.mouse,this.handleDragStop(t))),Xt(this,"onTouchStart",t=>(ho=Bn.touch,this.handleDragStart(t))),Xt(this,"onTouchEnd",t=>(ho=Bn.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,$t.addEvent)(t,Bn.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,$t.removeEvent)(n,Bn.mouse.move,this.handleDrag),(0,$t.removeEvent)(n,Bn.touch.move,this.handleDrag),(0,$t.removeEvent)(n,Bn.mouse.stop,this.handleDragStop),(0,$t.removeEvent)(n,Bn.touch.stop,this.handleDragStop),(0,$t.removeEvent)(t,Bn.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,$t.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:w8.default.findDOMNode(this)}render(){return ap.cloneElement(ap.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};fu.default=pu,Xt(pu,"displayName","DraggableCore"),Xt(pu,"propTypes",{allowAnyClick:on.default.bool,children:on.default.node.isRequired,disabled:on.default.bool,enableUserSelectHack:on.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:on.default.arrayOf(on.default.number),handle:on.default.string,cancel:on.default.string,nodeRef:on.default.object,onStart:on.default.func,onDrag:on.default.func,onStop:on.default.func,onMouseDown:on.default.func,scale:on.default.number,className:sp.dontSetMe,style:sp.dontSetMe,transform:sp.dontSetMe}),Xt(pu,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(E),n=u(uo),r=u(tr),o=u(L5),i=wt,a=gr,s=mr,l=u(fu),c=u(hu);function u(b){return b&&b.__esModule?b:{default:b}}function d(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,S=new WeakMap;return(d=function(C){return C?S:x})(b)}function f(b,x){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var S=d(x);if(S&&S.has(b))return S.get(b);var C={},N=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if(R!=="default"&&Object.prototype.hasOwnProperty.call(b,R)){var T=N?Object.getOwnPropertyDescriptor(b,R):null;T&&(T.get||T.set)?Object.defineProperty(C,R,T):C[R]=b[R]}return C.default=b,S&&S.set(b,C),C}function h(){return h=Object.assign?Object.assign.bind():function(b){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(b[C]=S[C])}return b},h.apply(this,arguments)}function p(b,x,S){return x=m(x),x in b?Object.defineProperty(b,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):b[x]=S,b}function m(b){var x=v(b,"string");return typeof x=="symbol"?x:String(x)}function v(b,x){if(typeof b!="object"||b===null)return b;var S=b[Symbol.toPrimitive];if(S!==void 0){var C=S.call(b,x||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(b)}class w extends t.Component{static getDerivedStateFromProps(x,S){let{position:C}=x,{prevPropsPosition:N}=S;return C&&(!N||C.x!==N.x||C.y!==N.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:N}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(x){super(x),p(this,"onDragStart",(S,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(S,(0,a.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(S,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const N=(0,a.createDraggableData)(this,C),R={x:N.x,y:N.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:A}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[k,F]=(0,a.getBoundPosition)(this,R.x,R.y);R.x=k,R.y=F,R.slackX=this.state.slackX+(M-R.x),R.slackY=this.state.slackY+(A-R.y),N.x=R.x,N.y=R.y,N.deltaX=R.x-this.state.x,N.deltaY=R.y-this.state.y}if(this.props.onDrag(S,N)===!1)return!1;this.setState(R)}),p(this,"onDragStop",(S,C)=>{if(!this.state.dragging||this.props.onStop(S,(0,a.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const R={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:A}=this.props.position;R.x=M,R.y=A}this.setState(R)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,S;return(x=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:S,children:C,defaultPosition:N,defaultClassName:R,defaultClassNameDragging:T,defaultClassNameDragged:M,position:A,positionOffset:k,scale:F,...L}=this.props;let Y={},ne=null;const X=!!!A||this.state.dragging,B=A||N,ee={x:(0,a.canDragX)(this)&&X?this.state.x:B.x,y:(0,a.canDragY)(this)&&X?this.state.y:B.y};this.state.isElementSVG?ne=(0,i.createSVGTransform)(ee,k):Y=(0,i.createCSSTransform)(ee,k);const Z=(0,o.default)(C.props.className||"",R,{[T]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,h({},L,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:Z,style:{...C.props.style,...Y},transform:ne}))}}e.default=w,p(w,"displayName","Draggable"),p(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(n_);const{default:h_,DraggableCore:x8}=n_;uu.exports=h_,uu.exports.default=h_,uu.exports.DraggableCore=x8;var p_=uu.exports,mu={exports:{}},Zs={},cp={};cp.__esModule=!0,cp.cloneElement=R8;var _8=S8(E);function S8(e){return e&&e.__esModule?e:{default:e}}function m_(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 g_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(r){C8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C8(e,t,n){return t=E8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E8(e){var t=P8(e,"string");return typeof t=="symbol"?t:String(t)}function P8(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R8(e,t){return t.style&&e.props.style&&(t.style=g_(g_({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),_8.default.cloneElement(e,t)}var Js={};Js.__esModule=!0,Js.resizableProps=void 0;var ke=N8(uo);function N8(e){return e&&e.__esModule?e:{default:e}}var T8={axis:ke.default.oneOf(["both","x","y","none"]),className:ke.default.string,children:ke.default.element.isRequired,draggableOpts:ke.default.shape({allowAnyClick:ke.default.bool,cancel:ke.default.string,children:ke.default.node,disabled:ke.default.bool,enableUserSelectHack:ke.default.bool,offsetParent:ke.default.node,grid:ke.default.arrayOf(ke.default.number),handle:ke.default.string,nodeRef:ke.default.object,onStart:ke.default.func,onDrag:ke.default.func,onStop:ke.default.func,onMouseDown:ke.default.func,scale:ke.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=ke.default.number).isRequired.apply(i,n)}return ke.default.number.apply(ke.default,n)},handle:ke.default.oneOfType([ke.default.node,ke.default.func]),handleSize:ke.default.arrayOf(ke.default.number),lockAspectRatio:ke.default.bool,maxConstraints:ke.default.arrayOf(ke.default.number),minConstraints:ke.default.arrayOf(ke.default.number),onResizeStop:ke.default.func,onResizeStart:ke.default.func,onResize:ke.default.func,resizeHandles:ke.default.arrayOf(ke.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:ke.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=ke.default.number).isRequired.apply(i,n)}return ke.default.number.apply(ke.default,n)}};Js.resizableProps=T8,Zs.__esModule=!0,Zs.default=void 0;var Qs=I8(E),M8=p_,D8=cp,A8=Js,k8=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function w_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(w_=function(o){return o?n:t})(e)}function I8(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=w_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function up(){return up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},up.apply(this,arguments)}function O8(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}function v_(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 dp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v_(Object(n),!0).forEach(function(r){j8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j8(e,t,n){return t=$8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $8(e){var t=F8(e,"string");return typeof t=="symbol"?t:String(t)}function F8(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,fp(e,t)}function fp(e,t){return fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},fp(e,t)}var hp=function(e){L8(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var h=o,p=i,m=this.slack||[0,0],v=m[0],w=m[1];return o+=v,i+=w,s&&(o=Math.max(s[0],o),i=Math.max(s[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[v+(h-o),w+(p-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&a.resetData();var f=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",h=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var p=i[0],m=i[i.length-1],v=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(m==="w"){var w=v.left-a.lastHandleRect.left;u+=w}if(p==="n"){var b=v.top-a.lastHandleRect.top;d+=b}}a.lastHandleRect=v,m==="w"&&(u=-u),p==="n"&&(d=-d);var x=a.props.width+(f?u/a.props.transformScale:0),S=a.props.height+(h?d/a.props.transformScale:0),C=a.runConstraints(x,S);x=C[0],S=C[1];var N=x!==a.props.width||S!==a.props.height,R=typeof a.props[o]=="function"?a.props[o]:null,T=o==="onResize"&&!N;R&&!T&&(s.persist==null||s.persist(),R(s,{node:c,size:{width:x,height:S},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return Qs.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var s=typeof a.type=="string",l=dp({ref:i},s?{}:{handleAxis:o});return Qs.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=O8(i,k8);return(0,D8.cloneElement)(a,dp(dp({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(d){var f,h=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=Qs.createRef();return Qs.createElement(M8.DraggableCore,up({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(Qs.Component);Zs.default=hp,hp.propTypes=A8.resizableProps,hp.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var gu={};gu.__esModule=!0,gu.default=void 0;var pp=V8(E),z8=y_(uo),B8=y_(Zs),H8=Js,U8=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function y_(e){return e&&e.__esModule?e:{default:e}}function b_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(b_=function(o){return o?n:t})(e)}function V8(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=b_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function mp(){return mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mp.apply(this,arguments)}function x_(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 wu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x_(Object(n),!0).forEach(function(r){W8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W8(e,t,n){return t=G8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G8(e){var t=q8(e,"string");return typeof t=="symbol"?t:String(t)}function q8(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y8(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}function K8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gp(e,t)}function gp(e,t){return gp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},gp(e,t)}var __=function(e){K8(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var s=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,h=o.axis;o.width,o.height;var p=o.resizeHandles,m=o.style,v=o.transformScale,w=Y8(o,U8);return pp.createElement(B8.default,{axis:h,draggableOpts:c,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:v,width:this.state.width},pp.createElement("div",mp({},w,{style:wu(wu({},m),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(pp.Component);gu.default=__,__.propTypes=wu(wu({},H8.resizableProps),{},{children:z8.default.element}),mu.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},mu.exports.Resizable=Zs.default,mu.exports.ResizableBox=gu.default;var X8=mu.exports,Fr={};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.resizeHandleType=Fr.resizeHandleAxesType=Fr.default=void 0;var Oe=S_(uo),Z8=S_(E);function S_(e){return e&&e.__esModule?e:{default:e}}const J8=Fr.resizeHandleAxesType=Oe.default.arrayOf(Oe.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Q8=Fr.resizeHandleType=Oe.default.oneOfType([Oe.default.node,Oe.default.func]);Fr.default={className:Oe.default.string,style:Oe.default.object,width:Oe.default.number,autoSize:Oe.default.bool,cols:Oe.default.number,draggableCancel:Oe.default.string,draggableHandle:Oe.default.string,verticalCompact:function(e){e.verticalCompact},compactType:Oe.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Fe.validateLayout(t,"layout")},margin:Oe.default.arrayOf(Oe.default.number),containerPadding:Oe.default.arrayOf(Oe.default.number),rowHeight:Oe.default.number,maxRows:Oe.default.number,isBounded:Oe.default.bool,isDraggable:Oe.default.bool,isResizable:Oe.default.bool,allowOverlap:Oe.default.bool,preventCollision:Oe.default.bool,useCSSTransforms:Oe.default.bool,transformScale:Oe.default.number,isDroppable:Oe.default.bool,resizeHandles:J8,resizeHandle:Q8,onLayoutChange:Oe.default.func,onDragStart:Oe.default.func,onDrag:Oe.default.func,onDragStop:Oe.default.func,onResizeStart:Oe.default.func,onResize:Oe.default.func,onResizeStop:Oe.default.func,onDrop:Oe.default.func,droppingItem:Oe.default.shape({i:Oe.default.string.isRequired,w:Oe.default.number.isRequired,h:Oe.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Z8.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Oe.default.any},Object.defineProperty(cu,"__esModule",{value:!0}),cu.default=void 0;var Qi=wp(E),Ze=wp(uo),e3=p_,t3=X8,ea=Fe,kt=pr,C_=Fr,n3=wp(Vh);function wp(e){return e&&e.__esModule?e:{default:e}}function wr(e,t,n){return t=r3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r3(e){var t=o3(e,"string");return typeof t=="symbol"?t:String(t)}function o3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class vp extends Qi.default.Component{constructor(){super(...arguments),wr(this,"state",{resizing:null,dragging:null,className:""}),wr(this,"elementRef",Qi.default.createRef()),wr(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:s}=r;if(!s)return;const l=s.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,f=c.top/i,h=l.top/i;a.left=u-d+s.scrollLeft,a.top=f-h+s.scrollTop,this.setState({dragging:a});const{x:p,y:m}=(0,kt.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,p,m,{e:t,node:r,newPosition:a})}),wr(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h:f,containerWidth:h}=this.props,p=this.getPositionParams();if(c){const{offsetParent:b}=r;if(b){const{margin:x,rowHeight:S,containerPadding:C}=this.props,N=b.clientHeight-(0,kt.calcGridItemWHPx)(f,S,x[1]);s=(0,kt.clamp)(s-C[1],0,N);const R=(0,kt.calcGridColWidth)(p),T=h-(0,kt.calcGridItemWHPx)(d,R,x[0]);l=(0,kt.clamp)(l-C[0],0,T)}}const m={top:s,left:l};this.setState({dragging:m});const{x:v,y:w}=(0,kt.calcXY)(p,s,l,d,f);return a.call(this,u,v,w,{e:t,node:r,newPosition:m})}),wr(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:f}=(0,kt.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,f,{e:t,node:r,newPosition:u})}),wr(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),wr(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),wr(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,kt.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,kt.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ea.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const s=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,ea.setTransform)(t):(i=(0,ea.setTopLeft)(t),n&&(i.left=(0,ea.perc)(t.left/r),i.width=(0,ea.perc)(t.width/r))),i}mixinDraggable(t,n){return Qi.default.createElement(e3.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,f=this.getPositionParams(),h=(0,kt.calcGridItemPosition)(f,0,0,o,0).width,p=(0,kt.calcGridItemPosition)(f,0,0,i,a),m=(0,kt.calcGridItemPosition)(f,0,0,s,l),v=[p.width,p.height],w=[Math.min(m.width,h),Math.min(m.height,1/0)];return Qi.default.createElement(t3.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:s}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:f,minH:h,containerWidth:p}=this.props,{minW:m,maxW:v}=this.props;let w=a;i&&(w=(0,ea.resizeItemInDirection)(s,r,a,p),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:b,h:x}=(0,kt.calcWH)(this.getPositionParams(),w.width,w.height,c,u,s);b=(0,kt.clamp)(b,Math.max(m,1),v),x=(0,kt.clamp)(x,h,f),l.call(this,d,b,x,{e:t,node:i,size:w,handle:s})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,kt.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Qi.default.Children.only(this.props.children);let d=Qi.default.cloneElement(u,{ref:this.elementRef,className:(0,n3.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,a),d=this.mixinDraggable(d,i),d}}cu.default=vp,wr(vp,"propTypes",{children:Ze.default.element,cols:Ze.default.number.isRequired,containerWidth:Ze.default.number.isRequired,rowHeight:Ze.default.number.isRequired,margin:Ze.default.array.isRequired,maxRows:Ze.default.number.isRequired,containerPadding:Ze.default.array.isRequired,x:Ze.default.number.isRequired,y:Ze.default.number.isRequired,w:Ze.default.number.isRequired,h:Ze.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Ze.default.string.isRequired,resizeHandles:C_.resizeHandleAxesType,resizeHandle:C_.resizeHandleType,onDragStop:Ze.default.func,onDragStart:Ze.default.func,onDrag:Ze.default.func,onResizeStop:Ze.default.func,onResizeStart:Ze.default.func,onResize:Ze.default.func,isDraggable:Ze.default.bool.isRequired,isResizable:Ze.default.bool.isRequired,isBounded:Ze.default.bool.isRequired,static:Ze.default.bool,useCSSTransforms:Ze.default.bool.isRequired,transformScale:Ze.default.number,className:Ze.default.string,handle:Ze.default.string,cancel:Ze.default.string,droppingPosition:Ze.default.shape({e:Ze.default.object.isRequired,left:Ze.default.number.isRequired,top:Ze.default.number.isRequired})}),wr(vp,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=void 0;var Xo=l3(E),yp=Uh,i3=bp(Vh),Te=Fe,a3=pr,E_=bp(cu),s3=bp(Fr);function bp(e){return e&&e.__esModule?e:{default:e}}function P_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(P_=function(r){return r?n:t})(e)}function l3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=P_(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ft(e,t,n){return t=c3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c3(e){var t=u3(e,"string");return typeof t=="symbol"?t:String(t)}function u3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const R_="react-grid-layout";let N_=!1;try{N_=/firefox/i.test(navigator.userAgent)}catch{}class vu extends Xo.Component{constructor(){super(...arguments),Ft(this,"state",{activeDrag:null,layout:(0,Te.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Te.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Ft(this,"dragEnterCounter",0),Ft(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Te.getLayoutItem)(s,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Te.cloneLayoutItem)(l),oldLayout:s,activeDrag:c}),this.props.onDragStart(s,l,l,null,i,a)}),Ft(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,f=(0,Te.getLayoutItem)(l,t);if(!f)return;const h={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,Te.moveElement)(l,f,n,r,!0,d,(0,Te.compactType)(this.props),c,u),this.props.onDrag(l,s,f,h,i,a),this.setState({layout:u?l:(0,Te.compact)(l,(0,Te.compactType)(this.props),c),activeDrag:h})}),Ft(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,f=(0,Te.getLayoutItem)(l,t);if(!f)return;l=(0,Te.moveElement)(l,f,n,r,!0,u,(0,Te.compactType)(this.props),c,d);const p=d?l:(0,Te.compact)(l,(0,Te.compactType)(this.props),c);this.props.onDragStop(p,s,f,null,i,a);const{oldLayout:m}=this.state;this.setState({activeDrag:null,layout:p,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(p,m)}),Ft(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Te.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,Te.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),Ft(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:s,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:f,allowOverlap:h}=this.props;let p=!1,m,v,w;const[b,x]=(0,Te.withLayoutItem)(u,t,C=>{let N;return v=C.x,w=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=C.x+(C.w-n),n=C.x!==v&&v<0?C.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(w=C.y+(C.h-r),r=C.y!==w&&w<0?C.h:r,w=w<0?0:w),p=!0),f&&!h&&(N=(0,Te.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:w}).filter(T=>T.i!==C.i).length>0,N&&(w=C.y,r=C.h,v=C.x,n=C.w,p=!1)),C.w=n,C.h=r,C});if(!x)return;m=b,p&&(m=(0,Te.moveElement)(b,x,v,w,!0,this.props.preventCollision,(0,Te.compactType)(this.props),d,h));const S={w:x.w,h:x.h,x:x.x,y:x.y,static:!0,i:t};this.props.onResize(m,c,x,S,i,a),this.setState({layout:h?m:(0,Te.compact)(m,(0,Te.compactType)(this.props),d),activeDrag:S})}),Ft(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,Te.getLayoutItem)(s,t),f=u?s:(0,Te.compact)(s,(0,Te.compactType)(this.props),c);this.props.onResizeStop(f,l,d,null,i,a);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,h)}),Ft(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),N_&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(R_)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:a,maxRows:s,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...d},{layout:h}=this.state,p=t.currentTarget.getBoundingClientRect(),m=t.clientX-p.left,v=t.clientY-p.top,w={left:m/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:x,top:S}=this.state.droppingPosition;(x!=m||S!=v)&&this.setState({droppingPosition:w})}}else{const x={cols:i,margin:o,maxRows:s,rowHeight:a,containerWidth:l,containerPadding:c||o},S=(0,a3.calcXY)(x,v,m,f.w,f.h);this.setState({droppingDOMNode:Xo.createElement("div",{key:f.i}),droppingPosition:w,layout:[...h,{...f,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),Ft(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Te.compact)(r.filter(i=>i.i!==t.i),(0,Te.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Ft(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Ft(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Ft(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,yp.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Te.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Te.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Te.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Te.fastRGLPropsEqual)(this.props,t,yp.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Te.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,yp.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return Xo.createElement(E_.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Xo.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Te.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:f,useCSSTransforms:h,transformScale:p,draggableCancel:m,draggableHandle:v,resizeHandles:w,resizeHandle:b}=this.props,{mounted:x,droppingPosition:S}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,N=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,R=r.resizeHandles||w,T=C&&f&&r.isBounded!==!1;return Xo.createElement(E_.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:m,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:N,isBounded:T,useCSSTransforms:h&&x,usePercentages:!x,transformScale:p,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?S:void 0,resizeHandles:R,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,i3.default)(R_,t),a={height:this.containerHeight(),...n};return Xo.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:Te.noop,onDragLeave:r?this.onDragLeave:Te.noop,onDragEnter:r?this.onDragEnter:Te.noop,onDragOver:r?this.onDragOver:Te.noop},Xo.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}qs.default=vu,Ft(vu,"displayName","ReactGridLayout"),Ft(vu,"propTypes",s3.default),Ft(vu,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Te.noop,onDragStart:Te.noop,onDrag:Te.noop,onDragStop:Te.noop,onResizeStart:Te.noop,onResize:Te.noop,onResizeStop:Te.noop,onDrop:Te.noop,onDropDragOver:Te.noop});var yu={},Zo={};Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.findOrGenerateResponsiveLayout=h3,Zo.getBreakpointFromWidth=d3,Zo.getColsFromBreakpoint=f3,Zo.sortBreakpoints=xp;var bu=Fe;function d3(e,t){const n=xp(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function f3(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function h3(e,t,n,r,o,i){if(e[n])return(0,bu.cloneLayout)(e[n]);let a=e[r];const s=xp(t),l=s.slice(s.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){a=e[d];break}}return a=(0,bu.cloneLayout)(a||[]),(0,bu.compact)((0,bu.correctBounds)(a,{cols:o}),i,o)}function xp(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(yu,"__esModule",{value:!0}),yu.default=void 0;var T_=m3(E),an=M_(uo),_p=Uh,ta=Fe,Jo=Zo,p3=M_(qs);function M_(e){return e&&e.__esModule?e:{default:e}}function D_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(D_=function(r){return r?n:t})(e)}function m3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=D_(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sp.apply(this,arguments)}function xu(e,t,n){return t=g3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g3(e){var t=w3(e,"string");return typeof t=="symbol"?t:String(t)}function w3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const A_=e=>Object.prototype.toString.call(e);function _u(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Cp extends T_.Component{constructor(){super(...arguments),xu(this,"state",this.generateInitialState()),xu(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Jo.getBreakpointFromWidth)(n,t),a=(0,Jo.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Jo.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,_p.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Jo.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,_p.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,_p.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,Jo.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,Jo.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,ta.cloneLayout)(this.state.layout));let f=(0,Jo.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);f=(0,ta.synchronizeLayoutWithChildren)(f,this.props.children,l,i,this.props.allowOverlap),c[a]=f,this.props.onBreakpointChange(a,l),this.props.onLayoutChange(f,c),this.setState({breakpoint:a,layout:f,cols:l})}const u=_u(this.props.margin,a),d=_u(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return T_.createElement(p3.default,Sp({},u,{margin:_u(i,this.state.breakpoint),containerPadding:_u(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}yu.default=Cp,xu(Cp,"propTypes",{breakpoint:an.default.string,breakpoints:an.default.object,allowOverlap:an.default.bool,cols:an.default.object,margin:an.default.oneOfType([an.default.array,an.default.object]),containerPadding:an.default.oneOfType([an.default.array,an.default.object]),layouts(e,t){if(A_(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+A_(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ta.validateLayout)(e.layouts[n],"layouts."+n)})},width:an.default.number.isRequired,onBreakpointChange:an.default.func,onLayoutChange:an.default.func,onWidthChange:an.default.func}),xu(Cp,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:ta.noop,onLayoutChange:ta.noop,onWidthChange:ta.noop});var Ep={},k_=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),Pp=typeof window<"u"&&typeof document<"u"&&window.document===document,Su=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),v3=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Su):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),y3=2;function b3(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){v3(i)}function s(){var l=Date.now();if(n){if(l-o<y3)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var x3=20,_3=["top","right","bottom","left","width","height","size","weight"],S3=typeof MutationObserver<"u",C3=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=b3(this.refresh.bind(this),x3)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Pp||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),S3?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Pp||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=_3.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),I_=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},na=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Su},O_=Eu(0,0,0,0);function Cu(e){return parseFloat(e)||0}function j_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Cu(i)},0)}function E3(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=Cu(a)}return n}function P3(e){var t=e.getBBox();return Eu(0,0,t.width,t.height)}function R3(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return O_;var r=na(e).getComputedStyle(e),o=E3(r),i=o.left+o.right,a=o.top+o.bottom,s=Cu(r.width),l=Cu(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=j_(r,"left","right")+i),Math.round(l+a)!==n&&(l-=j_(r,"top","bottom")+a)),!T3(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Eu(o.left,o.top,s,l)}var N3=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof na(e).SVGGraphicsElement}:function(e){return e instanceof na(e).SVGElement&&typeof e.getBBox=="function"}}();function T3(e){return e===na(e).document.documentElement}function M3(e){return Pp?N3(e)?P3(e):R3(e):O_}function D3(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return I_(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Eu(e,t,n,r){return{x:e,y:t,width:n,height:r}}var A3=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Eu(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=M3(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),k3=function(){function e(t,n){var r=D3(n);I_(this,{target:t,contentRect:r})}return e}(),I3=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new k_,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof na(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new A3(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof na(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new k3(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$_=typeof WeakMap<"u"?new WeakMap:new k_,F_=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=C3.getInstance(),r=new I3(t,n,this);$_.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){F_.prototype[e]=function(){var t;return(t=$_.get(this))[e].apply(t,arguments)}});var O3=function(){return typeof Su.ResizeObserver<"u"?Su.ResizeObserver:F_}();const j3=oc(Object.freeze(Object.defineProperty({__proto__:null,default:O3},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.default=V3;var Pu=z3(E),$3=Rp(uo),F3=Rp(j3),L3=Rp(Vh);function Rp(e){return e&&e.__esModule?e:{default:e}}function L_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(L_=function(r){return r?n:t})(e)}function z3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=L_(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Np.apply(this,arguments)}function ra(e,t,n){return t=B3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B3(e){var t=H3(e,"string");return typeof t=="symbol"?t:String(t)}function H3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const U3="react-grid-layout";function V3(e){var t;return t=class extends Pu.Component{constructor(){super(...arguments),ra(this,"state",{width:1280}),ra(this,"elementRef",Pu.createRef()),ra(this,"mounted",!1),ra(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new F3.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Pu.createElement("div",{className:(0,L3.default)(this.props.className,U3),style:this.props.style,ref:this.elementRef}):Pu.createElement(e,Np({innerRef:this.elementRef},o,this.state))}},ra(t,"defaultProps",{measureBeforeMount:!1}),ra(t,"propTypes",{measureBeforeMount:$3.default.bool}),t}(function(e){e.exports=qs.default,e.exports.utils=Fe,e.exports.calculateUtils=pr,e.exports.Responsive=yu.default,e.exports.Responsive.utils=Zo,e.exports.WidthProvider=Ep.default})(Lx);var Tp=Lx.exports;const z_=Nn(Tp),W3=Tp.WidthProvider(z_),G3=co.div`
150
151
  .grid-container {
151
152
  display: flex;
152
153
 
@@ -174,7 +175,7 @@ object-assign
174
175
  .react-grid-drag-handle {
175
176
  cursor: move;
176
177
  }
177
- `,ph=e=>ve.jsx(ve.Fragment,{children:ve.jsx($x,{children:ve.jsx(Ax,{className:"layout",rowHeight:50,cols:12,compactType:null,isResizable:!1,isDraggable:!1,preventCollision:!0,margin:[0,0],layout:e.layout,children:e.components.map(t=>ve.jsx("div",{className:"grid-item",children:t.component},t.id))})})}),Dx=gr.div`
178
+ `,B_=e=>g.jsx(g.Fragment,{children:g.jsx(G3,{children:g.jsx(W3,{className:"layout",rowHeight:50,cols:12,compactType:null,isResizable:!1,isDraggable:!1,preventCollision:!0,margin:[0,0],layout:e.layout,children:e.components.map(t=>g.jsx("div",{className:"grid-item",children:t.component},t.id))})})}),q3=co.div`
178
179
  .mi-container {
179
180
  display: flex;
180
181
  flex-direction: row;
@@ -193,7 +194,7 @@ object-assign
193
194
  flex-grow: 1;
194
195
  overflow: auto;
195
196
  }
196
- `,Ix=()=>{const[e,t]=K.useState([]),[r,n]=K.useState([]),[i,a]=K.useState(!1),{projectMetadata:o}=Rs(),s=async()=>{a(!0),await Pf(o.projectName,o.projectURL),a(!1),await ss(o.projectName,o.projectURL),await Eb(o.projectName);const l=await ud(o.projectName);t(l.components),n(l.layout)};return K.useEffect(()=>{!o.projectName&&!o.projectURL||s()},[o.projectName,o.projectURL]),ve.jsx(ve.Fragment,{children:ve.jsxs(Dx,{children:[ve.jsx(rv,{isVisible:i}),ve.jsx("div",{className:"mi-container",children:ve.jsx("div",{className:"mi-workspace",style:{backgroundColor:"#6f4d80"},children:ve.jsx(ph,{components:e,layout:r})})})]})})},jx=K.forwardRef(({style:e,className:t,onMouseDown:r,onMouseUp:n,onTouchEnd:i,children:a,componentId:o},s)=>{const{selectedComponentId:l}=Rs(),c=K.useMemo(()=>l===o,[l]),u=K.Children.toArray(a),d=u.filter(m=>m.key===".$resizableHandle-se"),p=u.filter(m=>m.key!==".$resizableHandle-se");return ve.jsxs("div",{style:{...e},className:t+(c?" selected":""),ref:s,onMouseDown:r,onMouseUp:n,onTouchEnd:i,children:[ve.jsx("div",{className:"grid-item "+(c?"selected":""),children:p}),d]})});class Bx extends K.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){const{hasError:t,error:r}=this.state,{children:n,fallback:i,fallbackProps:a}=this.props;return t&&(this.resetState(),i)?ve.jsx(i,{error:r,...a}):n}resetState(){this.state={hasError:!1,error:null}}}const zx=e=>ve.jsx(ve.Fragment,{children:ve.jsx("div",{className:"droppable-element",draggable:!0,unselectable:"on",onDragStart:t=>{t.dataTransfer.setData("text/plain",""),t.dataTransfer.setData("application/reactgridlayout",JSON.stringify({id:e.id,type:e.type,initialSize:e.initialSize,metadata:e.metadata}))},children:e.node})}),Nx=mc.WidthProvider(hh),Mx=gr.div`
197
+ `,Y3=()=>{const[e,t]=E.useState([]),[n,r]=E.useState([]),[o,i]=E.useState(!1),{projectMetadata:a}=Bh(),s=async()=>{i(!0),await ux(a.projectName,a.projectURL),i(!1),await _h(a.projectName,a.projectURL),await XB(a.projectName);const l=await sx(a.projectName);t(l.components),r(l.layout)};return E.useEffect(()=>{!a.projectName&&!a.projectURL||s()},[a.projectName,a.projectURL]),g.jsx(g.Fragment,{children:g.jsxs(q3,{children:[g.jsx(g5,{isVisible:o}),g.jsx("div",{className:"mi-container",children:g.jsx("div",{className:"mi-workspace",style:{backgroundColor:"#6f4d80"},children:g.jsx(B_,{components:e,layout:n})})})]})})},K3=E.forwardRef(({style:e,className:t,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:i,componentId:a},s)=>{const{selectedComponentId:l}=Bh(),c=E.useMemo(()=>l===a,[l]),u=E.Children.toArray(i),d=u.filter(h=>h.key===".$resizableHandle-se"),f=u.filter(h=>h.key!==".$resizableHandle-se");return g.jsxs("div",{style:{...e},className:t+(c?" selected":""),ref:s,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:[g.jsx("div",{className:"grid-item "+(c?"selected":""),children:f}),d]})});class X3 extends E.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){const{hasError:t,error:n}=this.state,{children:r,fallback:o,fallbackProps:i}=this.props;return t&&(this.resetState(),o)?g.jsx(o,{error:n,...i}):r}resetState(){this.state={hasError:!1,error:null}}}const Z3=e=>g.jsx(g.Fragment,{children:g.jsx("div",{className:"droppable-element",draggable:!0,unselectable:"on",onDragStart:t=>{t.dataTransfer.setData("text/plain",""),t.dataTransfer.setData("application/reactgridlayout",JSON.stringify({id:e.id,type:e.type,initialSize:e.initialSize,metadata:e.metadata}))},children:e.node})}),J3=Tp.WidthProvider(z_),Q3=co.div`
197
198
  .react-grid-layout {
198
199
  position: relative;
199
200
  // transition: height 200ms ease;
@@ -241,7 +242,7 @@ object-assign
241
242
  box-sizing: border-box;
242
243
  cursor: se-resize;
243
244
  }
244
- `,Lx=gr.div`
245
+ `,eH=co.div`
245
246
  .grid-container {
246
247
  display: flex;
247
248
 
@@ -269,4 +270,173 @@ object-assign
269
270
  .react-grid-drag-handle {
270
271
  cursor: move;
271
272
  }
272
- `,Fx=e=>ve.jsx(ve.Fragment,{children:ve.jsx(Mx,{children:ve.jsx(Lx,{children:ve.jsx(Nx,{className:"layout",rowHeight:50,cols:12,layout:e.layout,onLayoutChange:e.onLayoutChange,onResizeStop:e.onResize,onDrop:e.onDrop,onDragStop:e.onDrag,compactType:null,preventCollision:!0,draggableCancel:".cancel-drag",isDroppable:!0,draggableHandle:".react-grid-drag-handle",children:e.components})})})}),Ux=()=>{typeof window<"u"&&(window.Buffer=Ja.Buffer,window.fs=new up("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};be.APIHandler=xs,be.APIProxyHandler=Es,be.MiniApp=Ix,be.ProjectProvider=G_,be.RGComponent=jx,be.RGComponentErrorBoundary=Bx,be.RGDroppable=zx,be.RGEditLayout=Fx,be.RGPreviewLayout=ph,be.getHeadCommit=Rb,be.getRedoTargetCommitForFile=Cb,be.getTags=ss,be.getUndoTargetCommitForFile=Ob,be.initializeMakeInfinite=Ux,be.listDir=Of,be.loadLibraryComponents=Y_,be.loadProjectComponents=ud,be.setTailwindTheme=Z_,be.syncAndRetry=Pf,be.useAPI=od,be.useAppMetadata=K_,be.useAppSettings=J_,be.useAppVersions=Q_,be.useB64UrlForProjectImage=V_,be.useProject=Rs,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})});
273
+ `,tH=e=>g.jsx(g.Fragment,{children:g.jsx(Q3,{children:g.jsx(eH,{children:g.jsx(J3,{className:"layout",rowHeight:50,cols:12,layout:e.layout,onLayoutChange:e.onLayoutChange,onResizeStop:e.onResize,onDrop:e.onDrop,onDragStop:e.onDrag,compactType:null,preventCollision:!0,draggableCancel:".cancel-drag",isDroppable:!0,draggableHandle:".react-grid-drag-handle",children:e.components})})})});function H_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function el(...e){return t=>{let n=!1;const r=e.map(o=>{const i=H_(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():H_(e[o],null)}}}}function Se(...e){return y.useCallback(el(...e),e)}var Hn=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),i=o.find(nH);if(i){const a=i.props.children,s=o.map(l=>l===i?y.Children.count(a)>1?y.Children.only(null):y.isValidElement(a)?a.props.children:null:l);return g.jsx(Mp,{...r,ref:t,children:y.isValidElement(a)?y.cloneElement(a,void 0,s):null})}return g.jsx(Mp,{...r,ref:t,children:n})});Hn.displayName="Slot";var Mp=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const o=oH(n),i=rH(r,n.props);return n.type!==y.Fragment&&(i.ref=t?el(t,o):o),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});Mp.displayName="SlotClone";var Ru=({children:e})=>g.jsx(g.Fragment,{children:e});function nH(e){return y.isValidElement(e)&&e.type===Ru}function rH(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 oH(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 iH=Hn;const aH=Object.freeze(Object.defineProperty({__proto__:null,Root:iH,Slot:Hn,Slottable:Ru},Symbol.toStringTag,{value:"Module"}));var sH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],he=sH.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Hn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Nu(e,t){e&&nc.flushSync(()=>e.dispatchEvent(t))}var lH="VisuallyHidden",Dp=y.forwardRef((e,t)=>g.jsx(he.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}}));Dp.displayName=lH;var U_=Dp;function cH(e,t){const n=y.createContext(t),r=i=>{const{children:a,...s}=i,l=y.useMemo(()=>s,Object.values(s));return g.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=y.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function at(e,t=[]){let n=[];function r(i,a){const s=y.createContext(a),l=n.length;n=[...n,a];const c=d=>{var w;const{scope:f,children:h,...p}=d,m=((w=f==null?void 0:f[e])==null?void 0:w[l])||s,v=y.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:v,children:h})};c.displayName=i+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[l])||s,p=y.useContext(h);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(a=>y.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,uH(o,...t)]}function uH(...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:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function po(e){const t=e+"CollectionProvider",[n,r]=at(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:p,children:m}=h,v=E.useRef(null),w=E.useRef(new Map).current;return g.jsx(o,{scope:p,itemMap:w,collectionRef:v,children:m})};a.displayName=t;const s=e+"CollectionSlot",l=E.forwardRef((h,p)=>{const{scope:m,children:v}=h,w=i(s,m),b=Se(p,w.collectionRef);return g.jsx(Hn,{ref:b,children:v})});l.displayName=s;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=E.forwardRef((h,p)=>{const{scope:m,children:v,...w}=h,b=E.useRef(null),x=Se(p,b),S=i(c,m);return E.useEffect(()=>(S.itemMap.set(b,{ref:b,...w}),()=>void S.itemMap.delete(b))),g.jsx(Hn,{[u]:"",ref:x,children:v})});d.displayName=c;function f(h){const p=i(e+"CollectionConsumer",h);return E.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,C)=>w.indexOf(S.ref.current)-w.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}function le(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 et(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=dH({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=et(n),l=y.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function dH({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),i=et(t);return y.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var vt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{};function fH(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ht=e=>{const{present:t,children:n}=e,r=hH(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=Se(r.ref,pH(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};ht.displayName="Presence";function hH(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),i=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=fH(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Tu(r.current);i.current=s==="mounted"?c:"none"},[s]),vt(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=Tu(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),vt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=Tu(r.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=h=>{h.target===t&&(i.current=Tu(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Tu(e){return(e==null?void 0:e.animationName)||"none"}function pH(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 mH=y.useId||(()=>{}),gH=0;function _t(e){const[t,n]=y.useState(mH());return vt(()=>{e||n(r=>r??String(gH++))},[e]),e||(t?`radix-${t}`:"")}var Ap="Collapsible",[wH,V_]=at(Ap),[vH,kp]=wH(Ap),W_=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l=!1,c]=lt({prop:r,defaultProp:o,onChange:a});return g.jsx(vH,{scope:n,disabled:i,contentId:_t(),open:l,onOpenToggle:y.useCallback(()=>c(u=>!u),[c]),children:g.jsx(he.div,{"data-state":$p(l),"data-disabled":i?"":void 0,...s,ref:t})})});W_.displayName=Ap;var G_="CollapsibleTrigger",Ip=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=kp(G_,n);return g.jsx(he.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":$p(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:le(e.onClick,o.onOpenToggle)})});Ip.displayName=G_;var Op="CollapsibleContent",jp=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=kp(Op,e.__scopeCollapsible);return g.jsx(ht,{present:n||o.open,children:({present:i})=>g.jsx(yH,{...r,ref:t,present:i})})});jp.displayName=Op;var yH=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=kp(Op,n),[s,l]=y.useState(r),c=y.useRef(null),u=Se(t,c),d=y.useRef(0),f=d.current,h=y.useRef(0),p=h.current,m=a.open||s,v=y.useRef(m),w=y.useRef(void 0);return y.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),vt(()=>{const b=c.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,h.current=x.width,v.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),l(r)}},[a.open,r]),g.jsx(he.div,{"data-state":$p(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&o})});function $p(e){return e?"open":"closed"}var q_=W_,bH=Ip,xH=jp,_H=y.createContext(void 0);function Un(e){const t=y.useContext(_H);return e||t||"ltr"}var Lr="Accordion",SH=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Fp,CH,EH]=po(Lr),[Mu,Kne]=at(Lr,[EH,V_]),Lp=V_(),Y_=E.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return g.jsx(Fp.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?g.jsx(TH,{...i,ref:t}):g.jsx(NH,{...o,ref:t})})});Y_.displayName=Lr;var[K_,PH]=Mu(Lr),[X_,RH]=Mu(Lr,{collapsible:!1}),NH=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=lt({prop:n,defaultProp:r,onChange:o});return g.jsx(K_,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:E.useCallback(()=>i&&l(""),[i,l]),children:g.jsx(X_,{scope:e.__scopeAccordion,collapsible:i,children:g.jsx(Z_,{...a,ref:t})})})}),TH=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=lt({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=E.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return g.jsx(K_,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:g.jsx(X_,{scope:e.__scopeAccordion,collapsible:!0,children:g.jsx(Z_,{...i,ref:t})})})}),[MH,Du]=Mu(Lr),Z_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=E.useRef(null),l=Se(s,t),c=CH(n),d=Un(o)==="ltr",f=le(e.onKeyDown,h=>{var T;if(!SH.includes(h.key))return;const p=h.target,m=c().filter(M=>{var A;return!((A=M.ref.current)!=null&&A.disabled)}),v=m.findIndex(M=>M.ref.current===p),w=m.length;if(v===-1)return;h.preventDefault();let b=v;const x=0,S=w-1,C=()=>{b=v+1,b>S&&(b=x)},N=()=>{b=v-1,b<x&&(b=S)};switch(h.key){case"Home":b=x;break;case"End":b=S;break;case"ArrowRight":i==="horizontal"&&(d?C():N());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?N():C());break;case"ArrowUp":i==="vertical"&&N();break}const R=b%w;(T=m[R].ref.current)==null||T.focus()});return g.jsx(MH,{scope:n,disabled:r,direction:o,orientation:i,children:g.jsx(Fp.Slot,{scope:n,children:g.jsx(he.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),Au="AccordionItem",[DH,zp]=Mu(Au),J_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Du(Au,n),a=PH(Au,n),s=Lp(n),l=_t(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return g.jsx(DH,{scope:n,open:c,disabled:u,triggerId:l,children:g.jsx(q_,{"data-orientation":i.orientation,"data-state":oS(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})})});J_.displayName=Au;var Q_="AccordionHeader",eS=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Du(Lr,n),i=zp(Q_,n);return g.jsx(he.h3,{"data-orientation":o.orientation,"data-state":oS(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});eS.displayName=Q_;var Bp="AccordionTrigger",tS=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Du(Lr,n),i=zp(Bp,n),a=RH(Bp,n),s=Lp(n);return g.jsx(Fp.ItemSlot,{scope:n,children:g.jsx(bH,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});tS.displayName=Bp;var nS="AccordionContent",rS=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Du(Lr,n),i=zp(nS,n),a=Lp(n);return g.jsx(xH,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});rS.displayName=nS;function oS(e){return e?"open":"closed"}var AH=Y_,kH=J_,IH=eS,OH=tS,jH=rS;function $H(e,t=globalThis==null?void 0:globalThis.document){const n=et(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var FH="DismissableLayer",Hp="dismissableLayer.update",LH="dismissableLayer.pointerDownOutside",zH="dismissableLayer.focusOutside",iS,aS=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mo=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=y.useContext(aS),[u,d]=y.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),p=Se(t,R=>d(R)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(v),b=u?m.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=w,C=UH(R=>{const T=R.target,M=[...c.branches].some(A=>A.contains(T));!S||M||(o==null||o(R),a==null||a(R),R.defaultPrevented||s==null||s())},f),N=VH(R=>{const T=R.target;[...c.branches].some(A=>A.contains(T))||(i==null||i(R),a==null||a(R),R.defaultPrevented||s==null||s())},f);return $H(R=>{b===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&s&&(R.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(iS=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),sS(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=iS)}},[u,f,n,c]),y.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),sS())},[u,c]),y.useEffect(()=>{const R=()=>h({});return document.addEventListener(Hp,R),()=>document.removeEventListener(Hp,R)},[]),g.jsx(he.div,{...l,ref:p,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,N.onFocusCapture),onBlurCapture:le(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,C.onPointerDownCapture)})});mo.displayName=FH;var BH="DismissableLayerBranch",HH=y.forwardRef((e,t)=>{const n=y.useContext(aS),r=y.useRef(null),o=Se(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(he.div,{...e,ref:o})});HH.displayName=BH;function UH(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){lS(LH,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}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 VH(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&lS(zH,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 sS(){const e=new CustomEvent(Hp);document.dispatchEvent(e)}function lS(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?Nu(o,i):o.dispatchEvent(i)}var Up="focusScope.autoFocusOnMount",Vp="focusScope.autoFocusOnUnmount",cS={bubbles:!1,cancelable:!0},WH="FocusScope",tl=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=y.useState(null),c=et(o),u=et(i),d=y.useRef(null),f=Se(t,m=>l(m)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let m=function(x){if(h.paused||!s)return;const S=x.target;s.contains(S)?d.current=S:go(d.current,{select:!0})},v=function(x){if(h.paused||!s)return;const S=x.relatedTarget;S!==null&&(s.contains(S)||go(d.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&go(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(w);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,s,h.paused]),y.useEffect(()=>{if(s){fS.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Up,cS);s.addEventListener(Up,c),s.dispatchEvent(w),w.defaultPrevented||(GH(ZH(uS(s)),{select:!0}),document.activeElement===m&&go(s))}return()=>{s.removeEventListener(Up,c),setTimeout(()=>{const w=new CustomEvent(Vp,cS);s.addEventListener(Vp,u),s.dispatchEvent(w),w.defaultPrevented||go(m??document.body,{select:!0}),s.removeEventListener(Vp,u),fS.remove(h)},0)}}},[s,c,u,h]);const p=y.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(v&&w){const b=m.currentTarget,[x,S]=qH(b);x&&S?!m.shiftKey&&w===S?(m.preventDefault(),n&&go(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&go(S,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(he.div,{tabIndex:-1,...a,ref:f,onKeyDown:p})});tl.displayName=WH;function GH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(go(r,{select:t}),document.activeElement!==n)return}function qH(e){const t=uS(e),n=dS(t,e),r=dS(t.reverse(),e);return[n,r]}function uS(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 dS(e,t){for(const n of e)if(!YH(n,{upTo:t}))return n}function YH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function KH(e){return e instanceof HTMLInputElement&&"select"in e}function go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&KH(e)&&t&&e.select()}}var fS=XH();function XH(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hS(e,t),e.unshift(t)},remove(t){var n;e=hS(e,t),(n=e[0])==null||n.resume()}}}function hS(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ZH(e){return e.filter(t=>t.tagName!=="A")}var JH="Portal",nl=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=y.useState(!1);vt(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?tr.createPortal(g.jsx(he.div,{...r,ref:t}),a):null});nl.displayName=JH;var Wp=0;function ku(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pS()),document.body.insertAdjacentElement("beforeend",e[1]??pS()),Wp++,()=>{Wp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wp--}},[])}function pS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Lt=function(){return Lt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Lt.apply(this,arguments)};function Gp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function mS(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var rl="right-scroll-bar-position",ol="width-before-scroll-bar",QH="with-scroll-bars-hidden",eU="--removed-body-scroll-bar-size";function qp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tU(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var nU=typeof window<"u"?y.useLayoutEffect:y.useEffect,gS=new WeakMap;function wS(e,t){var n=tU(null,function(r){return e.forEach(function(o){return qp(o,r)})});return nU(function(){var r=gS.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||qp(s,null)}),i.forEach(function(s){o.has(s)||qp(s,a)})}gS.set(n,e)},[e]),n}function rU(e){return e}function oU(e,t){t===void 0&&(t=rU);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var u=a;a=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return o}function vS(e){e===void 0&&(e={});var t=oU(null);return t.options=Lt({async:!0,ssr:!1},e),t}var yS=function(e){var t=e.sideCar,n=Gp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Lt({},n))};yS.isSideCarExport=!0;function bS(e,t){return e.useMedium(t),yS}var xS=vS(),Yp=function(){},Iu=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Yp,onWheelCapture:Yp,onTouchMoveCapture:Yp}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=e.gapMode,x=Gp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=wS([n,t]),N=Lt(Lt({},x),o);return y.createElement(y.Fragment,null,u&&y.createElement(S,{sideCar:xS,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),a?y.cloneElement(y.Children.only(s),Lt(Lt({},N),{ref:C})):y.createElement(w,Lt({},N,{className:l,ref:C}),s))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Iu.classNames={fullWidth:ol,zeroRight:rl};var iU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iU();return t&&e.setAttribute("nonce",t),e}function sU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var cU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=aU())&&(sU(t,n),lU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uU=function(){var e=cU();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kp=function(){var e=uU(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},dU={left:0,top:0,right:0,gap:0},Xp=function(e){return parseInt(e||"",10)||0},fU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Xp(n),Xp(r),Xp(o)]},hU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dU;var t=fU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},pU=Kp(),oa="data-scroll-locked",mU=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
274
+ .`.concat(QH,` {
275
+ overflow: hidden `).concat(r,`;
276
+ padding-right: `).concat(s,"px ").concat(r,`;
277
+ }
278
+ body[`).concat(oa,`] {
279
+ overflow: hidden `).concat(r,`;
280
+ overscroll-behavior: contain;
281
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
282
+ padding-left: `.concat(o,`px;
283
+ padding-top: `).concat(i,`px;
284
+ padding-right: `).concat(a,`px;
285
+ margin-left:0;
286
+ margin-top:0;
287
+ margin-right: `).concat(s,"px ").concat(r,`;
288
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
289
+ }
290
+
291
+ .`).concat(rl,` {
292
+ right: `).concat(s,"px ").concat(r,`;
293
+ }
294
+
295
+ .`).concat(ol,` {
296
+ margin-right: `).concat(s,"px ").concat(r,`;
297
+ }
298
+
299
+ .`).concat(rl," .").concat(rl,` {
300
+ right: 0 `).concat(r,`;
301
+ }
302
+
303
+ .`).concat(ol," .").concat(ol,` {
304
+ margin-right: 0 `).concat(r,`;
305
+ }
306
+
307
+ body[`).concat(oa,`] {
308
+ `).concat(eU,": ").concat(s,`px;
309
+ }
310
+ `)},_S=function(){var e=parseInt(document.body.getAttribute(oa)||"0",10);return isFinite(e)?e:0},gU=function(){y.useEffect(function(){return document.body.setAttribute(oa,(_S()+1).toString()),function(){var e=_S()-1;e<=0?document.body.removeAttribute(oa):document.body.setAttribute(oa,e.toString())}},[])},SS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;gU();var i=y.useMemo(function(){return hU(o)},[o]);return y.createElement(pU,{styles:mU(i,!t,o,n?"":"!important")})},Zp=!1;if(typeof window<"u")try{var Ou=Object.defineProperty({},"passive",{get:function(){return Zp=!0,!0}});window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{Zp=!1}var ia=Zp?{passive:!1}:!1,wU=function(e){return e.tagName==="TEXTAREA"},CS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wU(e)&&n[t]==="visible")},vU=function(e){return CS(e,"overflowY")},yU=function(e){return CS(e,"overflowX")},ES=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=PS(e,r);if(o){var i=RS(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},xU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},PS=function(e,t){return e==="v"?vU(t):yU(t)},RS=function(e,t){return e==="v"?bU(t):xU(t)},_U=function(e,t){return e==="h"&&t==="rtl"?-1:1},SU=function(e,t,n,r,o){var i=_U(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{var h=RS(e,s),p=h[0],m=h[1],v=h[2],w=m-v-i*p;(p||w)&&PS(e,s)&&(d+=w,f+=p),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},ju=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NS=function(e){return[e.deltaX,e.deltaY]},TS=function(e){return e&&"current"in e?e.current:e},CU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EU=function(e){return`
311
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
312
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
313
+ `)},PU=0,aa=[];function RU(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(PU++)[0],i=y.useState(Kp)[0],a=y.useRef(e);y.useEffect(function(){a.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=mS([e.lockRef.current],(e.shards||[]).map(TS),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var w=ju(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-w[0],S="deltaY"in m?m.deltaY:b[1]-w[1],C,N=m.target,R=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&R==="h"&&N.type==="range")return!1;var T=ES(R,N);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=ES(R,N)),!T)return!1;if(!r.current&&"changedTouches"in m&&(x||S)&&(r.current=C),!C)return!0;var M=r.current||C;return SU(M,v,m,M==="h"?x:S)},[]),l=y.useCallback(function(m){var v=m;if(!(!aa.length||aa[aa.length-1]!==i)){var w="deltaY"in v?NS(v):ju(v),b=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&CU(C.delta,w)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(TS).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?s(v,x[0]):!a.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=y.useCallback(function(m,v,w,b){var x={name:m,delta:v,target:w,should:b,shadowParent:NU(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=y.useCallback(function(m){n.current=ju(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,NS(m),m.target,s(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,ju(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return aa.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ia),document.addEventListener("touchmove",l,ia),document.addEventListener("touchstart",u,ia),function(){aa=aa.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,ia),document.removeEventListener("touchmove",l,ia),document.removeEventListener("touchstart",u,ia)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(i,{styles:EU(o)}):null,h?y.createElement(SS,{gapMode:e.gapMode}):null)}function NU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const TU=bS(xS,RU);var il=y.forwardRef(function(e,t){return y.createElement(Iu,Lt({},e,{ref:t,sideCar:TU}))});il.classNames=Iu.classNames;var MU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sa=new WeakMap,$u=new WeakMap,Fu={},Jp=0,MS=function(e){return e&&(e.host||MS(e.parentNode))},DU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=MS(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},AU=function(e,t,n,r){var o=DU(t,Array.isArray(e)?e:[e]);Fu[n]||(Fu[n]=new WeakMap);var i=Fu[n],a=[],s=new Set,l=new Set(o),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(sa.get(f)||0)+1,v=(i.get(f)||0)+1;sa.set(f,m),i.set(f,v),a.push(f),m===1&&p&&$u.set(f,!0),v===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return u(t),s.clear(),Jp++,function(){a.forEach(function(d){var f=sa.get(d)-1,h=i.get(d)-1;sa.set(d,f),i.set(d,h),f||($u.has(d)||d.removeAttribute(r),$u.delete(d)),h||d.removeAttribute(n)}),Jp--,Jp||(sa=new WeakMap,sa=new WeakMap,$u=new WeakMap,Fu={})}},al=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=MU(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),AU(r,o,n,"aria-hidden")):function(){return null}},Qp="Dialog",[DS,AS]=at(Qp),[kU,Vn]=DS(Qp),kS=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=y.useRef(null),l=y.useRef(null),[c=!1,u]=lt({prop:r,defaultProp:o,onChange:i});return g.jsx(kU,{scope:t,triggerRef:s,contentRef:l,contentId:_t(),titleId:_t(),descriptionId:_t(),open:c,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};kS.displayName=Qp;var IS="DialogTrigger",OS=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(IS,n),i=Se(t,o.triggerRef);return g.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":nm(o.open),...r,ref:i,onClick:le(e.onClick,o.onOpenToggle)})});OS.displayName=IS;var em="DialogPortal",[IU,jS]=DS(em,{forceMount:void 0}),$S=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Vn(em,t);return g.jsx(IU,{scope:t,forceMount:n,children:y.Children.map(r,a=>g.jsx(ht,{present:n||i.open,children:g.jsx(nl,{asChild:!0,container:o,children:a})}))})};$S.displayName=em;var Lu="DialogOverlay",FS=y.forwardRef((e,t)=>{const n=jS(Lu,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Vn(Lu,e.__scopeDialog);return i.modal?g.jsx(ht,{present:r||i.open,children:g.jsx(OU,{...o,ref:t})}):null});FS.displayName=Lu;var OU=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(Lu,n);return g.jsx(il,{as:Hn,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx(he.div,{"data-state":nm(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qo="DialogContent",LS=y.forwardRef((e,t)=>{const n=jS(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Vn(Qo,e.__scopeDialog);return g.jsx(ht,{present:r||i.open,children:i.modal?g.jsx(jU,{...o,ref:t}):g.jsx($U,{...o,ref:t})})});LS.displayName=Qo;var jU=y.forwardRef((e,t)=>{const n=Vn(Qo,e.__scopeDialog),r=y.useRef(null),o=Se(t,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return al(i)},[]),g.jsx(zS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:le(e.onFocusOutside,i=>i.preventDefault())})}),$U=y.forwardRef((e,t)=>{const n=Vn(Qo,e.__scopeDialog),r=y.useRef(!1),o=y.useRef(!1);return g.jsx(zS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),zS=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Vn(Qo,n),l=y.useRef(null),c=Se(t,l);return ku(),g.jsxs(g.Fragment,{children:[g.jsx(tl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(mo,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":nm(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(LU,{titleId:s.titleId}),g.jsx(BU,{contentRef:l,descriptionId:s.descriptionId})]})]})}),tm="DialogTitle",BS=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(tm,n);return g.jsx(he.h2,{id:o.titleId,...r,ref:t})});BS.displayName=tm;var HS="DialogDescription",US=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(HS,n);return g.jsx(he.p,{id:o.descriptionId,...r,ref:t})});US.displayName=HS;var VS="DialogClose",WS=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(VS,n);return g.jsx(he.button,{type:"button",...r,ref:t,onClick:le(e.onClick,()=>o.onOpenChange(!1))})});WS.displayName=VS;function nm(e){return e?"open":"closed"}var GS="DialogTitleWarning",[FU,qS]=cH(GS,{contentName:Qo,titleName:tm,docsSlug:"dialog"}),LU=({titleId:e})=>{const t=qS(GS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
314
+
315
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
316
+
317
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},zU="DialogDescriptionWarning",BU=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qS(zU).contentName}}.`;return y.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},zu=kS,Bu=OS,Hu=$S,la=FS,ca=LS,ua=BS,da=US,fa=WS,YS="AlertDialog",[HU,Xne]=at(YS,[AS]),zr=AS(),KS=e=>{const{__scopeAlertDialog:t,...n}=e,r=zr(t);return g.jsx(zu,{...r,...n,modal:!0})};KS.displayName=YS;var UU="AlertDialogTrigger",XS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=zr(n);return g.jsx(Bu,{...o,...r,ref:t})});XS.displayName=UU;var VU="AlertDialogPortal",ZS=e=>{const{__scopeAlertDialog:t,...n}=e,r=zr(t);return g.jsx(Hu,{...r,...n})};ZS.displayName=VU;var WU="AlertDialogOverlay",JS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=zr(n);return g.jsx(la,{...o,...r,ref:t})});JS.displayName=WU;var ha="AlertDialogContent",[GU,qU]=HU(ha),QS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=zr(n),a=y.useRef(null),s=Se(t,a),l=y.useRef(null);return g.jsx(FU,{contentName:ha,titleName:e1,docsSlug:"alert-dialog",children:g.jsx(GU,{scope:n,cancelRef:l,children:g.jsxs(ca,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:le(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[g.jsx(Ru,{children:r}),g.jsx(KU,{contentRef:a})]})})})});QS.displayName=ha;var e1="AlertDialogTitle",t1=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=zr(n);return g.jsx(ua,{...o,...r,ref:t})});t1.displayName=e1;var n1="AlertDialogDescription",r1=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=zr(n);return g.jsx(da,{...o,...r,ref:t})});r1.displayName=n1;var YU="AlertDialogAction",o1=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=zr(n);return g.jsx(fa,{...o,...r,ref:t})});o1.displayName=YU;var i1="AlertDialogCancel",a1=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=qU(i1,n),i=zr(n),a=Se(t,o);return g.jsx(fa,{...i,...r,ref:a})});a1.displayName=i1;var KU=({contentRef:e})=>{const t=`\`${ha}\` requires a description for the component to be accessible for screen reader users.
318
+
319
+ You can add a description to the \`${ha}\` by passing a \`${n1}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
320
+
321
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ha}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
322
+
323
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},XU=KS,ZU=XS,JU=ZS,s1=JS,l1=QS,c1=o1,u1=a1,d1=t1,f1=r1,QU="AspectRatio",rm=y.forwardRef((e,t)=>{const{ratio:n=1/1,style:r,...o}=e;return g.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":"",children:g.jsx(he.div,{...o,ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});rm.displayName=QU;var eV=rm;const tV=Object.freeze(Object.defineProperty({__proto__:null,AspectRatio:rm,Root:eV},Symbol.toStringTag,{value:"Module"}));var om="Avatar",[nV,Zne]=at(om),[rV,h1]=nV(om),p1=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=y.useState("idle");return g.jsx(rV,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(he.span,{...r,ref:t})})});p1.displayName=om;var m1="AvatarImage",g1=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=h1(m1,n),s=oV(r,i.referrerPolicy),l=et(c=>{o(c),a.onImageLoadingStatusChange(c)});return vt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?g.jsx(he.img,{...i,ref:t,src:r}):null});g1.displayName=m1;var w1="AvatarFallback",v1=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=h1(w1,n),[a,s]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?g.jsx(he.span,{...o,ref:t}):null});v1.displayName=w1;function oV(e,t){const[n,r]=y.useState("idle");return vt(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,a=s=>()=>{o&&r(s)};return r("loading"),i.onload=a("loaded"),i.onerror=a("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var y1=p1,b1=g1,x1=v1;function pa(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function sl(e){const[t,n]=y.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var im="Checkbox",[iV,Jne]=at(im),[aV,sV]=iV(im),_1=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=y.useState(null),p=Se(t,S=>h(S)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=lt({prop:o,defaultProp:i,onChange:c}),x=y.useRef(w);return y.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const C=()=>b(x.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[f,b]),g.jsxs(aV,{scope:n,state:w,disabled:s,children:[g.jsx(he.button,{type:"button",role:"checkbox","aria-checked":wo(w)?"mixed":w,"aria-required":a,"data-state":E1(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onKeyDown:le(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:le(e.onClick,S=>{b(C=>wo(C)?!0:!C),v&&(m.current=S.isPropagationStopped(),m.current||S.stopPropagation())})}),v&&g.jsx(lV,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:wo(i)?!1:i})]})});_1.displayName=im;var S1="CheckboxIndicator",C1=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=sV(S1,n);return g.jsx(ht,{present:r||wo(i.state)||i.state===!0,children:g.jsx(he.span,{"data-state":E1(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});C1.displayName=S1;var lV=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,a=y.useRef(null),s=pa(n),l=sl(t);y.useEffect(()=>{const u=a.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});u.indeterminate=wo(n),h.call(u,wo(n)?!1:n),u.dispatchEvent(p)}},[s,n,r]);const c=y.useRef(wo(n)?!1:n);return g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function wo(e){return e==="indeterminate"}function E1(e){return wo(e)?"indeterminate":e?"checked":"unchecked"}var P1=_1,cV=C1;const uV=["top","right","bottom","left"],vo=Math.min,xn=Math.max,Uu=Math.round,Vu=Math.floor,vr=e=>({x:e,y:e}),dV={left:"right",right:"left",bottom:"top",top:"bottom"},fV={start:"end",end:"start"};function am(e,t,n){return xn(e,vo(t,n))}function Br(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function ma(e){return e.split("-")[1]}function sm(e){return e==="x"?"y":"x"}function lm(e){return e==="y"?"height":"width"}function yo(e){return["top","bottom"].includes(Hr(e))?"y":"x"}function cm(e){return sm(yo(e))}function hV(e,t,n){n===void 0&&(n=!1);const r=ma(e),o=cm(e),i=lm(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Wu(a)),[a,Wu(a)]}function pV(e){const t=Wu(e);return[um(e),t,um(t)]}function um(e){return e.replace(/start|end/g,t=>fV[t])}function mV(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 gV(e,t,n,r){const o=ma(e);let i=mV(Hr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(um)))),i}function Wu(e){return e.replace(/left|right|bottom|top/g,t=>dV[t])}function wV(e){return{top:0,right:0,bottom:0,left:0,...e}}function R1(e){return typeof e!="number"?wV(e):{top:e,right:e,bottom:e,left:e}}function Gu(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 N1(e,t,n){let{reference:r,floating:o}=e;const i=yo(t),a=cm(t),s=lm(a),l=Hr(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ma(t)){case"start":h[a]-=f*(n&&c?-1:1);break;case"end":h[a]+=f*(n&&c?-1:1);break}return h}const vV=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=N1(c,r,l),f=r,h={},p=0;for(let m=0;m<s.length;m++){const{name:v,fn:w}=s[m],{x:b,y:x,data:S,reset:C}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=b??u,d=x??d,h={...h,[v]:{...h[v],...S}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=N1(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function ll(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Br(t,e),p=R1(h),v=s[f?d==="floating"?"reference":"floating":d],w=Gu(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=Gu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(w.top-C.top+p.top)/S.y,bottom:(C.bottom-w.bottom+p.bottom)/S.y,left:(w.left-C.left+p.left)/S.x,right:(C.right-w.right+p.right)/S.x}}const yV=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Br(e,t)||{};if(c==null)return{};const d=R1(u),f={x:n,y:r},h=cm(o),p=lm(h),m=await a.getDimensions(c),v=h==="y",w=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=i.reference[p]+i.reference[h]-f[h]-i.floating[p],C=f[h]-i.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let R=N?N[x]:0;(!R||!await(a.isElement==null?void 0:a.isElement(N)))&&(R=s.floating[x]||i.floating[p]);const T=S/2-C/2,M=R/2-m[p]/2-1,A=vo(d[w],M),k=vo(d[b],M),F=A,L=R-m[p]-k,Y=R/2-m[p]/2+T,ne=am(F,Y,L),q=!l.arrow&&ma(o)!=null&&Y!==ne&&i.reference[p]/2-(Y<F?A:k)-m[p]/2<0,X=q?Y<F?Y-F:Y-L:0;return{[h]:f[h]+X,data:{[h]:ne,centerOffset:Y-ne-X,...q&&{alignmentOffset:X}},reset:q}}}),bV=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:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=Br(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Hr(o),b=yo(s),x=Hr(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!m?[Wu(s)]:pV(s)),N=p!=="none";!f&&N&&C.push(...gV(s,m,p,S));const R=[s,...C],T=await ll(t,v),M=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&M.push(T[w]),d){const Y=hV(o,a,S);M.push(T[Y[0]],T[Y[1]])}if(A=[...A,{placement:o,overflows:M}],!M.every(Y=>Y<=0)){var k,F;const Y=(((k=i.flip)==null?void 0:k.index)||0)+1,ne=R[Y];if(ne)return{data:{index:Y,overflows:A},reset:{placement:ne}};let q=(F=A.filter(X=>X.overflows[0]<=0).sort((X,B)=>X.overflows[1]-B.overflows[1])[0])==null?void 0:F.placement;if(!q)switch(h){case"bestFit":{var L;const X=(L=A.filter(B=>{if(N){const ee=yo(B.placement);return ee===b||ee==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ee=>ee>0).reduce((ee,Z)=>ee+Z,0)]).sort((B,ee)=>B[1]-ee[1])[0])==null?void 0:L[0];X&&(q=X);break}case"initialPlacement":q=s;break}if(o!==q)return{reset:{placement:q}}}return{}}}};function T1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function M1(e){return uV.some(t=>e[t]>=0)}const xV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Br(e,t);switch(r){case"referenceHidden":{const i=await ll(t,{...o,elementContext:"reference"}),a=T1(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:M1(a)}}}case"escaped":{const i=await ll(t,{...o,altBoundary:!0}),a=T1(i,n.floating);return{data:{escapedOffsets:a,escaped:M1(a)}}}default:return{}}}}};async function _V(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Hr(n),s=ma(n),l=yo(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Br(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const SV=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,l=await _V(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},CV=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:v=>{let{x:w,y:b}=v;return{x:w,y:b}}},...l}=Br(e,t),c={x:n,y:r},u=await ll(t,l),d=yo(Hr(o)),f=sm(d);let h=c[f],p=c[d];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",b=h+u[v],x=h-u[w];h=am(b,h,x)}if(a){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",b=p+u[v],x=p-u[w];p=am(b,p,x)}const m=s.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:i,[d]:a}}}}}},EV=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:l=!0,crossAxis:c=!0}=Br(e,t),u={x:n,y:r},d=yo(o),f=sm(d);let h=u[f],p=u[d];const m=Br(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=f==="y"?"height":"width",S=i.reference[f]-i.floating[x]+v.mainAxis,C=i.reference[f]+i.reference[x]-v.mainAxis;h<S?h=S:h>C&&(h=C)}if(c){var w,b;const x=f==="y"?"width":"height",S=["top","left"].includes(Hr(o)),C=i.reference[d]-i.floating[x]+(S&&((w=a.offset)==null?void 0:w[d])||0)+(S?0:v.crossAxis),N=i.reference[d]+i.reference[x]+(S?0:((b=a.offset)==null?void 0:b[d])||0)-(S?v.crossAxis:0);p<C?p=C:p>N&&(p=N)}return{[f]:h,[d]:p}}}},PV=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:l=()=>{},...c}=Br(e,t),u=await ll(t,c),d=Hr(o),f=ma(o),h=yo(o)==="y",{width:p,height:m}=i.floating;let v,w;d==="top"||d==="bottom"?(v=d,w=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,v=f==="end"?"top":"bottom");const b=m-u.top-u.bottom,x=p-u.left-u.right,S=vo(m-u[v],b),C=vo(p-u[w],x),N=!t.middlewareData.shift;let R=S,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=b),N&&!f){const A=xn(u.left,0),k=xn(u.right,0),F=xn(u.top,0),L=xn(u.bottom,0);h?T=p-2*(A!==0||k!==0?A+k:xn(u.left,u.right)):R=m-2*(F!==0||L!==0?F+L:xn(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:R});const M=await a.getDimensions(s.floating);return p!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function qu(){return typeof window<"u"}function ga(e){return D1(e)?(e.nodeName||"").toLowerCase():"#document"}function _n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(D1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D1(e){return qu()?e instanceof Node||e instanceof _n(e).Node:!1}function Wn(e){return qu()?e instanceof Element||e instanceof _n(e).Element:!1}function br(e){return qu()?e instanceof HTMLElement||e instanceof _n(e).HTMLElement:!1}function A1(e){return!qu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _n(e).ShadowRoot}function cl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Gn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function RV(e){return["table","td","th"].includes(ga(e))}function Yu(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function dm(e){const t=fm(),n=Wn(e)?Gn(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function NV(e){let t=bo(e);for(;br(t)&&!wa(t);){if(dm(t))return t;if(Yu(t))return null;t=bo(t)}return null}function fm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wa(e){return["html","body","#document"].includes(ga(e))}function Gn(e){return _n(e).getComputedStyle(e)}function Ku(e){return Wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bo(e){if(ga(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A1(e)&&e.host||yr(e);return A1(t)?t.host:t}function k1(e){const t=bo(e);return wa(t)?e.ownerDocument?e.ownerDocument.body:e.body:br(t)&&cl(t)?t:k1(t)}function ul(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=k1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=_n(o);if(i){const s=hm(a);return t.concat(a,a.visualViewport||[],cl(o)?o:[],s&&n?ul(s):[])}return t.concat(o,ul(o,[],n))}function hm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I1(e){const t=Gn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=br(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Uu(n)!==i||Uu(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function pm(e){return Wn(e)?e:e.contextElement}function va(e){const t=pm(e);if(!br(t))return vr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=I1(t);let a=(i?Uu(n.width):n.width)/r,s=(i?Uu(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const TV=vr(0);function O1(e){const t=_n(e);return!fm()||!t.visualViewport?TV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_n(e)?!1:t}function ei(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=pm(e);let a=vr(1);t&&(r?Wn(r)&&(a=va(r)):a=va(e));const s=MV(i,n,r)?O1(i):vr(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const f=_n(i),h=r&&Wn(r)?_n(r):r;let p=f,m=hm(p);for(;m&&r&&h!==p;){const v=va(m),w=m.getBoundingClientRect(),b=Gn(m),x=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,S=w.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=S,p=_n(m),m=hm(p)}}return Gu({width:u,height:d,x:l,y:c})}function mm(e,t){const n=Ku(e).scrollLeft;return t?t.left+n:ei(yr(e)).left+n}function j1(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:mm(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function DV(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=yr(r),s=t?Yu(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=vr(1);const u=vr(0),d=br(r);if((d||!d&&!i)&&((ga(r)!=="body"||cl(a))&&(l=Ku(r)),br(r))){const h=ei(r);c=va(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=a&&!d&&!i?j1(a,l,!0):vr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function AV(e){return Array.from(e.getClientRects())}function kV(e){const t=yr(e),n=Ku(e),r=e.ownerDocument.body,o=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+mm(e);const s=-n.scrollTop;return Gn(r).direction==="rtl"&&(a+=xn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function IV(e,t){const n=_n(e),r=yr(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=fm();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function OV(e,t){const n=ei(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=br(e)?va(e):vr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function $1(e,t,n){let r;if(t==="viewport")r=IV(e,n);else if(t==="document")r=kV(yr(e));else if(Wn(t))r=OV(t,n);else{const o=O1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gu(r)}function F1(e,t){const n=bo(e);return n===t||!Wn(n)||wa(n)?!1:Gn(n).position==="fixed"||F1(n,t)}function jV(e,t){const n=t.get(e);if(n)return n;let r=ul(e,[],!1).filter(s=>Wn(s)&&ga(s)!=="body"),o=null;const i=Gn(e).position==="fixed";let a=i?bo(e):e;for(;Wn(a)&&!wa(a);){const s=Gn(a),l=dm(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||cl(a)&&!l&&F1(e,a))?r=r.filter(u=>u!==a):o=s,a=bo(a)}return t.set(e,r),r}function $V(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Yu(t)?[]:jV(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=$1(t,u,o);return c.top=xn(d.top,c.top),c.right=vo(d.right,c.right),c.bottom=vo(d.bottom,c.bottom),c.left=xn(d.left,c.left),c},$1(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function FV(e){const{width:t,height:n}=I1(e);return{width:t,height:n}}function LV(e,t,n){const r=br(t),o=yr(t),i=n==="fixed",a=ei(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=vr(0);if(r||!r&&!i)if((ga(t)!=="body"||cl(o))&&(s=Ku(t)),r){const f=ei(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=mm(o));const c=o&&!r&&!i?j1(o,s):vr(0),u=a.left+s.scrollLeft-l.x-c.x,d=a.top+s.scrollTop-l.y-c.y;return{x:u,y:d,width:a.width,height:a.height}}function gm(e){return Gn(e).position==="static"}function L1(e,t){if(!br(e)||Gn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yr(e)===n&&(n=n.ownerDocument.body),n}function z1(e,t){const n=_n(e);if(Yu(e))return n;if(!br(e)){let o=bo(e);for(;o&&!wa(o);){if(Wn(o)&&!gm(o))return o;o=bo(o)}return n}let r=L1(e,t);for(;r&&RV(r)&&gm(r);)r=L1(r,t);return r&&wa(r)&&gm(r)&&!dm(r)?n:r||NV(e)||n}const zV=async function(e){const t=this.getOffsetParent||z1,n=this.getDimensions,r=await n(e.floating);return{reference:LV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function BV(e){return Gn(e).direction==="rtl"}const HV={convertOffsetParentRelativeRectToViewportRelativeRect:DV,getDocumentElement:yr,getClippingRect:$V,getOffsetParent:z1,getElementRects:zV,getClientRects:AV,getDimensions:FV,getScale:va,isElement:Wn,isRTL:BV};function B1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UV(e,t){let n=null,r;const o=yr(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(s||t(),!f||!h)return;const p=Vu(d),m=Vu(o.clientWidth-(u+f)),v=Vu(o.clientHeight-(d+h)),w=Vu(u),x={rootMargin:-p+"px "+-m+"px "+-v+"px "+-w+"px",threshold:xn(0,vo(1,l))||1};let S=!0;function C(N){const R=N[0].intersectionRatio;if(R!==l){if(!S)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!B1(c,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),i}function VV(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:l=!1}=r,c=pm(e),u=o||i?[...c?ul(c):[],...ul(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&s?UV(c,n):null;let f=-1,h=null;a&&(h=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,m=l?ei(e):null;l&&v();function v(){const w=ei(e);m&&!B1(m,w)&&n(),m=w,p=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const WV=SV,GV=CV,qV=bV,YV=PV,KV=xV,H1=yV,XV=EV,ZV=(e,t,n)=>{const r=new Map,o={platform:HV,...n},i={...o.platform,_c:r};return vV(e,t,{...o,platform:i})};var Xu=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Zu(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(!Zu(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)&&!Zu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function U1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V1(e,t){const n=U1(e);return Math.round(t*n)/n}function wm(e){const t=y.useRef(e);return Xu(()=>{t.current=e}),t}function JV(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:l,open:c}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=y.useState(r);Zu(f,r)||h(r);const[p,m]=y.useState(null),[v,w]=y.useState(null),b=y.useCallback(B=>{B!==N.current&&(N.current=B,m(B))},[]),x=y.useCallback(B=>{B!==R.current&&(R.current=B,w(B))},[]),S=i||p,C=a||v,N=y.useRef(null),R=y.useRef(null),T=y.useRef(u),M=l!=null,A=wm(l),k=wm(o),F=wm(c),L=y.useCallback(()=>{if(!N.current||!R.current)return;const B={placement:t,strategy:n,middleware:f};k.current&&(B.platform=k.current),ZV(N.current,R.current,B).then(ee=>{const Z={...ee,isPositioned:F.current!==!1};Y.current&&!Zu(T.current,Z)&&(T.current=Z,nc.flushSync(()=>{d(Z)}))})},[f,t,n,k,F]);Xu(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const Y=y.useRef(!1);Xu(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Xu(()=>{if(S&&(N.current=S),C&&(R.current=C),S&&C){if(A.current)return A.current(S,C,L);L()}},[S,C,L,A,M]);const ne=y.useMemo(()=>({reference:N,floating:R,setReference:b,setFloating:x}),[b,x]),q=y.useMemo(()=>({reference:S,floating:C}),[S,C]),X=y.useMemo(()=>{const B={position:n,left:0,top:0};if(!q.floating)return B;const ee=V1(q.floating,u.x),Z=V1(q.floating,u.y);return s?{...B,transform:"translate("+ee+"px, "+Z+"px)",...U1(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:Z}},[n,s,q.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:L,refs:ne,elements:q,floatingStyles:X}),[u,L,ne,q,X])}const QV=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?H1({element:r.current,padding:o}).fn(n):{}:r?H1({element:r,padding:o}).fn(n):{}}}},eW=(e,t)=>({...WV(e),options:[e,t]}),tW=(e,t)=>({...GV(e),options:[e,t]}),nW=(e,t)=>({...XV(e),options:[e,t]}),rW=(e,t)=>({...qV(e),options:[e,t]}),oW=(e,t)=>({...YV(e),options:[e,t]}),iW=(e,t)=>({...KV(e),options:[e,t]}),aW=(e,t)=>({...QV(e),options:[e,t]});var sW="Arrow",W1=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(he.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});W1.displayName=sW;var lW=W1,vm="Popper",[G1,xr]=at(vm),[cW,q1]=G1(vm),Y1=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return g.jsx(cW,{scope:t,anchor:r,onAnchorChange:o,children:n})};Y1.displayName=vm;var K1="PopperAnchor",X1=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=q1(K1,n),a=y.useRef(null),s=Se(t,a);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(he.div,{...o,ref:s})});X1.displayName=K1;var ym="PopperContent",[uW,dW]=G1(ym),Z1=y.forwardRef((e,t)=>{var G,$,te,ie,re,z;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=e,v=q1(ym,n),[w,b]=y.useState(null),x=Se(t,se=>b(se)),[S,C]=y.useState(null),N=sl(S),R=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,M=r+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(c)?c:[c],F=k.length>0,L={padding:A,boundary:k.filter(hW),altBoundary:F},{refs:Y,floatingStyles:ne,placement:q,isPositioned:X,middlewareData:B}=JV({strategy:"fixed",placement:M,whileElementsMounted:(...se)=>VV(...se,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[eW({mainAxis:o+T,alignmentAxis:a}),l&&tW({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?nW():void 0,...L}),l&&rW({...L}),oW({...L,apply:({elements:se,rects:oe,availableWidth:fe,availableHeight:ge})=>{const{width:pe,height:me}=oe.reference,_e=se.floating.style;_e.setProperty("--radix-popper-available-width",`${fe}px`),_e.setProperty("--radix-popper-available-height",`${ge}px`),_e.setProperty("--radix-popper-anchor-width",`${pe}px`),_e.setProperty("--radix-popper-anchor-height",`${me}px`)}}),S&&aW({element:S,padding:s}),pW({arrowWidth:R,arrowHeight:T}),f&&iW({strategy:"referenceHidden",...L})]}),[ee,Z]=eC(q),J=et(p);vt(()=>{X&&(J==null||J())},[X,J]);const H=(G=B.arrow)==null?void 0:G.x,O=($=B.arrow)==null?void 0:$.y,V=((te=B.arrow)==null?void 0:te.centerOffset)!==0,[ae,j]=y.useState();return vt(()=>{w&&j(window.getComputedStyle(w).zIndex)},[w]),g.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:X?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(ie=B.transformOrigin)==null?void 0:ie.x,(re=B.transformOrigin)==null?void 0:re.y].join(" "),...((z=B.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(uW,{scope:n,placedSide:ee,onArrowChange:C,arrowX:H,arrowY:O,shouldHideArrow:V,children:g.jsx(he.div,{"data-side":ee,"data-align":Z,...m,ref:x,style:{...m.style,animation:X?void 0:"none"}})})})});Z1.displayName=ym;var J1="PopperArrow",fW={top:"bottom",right:"left",bottom:"top",left:"right"},Q1=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=dW(J1,r),a=fW[i.placedSide];return g.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:g.jsx(lW,{...o,ref:n,style:{...o.style,display:"block"}})})});Q1.displayName=J1;function hW(e){return e!==null}var pW=e=>({name:"transformOrigin",options:e,fn(t){var v,w,b;const{placement:n,rects:r,middlewareData:o}=t,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=eC(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,h=(((b=o.arrow)==null?void 0:b.y)??0)+l/2;let p="",m="";return c==="bottom"?(p=a?d:`${f}px`,m=`${-l}px`):c==="top"?(p=a?d:`${f}px`,m=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,m=a?d:`${h}px`):c==="left"&&(p=`${r.floating.width+l}px`,m=a?d:`${h}px`),{data:{x:p,y:m}}}});function eC(e){const[t,n="center"]=e.split("-");return[t,n]}var ya=Y1,ba=X1,dl=Z1,fl=Q1,bm="rovingFocusGroup.onEntryFocus",mW={bubbles:!1,cancelable:!0},Ju="RovingFocusGroup",[xm,tC,gW]=po(Ju),[wW,_r]=at(Ju,[gW]),[vW,yW]=wW(Ju),nC=y.forwardRef((e,t)=>g.jsx(xm.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(xm.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(bW,{...e,ref:t})})}));nC.displayName=Ju;var bW=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),h=Se(t,f),p=Un(i),[m=null,v]=lt({prop:a,defaultProp:s,onChange:l}),[w,b]=y.useState(!1),x=et(c),S=tC(n),C=y.useRef(!1),[N,R]=y.useState(0);return y.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(bm,x),()=>T.removeEventListener(bm,x)},[x]),g.jsx(vW,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:y.useCallback(T=>v(T),[v]),onItemShiftTab:y.useCallback(()=>b(!0),[]),onFocusableItemAdd:y.useCallback(()=>R(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>R(T=>T-1),[]),children:g.jsx(he.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:le(e.onMouseDown,()=>{C.current=!0}),onFocus:le(e.onFocus,T=>{const M=!C.current;if(T.target===T.currentTarget&&M&&!w){const A=new CustomEvent(bm,mW);if(T.currentTarget.dispatchEvent(A),!A.defaultPrevented){const k=S().filter(q=>q.focusable),F=k.find(q=>q.active),L=k.find(q=>q.id===m),ne=[F,L,...k].filter(Boolean).map(q=>q.ref.current);iC(ne,u)}}C.current=!1}),onBlur:le(e.onBlur,()=>b(!1))})})}),rC="RovingFocusGroupItem",oC=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=_t(),l=i||s,c=yW(rC,n),u=c.currentTabStopId===l,d=tC(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return y.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(xm.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(he.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:le(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:le(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:le(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=SW(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let w=d().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(p.currentTarget);w=c.loop?CW(w,b+1):w.slice(b+1)}setTimeout(()=>iC(w))}})})})});oC.displayName=rC;var xW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _W(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function SW(e,t,n){const r=_W(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xW[r]}function iC(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function CW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hl=nC,pl=oC,_m=["Enter"," "],EW=["ArrowDown","PageUp","Home"],aC=["ArrowUp","PageDown","End"],PW=[...EW,...aC],RW={ltr:[..._m,"ArrowRight"],rtl:[..._m,"ArrowLeft"]},NW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ml="Menu",[gl,TW,MW]=po(ml),[ti,wl]=at(ml,[MW,xr,_r]),vl=xr(),sC=_r(),[lC,xo]=ti(ml),[DW,yl]=ti(ml),cC=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=vl(t),[l,c]=y.useState(null),u=y.useRef(!1),d=et(i),f=Un(o);return y.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.jsx(ya,{...s,children:g.jsx(lC,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:g.jsx(DW,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};cC.displayName=ml;var AW="MenuAnchor",Sm=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=vl(n);return g.jsx(ba,{...o,...r,ref:t})});Sm.displayName=AW;var Cm="MenuPortal",[kW,uC]=ti(Cm,{forceMount:void 0}),dC=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=xo(Cm,t);return g.jsx(kW,{scope:t,forceMount:n,children:g.jsx(ht,{present:n||i.open,children:g.jsx(nl,{asChild:!0,container:o,children:r})})})};dC.displayName=Cm;var In="MenuContent",[IW,Em]=ti(In),fC=y.forwardRef((e,t)=>{const n=uC(In,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=xo(In,e.__scopeMenu),a=yl(In,e.__scopeMenu);return g.jsx(gl.Provider,{scope:e.__scopeMenu,children:g.jsx(ht,{present:r||i.open,children:g.jsx(gl.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(OW,{...o,ref:t}):g.jsx(jW,{...o,ref:t})})})})}),OW=y.forwardRef((e,t)=>{const n=xo(In,e.__scopeMenu),r=y.useRef(null),o=Se(t,r);return y.useEffect(()=>{const i=r.current;if(i)return al(i)},[]),g.jsx(Pm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:le(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),jW=y.forwardRef((e,t)=>{const n=xo(In,e.__scopeMenu);return g.jsx(Pm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Pm=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=e,v=xo(In,n),w=yl(In,n),b=vl(n),x=sC(n),S=TW(n),[C,N]=y.useState(null),R=y.useRef(null),T=Se(t,R,v.onContentChange),M=y.useRef(0),A=y.useRef(""),k=y.useRef(0),F=y.useRef(null),L=y.useRef("right"),Y=y.useRef(0),ne=p?il:y.Fragment,q=p?{as:Hn,allowPinchZoom:!0}:void 0,X=ee=>{var G,$;const Z=A.current+ee,J=S().filter(te=>!te.disabled),H=document.activeElement,O=(G=J.find(te=>te.ref.current===H))==null?void 0:G.textValue,V=J.map(te=>te.textValue),ae=YW(V,Z,O),j=($=J.find(te=>te.textValue===ae))==null?void 0:$.ref.current;(function te(ie){A.current=ie,window.clearTimeout(M.current),ie!==""&&(M.current=window.setTimeout(()=>te(""),1e3))})(Z),j&&setTimeout(()=>j.focus())};y.useEffect(()=>()=>window.clearTimeout(M.current),[]),ku();const B=y.useCallback(ee=>{var J,H;return L.current===((J=F.current)==null?void 0:J.side)&&XW(ee,(H=F.current)==null?void 0:H.area)},[]);return g.jsx(IW,{scope:n,searchRef:A,onItemEnter:y.useCallback(ee=>{B(ee)&&ee.preventDefault()},[B]),onItemLeave:y.useCallback(ee=>{var Z;B(ee)||((Z=R.current)==null||Z.focus(),N(null))},[B]),onTriggerLeave:y.useCallback(ee=>{B(ee)&&ee.preventDefault()},[B]),pointerGraceTimerRef:k,onPointerGraceIntentChange:y.useCallback(ee=>{F.current=ee},[]),children:g.jsx(ne,{...q,children:g.jsx(tl,{asChild:!0,trapped:o,onMountAutoFocus:le(i,ee=>{var Z;ee.preventDefault(),(Z=R.current)==null||Z.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(mo,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(hl,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:le(l,ee=>{w.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(dl,{role:"menu","aria-orientation":"vertical","data-state":MC(v.open),"data-radix-menu-content":"",dir:w.dir,...b,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:le(m.onKeyDown,ee=>{const J=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,H=ee.ctrlKey||ee.altKey||ee.metaKey,O=ee.key.length===1;J&&(ee.key==="Tab"&&ee.preventDefault(),!H&&O&&X(ee.key));const V=R.current;if(ee.target!==V||!PW.includes(ee.key))return;ee.preventDefault();const j=S().filter(G=>!G.disabled).map(G=>G.ref.current);aC.includes(ee.key)&&j.reverse(),GW(j)}),onBlur:le(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(M.current),A.current="")}),onPointerMove:le(e.onPointerMove,xl(ee=>{const Z=ee.target,J=Y.current!==ee.clientX;if(ee.currentTarget.contains(Z)&&J){const H=ee.clientX>Y.current?"right":"left";L.current=H,Y.current=ee.clientX}}))})})})})})})});fC.displayName=In;var $W="MenuGroup",Rm=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(he.div,{role:"group",...r,ref:t})});Rm.displayName=$W;var FW="MenuLabel",hC=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(he.div,{...r,ref:t})});hC.displayName=FW;var Qu="MenuItem",pC="menu.itemSelect",ed=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=y.useRef(null),a=yl(Qu,e.__scopeMenu),s=Em(Qu,e.__scopeMenu),l=Se(t,i),c=y.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(pC,{bubbles:!0,cancelable:!0});d.addEventListener(pC,h=>r==null?void 0:r(h),{once:!0}),Nu(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return g.jsx(mC,{...o,ref:l,disabled:n,onClick:le(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:le(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:le(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||_m.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ed.displayName=Qu;var mC=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=Em(Qu,n),s=sC(n),l=y.useRef(null),c=Se(t,l),[u,d]=y.useState(!1),[f,h]=y.useState("");return y.useEffect(()=>{const p=l.current;p&&h((p.textContent??"").trim())},[i.children]),g.jsx(gl.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:g.jsx(pl,{asChild:!0,...s,focusable:!r,children:g.jsx(he.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:le(e.onPointerMove,xl(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:le(e.onPointerLeave,xl(p=>a.onItemLeave(p))),onFocus:le(e.onFocus,()=>d(!0)),onBlur:le(e.onBlur,()=>d(!1))})})})}),LW="MenuCheckboxItem",gC=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(xC,{scope:e.__scopeMenu,checked:n,children:g.jsx(ed,{role:"menuitemcheckbox","aria-checked":td(n)?"mixed":n,...o,ref:t,"data-state":Mm(n),onSelect:le(o.onSelect,()=>r==null?void 0:r(td(n)?!0:!n),{checkForDefaultPrevented:!1})})})});gC.displayName=LW;var wC="MenuRadioGroup",[zW,BW]=ti(wC,{value:void 0,onValueChange:()=>{}}),vC=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=et(r);return g.jsx(zW,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Rm,{...o,ref:t})})});vC.displayName=wC;var yC="MenuRadioItem",bC=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=BW(yC,e.__scopeMenu),i=n===o.value;return g.jsx(xC,{scope:e.__scopeMenu,checked:i,children:g.jsx(ed,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Mm(i),onSelect:le(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});bC.displayName=yC;var Nm="MenuItemIndicator",[xC,HW]=ti(Nm,{checked:!1}),_C=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=HW(Nm,n);return g.jsx(ht,{present:r||td(i.checked)||i.checked===!0,children:g.jsx(he.span,{...o,ref:t,"data-state":Mm(i.checked)})})});_C.displayName=Nm;var UW="MenuSeparator",SC=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});SC.displayName=UW;var VW="MenuArrow",CC=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=vl(n);return g.jsx(fl,{...o,...r,ref:t})});CC.displayName=VW;var Tm="MenuSub",[WW,EC]=ti(Tm),PC=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=xo(Tm,t),a=vl(t),[s,l]=y.useState(null),[c,u]=y.useState(null),d=et(o);return y.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),g.jsx(ya,{...a,children:g.jsx(lC,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:g.jsx(WW,{scope:t,contentId:_t(),triggerId:_t(),trigger:s,onTriggerChange:l,children:n})})})};PC.displayName=Tm;var bl="MenuSubTrigger",RC=y.forwardRef((e,t)=>{const n=xo(bl,e.__scopeMenu),r=yl(bl,e.__scopeMenu),o=EC(bl,e.__scopeMenu),i=Em(bl,e.__scopeMenu),a=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=y.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return y.useEffect(()=>u,[u]),y.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),g.jsx(Sm,{asChild:!0,...c,children:g.jsx(mC,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":MC(n.open),...e,ref:el(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:le(e.onPointerMove,xl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:le(e.onPointerLeave,xl(d=>{var h,p;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(p=n.content)==null?void 0:p.dataset.side,v=m==="right",w=v?-5:5,b=f[v?"left":"right"],x=f[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:b,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:b,y:f.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:le(e.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";e.disabled||f&&d.key===" "||RW[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});RC.displayName=bl;var NC="MenuSubContent",TC=y.forwardRef((e,t)=>{const n=uC(In,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=xo(In,e.__scopeMenu),a=yl(In,e.__scopeMenu),s=EC(NC,e.__scopeMenu),l=y.useRef(null),c=Se(t,l);return g.jsx(gl.Provider,{scope:e.__scopeMenu,children:g.jsx(ht,{present:r||i.open,children:g.jsx(gl.Slot,{scope:e.__scopeMenu,children:g.jsx(Pm,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:le(e.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:le(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:le(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=NW[a.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=s.trigger)==null||h.focus(),u.preventDefault())})})})})})});TC.displayName=NC;function MC(e){return e?"open":"closed"}function td(e){return e==="indeterminate"}function Mm(e){return td(e)?"indeterminate":e?"checked":"unchecked"}function GW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function YW(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=qW(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function KW(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,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function XW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return KW(n,t)}function xl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Dm=cC,Am=Sm,km=dC,Im=fC,Om=Rm,jm=hC,$m=ed,Fm=gC,Lm=vC,zm=bC,Bm=_C,Hm=SC,Um=CC,Vm=PC,Wm=RC,Gm=TC,qm="ContextMenu",[ZW,Qne]=at(qm,[wl]),zt=wl(),[JW,DC]=ZW(qm),AC=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[a,s]=y.useState(!1),l=zt(t),c=et(r),u=y.useCallback(d=>{s(d),c(d)},[c]);return g.jsx(JW,{scope:t,open:a,onOpenChange:u,modal:i,children:g.jsx(Dm,{...l,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};AC.displayName=qm;var kC="ContextMenuTrigger",IC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,i=DC(kC,n),a=zt(n),s=y.useRef({x:0,y:0}),l=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=y.useRef(0),u=y.useCallback(()=>window.clearTimeout(c.current),[]),d=f=>{s.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return y.useEffect(()=>u,[u]),y.useEffect(()=>void(r&&u()),[r,u]),g.jsxs(g.Fragment,{children:[g.jsx(Am,{...a,virtualRef:l}),g.jsx(he.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:le(e.onContextMenu,f=>{u(),d(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:le(e.onPointerDown,nd(f=>{u(),c.current=window.setTimeout(()=>d(f),700)})),onPointerMove:r?e.onPointerMove:le(e.onPointerMove,nd(u)),onPointerCancel:r?e.onPointerCancel:le(e.onPointerCancel,nd(u)),onPointerUp:r?e.onPointerUp:le(e.onPointerUp,nd(u))})]})});IC.displayName=kC;var QW="ContextMenuPortal",OC=e=>{const{__scopeContextMenu:t,...n}=e,r=zt(t);return g.jsx(km,{...r,...n})};OC.displayName=QW;var jC="ContextMenuContent",$C=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=DC(jC,n),i=zt(n),a=y.useRef(!1);return g.jsx(Im,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)==null||l.call(e,s),!s.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$C.displayName=jC;var eG="ContextMenuGroup",FC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Om,{...o,...r,ref:t})});FC.displayName=eG;var tG="ContextMenuLabel",LC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(jm,{...o,...r,ref:t})});LC.displayName=tG;var nG="ContextMenuItem",zC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx($m,{...o,...r,ref:t})});zC.displayName=nG;var rG="ContextMenuCheckboxItem",BC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Fm,{...o,...r,ref:t})});BC.displayName=rG;var oG="ContextMenuRadioGroup",HC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Lm,{...o,...r,ref:t})});HC.displayName=oG;var iG="ContextMenuRadioItem",UC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(zm,{...o,...r,ref:t})});UC.displayName=iG;var aG="ContextMenuItemIndicator",VC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Bm,{...o,...r,ref:t})});VC.displayName=aG;var sG="ContextMenuSeparator",WC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Hm,{...o,...r,ref:t})});WC.displayName=sG;var lG="ContextMenuArrow",cG=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Um,{...o,...r,ref:t})});cG.displayName=lG;var uG="ContextMenuSub",GC=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:i}=e,a=zt(t),[s,l]=lt({prop:o,defaultProp:i,onChange:r});return g.jsx(Vm,{...a,open:s,onOpenChange:l,children:n})};GC.displayName=uG;var dG="ContextMenuSubTrigger",qC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Wm,{...o,...r,ref:t})});qC.displayName=dG;var fG="ContextMenuSubContent",YC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=zt(n);return g.jsx(Gm,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});YC.displayName=fG;function nd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var hG=AC,pG=IC,KC=OC,XC=$C,mG=FC,ZC=LC,JC=zC,QC=BC,gG=HC,eE=UC,tE=VC,nE=WC,wG=GC,rE=qC,oE=YC,Ym="DropdownMenu",[vG,ere]=at(Ym,[wl]),Bt=wl(),[yG,iE]=vG(Ym),aE=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=Bt(t),c=y.useRef(null),[u=!1,d]=lt({prop:o,defaultProp:i,onChange:a});return g.jsx(yG,{scope:t,triggerId:_t(),triggerRef:c,contentId:_t(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:s,children:g.jsx(Dm,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};aE.displayName=Ym;var sE="DropdownMenuTrigger",lE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=iE(sE,n),a=Bt(n);return g.jsx(Am,{asChild:!0,...a,children:g.jsx(he.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:el(t,i.triggerRef),onPointerDown:le(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:le(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});lE.displayName=sE;var bG="DropdownMenuPortal",cE=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Bt(t);return g.jsx(km,{...r,...n})};cE.displayName=bG;var uE="DropdownMenuContent",dE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=iE(uE,n),i=Bt(n),a=y.useRef(!1);return g.jsx(Im,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:le(e.onCloseAutoFocus,s=>{var l;a.current||(l=o.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:le(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});dE.displayName=uE;var xG="DropdownMenuGroup",fE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Om,{...o,...r,ref:t})});fE.displayName=xG;var _G="DropdownMenuLabel",hE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(jm,{...o,...r,ref:t})});hE.displayName=_G;var SG="DropdownMenuItem",pE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx($m,{...o,...r,ref:t})});pE.displayName=SG;var CG="DropdownMenuCheckboxItem",mE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Fm,{...o,...r,ref:t})});mE.displayName=CG;var EG="DropdownMenuRadioGroup",gE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Lm,{...o,...r,ref:t})});gE.displayName=EG;var PG="DropdownMenuRadioItem",wE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(zm,{...o,...r,ref:t})});wE.displayName=PG;var RG="DropdownMenuItemIndicator",vE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Bm,{...o,...r,ref:t})});vE.displayName=RG;var NG="DropdownMenuSeparator",yE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Hm,{...o,...r,ref:t})});yE.displayName=NG;var TG="DropdownMenuArrow",MG=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Um,{...o,...r,ref:t})});MG.displayName=TG;var DG=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=Bt(t),[s=!1,l]=lt({prop:r,defaultProp:i,onChange:o});return g.jsx(Vm,{...a,open:s,onOpenChange:l,children:n})},AG="DropdownMenuSubTrigger",bE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Wm,{...o,...r,ref:t})});bE.displayName=AG;var kG="DropdownMenuSubContent",xE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Bt(n);return g.jsx(Gm,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xE.displayName=kG;var IG=aE,OG=lE,_E=cE,SE=dE,jG=fE,CE=hE,EE=pE,PE=mE,$G=gE,RE=wE,NE=vE,TE=yE,FG=DG,ME=bE,DE=xE,LG="Label",AE=y.forwardRef((e,t)=>g.jsx(he.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())}}));AE.displayName=LG;var kE=AE,Km,Xm="HoverCard",[IE,tre]=at(Xm,[xr]),rd=xr(),[zG,Zm]=IE(Xm),OE=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=rd(t),c=y.useRef(0),u=y.useRef(0),d=y.useRef(!1),f=y.useRef(!1),[h=!1,p]=lt({prop:r,defaultProp:o,onChange:i}),m=y.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>p(!0),a)},[a,p]),v=y.useCallback(()=>{clearTimeout(c.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),s))},[s,p]),w=y.useCallback(()=>p(!1),[p]);return y.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),g.jsx(zG,{scope:t,open:h,onOpenChange:p,onOpen:m,onClose:v,onDismiss:w,hasSelectionRef:d,isPointerDownOnContentRef:f,children:g.jsx(ya,{...l,children:n})})};OE.displayName=Xm;var jE="HoverCardTrigger",$E=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Zm(jE,n),i=rd(n);return g.jsx(ba,{asChild:!0,...i,children:g.jsx(he.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:le(e.onPointerEnter,id(o.onOpen)),onPointerLeave:le(e.onPointerLeave,id(o.onClose)),onFocus:le(e.onFocus,o.onOpen),onBlur:le(e.onBlur,o.onClose),onTouchStart:le(e.onTouchStart,a=>a.preventDefault())})})});$E.displayName=jE;var BG="HoverCardPortal",[nre,HG]=IE(BG,{forceMount:void 0}),od="HoverCardContent",FE=y.forwardRef((e,t)=>{const n=HG(od,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=Zm(od,e.__scopeHoverCard);return g.jsx(ht,{present:r||i.open,children:g.jsx(UG,{"data-state":i.open?"open":"closed",...o,onPointerEnter:le(e.onPointerEnter,id(i.onOpen)),onPointerLeave:le(e.onPointerLeave,id(i.onClose)),ref:t})})});FE.displayName=od;var UG=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=Zm(od,n),c=rd(n),u=y.useRef(null),d=Se(t,u),[f,h]=y.useState(!1);return y.useEffect(()=>{if(f){const p=document.body;return Km=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Km,p.style.webkitUserSelect=Km}}},[f]),y.useEffect(()=>{if(u.current){const p=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),y.useEffect(()=>{u.current&&GG(u.current).forEach(m=>m.setAttribute("tabindex","-1"))}),g.jsx(mo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:le(i,p=>{p.preventDefault()}),onDismiss:l.onDismiss,children:g.jsx(dl,{...c,...s,onPointerDown:le(s.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),VG="HoverCardArrow",WG=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=rd(n);return g.jsx(fl,{...o,...r,ref:t})});WG.displayName=VG;function id(e){return t=>t.pointerType==="touch"?void 0:e()}function GG(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var qG=OE,YG=$E,LE=FE,ad="Menubar",[Jm,KG,XG]=po(ad),[zE,rre]=at(ad,[XG,_r]),Ht=wl(),BE=_r(),[ZG,Qm]=zE(ad),HE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:i,loop:a=!0,dir:s,...l}=e,c=Un(s),u=BE(n),[d="",f]=lt({prop:r,onChange:o,defaultProp:i}),[h,p]=y.useState(null);return g.jsx(ZG,{scope:n,value:d,onMenuOpen:y.useCallback(m=>{f(m),p(m)},[f]),onMenuClose:y.useCallback(()=>f(""),[f]),onMenuToggle:y.useCallback(m=>{f(v=>v?"":m),p(m)},[f]),dir:c,loop:a,children:g.jsx(Jm.Provider,{scope:n,children:g.jsx(Jm.Slot,{scope:n,children:g.jsx(hl,{asChild:!0,...u,orientation:"horizontal",loop:a,dir:c,currentTabStopId:h,onCurrentTabStopIdChange:p,children:g.jsx(he.div,{role:"menubar",...l,ref:t})})})})})});HE.displayName=ad;var eg="MenubarMenu",[JG,UE]=zE(eg),VE=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=_t(),i=n||o||"LEGACY_REACT_AUTO_VALUE",a=Qm(eg,t),s=Ht(t),l=y.useRef(null),c=y.useRef(!1),u=a.value===i;return y.useEffect(()=>{u||(c.current=!1)},[u]),g.jsx(JG,{scope:t,value:i,triggerId:_t(),triggerRef:l,contentId:_t(),wasKeyboardTriggerOpenRef:c,children:g.jsx(Dm,{...s,open:u,onOpenChange:d=>{d||a.onMenuClose()},modal:!1,dir:a.dir,...r})})};VE.displayName=eg;var tg="MenubarTrigger",WE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,i=BE(n),a=Ht(n),s=Qm(tg,n),l=UE(tg,n),c=y.useRef(null),u=Se(t,c,l.triggerRef),[d,f]=y.useState(!1),h=s.value===l.value;return g.jsx(Jm.ItemSlot,{scope:n,value:l.value,disabled:r,children:g.jsx(pl,{asChild:!0,...i,focusable:!r,tabStopId:l.value,children:g.jsx(Am,{asChild:!0,...a,children:g.jsx(he.button,{type:"button",role:"menuitem",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?l.contentId:void 0,"data-highlighted":d?"":void 0,"data-state":h?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:u,onPointerDown:le(e.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(s.onMenuOpen(l.value),h||p.preventDefault())}),onPointerEnter:le(e.onPointerEnter,()=>{var m;!!s.value&&!h&&(s.onMenuOpen(l.value),(m=c.current)==null||m.focus())}),onKeyDown:le(e.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&s.onMenuToggle(l.value),p.key==="ArrowDown"&&s.onMenuOpen(l.value),["Enter"," ","ArrowDown"].includes(p.key)&&(l.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:le(e.onFocus,()=>f(!0)),onBlur:le(e.onBlur,()=>f(!1))})})})})});WE.displayName=tg;var QG="MenubarPortal",GE=e=>{const{__scopeMenubar:t,...n}=e,r=Ht(t);return g.jsx(km,{...r,...n})};GE.displayName=QG;var ng="MenubarContent",qE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,i=Ht(n),a=Qm(ng,n),s=UE(ng,n),l=KG(n),c=y.useRef(!1);return g.jsx(Im,{id:s.contentId,"aria-labelledby":s.triggerId,"data-radix-menubar-content":"",...i,...o,ref:t,align:r,onCloseAutoFocus:le(e.onCloseAutoFocus,u=>{var f;!!!a.value&&!c.current&&((f=s.triggerRef.current)==null||f.focus()),c.current=!1,u.preventDefault()}),onFocusOutside:le(e.onFocusOutside,u=>{const d=u.target;l().some(h=>{var p;return(p=h.ref.current)==null?void 0:p.contains(d)})&&u.preventDefault()}),onInteractOutside:le(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:u=>{s.wasKeyboardTriggerOpenRef.current||u.preventDefault()},onKeyDown:le(e.onKeyDown,u=>{if(["ArrowRight","ArrowLeft"].includes(u.key)){const d=u.target,f=d.hasAttribute("data-radix-menubar-subtrigger"),h=d.closest("[data-radix-menubar-content]")!==u.currentTarget,m=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===u.key;if(!m&&f||h&&m)return;let b=l().filter(C=>!C.disabled).map(C=>C.value);m&&b.reverse();const x=b.indexOf(s.value);b=a.loop?h7(b,x+1):b.slice(x+1);const[S]=b;S&&a.onMenuOpen(S)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});qE.displayName=ng;var e7="MenubarGroup",YE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Om,{...o,...r,ref:t})});YE.displayName=e7;var t7="MenubarLabel",KE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(jm,{...o,...r,ref:t})});KE.displayName=t7;var n7="MenubarItem",XE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx($m,{...o,...r,ref:t})});XE.displayName=n7;var r7="MenubarCheckboxItem",ZE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Fm,{...o,...r,ref:t})});ZE.displayName=r7;var o7="MenubarRadioGroup",JE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Lm,{...o,...r,ref:t})});JE.displayName=o7;var i7="MenubarRadioItem",QE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(zm,{...o,...r,ref:t})});QE.displayName=i7;var a7="MenubarItemIndicator",eP=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Bm,{...o,...r,ref:t})});eP.displayName=a7;var s7="MenubarSeparator",tP=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Hm,{...o,...r,ref:t})});tP.displayName=s7;var l7="MenubarArrow",c7=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Um,{...o,...r,ref:t})});c7.displayName=l7;var u7="MenubarSub",nP=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=Ht(t),[s=!1,l]=lt({prop:r,defaultProp:i,onChange:o});return g.jsx(Vm,{...a,open:s,onOpenChange:l,children:n})};nP.displayName=u7;var d7="MenubarSubTrigger",rP=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Wm,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});rP.displayName=d7;var f7="MenubarSubContent",oP=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Ht(n);return g.jsx(Gm,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});oP.displayName=f7;function h7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var iP=HE,p7=VE,aP=WE,sP=GE,lP=qE,m7=YE,cP=KE,uP=XE,dP=ZE,g7=JE,fP=QE,hP=eP,pP=tP,w7=nP,mP=rP,gP=oP,xa="NavigationMenu",[rg,wP,v7]=po(xa),[og,y7,b7]=po(xa),[ig,ore]=at(xa,[v7,b7]),[x7,On]=ig(xa),[_7,S7]=ig(xa),vP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=e,[d,f]=y.useState(null),h=Se(t,M=>f(M)),p=Un(c),m=y.useRef(0),v=y.useRef(0),w=y.useRef(0),[b,x]=y.useState(!0),[S="",C]=lt({prop:r,onChange:M=>{const A=M!=="",k=s>0;A?(window.clearTimeout(w.current),k&&x(!1)):(window.clearTimeout(w.current),w.current=window.setTimeout(()=>x(!0),s)),o==null||o(M)},defaultProp:i}),N=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>C(""),150)},[C]),R=y.useCallback(M=>{window.clearTimeout(v.current),C(M)},[C]),T=y.useCallback(M=>{S===M?window.clearTimeout(v.current):m.current=window.setTimeout(()=>{window.clearTimeout(v.current),C(M)},a)},[S,C,a]);return y.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(v.current),window.clearTimeout(w.current)},[]),g.jsx(bP,{scope:n,isRootMenu:!0,value:S,dir:p,orientation:l,rootNavigationMenu:d,onTriggerEnter:M=>{window.clearTimeout(m.current),b?T(M):R(M)},onTriggerLeave:()=>{window.clearTimeout(m.current),N()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:N,onItemSelect:M=>{C(A=>A===M?"":M)},onItemDismiss:()=>C(""),children:g.jsx(he.nav,{"aria-label":"Main","data-orientation":l,dir:p,...u,ref:h})})});vP.displayName=xa;var yP="NavigationMenuSub",C7=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",...s}=e,l=On(yP,n),[c="",u]=lt({prop:r,onChange:o,defaultProp:i});return g.jsx(bP,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:g.jsx(he.div,{"data-orientation":a,...s,ref:t})})});C7.displayName=yP;var bP=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:h}=e,[p,m]=y.useState(null),[v,w]=y.useState(new Map),[b,x]=y.useState(null);return g.jsx(x7,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:pa(s),baseId:_t(),dir:o,orientation:i,viewport:p,onViewportChange:m,indicatorTrack:b,onIndicatorTrackChange:x,onTriggerEnter:et(u),onTriggerLeave:et(d),onContentEnter:et(f),onContentLeave:et(h),onItemSelect:et(l),onItemDismiss:et(c),onViewportContentChange:y.useCallback((S,C)=>{w(N=>(N.set(S,C),new Map(N)))},[]),onViewportContentRemove:y.useCallback(S=>{w(C=>C.has(S)?(C.delete(S),new Map(C)):C)},[]),children:g.jsx(rg.Provider,{scope:t,children:g.jsx(_7,{scope:t,items:v,children:a})})})},xP="NavigationMenuList",_P=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=On(xP,n),i=g.jsx(he.ul,{"data-orientation":o.orientation,...r,ref:t});return g.jsx(he.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:g.jsx(rg.Slot,{scope:n,children:o.isRootMenu?g.jsx(kP,{asChild:!0,children:i}):i})})});_P.displayName=xP;var SP="NavigationMenuItem",[E7,CP]=ig(SP),EP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...o}=e,i=_t(),a=r||i||"LEGACY_REACT_AUTO_VALUE",s=y.useRef(null),l=y.useRef(null),c=y.useRef(null),u=y.useRef(()=>{}),d=y.useRef(!1),f=y.useCallback((p="start")=>{if(s.current){u.current();const m=cg(s.current);m.length&&ug(p==="start"?m:m.reverse())}},[]),h=y.useCallback(()=>{if(s.current){const p=cg(s.current);p.length&&(u.current=A7(p))}},[]);return g.jsx(E7,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:g.jsx(he.li,{...o,ref:t})})});EP.displayName=SP;var ag="NavigationMenuTrigger",PP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=e,i=On(ag,e.__scopeNavigationMenu),a=CP(ag,e.__scopeNavigationMenu),s=y.useRef(null),l=Se(s,a.triggerRef,t),c=jP(i.baseId,a.value),u=$P(i.baseId,a.value),d=y.useRef(!1),f=y.useRef(!1),h=a.value===i.value;return g.jsxs(g.Fragment,{children:[g.jsx(rg.ItemSlot,{scope:n,value:a.value,children:g.jsx(OP,{asChild:!0,children:g.jsx(he.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":fg(h),"aria-expanded":h,"aria-controls":u,...o,ref:l,onPointerEnter:le(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:le(e.onPointerMove,ld(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:le(e.onPointerLeave,ld(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:le(e.onClick,()=>{i.onItemSelect(a.value),f.current=h}),onKeyDown:le(e.onKeyDown,p=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&p.key===v&&(a.onEntryKeyDown(),p.preventDefault())})})})}),h&&g.jsxs(g.Fragment,{children:[g.jsx(U_,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const m=a.contentRef.current,v=p.relatedTarget,w=v===s.current,b=m==null?void 0:m.contains(v);(w||!b)&&a.onFocusProxyEnter(w?"start":"end")}}),i.viewport&&g.jsx("span",{"aria-owns":u})]})]})});PP.displayName=ag;var P7="NavigationMenuLink",RP="navigationMenu.linkSelect",NP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=e;return g.jsx(OP,{asChild:!0,children:g.jsx(he.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:le(e.onClick,a=>{const s=a.target,l=new CustomEvent(RP,{bubbles:!0,cancelable:!0});if(s.addEventListener(RP,c=>o==null?void 0:o(c),{once:!0}),Nu(s,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(sd,{bubbles:!0,cancelable:!0});Nu(s,c)}},{checkForDefaultPrevented:!1})})})});NP.displayName=P7;var sg="NavigationMenuIndicator",TP=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=On(sg,e.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?tr.createPortal(g.jsx(ht,{present:n||i,children:g.jsx(R7,{...r,ref:t})}),o.indicatorTrack):null});TP.displayName=sg;var R7=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=On(sg,n),i=wP(n),[a,s]=y.useState(null),[l,c]=y.useState(null),u=o.orientation==="horizontal",d=!!o.value;y.useEffect(()=>{var m;const p=(m=i().find(v=>v.value===o.value))==null?void 0:m.ref.current;p&&s(p)},[i,o.value]);const f=()=>{a&&c({size:u?a.offsetWidth:a.offsetHeight,offset:u?a.offsetLeft:a.offsetTop})};return dg(a,f),dg(o.indicatorTrack,f),l?g.jsx(he.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...r,ref:t,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),_a="NavigationMenuContent",MP=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=On(_a,e.__scopeNavigationMenu),i=CP(_a,e.__scopeNavigationMenu),a=Se(i.contentRef,t),s=i.value===o.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?g.jsx(N7,{forceMount:n,...l,ref:a}):g.jsx(ht,{present:n||s,children:g.jsx(DP,{"data-state":fg(s),...l,ref:a,onPointerEnter:le(e.onPointerEnter,o.onContentEnter),onPointerLeave:le(e.onPointerLeave,ld(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});MP.displayName=_a;var N7=y.forwardRef((e,t)=>{const n=On(_a,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return vt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),vt(()=>()=>o(e.value),[e.value,o]),null}),sd="navigationMenu.rootContentDismiss",DP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=e,u=On(_a,n),d=y.useRef(null),f=Se(d,t),h=jP(u.baseId,r),p=$P(u.baseId,r),m=wP(n),v=y.useRef(null),{onItemDismiss:w}=u;y.useEffect(()=>{const x=d.current;if(u.isRootMenu&&x){const S=()=>{var C;w(),s(),x.contains(document.activeElement)&&((C=o.current)==null||C.focus())};return x.addEventListener(sd,S),()=>x.removeEventListener(sd,S)}},[u.isRootMenu,e.value,o,w,s]);const b=y.useMemo(()=>{const S=m().map(A=>A.value);u.dir==="rtl"&&S.reverse();const C=S.indexOf(u.value),N=S.indexOf(u.previousValue),R=r===u.value,T=N===S.indexOf(r);if(!R&&!T)return v.current;const M=(()=>{if(C!==N){if(R&&N!==-1)return C>N?"from-end":"from-start";if(T&&C!==-1)return C>N?"to-start":"to-end"}return null})();return v.current=M,M},[u.previousValue,u.value,u.dir,m,r]);return g.jsx(kP,{asChild:!0,children:g.jsx(mo,{id:p,"aria-labelledby":h,"data-motion":b,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const x=new Event(sd,{bubbles:!0,cancelable:!0});(S=d.current)==null||S.dispatchEvent(x)},onFocusOutside:le(e.onFocusOutside,x=>{var C;l();const S=x.target;(C=u.rootNavigationMenu)!=null&&C.contains(S)&&x.preventDefault()}),onPointerDownOutside:le(e.onPointerDownOutside,x=>{var R;const S=x.target,C=m().some(T=>{var M;return(M=T.ref.current)==null?void 0:M.contains(S)}),N=u.isRootMenu&&((R=u.viewport)==null?void 0:R.contains(S));(C||N||!u.isRootMenu)&&x.preventDefault()}),onKeyDown:le(e.onKeyDown,x=>{var N;const S=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!S){const R=cg(x.currentTarget),T=document.activeElement,M=R.findIndex(F=>F===T),k=x.shiftKey?R.slice(0,M).reverse():R.slice(M+1,R.length);ug(k)?x.preventDefault():(N=i.current)==null||N.focus()}}),onEscapeKeyDown:le(e.onEscapeKeyDown,x=>{a.current=!0})})})}),lg="NavigationMenuViewport",AP=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!On(lg,e.__scopeNavigationMenu).value;return g.jsx(ht,{present:n||i,children:g.jsx(T7,{...r,ref:t})})});AP.displayName=lg;var T7=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...o}=e,i=On(lg,n),a=Se(t,i.onViewportChange),s=S7(_a,e.__scopeNavigationMenu),[l,c]=y.useState(null),[u,d]=y.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,p=!!i.value,m=p?i.value:i.previousValue;return dg(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),g.jsx(he.div,{"data-state":fg(p),"data-orientation":i.orientation,...o,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...o.style},onPointerEnter:le(e.onPointerEnter,i.onContentEnter),onPointerLeave:le(e.onPointerLeave,ld(i.onContentLeave)),children:Array.from(s.items).map(([w,{ref:b,forceMount:x,...S}])=>{const C=m===w;return g.jsx(ht,{present:x||C,children:g.jsx(DP,{...S,ref:el(b,N=>{C&&N&&d(N)})})},w)})})}),M7="FocusGroup",kP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=On(M7,n);return g.jsx(og.Provider,{scope:n,children:g.jsx(og.Slot,{scope:n,children:g.jsx(he.div,{dir:o.dir,...r,ref:t})})})}),IP=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],D7="FocusGroupItem",OP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=y7(n),i=On(D7,n);return g.jsx(og.ItemSlot,{scope:n,children:g.jsx(he.button,{...r,ref:t,onKeyDown:le(e.onKeyDown,a=>{if(["Home","End",...IP].includes(a.key)){let l=o().map(d=>d.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),IP.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>ug(l)),a.preventDefault()}})})})});function cg(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 ug(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function A7(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function dg(e,t){const n=et(t);vt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}function fg(e){return e?"open":"closed"}function jP(e,t){return`${e}-trigger-${t}`}function $P(e,t){return`${e}-content-${t}`}function ld(e){return t=>t.pointerType==="mouse"?e(t):void 0}var FP=vP,LP=_P,k7=EP,zP=PP,I7=NP,BP=TP,HP=MP,UP=AP,hg="Popover",[VP,ire]=at(hg,[xr]),_l=xr(),[O7,_o]=VP(hg),WP=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=_l(t),l=y.useRef(null),[c,u]=y.useState(!1),[d=!1,f]=lt({prop:r,defaultProp:o,onChange:i});return g.jsx(ya,{...s,children:g.jsx(O7,{scope:t,contentId:_t(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:y.useCallback(()=>u(!1),[]),modal:a,children:n})})};WP.displayName=hg;var GP="PopoverAnchor",j7=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_o(GP,n),i=_l(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return y.useEffect(()=>(a(),()=>s()),[a,s]),g.jsx(ba,{...i,...r,ref:t})});j7.displayName=GP;var qP="PopoverTrigger",YP=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_o(qP,n),i=_l(n),a=Se(t,o.triggerRef),s=g.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":QP(o.open),...r,ref:a,onClick:le(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:g.jsx(ba,{asChild:!0,...i,children:s})});YP.displayName=qP;var pg="PopoverPortal",[$7,F7]=VP(pg,{forceMount:void 0}),KP=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=_o(pg,t);return g.jsx($7,{scope:t,forceMount:n,children:g.jsx(ht,{present:n||i.open,children:g.jsx(nl,{asChild:!0,container:o,children:r})})})};KP.displayName=pg;var Sa="PopoverContent",XP=y.forwardRef((e,t)=>{const n=F7(Sa,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=_o(Sa,e.__scopePopover);return g.jsx(ht,{present:r||i.open,children:i.modal?g.jsx(L7,{...o,ref:t}):g.jsx(z7,{...o,ref:t})})});XP.displayName=Sa;var L7=y.forwardRef((e,t)=>{const n=_o(Sa,e.__scopePopover),r=y.useRef(null),o=Se(t,r),i=y.useRef(!1);return y.useEffect(()=>{const a=r.current;if(a)return al(a)},[]),g.jsx(il,{as:Hn,allowPinchZoom:!0,children:g.jsx(ZP,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:le(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),z7=y.forwardRef((e,t)=>{const n=_o(Sa,e.__scopePopover),r=y.useRef(!1),o=y.useRef(!1);return g.jsx(ZP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ZP=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=_o(Sa,n),h=_l(n);return ku(),g.jsx(tl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(mo,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:g.jsx(dl,{"data-state":QP(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),JP="PopoverClose",B7=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_o(JP,n);return g.jsx(he.button,{type:"button",...r,ref:t,onClick:le(e.onClick,()=>o.onOpenChange(!1))})});B7.displayName=JP;var H7="PopoverArrow",U7=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_l(n);return g.jsx(fl,{...o,...r,ref:t})});U7.displayName=H7;function QP(e){return e?"open":"closed"}var V7=WP,W7=YP,G7=KP,eR=XP,mg="Progress",gg=100,[q7,are]=at(mg),[Y7,K7]=q7(mg),tR=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=X7,...a}=e;(o||o===0)&&!iR(o)&&console.error(Z7(`${o}`,"Progress"));const s=iR(o)?o:gg;r!==null&&!aR(r,s)&&console.error(J7(`${r}`,"Progress"));const l=aR(r,s)?r:null,c=cd(l)?i(l,s):void 0;return g.jsx(Y7,{scope:n,value:l,max:s,children:g.jsx(he.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":cd(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":oR(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});tR.displayName=mg;var nR="ProgressIndicator",rR=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=K7(nR,n);return g.jsx(he.div,{"data-state":oR(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});rR.displayName=nR;function X7(e,t){return`${Math.round(e/t*100)}%`}function oR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function cd(e){return typeof e=="number"}function iR(e){return cd(e)&&!isNaN(e)&&e>0}function aR(e,t){return cd(e)&&!isNaN(e)&&e<=t&&e>=0}function Z7(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${gg}\`.`}function J7(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
324
+ - a positive number
325
+ - less than the value passed to \`max\` (or ${gg} if no \`max\` prop is set)
326
+ - \`null\` or \`undefined\` if the progress is indeterminate.
327
+
328
+ Defaulting to \`null\`.`}var sR=tR,Q7=rR,wg="Radio",[e9,lR]=at(wg),[t9,n9]=e9(wg),cR=y.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=e,[d,f]=y.useState(null),h=Se(t,v=>f(v)),p=y.useRef(!1),m=d?c||!!d.closest("form"):!0;return g.jsxs(t9,{scope:n,checked:o,disabled:a,children:[g.jsx(he.button,{type:"button",role:"radio","aria-checked":o,"data-state":fR(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:h,onClick:le(e.onClick,v=>{o||l==null||l(),m&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),m&&g.jsx(r9,{control:d,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});cR.displayName=wg;var uR="RadioIndicator",dR=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=n9(uR,n);return g.jsx(ht,{present:r||i.checked,children:g.jsx(he.span,{"data-state":fR(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});dR.displayName=uR;var r9=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=pa(n),s=sl(t);return y.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fR(e){return e?"checked":"unchecked"}var o9=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vg="RadioGroup",[i9,sre]=at(vg,[_r,lR]),hR=_r(),pR=lR(),[a9,s9]=i9(vg),mR=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=e,h=hR(n),p=Un(c),[m,v]=lt({prop:i,defaultProp:o,onChange:d});return g.jsx(a9,{scope:n,name:r,required:a,disabled:s,value:m,onValueChange:v,children:g.jsx(hl,{asChild:!0,...h,orientation:l,dir:p,loop:u,children:g.jsx(he.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:p,...f,ref:t})})})});mR.displayName=vg;var gR="RadioGroupItem",wR=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=s9(gR,n),a=i.disabled||r,s=hR(n),l=pR(n),c=y.useRef(null),u=Se(t,c),d=i.value===o.value,f=y.useRef(!1);return y.useEffect(()=>{const h=m=>{o9.includes(m.key)&&(f.current=!0)},p=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),g.jsx(pl,{asChild:!0,...s,focusable:!a,active:d,children:g.jsx(cR,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:le(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:le(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});wR.displayName=gR;var l9="RadioGroupIndicator",vR=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=pR(n);return g.jsx(dR,{...o,...r,ref:t})});vR.displayName=l9;var yR=mR,bR=wR,c9=vR;function Sl(e,[t,n]){return Math.min(n,Math.max(t,e))}function u9(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var yg="ScrollArea",[xR,lre]=at(yg),[d9,jn]=xR(yg),_R=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[s,l]=y.useState(null),[c,u]=y.useState(null),[d,f]=y.useState(null),[h,p]=y.useState(null),[m,v]=y.useState(null),[w,b]=y.useState(0),[x,S]=y.useState(0),[C,N]=y.useState(!1),[R,T]=y.useState(!1),M=Se(t,k=>l(k)),A=Un(o);return g.jsx(d9,{scope:n,type:r,dir:A,scrollHideDelay:i,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:p,scrollbarXEnabled:C,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:v,scrollbarYEnabled:R,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:S,children:g.jsx(he.div,{dir:A,...a,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});_R.displayName=yg;var SR="ScrollAreaViewport",CR=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=jn(SR,n),s=y.useRef(null),l=Se(t,s,a.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(he.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});CR.displayName=SR;var Sr="ScrollAreaScrollbar",bg=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jn(Sr,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s=e.orientation==="horizontal";return y.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),o.type==="hover"?g.jsx(f9,{...r,ref:t,forceMount:n}):o.type==="scroll"?g.jsx(h9,{...r,ref:t,forceMount:n}):o.type==="auto"?g.jsx(ER,{...r,ref:t,forceMount:n}):o.type==="always"?g.jsx(xg,{...r,ref:t}):null});bg.displayName=Sr;var f9=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jn(Sr,e.__scopeScrollArea),[i,a]=y.useState(!1);return y.useEffect(()=>{const s=o.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},u=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),g.jsx(ht,{present:n||i,children:g.jsx(ER,{"data-state":i?"visible":"hidden",...r,ref:t})})}),h9=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jn(Sr,e.__scopeScrollArea),i=e.orientation==="horizontal",a=hd(()=>l("SCROLL_END"),100),[s,l]=u9("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),y.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(l("SCROLL"),a()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,a]),g.jsx(ht,{present:n||s!=="hidden",children:g.jsx(xg,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:le(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:le(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),ER=y.forwardRef((e,t)=>{const n=jn(Sr,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=y.useState(!1),s=e.orientation==="horizontal",l=hd(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return Ca(n.viewport,l),Ca(n.content,l),g.jsx(ht,{present:r||i,children:g.jsx(xg,{"data-state":i?"visible":"hidden",...o,ref:t})})}),xg=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=jn(Sr,e.__scopeScrollArea),i=y.useRef(null),a=y.useRef(0),[s,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=MR(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function d(f,h){return y9(f,a.current,s,h)}return n==="horizontal"?g.jsx(p9,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=DR(f,s,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?g.jsx(m9,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=DR(f,s);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),p9=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=jn(Sr,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Se(t,l,i.onScrollbarXChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx(RR,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":fd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),kR(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:dd(a.paddingLeft),paddingEnd:dd(a.paddingRight)}})}})}),m9=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=jn(Sr,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Se(t,l,i.onScrollbarYChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx(RR,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":fd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),kR(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:dd(a.paddingTop),paddingEnd:dd(a.paddingBottom)}})}})}),[g9,PR]=xR(Sr),RR=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=jn(Sr,n),[p,m]=y.useState(null),v=Se(t,M=>m(M)),w=y.useRef(null),b=y.useRef(""),x=h.viewport,S=r.content-r.viewport,C=et(u),N=et(l),R=hd(d,10);function T(M){if(w.current){const A=M.clientX-w.current.left,k=M.clientY-w.current.top;c({x:A,y:k})}}return y.useEffect(()=>{const M=A=>{const k=A.target;(p==null?void 0:p.contains(k))&&C(A,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,p,S,C]),y.useEffect(N,[r,N]),Ca(p,R),Ca(h.content,R),g.jsx(g9,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:et(i),onThumbPointerUp:et(a),onThumbPositionChange:N,onThumbPointerDown:et(s),children:g.jsx(he.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:le(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),w.current=p.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(M))}),onPointerMove:le(e.onPointerMove,T),onPointerUp:le(e.onPointerUp,M=>{const A=M.target;A.hasPointerCapture(M.pointerId)&&A.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),ud="ScrollAreaThumb",NR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=PR(ud,e.__scopeScrollArea);return g.jsx(ht,{present:n||o.hasThumb,children:g.jsx(w9,{ref:t,...r})})}),w9=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=jn(ud,n),a=PR(ud,n),{onThumbPositionChange:s}=a,l=Se(t,d=>a.onThumbChange(d)),c=y.useRef(void 0),u=hd(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=b9(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,s]),g.jsx(he.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:le(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),p=d.clientX-h.left,m=d.clientY-h.top;a.onThumbPointerDown({x:p,y:m})}),onPointerUp:le(e.onPointerUp,a.onThumbPointerUp)})});NR.displayName=ud;var _g="ScrollAreaCorner",TR=y.forwardRef((e,t)=>{const n=jn(_g,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx(v9,{...e,ref:t}):null});TR.displayName=_g;var v9=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=jn(_g,n),[i,a]=y.useState(0),[s,l]=y.useState(0),c=!!(i&&s);return Ca(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Ca(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),a(u)}),c?g.jsx(he.div,{...r,ref:t,style:{width:i,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function dd(e){return e?parseInt(e,10):0}function MR(e,t){const n=e/t;return isNaN(n)?0:n}function fd(e){const t=MR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function y9(e,t,n,r="ltr"){const o=fd(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return AR([l,c],d)(e)}function DR(e,t,n="ltr"){const r=fd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=n==="ltr"?[0,a]:[a*-1,0],c=Sl(e,l);return AR([0,a],[0,s])(c)}function AR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function kR(e,t){return e>0&&e<t}var b9=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function hd(e,t){const n=et(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ca(e,t){const n=et(t);vt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var IR=_R,x9=CR,_9=TR,S9=[" ","Enter","ArrowUp","ArrowDown"],C9=[" ","Enter"],Cl="Select",[pd,md,E9]=po(Cl),[Ea,cre]=at(Cl,[E9,xr]),gd=xr(),[P9,So]=Ea(Cl),[R9,N9]=Ea(Cl),OR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:p}=e,m=gd(t),[v,w]=y.useState(null),[b,x]=y.useState(null),[S,C]=y.useState(!1),N=Un(c),[R=!1,T]=lt({prop:r,defaultProp:o,onChange:i}),[M,A]=lt({prop:a,defaultProp:s,onChange:l}),k=y.useRef(null),F=v?p||!!v.closest("form"):!0,[L,Y]=y.useState(new Set),ne=Array.from(L).map(q=>q.props.value).join(";");return g.jsx(ya,{...m,children:g.jsxs(P9,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:_t(),value:M,onValueChange:A,open:R,onOpenChange:T,dir:N,triggerPointerDownPosRef:k,disabled:f,children:[g.jsx(pd.Provider,{scope:t,children:g.jsx(R9,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(q=>{Y(X=>new Set(X).add(q))},[]),onNativeOptionRemove:y.useCallback(q=>{Y(X=>{const B=new Set(X);return B.delete(q),B})},[]),children:n})}),F?g.jsxs(sN,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:q=>A(q.target.value),disabled:f,form:p,children:[M===void 0?g.jsx("option",{value:""}):null,Array.from(L)]},ne):null]})})};OR.displayName=Cl;var jR="SelectTrigger",$R=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=gd(n),a=So(jR,n),s=a.disabled||r,l=Se(t,a.onTriggerChange),c=md(n),u=y.useRef("touch"),[d,f,h]=lN(m=>{const v=c().filter(x=>!x.disabled),w=v.find(x=>x.value===a.value),b=cN(v,m,w);b!==void 0&&a.onValueChange(b.value)}),p=m=>{s||(a.onOpenChange(!0),h()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(ba,{asChild:!0,...i,children:g.jsx(he.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":aN(a.value)?"":void 0,...o,ref:l,onClick:le(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:le(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:le(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(v&&m.key===" ")&&S9.includes(m.key)&&(p(),m.preventDefault())})})})});$R.displayName=jR;var FR="SelectValue",LR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=So(FR,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Se(t,l.onValueNodeChange);return vt(()=>{c(u)},[c,u]),g.jsx(he.span,{...s,ref:d,style:{pointerEvents:"none"},children:aN(l.value)?g.jsx(g.Fragment,{children:a}):i})});LR.displayName=FR;var T9="SelectIcon",zR=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(he.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});zR.displayName=T9;var M9="SelectPortal",BR=e=>g.jsx(nl,{asChild:!0,...e});BR.displayName=M9;var ni="SelectContent",HR=y.forwardRef((e,t)=>{const n=So(ni,e.__scopeSelect),[r,o]=y.useState();if(vt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?nc.createPortal(g.jsx(UR,{scope:e.__scopeSelect,children:g.jsx(pd.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(VR,{...e,ref:t})});HR.displayName=ni;var qn=10,[UR,Co]=Ea(ni),D9="SelectContentImpl",VR=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v,...w}=e,b=So(ni,n),[x,S]=y.useState(null),[C,N]=y.useState(null),R=Se(t,G=>S(G)),[T,M]=y.useState(null),[A,k]=y.useState(null),F=md(n),[L,Y]=y.useState(!1),ne=y.useRef(!1);y.useEffect(()=>{if(x)return al(x)},[x]),ku();const q=y.useCallback(G=>{const[$,...te]=F().map(z=>z.ref.current),[ie]=te.slice(-1),re=document.activeElement;for(const z of G)if(z===re||(z==null||z.scrollIntoView({block:"nearest"}),z===$&&C&&(C.scrollTop=0),z===ie&&C&&(C.scrollTop=C.scrollHeight),z==null||z.focus(),document.activeElement!==re))return},[F,C]),X=y.useCallback(()=>q([T,x]),[q,T,x]);y.useEffect(()=>{L&&X()},[L,X]);const{onOpenChange:B,triggerPointerDownPosRef:ee}=b;y.useEffect(()=>{if(x){let G={x:0,y:0};const $=ie=>{var re,z;G={x:Math.abs(Math.round(ie.pageX)-(((re=ee.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((z=ee.current)==null?void 0:z.y)??0))}},te=ie=>{G.x<=10&&G.y<=10?ie.preventDefault():x.contains(ie.target)||B(!1),document.removeEventListener("pointermove",$),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,B,ee]),y.useEffect(()=>{const G=()=>B(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[B]);const[Z,J]=lN(G=>{const $=F().filter(re=>!re.disabled),te=$.find(re=>re.ref.current===document.activeElement),ie=cN($,G,te);ie&&setTimeout(()=>ie.ref.current.focus())}),H=y.useCallback((G,$,te)=>{const ie=!ne.current&&!te;(b.value!==void 0&&b.value===$||ie)&&(M(G),ie&&(ne.current=!0))},[b.value]),O=y.useCallback(()=>x==null?void 0:x.focus(),[x]),V=y.useCallback((G,$,te)=>{const ie=!ne.current&&!te;(b.value!==void 0&&b.value===$||ie)&&k(G)},[b.value]),ae=r==="popper"?Sg:WR,j=ae===Sg?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(UR,{scope:n,content:x,viewport:C,onViewportChange:N,itemRefCallback:H,selectedItem:T,onItemLeave:O,itemTextRefCallback:V,focusSelectedItem:X,selectedItemText:A,position:r,isPositioned:L,searchRef:Z,children:g.jsx(il,{as:Hn,allowPinchZoom:!0,children:g.jsx(tl,{asChild:!0,trapped:b.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:le(o,G=>{var $;($=b.trigger)==null||$.focus({preventScroll:!0}),G.preventDefault()}),children:g.jsx(mo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ae,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:G=>G.preventDefault(),...w,...j,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:le(w.onKeyDown,G=>{const $=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!$&&G.key.length===1&&J(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let ie=F().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(G.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const re=G.target,z=ie.indexOf(re);ie=ie.slice(z+1)}setTimeout(()=>q(ie)),G.preventDefault()}})})})})})})});VR.displayName=D9;var A9="SelectItemAlignedPosition",WR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=So(ni,n),a=Co(ni,n),[s,l]=y.useState(null),[c,u]=y.useState(null),d=Se(t,R=>u(R)),f=md(n),h=y.useRef(!1),p=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=a,x=y.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&m&&v&&w){const R=i.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),A=w.getBoundingClientRect();if(i.dir!=="rtl"){const re=A.left-T.left,z=M.left-re,se=R.left-z,oe=R.width+se,fe=Math.max(oe,T.width),ge=window.innerWidth-qn,pe=Sl(z,[qn,Math.max(qn,ge-fe)]);s.style.minWidth=oe+"px",s.style.left=pe+"px"}else{const re=T.right-A.right,z=window.innerWidth-M.right-re,se=window.innerWidth-R.right-z,oe=R.width+se,fe=Math.max(oe,T.width),ge=window.innerWidth-qn,pe=Sl(z,[qn,Math.max(qn,ge-fe)]);s.style.minWidth=oe+"px",s.style.right=pe+"px"}const k=f(),F=window.innerHeight-qn*2,L=m.scrollHeight,Y=window.getComputedStyle(c),ne=parseInt(Y.borderTopWidth,10),q=parseInt(Y.paddingTop,10),X=parseInt(Y.borderBottomWidth,10),B=parseInt(Y.paddingBottom,10),ee=ne+q+L+B+X,Z=Math.min(v.offsetHeight*5,ee),J=window.getComputedStyle(m),H=parseInt(J.paddingTop,10),O=parseInt(J.paddingBottom,10),V=R.top+R.height/2-qn,ae=F-V,j=v.offsetHeight/2,G=v.offsetTop+j,$=ne+q+G,te=ee-$;if($<=V){const re=k.length>0&&v===k[k.length-1].ref.current;s.style.bottom="0px";const z=c.clientHeight-m.offsetTop-m.offsetHeight,se=Math.max(ae,j+(re?O:0)+z+X),oe=$+se;s.style.height=oe+"px"}else{const re=k.length>0&&v===k[0].ref.current;s.style.top="0px";const se=Math.max(V,ne+m.offsetTop+(re?H:0)+j)+te;s.style.height=se+"px",m.scrollTop=$-V+m.offsetTop}s.style.margin=`${qn}px 0`,s.style.minHeight=Z+"px",s.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,s,c,m,v,w,i.dir,r]);vt(()=>x(),[x]);const[S,C]=y.useState();vt(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=y.useCallback(R=>{R&&p.current===!0&&(x(),b==null||b(),p.current=!1)},[x,b]);return g.jsx(I9,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:g.jsx(he.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});WR.displayName=A9;var k9="SelectPopperPosition",Sg=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=qn,...i}=e,a=gd(n);return g.jsx(dl,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Sg.displayName=k9;var[I9,Cg]=Ea(ni,{}),Eg="SelectViewport",GR=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Co(Eg,n),a=Cg(Eg,n),s=Se(t,i.onViewportChange),l=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(pd.Slot,{scope:n,children:g.jsx(he.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:le(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const p=window.innerHeight-qn*2,m=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),w=Math.max(m,v);if(w<p){const b=w+h,x=Math.min(p,b),S=b-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});GR.displayName=Eg;var qR="SelectGroup",[O9,j9]=Ea(qR),YR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_t();return g.jsx(O9,{scope:n,id:o,children:g.jsx(he.div,{role:"group","aria-labelledby":o,...r,ref:t})})});YR.displayName=qR;var KR="SelectLabel",XR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=j9(KR,n);return g.jsx(he.div,{id:o.id,...r,ref:t})});XR.displayName=KR;var wd="SelectItem",[$9,ZR]=Ea(wd),JR=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=So(wd,n),l=Co(wd,n),c=s.value===r,[u,d]=y.useState(i??""),[f,h]=y.useState(!1),p=Se(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,r,o)}),m=_t(),v=y.useRef("touch"),w=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx($9,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:y.useCallback(b=>{d(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:g.jsx(pd.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:g.jsx(he.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:p,onFocus:le(a.onFocus,()=>h(!0)),onBlur:le(a.onBlur,()=>h(!1)),onClick:le(a.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:le(a.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:le(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:le(a.onPointerMove,b=>{var x;v.current=b.pointerType,o?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:le(a.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:le(a.onKeyDown,b=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(C9.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})});JR.displayName=wd;var El="SelectItemText",QR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=So(El,n),s=Co(El,n),l=ZR(El,n),c=N9(El,n),[u,d]=y.useState(null),f=Se(t,w=>d(w),l.onItemTextChange,w=>{var b;return(b=s.itemTextRefCallback)==null?void 0:b.call(s,w,l.value,l.disabled)}),h=u==null?void 0:u.textContent,p=y.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=c;return vt(()=>(m(p),()=>v(p)),[m,v,p]),g.jsxs(g.Fragment,{children:[g.jsx(he.span,{id:l.textId,...i,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?nc.createPortal(i.children,a.valueNode):null]})});QR.displayName=El;var eN="SelectItemIndicator",tN=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ZR(eN,n).isSelected?g.jsx(he.span,{"aria-hidden":!0,...r,ref:t}):null});tN.displayName=eN;var Pg="SelectScrollUpButton",nN=y.forwardRef((e,t)=>{const n=Co(Pg,e.__scopeSelect),r=Cg(Pg,e.__scopeSelect),[o,i]=y.useState(!1),a=Se(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?g.jsx(oN,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});nN.displayName=Pg;var Rg="SelectScrollDownButton",rN=y.forwardRef((e,t)=>{const n=Co(Rg,e.__scopeSelect),r=Cg(Rg,e.__scopeSelect),[o,i]=y.useState(!1),a=Se(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?g.jsx(oN,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});rN.displayName=Rg;var oN=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Co("SelectScrollButton",n),a=y.useRef(null),s=md(n),l=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),vt(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),g.jsx(he.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:le(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:le(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:le(o.onPointerLeave,()=>{l()})})}),F9="SelectSeparator",iN=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(he.div,{"aria-hidden":!0,...r,ref:t})});iN.displayName=F9;var Ng="SelectArrow",L9=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=gd(n),i=So(Ng,n),a=Co(Ng,n);return i.open&&a.position==="popper"?g.jsx(fl,{...o,...r,ref:t}):null});L9.displayName=Ng;function aN(e){return e===""||e===void 0}var sN=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=y.useRef(null),i=Se(t,o),a=pa(n);return y.useEffect(()=>{const s=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&u){const d=new Event("change",{bubbles:!0});u.call(s,n),s.dispatchEvent(d)}},[a,n]),g.jsx(Dp,{asChild:!0,children:g.jsx("select",{...r,ref:i,defaultValue:n})})});sN.displayName="BubbleSelect";function lN(e){const t=et(e),n=y.useRef(""),r=y.useRef(0),o=y.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function cN(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=z9(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var B9=OR,uN=$R,H9=LR,U9=zR,V9=BR,dN=HR,W9=GR,G9=YR,fN=XR,hN=JR,q9=QR,Y9=tN,pN=nN,mN=rN,gN=iN,K9="Separator",wN="horizontal",X9=["horizontal","vertical"],vN=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=wN,...o}=e,i=Z9(r)?r:wN,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return g.jsx(he.div,{"data-orientation":i,...s,...o,ref:t})});vN.displayName=K9;function Z9(e){return X9.includes(e)}var yN=vN,bN=["PageUp","PageDown"],xN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_N={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pa="Slider",[Tg,J9,Q9]=po(Pa),[SN,ure]=at(Pa,[Q9]),[eq,vd]=SN(Pa),CN=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:p,...m}=e,v=y.useRef(new Set),w=y.useRef(0),x=a==="horizontal"?tq:nq,[S=[],C]=lt({prop:u,defaultProp:c,onChange:k=>{var L;(L=[...v.current][w.current])==null||L.focus(),d(k)}}),N=y.useRef(S);function R(k){const F=sq(S,k);A(k,F)}function T(k){A(k,w.current)}function M(){const k=N.current[w.current];S[w.current]!==k&&f(S)}function A(k,F,{commit:L}={commit:!1}){const Y=dq(i),ne=fq(Math.round((k-r)/i)*i+r,Y),q=Sl(ne,[r,o]);C((X=[])=>{const B=iq(X,q,F);if(uq(B,l*i)){w.current=B.indexOf(q);const ee=String(B)!==String(X);return ee&&L&&f(B),ee?B:X}else return X})}return g.jsx(eq,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:S,orientation:a,form:p,children:g.jsx(Tg.Provider,{scope:e.__scopeSlider,children:g.jsx(Tg.Slot,{scope:e.__scopeSlider,children:g.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...m,ref:t,onPointerDown:le(m.onPointerDown,()=>{s||(N.current=S)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:R,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>!s&&A(r,0,{commit:!0}),onEndKeyDown:()=>!s&&A(o,S.length-1,{commit:!0}),onStepKeyDown:({event:k,direction:F})=>{if(!s){const ne=bN.includes(k.key)||k.shiftKey&&xN.includes(k.key)?10:1,q=w.current,X=S[q],B=i*ne*F;A(X+B,q,{commit:!0})}}})})})})});CN.displayName=Pa;var[EN,PN]=SN(Pa,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tq=y.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,f]=y.useState(null),h=Se(t,x=>f(x)),p=y.useRef(void 0),m=Un(o),v=m==="ltr",w=v&&!i||!v&&i;function b(x){const S=p.current||d.getBoundingClientRect(),C=[0,S.width],R=Ag(C,w?[n,r]:[r,n]);return p.current=S,R(x-S.left)}return g.jsx(EN,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:g.jsx(RN,{dir:m,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const S=b(x.clientX);a==null||a(S)},onSlideMove:x=>{const S=b(x.clientX);s==null||s(S)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:x=>{const C=_N[w?"from-left":"from-right"].includes(x.key);c==null||c({event:x,direction:C?-1:1})}})})}),nq=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=y.useRef(null),d=Se(t,u),f=y.useRef(void 0),h=!o;function p(m){const v=f.current||u.current.getBoundingClientRect(),w=[0,v.height],x=Ag(w,h?[r,n]:[n,r]);return f.current=v,x(m-v.top)}return g.jsx(EN,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:g.jsx(RN,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const v=p(m.clientY);i==null||i(v)},onSlideMove:m=>{const v=p(m.clientY);a==null||a(v)},onSlideEnd:()=>{f.current=void 0,s==null||s()},onStepKeyDown:m=>{const w=_N[h?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:w?-1:1})}})})}),RN=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=vd(Pa,n);return g.jsx(he.span,{...c,ref:t,onKeyDown:le(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):bN.concat(xN).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:le(e.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:le(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:le(e.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),i(d))})})}),NN="SliderTrack",TN=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=vd(NN,n);return g.jsx(he.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});TN.displayName=NN;var Mg="SliderRange",MN=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=vd(Mg,n),i=PN(Mg,n),a=y.useRef(null),s=Se(t,a),l=o.values.length,c=o.values.map(f=>AN(f,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return g.jsx(he.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});MN.displayName=Mg;var Dg="SliderThumb",DN=y.forwardRef((e,t)=>{const n=J9(e.__scopeSlider),[r,o]=y.useState(null),i=Se(t,s=>o(s)),a=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return g.jsx(rq,{...e,ref:i,index:a})}),rq=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=vd(Dg,n),s=PN(Dg,n),[l,c]=y.useState(null),u=Se(t,b=>c(b)),d=l?a.form||!!l.closest("form"):!0,f=sl(l),h=a.values[r],p=h===void 0?0:AN(h,a.min,a.max),m=aq(r,a.values.length),v=f==null?void 0:f[s.size],w=v?lq(v,p,s.direction):0;return y.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),g.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${p}% + ${w}px)`},children:[g.jsx(Tg.ItemSlot,{scope:e.__scopeSlider,children:g.jsx(he.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:h===void 0?{display:"none"}:e.style,onFocus:le(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&g.jsx(oq,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});DN.displayName=Dg;var oq=e=>{const{value:t,...n}=e,r=y.useRef(null),o=pa(t);return y.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(a,"value").set;if(o!==t&&l){const c=new Event("input",{bubbles:!0});l.call(i,t),i.dispatchEvent(c)}},[o,t]),g.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function iq(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function AN(e,t,n){const i=100/(n-t)*(e-t);return Sl(i,[0,100])}function aq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function sq(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function lq(e,t,n){const r=e/2,i=Ag([0,50],[0,r]);return(r-i(t)*n)*n}function cq(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function uq(e,t){if(t>0){const n=cq(e);return Math.min(...n)>=t}return!0}function Ag(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function dq(e){return(String(e).split(".")[1]||"").length}function fq(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var kN=CN,hq=TN,pq=MN,mq=DN,kg="Switch",[gq,dre]=at(kg),[wq,vq]=gq(kg),IN=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=y.useState(null),p=Se(t,x=>h(x)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=lt({prop:o,defaultProp:i,onChange:c});return g.jsxs(wq,{scope:n,checked:w,disabled:s,children:[g.jsx(he.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":$N(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onClick:le(e.onClick,x=>{b(S=>!S),v&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),v&&g.jsx(yq,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});IN.displayName=kg;var ON="SwitchThumb",jN=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=vq(ON,n);return g.jsx(he.span,{"data-state":$N(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});jN.displayName=ON;var yq=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=pa(n),s=sl(t);return y.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function $N(e){return e?"checked":"unchecked"}var FN=IN,bq=jN,Ig="Tabs",[xq,fre]=at(Ig,[_r]),LN=_r(),[_q,Og]=xq(Ig),zN=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=Un(s),[d,f]=lt({prop:r,onChange:o,defaultProp:i});return g.jsx(_q,{scope:n,baseId:_t(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:g.jsx(he.div,{dir:u,"data-orientation":a,...c,ref:t})})});zN.displayName=Ig;var BN="TabsList",HN=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Og(BN,n),a=LN(n);return g.jsx(hl,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(he.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});HN.displayName=BN;var UN="TabsTrigger",VN=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Og(UN,n),s=LN(n),l=qN(a.baseId,r),c=YN(a.baseId,r),u=r===a.value;return g.jsx(pl,{asChild:!0,...s,focusable:!o,active:u,children:g.jsx(he.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:le(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:le(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:le(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})})});VN.displayName=UN;var WN="TabsContent",GN=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=Og(WN,n),l=qN(s.baseId,r),c=YN(s.baseId,r),u=r===s.value,d=y.useRef(u);return y.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),g.jsx(ht,{present:o||u,children:({present:f})=>g.jsx(he.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});GN.displayName=WN;function qN(e,t){return`${e}-trigger-${t}`}function YN(e,t){return`${e}-content-${t}`}var Sq=zN,KN=HN,XN=VN,ZN=GN,Cq="Toggle",jg=y.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,s]=lt({prop:n,onChange:o,defaultProp:r});return g.jsx(he.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:le(e.onClick,()=>{e.disabled||s(!a)})})});jg.displayName=Cq;var JN=jg,Ra="ToggleGroup",[QN,hre]=at(Ra,[_r]),eT=_r(),$g=E.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(Eq,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(Pq,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Ra}\``)});$g.displayName=Ra;var[tT,nT]=QN(Ra),Eq=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=lt({prop:n,defaultProp:r,onChange:o});return g.jsx(tT,{scope:e.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:s,onItemDeactivate:E.useCallback(()=>s(""),[s]),children:g.jsx(rT,{...i,ref:t})})}),Pq=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=lt({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=E.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return g.jsx(tT,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:g.jsx(rT,{...i,ref:t})})});$g.displayName=Ra;var[Rq,Nq]=QN(Ra),rT=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=eT(n),u=Un(a),d={role:"group",dir:u,...l};return g.jsx(Rq,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(hl,{asChild:!0,...c,orientation:i,dir:u,loop:s,children:g.jsx(he.div,{...d,ref:t})}):g.jsx(he.div,{...d,ref:t})})}),yd="ToggleGroupItem",oT=E.forwardRef((e,t)=>{const n=nT(yd,e.__scopeToggleGroup),r=Nq(yd,e.__scopeToggleGroup),o=eT(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,s={...e,pressed:i,disabled:a},l=E.useRef(null);return r.rovingFocus?g.jsx(pl,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:g.jsx(iT,{...s,ref:t})}):g.jsx(iT,{...s,ref:t})});oT.displayName=yd;var iT=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=nT(yd,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return g.jsx(jg,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),aT=$g,sT=oT,[bd,pre]=at("Tooltip",[xr]),xd=xr(),lT="TooltipProvider",Tq=700,Fg="tooltip.open",[Mq,Lg]=bd(lT),cT=e=>{const{__scopeTooltip:t,delayDuration:n=Tq,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=y.useState(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),g.jsx(Mq,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};cT.displayName=lT;var _d="Tooltip",[Dq,Sd]=bd(_d),uT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Lg(_d,e.__scopeTooltip),c=xd(t),[u,d]=y.useState(null),f=_t(),h=y.useRef(0),p=a??l.disableHoverableContent,m=s??l.delayDuration,v=y.useRef(!1),[w=!1,b]=lt({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Fg))):l.onClose(),i==null||i(R)}}),x=y.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),S=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},m)},[m,b]);return y.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(ya,{...c,children:g.jsx(Dq,{scope:t,contentId:f,open:w,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?N():S()},[l.isOpenDelayed,N,S]),onTriggerLeave:y.useCallback(()=>{p?C():(window.clearTimeout(h.current),h.current=0)},[C,p]),onOpen:S,onClose:C,disableHoverableContent:p,children:n})})};uT.displayName=_d;var zg="TooltipTrigger",dT=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Sd(zg,n),i=Lg(zg,n),a=xd(n),s=y.useRef(null),l=Se(t,s,o.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(ba,{asChild:!0,...a,children:g.jsx(he.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:le(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:le(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:le(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:le(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:le(e.onBlur,o.onClose),onClick:le(e.onClick,o.onClose)})})});dT.displayName=zg;var Aq="TooltipPortal",[mre,kq]=bd(Aq,{forceMount:void 0}),Na="TooltipContent",fT=y.forwardRef((e,t)=>{const n=kq(Na,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Sd(Na,e.__scopeTooltip);return g.jsx(ht,{present:r||a.open,children:a.disableHoverableContent?g.jsx(hT,{side:o,...i,ref:t}):g.jsx(Iq,{side:o,...i,ref:t})})}),Iq=y.forwardRef((e,t)=>{const n=Sd(Na,e.__scopeTooltip),r=Lg(Na,e.__scopeTooltip),o=y.useRef(null),i=Se(t,o),[a,s]=y.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),h=y.useCallback((p,m)=>{const v=p.currentTarget,w={x:p.clientX,y:p.clientY},b=Fq(w,v.getBoundingClientRect()),x=Lq(w,b),S=zq(m.getBoundingClientRect()),C=Hq([...x,...S]);s(C),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&u){const p=v=>h(v,u),m=v=>h(v,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[l,u,h,f]),y.useEffect(()=>{if(a){const p=m=>{const v=m.target,w={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!Bq(w,a);b?f():x&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,a,c,f]),g.jsx(hT,{...e,ref:i})}),[Oq,jq]=bd(_d,{isInside:!1}),hT=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=Sd(Na,n),c=xd(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(Fg,u),()=>document.removeEventListener(Fg,u)),[u]),y.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),g.jsx(mo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:g.jsxs(dl,{"data-state":l.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:[g.jsx(Ru,{children:r}),g.jsx(Oq,{scope:n,isInside:!0,children:g.jsx(U_,{id:l.contentId,role:"tooltip",children:o||r})})]})})});fT.displayName=Na;var pT="TooltipArrow",$q=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xd(n);return jq(pT,n).isInside?null:g.jsx(fl,{...o,...r,ref:t})});$q.displayName=pT;function Fq(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 Lq(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 zq(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 Bq(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,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function Hq(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),Uq(t)}function Uq(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 Vq=cT,Wq=uT,Gq=dT,mT=fT;/**
329
+ * @license lucide-react v0.475.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */const qq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gT=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
334
+ * @license lucide-react v0.475.0 - ISC
335
+ *
336
+ * This source code is licensed under the ISC license.
337
+ * See the LICENSE file in the root directory of this source tree.
338
+ */var Yq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
339
+ * @license lucide-react v0.475.0 - ISC
340
+ *
341
+ * This source code is licensed under the ISC license.
342
+ * See the LICENSE file in the root directory of this source tree.
343
+ */const Kq=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>E.createElement("svg",{ref:l,...Yq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gT("lucide",o),...s},[...a.map(([c,u])=>E.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
344
+ * @license lucide-react v0.475.0 - ISC
345
+ *
346
+ * This source code is licensed under the ISC license.
347
+ * See the LICENSE file in the root directory of this source tree.
348
+ */const Sn=(e,t)=>{const n=E.forwardRef(({className:r,...o},i)=>E.createElement(Kq,{ref:i,iconNode:t,className:gT(`lucide-${qq(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
349
+ * @license lucide-react v0.475.0 - ISC
350
+ *
351
+ * This source code is licensed under the ISC license.
352
+ * See the LICENSE file in the root directory of this source tree.
353
+ */const wT=Sn("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
354
+ * @license lucide-react v0.475.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */const Ta=Sn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
359
+ * @license lucide-react v0.475.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */const Cd=Sn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
364
+ * @license lucide-react v0.475.0 - ISC
365
+ *
366
+ * This source code is licensed under the ISC license.
367
+ * See the LICENSE file in the root directory of this source tree.
368
+ */const Ed=Sn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
369
+ * @license lucide-react v0.475.0 - ISC
370
+ *
371
+ * This source code is licensed under the ISC license.
372
+ * See the LICENSE file in the root directory of this source tree.
373
+ */const Eo=Sn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
374
+ * @license lucide-react v0.475.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */const Xq=Sn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
379
+ * @license lucide-react v0.475.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */const Zq=Sn("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
384
+ * @license lucide-react v0.475.0 - ISC
385
+ *
386
+ * This source code is licensed under the ISC license.
387
+ * See the LICENSE file in the root directory of this source tree.
388
+ */const Jq=Sn("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
389
+ * @license lucide-react v0.475.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const Qq=Sn("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
394
+ * @license lucide-react v0.475.0 - ISC
395
+ *
396
+ * This source code is licensed under the ISC license.
397
+ * See the LICENSE file in the root directory of this source tree.
398
+ */const Pd=Sn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
399
+ * @license lucide-react v0.475.0 - ISC
400
+ *
401
+ * This source code is licensed under the ISC license.
402
+ * See the LICENSE file in the root directory of this source tree.
403
+ */const eY=Sn("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
404
+ * @license lucide-react v0.475.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */const tY=Sn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
409
+ * @license lucide-react v0.475.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */const vT=Sn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Bg="-",nY=e=>{const t=oY(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(Bg);return s[0]===""&&s.length!==1&&s.shift(),yT(s,t)||rY(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},yT=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?yT(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Bg);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},bT=/^\[(.+)\]$/,rY=e=>{if(bT.test(e)){const t=bT.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},oY=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Hg(n[o],r,o,t);return r},Hg=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:xT(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(iY(o)){Hg(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Hg(a,xT(t,i),n,r)})})},xT=(e,t)=>{let n=e;return t.split(Bg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},iY=e=>e.isThemeGetter,aY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Ug="!",Vg=":",sY=Vg.length,lY=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let a=0,s=0,l=0,c;for(let p=0;p<o.length;p++){let m=o[p];if(a===0&&s===0){if(m===Vg){i.push(o.slice(l,p)),l=p+sY;continue}if(m==="/"){c=p;continue}}m==="["?a++:m==="]"?a--:m==="("?s++:m===")"&&s--}const u=i.length===0?o:o.substring(l),d=cY(u),f=d!==u,h=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(t){const o=t+Vg,i=r;r=a=>a.startsWith(o)?i(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},cY=e=>e.endsWith(Ug)?e.substring(0,e.length-1):e.startsWith(Ug)?e.substring(1):e,uY=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let i=[];return r.forEach(a=>{a[0]==="["||t[a]?(o.push(...i.sort(),a),i=[]):i.push(a)}),o.push(...i.sort()),o}},dY=e=>({cache:aY(e.cacheSize),parseClassName:lY(e),sortModifiers:uY(e),...nY(e)}),fY=/\s+/,hY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(fY);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,w=r(v?p.substring(0,m):p);if(!w){if(!v){l=u+(l.length>0?" "+l:l);continue}if(w=r(p),!w){l=u+(l.length>0?" "+l:l);continue}v=!1}const b=i(f).join(":"),x=h?b+Ug:b,S=x+w;if(a.includes(S))continue;a.push(S);const C=o(w,v);for(let N=0;N<C.length;++N){const R=C[N];a.push(x+R)}l=u+(l.length>0?" "+l:l)}return l};function pY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=_T(t))&&(r&&(r+=" "),r+=n);return r}const _T=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_T(e[r]))&&(n&&(n+=" "),n+=t);return n};function mY(e,...t){let n,r,o,i=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=dY(c),r=n.cache.get,o=n.cache.set,i=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=hY(l,n);return o(l,u),u}return function(){return i(pY.apply(null,arguments))}}const Tt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ST=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,CT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gY=/^\d+\/\d+$/,wY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vY=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bY=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=e=>gY.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),ri=e=>!!e&&Number.isInteger(Number(e)),ET=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Po=e=>wY.test(e),_Y=()=>!0,SY=e=>vY.test(e)&&!yY.test(e),Wg=()=>!1,CY=e=>bY.test(e),EY=e=>xY.test(e),PY=e=>!ve(e)&&!ye(e),RY=e=>Da(e,NT,Wg),ve=e=>ST.test(e),oi=e=>Da(e,TT,SY),Gg=e=>Da(e,FY,Be),NY=e=>Da(e,PT,Wg),TY=e=>Da(e,RT,EY),MY=e=>Da(e,Wg,CY),ye=e=>CT.test(e),Rd=e=>Aa(e,TT),DY=e=>Aa(e,LY),AY=e=>Aa(e,PT),kY=e=>Aa(e,NT),IY=e=>Aa(e,RT),OY=e=>Aa(e,zY,!0),Da=(e,t,n)=>{const r=ST.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Aa=(e,t,n=!1)=>{const r=CT.exec(e);return r?r[1]?t(r[1]):n:!1},PT=e=>e==="position",jY=new Set(["image","url"]),RT=e=>jY.has(e),$Y=new Set(["length","size","percentage"]),NT=e=>$Y.has(e),TT=e=>e==="length",FY=e=>e==="number",LY=e=>e==="family-name",zY=e=>e==="shadow",BY=mY(()=>{const e=Tt("color"),t=Tt("font"),n=Tt("text"),r=Tt("font-weight"),o=Tt("tracking"),i=Tt("leading"),a=Tt("breakpoint"),s=Tt("container"),l=Tt("spacing"),c=Tt("radius"),u=Tt("shadow"),d=Tt("inset-shadow"),f=Tt("drop-shadow"),h=Tt("blur"),p=Tt("perspective"),m=Tt("aspect"),v=Tt("ease"),w=Tt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],S=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],N=()=>[ye,ve,l],R=()=>[Ma,"full","auto",...N()],T=()=>[ri,"none","subgrid",ye,ve],M=()=>["auto",{span:["full",ri,ye,ve]},ye,ve],A=()=>[ri,"auto",ye,ve],k=()=>["auto","min","max","fr",ye,ve],F=()=>["start","end","center","between","around","evenly","stretch","baseline"],L=()=>["start","end","center","stretch"],Y=()=>["auto",...N()],ne=()=>[Ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],q=()=>[e,ye,ve],X=()=>[ET,oi],B=()=>["","none","full",c,ye,ve],ee=()=>["",Be,Rd,oi],Z=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["","none",h,ye,ve],O=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye,ve],V=()=>["none",Be,ye,ve],ae=()=>["none",Be,ye,ve],j=()=>[Be,ye,ve],G=()=>[Ma,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Po],breakpoint:[Po],color:[_Y],container:[Po],"drop-shadow":[Po],ease:["in","out","in-out"],font:[PY],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Po],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Po],shadow:[Po],spacing:["px",Be],text:[Po],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ma,ve,ye,m]}],container:["container"],columns:[{columns:[Be,ve,ye,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...x(),ve,ye]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[ri,"auto",ye,ve]}],basis:[{basis:[Ma,"full","auto",s,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,Ma,"auto","initial","none",ve]}],grow:[{grow:["",Be,ye,ve]}],shrink:[{shrink:["",Be,ye,ve]}],order:[{order:[ri,"first","last","none",ye,ve]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...L(),"baseline"]}],"align-self":[{self:["auto",...L(),"baseline"]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[s,"screen",...ne()]}],"min-w":[{"min-w":[s,"screen","none",...ne()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...ne()]}],h:[{h:["screen",...ne()]}],"min-h":[{"min-h":["screen","none",...ne()]}],"max-h":[{"max-h":["screen",...ne()]}],"font-size":[{text:["base",n,Rd,oi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ye,Gg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ET,ve]}],"font-family":[{font:[DY,ve,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ye,ve]}],"line-clamp":[{"line-clamp":[Be,"none",ye,Gg]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",ye,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",ye,oi]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Be,"auto",ye,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),AY,NY]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",kY,RY]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ri,ye,ve],radial:["",ye,ve],conic:[ri,ye,ve]},IY,TY]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,ye,ve]}],"outline-w":[{outline:["",Be,Rd,oi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,OY,MY]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",ye,ve,d]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Be,oi]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":q()}],opacity:[{opacity:[Be,ye,ve]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none",ye,ve]}],blur:[{blur:H()}],brightness:[{brightness:[Be,ye,ve]}],contrast:[{contrast:[Be,ye,ve]}],"drop-shadow":[{"drop-shadow":["","none",f,ye,ve]}],grayscale:[{grayscale:["",Be,ye,ve]}],"hue-rotate":[{"hue-rotate":[Be,ye,ve]}],invert:[{invert:["",Be,ye,ve]}],saturate:[{saturate:[Be,ye,ve]}],sepia:[{sepia:["",Be,ye,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ve]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[Be,ye,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Be,ye,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,ye,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,ye,ve]}],"backdrop-invert":[{"backdrop-invert":["",Be,ye,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Be,ye,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Be,ye,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,ye,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",ye,ve]}],ease:[{ease:["linear","initial",v,ye,ve]}],delay:[{delay:[Be,ye,ve]}],animate:[{animate:["none",w,ye,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,ye,ve]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[ye,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,ve]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Be,Rd,oi,Gg]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}});function K(...e){return BY(au(e))}const HY=AH,MT=y.forwardRef(({className:e,...t},n)=>g.jsx(kH,{ref:n,className:K("border-b",e),...t}));MT.displayName="AccordionItem";const DT=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(IH,{className:"flex",children:g.jsxs(OH,{ref:r,className:K("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,g.jsx(Cd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));DT.displayName="AccordionTrigger";const AT=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(jH,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g.jsx("div",{className:K("pb-4 pt-0",e),children:t})}));AT.displayName="AccordionContent";const kT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,IT=au,Cn=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return IT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=kT(u)||kT(d);return o[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,v]=p;return Array.isArray(v)?v.includes({...i,...s}[m]):{...i,...s}[m]===v})?[...c,d,f]:c},[]);return IT(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},OT={alert:{defaultStyles:"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",variantStyles:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}},badge:{defaultStyles:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",variantStyles:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"text-foreground"}},defaultVariants:{variant:"default"}},button:{defaultStyles:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variantStyles:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}},sidebar:{defaultStyles:"relative flex flex-col gap-2 h-screen p-4 bg-background border-r transition-all duration-300 ease-in-out",variantStyles:{variant:{default:"border-r",floating:"rounded-lg border shadow-lg m-2 h-[calc(100vh-1rem)]"},size:{default:"w-64",sm:"w-48",lg:"w-72"},collapsed:{true:"w-16",false:""}},defaultVariants:{variant:"default",size:"default",collapsed:!1}},sidebarItem:{defaultStyles:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",variantStyles:{variant:{default:"hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-transparent hover:text-foreground/80",active:"bg-accent text-accent-foreground"}},defaultVariants:{variant:"default"}},toggle:{defaultStyles:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground 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=on]:bg-accent data-[state=on]:text-accent-foreground",variantStyles:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}},UY=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT:OT},Symbol.toStringTag,{value:"Module"})),Pl=E.createContext(null),VY=Pl.Consumer,WY=Object.freeze(Object.defineProperty({__proto__:null,TailwindThemeConsumer:VY,TailwindThemeContext:Pl,TailwindThemeProvider:e=>{const[t,n]=E.useState(OT),[r,o]=E.useState("");return g.jsx(Pl.Provider,{value:{setVariants:n,variants:t,setFont:o,font:r},children:e.children})}},Symbol.toStringTag,{value:"Module"})),GY=()=>{const e=E.useContext(Pl);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{font:e.font,setFont:e.setFont}},Ro=()=>{const e=E.useContext(Pl);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{variants:e.variants,setVariants:e.setVariants}},qY=Object.freeze(Object.defineProperty({__proto__:null,useFont:GY,useVariants:Ro},Symbol.toStringTag,{value:"Module"})),jT=E.forwardRef(({className:e,variant:t,...n},r)=>{const{variants:o}=Ro(),i=E.useMemo(()=>Cn(o.alert.defaultStyles,{variants:o.alert.variantStyles,defaultVariants:o.alert.defaultVariants}),[o]);return g.jsx("div",{ref:r,role:"alert",className:K(i({variant:t}),e),...n})});jT.displayName="Alert";const $T=E.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:K("mb-1 font-medium leading-none tracking-tight",e),...t}));$T.displayName="AlertTitle";const FT=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("text-sm [&_p]:leading-relaxed",e),...t}));FT.displayName="AlertDescription";const YY=XU,KY=ZU,XY=JU,LT=y.forwardRef(({className:e,...t},n)=>g.jsx(s1,{className:K("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,ref:n}));LT.displayName=s1.displayName;const zT=y.forwardRef(({className:e,...t},n)=>g.jsxs(XY,{children:[g.jsx(LT,{}),g.jsx(l1,{ref:n,className:K("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),...t})]}));zT.displayName=l1.displayName;const BT=({className:e,...t})=>g.jsx("div",{className:K("flex flex-col space-y-2 text-center sm:text-left",e),...t});BT.displayName="AlertDialogHeader";const HT=({className:e,...t})=>g.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});HT.displayName="AlertDialogFooter";const UT=y.forwardRef(({className:e,...t},n)=>g.jsx(d1,{ref:n,className:K("text-lg font-semibold",e),...t}));UT.displayName=d1.displayName;const VT=y.forwardRef(({className:e,...t},n)=>g.jsx(f1,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));VT.displayName=f1.displayName;const WT=y.forwardRef(({className:e,...t},n)=>g.jsx(c1,{ref:n,className:K("inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));WT.displayName=c1.displayName;const GT=y.forwardRef(({className:e,...t},n)=>g.jsx(u1,{ref:n,className:K("mt-2 inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 sm:mt-0",e),...t}));GT.displayName=u1.displayName;const ZY=tV,qT=y.forwardRef(({className:e,...t},n)=>g.jsx(y1,{ref:n,className:K("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));qT.displayName=y1.displayName;const YT=y.forwardRef(({className:e,...t},n)=>g.jsx(b1,{ref:n,className:K("aspect-square h-full w-full",e),...t}));YT.displayName=b1.displayName;const KT=y.forwardRef(({className:e,...t},n)=>g.jsx(x1,{ref:n,className:K("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));KT.displayName=x1.displayName;const JY=Cn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function QY({className:e,variant:t,...n}){const{variants:r}=Ro(),o=E.useMemo(()=>Cn(r.badge.defaultStyles,{variants:r.badge.variantStyles,defaultVariants:r.badge.defaultVariants}),[r]);return g.jsx("div",{className:K(o({variant:t}),e),...n})}const XT=y.forwardRef(({...e},t)=>g.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));XT.displayName="Breadcrumb";const ZT=y.forwardRef(({className:e,...t},n)=>g.jsx("ol",{ref:n,className:K("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));ZT.displayName="BreadcrumbList";const JT=y.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:K("inline-flex items-center gap-1.5",e),...t}));JT.displayName="BreadcrumbItem";const QT=y.forwardRef(({className:e,...t},n)=>g.jsx("a",{ref:n,className:K("transition-colors hover:text-foreground hover:underline",e),...t}));QT.displayName="BreadcrumbLink";const eM=y.forwardRef(({className:e,...t},n)=>g.jsx("span",{ref:n,role:"link","aria-current":"page",className:K("font-normal text-foreground",e),...t}));eM.displayName="BreadcrumbPage";const tM=({className:e,...t})=>g.jsx("li",{role:"presentation","aria-hidden":"true",className:K("[&>svg]:size-3.5",e),...t,children:g.jsx(Eo,{})});tM.displayName="BreadcrumbSeparator";const e6=Cn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Yn=E.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?aH:"button",{variants:s}=Ro(),l=E.useMemo(()=>Cn(s.button.defaultStyles,{variants:s.button.variantStyles,defaultVariants:s.button.defaultVariants}),[s]);return g.jsx(a,{className:K(l({variant:t,size:n,className:e})),ref:i,...o})});Yn.displayName="Button";function qe(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function En(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Zt(e,t){const n=qe(e);return isNaN(t)?En(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Kn(e,t){const n=qe(e);if(isNaN(t))return En(e,NaN);if(!t)return n;const r=n.getDate(),o=En(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const qg=6048e5,t6=864e5;let n6={};function Rl(){return n6}function Cr(e,t){var s,l,c,u;const n=Rl(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=qe(e),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function ii(e){return Cr(e,{weekStartsOn:1})}function nM(e){const t=qe(e),n=t.getFullYear(),r=En(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=ii(r),i=En(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=ii(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function ka(e){const t=qe(e);return t.setHours(0,0,0,0),t}function Nd(e){const t=qe(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Er(e,t){const n=ka(e),r=ka(t),o=+n-Nd(n),i=+r-Nd(r);return Math.round((o-i)/t6)}function r6(e){const t=nM(e),n=En(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ii(n)}function Yg(e,t){const n=t*7;return Zt(e,n)}function o6(e,t){return Kn(e,t*12)}function i6(e){let t;return e.forEach(function(n){const r=qe(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function a6(e){let t;return e.forEach(n=>{const r=qe(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function sn(e,t){const n=ka(e),r=ka(t);return+n==+r}function Kg(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function s6(e){if(!Kg(e)&&typeof e!="number")return!1;const t=qe(e);return!isNaN(Number(t))}function Nl(e,t){const n=qe(e),r=qe(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function l6(e,t,n){const r=Cr(e,n),o=Cr(t,n),i=+r-Nd(r),a=+o-Nd(o);return Math.round((i-a)/qg)}function Xg(e){const t=qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ln(e){const t=qe(e);return t.setDate(1),t.setHours(0,0,0,0),t}function rM(e){const t=qe(e),n=En(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Zg(e,t){var s,l,c,u;const n=Rl(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=qe(e),i=o.getDay(),a=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function oM(e){return Zg(e,{weekStartsOn:1})}const c6={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},u6=(e,t,n)=>{let r;const o=c6[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Jg(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const d6={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},f6={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},h6={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},p6={date:Jg({formats:d6,defaultWidth:"full"}),time:Jg({formats:f6,defaultWidth:"full"}),dateTime:Jg({formats:h6,defaultWidth:"full"})},m6={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},g6=(e,t,n,r)=>m6[e];function Tl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const w6={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},v6={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},y6={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},b6={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},x6={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_6={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},S6={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Tl({values:w6,defaultWidth:"wide"}),quarter:Tl({values:v6,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Tl({values:y6,defaultWidth:"wide"}),day:Tl({values:b6,defaultWidth:"wide"}),dayPeriod:Tl({values:x6,defaultWidth:"wide",formattingValues:_6,defaultFormattingWidth:"wide"})};function Ml(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?E6(s,d=>d.test(a)):C6(s,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function C6(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function E6(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function P6(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const R6=/^(\d+)(th|st|nd|rd)?/i,N6=/\d+/i,T6={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},M6={any:[/^b/i,/^(a|c)/i]},D6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},A6={any:[/1/i,/2/i,/3/i,/4/i]},k6={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},I6={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},O6={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},j6={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$6={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},F6={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},L6={ordinalNumber:P6({matchPattern:R6,parsePattern:N6,valueCallback:e=>parseInt(e,10)}),era:Ml({matchPatterns:T6,defaultMatchWidth:"wide",parsePatterns:M6,defaultParseWidth:"any"}),quarter:Ml({matchPatterns:D6,defaultMatchWidth:"wide",parsePatterns:A6,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ml({matchPatterns:k6,defaultMatchWidth:"wide",parsePatterns:I6,defaultParseWidth:"any"}),day:Ml({matchPatterns:O6,defaultMatchWidth:"wide",parsePatterns:j6,defaultParseWidth:"any"}),dayPeriod:Ml({matchPatterns:$6,defaultMatchWidth:"any",parsePatterns:F6,defaultParseWidth:"any"})},iM={code:"en-US",formatDistance:u6,formatLong:p6,formatRelative:g6,localize:S6,match:L6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function z6(e){const t=qe(e);return Er(t,rM(t))+1}function aM(e){const t=qe(e),n=+ii(t)-+r6(t);return Math.round(n/qg)+1}function sM(e,t){var u,d,f,h;const n=qe(e),r=n.getFullYear(),o=Rl(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,a=En(e,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=Cr(a,t),l=En(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Cr(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function B6(e,t){var s,l,c,u;const n=Rl(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=sM(e,t),i=En(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Cr(i,t)}function lM(e,t){const n=qe(e),r=+Cr(n,t)-+B6(n,t);return Math.round(r/qg)+1}function tt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const No={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return tt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):tt(n+1,2)},d(e,t){return tt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return tt(e.getHours()%12||12,t.length)},H(e,t){return tt(e.getHours(),t.length)},m(e,t){return tt(e.getMinutes(),t.length)},s(e,t){return tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return tt(o,t.length)}},Ia={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cM={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return No.y(e,t)},Y:function(e,t,n,r){const o=sM(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return tt(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):tt(i,t.length)},R:function(e,t){const n=nM(e);return tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return tt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return tt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return tt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return No.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return tt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=lM(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):tt(o,t.length)},I:function(e,t,n){const r=aM(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):tt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):No.d(e,t)},D:function(e,t,n){const r=z6(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):tt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return tt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return tt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return tt(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Ia.noon:r===0?o=Ia.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Ia.evening:r>=12?o=Ia.afternoon:r>=4?o=Ia.morning:o=Ia.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return No.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):No.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):tt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):tt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):No.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):No.s(e,t)},S:function(e,t){return No.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return dM(r);case"XXXX":case"XX":return ai(r);case"XXXXX":case"XXX":default:return ai(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return dM(r);case"xxxx":case"xx":return ai(r);case"xxxxx":case"xxx":default:return ai(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uM(r,":");case"OOOO":default:return"GMT"+ai(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uM(r,":");case"zzzz":default:return"GMT"+ai(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return tt(r,t.length)},T:function(e,t,n){const r=e.getTime();return tt(r,t.length)}};function uM(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+tt(i,2)}function dM(e,t){return e%60===0?(e>0?"-":"+")+tt(Math.abs(e)/60,2):ai(e,t)}function ai(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=tt(Math.trunc(r/60),2),i=tt(r%60,2);return n+o+t+i}const fM=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hM=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},H6={p:hM,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return fM(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",fM(r,t)).replace("{{time}}",hM(o,t))}},U6=/^D+$/,V6=/^Y+$/,W6=["D","DD","YY","YYYY"];function G6(e){return U6.test(e)}function q6(e){return V6.test(e)}function Y6(e,t,n){const r=K6(e,t,n);if(console.warn(r),W6.includes(e))throw new RangeError(r)}function K6(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const X6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J6=/^'([^]*?)'?$/,Q6=/''/g,eK=/[a-zA-Z]/;function Pr(e,t,n){var u,d,f,h,p,m,v,w;const r=Rl(),o=(n==null?void 0:n.locale)??r.locale??iM,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((m=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((w=(v=r.locale)==null?void 0:v.options)==null?void 0:w.weekStartsOn)??0,s=qe(e);if(!s6(s))throw new RangeError("Invalid time value");let l=t.match(Z6).map(b=>{const x=b[0];if(x==="p"||x==="P"){const S=H6[x];return S(b,o.formatLong)}return b}).join("").match(X6).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:tK(b)};if(cM[x])return{isToken:!0,value:b};if(x.match(eK))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(b=>{if(!b.isToken)return b.value;const x=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&q6(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&G6(x))&&Y6(x,t,String(e));const S=cM[x[0]];return S(s,x,o.localize,c)}).join("")}function tK(e){const t=e.match(J6);return t?t[1].replace(Q6,"'"):e}function nK(e){const t=qe(e),n=t.getFullYear(),r=t.getMonth(),o=En(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function rK(e){return Math.trunc(+qe(e)/1e3)}function oK(e){const t=qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function iK(e,t){return l6(oK(e),ln(e),t)+1}function Qg(e,t){const n=qe(e),r=qe(t);return n.getTime()>r.getTime()}function pM(e,t){const n=qe(e),r=qe(t);return+n<+r}function ew(e,t){const n=qe(e),r=qe(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function aK(e,t){const n=qe(e),r=qe(t);return n.getFullYear()===r.getFullYear()}function tw(e,t){return Zt(e,-t)}function nw(e,t){const n=qe(e),r=n.getFullYear(),o=n.getDate(),i=En(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const a=nK(i);return n.setMonth(t,Math.min(o,a)),n}function mM(e,t){const n=qe(e);return isNaN(+n)?En(e,NaN):(n.setFullYear(t),n)}var Ne=function(){return Ne=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ne.apply(this,arguments)};function sK(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function gM(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Dl(e){return e.mode==="multiple"}function Al(e){return e.mode==="range"}function Td(e){return e.mode==="single"}var lK={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function cK(e,t){return Pr(e,"LLLL y",t)}function uK(e,t){return Pr(e,"d",t)}function dK(e,t){return Pr(e,"LLLL",t)}function fK(e){return"".concat(e)}function hK(e,t){return Pr(e,"cccccc",t)}function pK(e,t){return Pr(e,"yyyy",t)}var mK=Object.freeze({__proto__:null,formatCaption:cK,formatDay:uK,formatMonthCaption:dK,formatWeekNumber:fK,formatWeekdayName:hK,formatYearCaption:pK}),gK=function(e,t,n){return Pr(e,"do MMMM (EEEE)",n)},wK=function(){return"Month: "},vK=function(){return"Go to next month"},yK=function(){return"Go to previous month"},bK=function(e,t){return Pr(e,"cccc",t)},xK=function(e){return"Week n. ".concat(e)},_K=function(){return"Year: "},SK=Object.freeze({__proto__:null,labelDay:gK,labelMonthDropdown:wK,labelNext:vK,labelPrevious:yK,labelWeekNumber:xK,labelWeekday:bK,labelYearDropdown:_K});function CK(){var e="buttons",t=lK,n=iM,r={},o={},i=1,a={},s=new Date;return{captionLayout:e,classNames:t,formatters:mK,labels:SK,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:a,today:s,mode:"default"}}function EK(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,a=e.toDate;return r?i=ln(r):t&&(i=new Date(t,0,1)),o?a=Xg(o):n&&(a=new Date(n,11,31)),{fromDate:i?ka(i):void 0,toDate:a?ka(a):void 0}}var wM=E.createContext(void 0);function PK(e){var t,n=e.initialProps,r=CK(),o=EK(n),i=o.fromDate,a=o.toDate,s=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;s!=="buttons"&&(!i||!a)&&(s="buttons");var l;(Td(n)||Dl(n)||Al(n))&&(l=n.onSelect);var c=Ne(Ne(Ne({},r),n),{captionLayout:s,classNames:Ne(Ne({},r.classNames),n.classNames),components:Ne({},n.components),formatters:Ne(Ne({},r.formatters),n.formatters),fromDate:i,labels:Ne(Ne({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ne(Ne({},r.modifiers),n.modifiers),modifiersClassNames:Ne(Ne({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ne(Ne({},r.styles),n.styles),toDate:a});return g.jsx(wM.Provider,{value:c,children:e.children})}function st(){var e=E.useContext(wM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function vM(e){var t=st(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return g.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function RK(e){return g.jsx("svg",Ne({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:g.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function yM(e){var t,n,r=e.onChange,o=e.value,i=e.children,a=e.caption,s=e.className,l=e.style,c=st(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:RK;return g.jsxs("div",{className:s,style:l,children:[g.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),g.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),g.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[a,g.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function NK(e){var t,n=st(),r=n.fromDate,o=n.toDate,i=n.styles,a=n.locale,s=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return g.jsx(g.Fragment,{});if(!o)return g.jsx(g.Fragment,{});var d=[];if(aK(r,o))for(var f=ln(r),h=r.getMonth();h<=o.getMonth();h++)d.push(nw(f,h));else for(var f=ln(new Date),h=0;h<=11;h++)d.push(nw(f,h));var p=function(v){var w=Number(v.target.value),b=nw(ln(e.displayMonth),w);e.onChange(b)},m=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:yM;return g.jsx(m,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:p,value:e.displayMonth.getMonth(),caption:s(e.displayMonth,{locale:a}),children:d.map(function(v){return g.jsx("option",{value:v.getMonth(),children:s(v,{locale:a})},v.getMonth())})})}function TK(e){var t,n=e.displayMonth,r=st(),o=r.fromDate,i=r.toDate,a=r.locale,s=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o)return g.jsx(g.Fragment,{});if(!i)return g.jsx(g.Fragment,{});for(var h=o.getFullYear(),p=i.getFullYear(),m=h;m<=p;m++)f.push(mM(rM(new Date),m));var v=function(b){var x=mM(ln(n),Number(b.target.value));e.onChange(x)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:yM;return g.jsx(w,{name:"years","aria-label":d(),className:l.dropdown_year,style:s.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:a}),children:f.map(function(b){return g.jsx("option",{value:b.getFullYear(),children:u(b,{locale:a})},b.getFullYear())})})}function MK(e,t){var n=E.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function DK(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,a=e.fromDate,s=e.numberOfMonths,l=s===void 0?1:s;if(i&&Nl(i,o)<0){var c=-1*(l-1);o=Kn(i,c)}return a&&Nl(o,a)<0&&(o=a),ln(o)}function AK(){var e=st(),t=DK(e),n=MK(t,e.month),r=n[0],o=n[1],i=function(a){var s;if(!e.disableNavigation){var l=ln(a);o(l),(s=e.onMonthChange)===null||s===void 0||s.call(e,l)}};return[r,i]}function kK(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=ln(e),i=ln(Kn(o,r)),a=Nl(i,o),s=[],l=0;l<a;l++){var c=Kn(o,l);s.push(c)}return n&&(s=s.reverse()),s}function IK(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=ln(e);if(!n)return Kn(s,a);var l=Nl(n,e);if(!(l<i))return Kn(s,a)}}function OK(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=ln(e);if(!n)return Kn(s,-a);var l=Nl(s,n);if(!(l<=0))return Kn(s,-a)}}var bM=E.createContext(void 0);function jK(e){var t=st(),n=AK(),r=n[0],o=n[1],i=kK(r,t),a=IK(r,t),s=OK(r,t),l=function(d){return i.some(function(f){return ew(d,f)})},c=function(d,f){l(d)||(f&&pM(d,f)?o(Kn(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:s,nextMonth:a,isDateDisplayed:l};return g.jsx(bM.Provider,{value:u,children:e.children})}function kl(){var e=E.useContext(bM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function xM(e){var t,n=st(),r=n.classNames,o=n.styles,i=n.components,a=kl().goToMonth,s=function(u){a(Kn(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:vM,c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth});return g.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[g.jsx("div",{className:r.vhidden,children:c}),g.jsx(NK,{onChange:s,displayMonth:e.displayMonth}),g.jsx(TK,{onChange:s,displayMonth:e.displayMonth})]})}function $K(e){return g.jsx("svg",Ne({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function FK(e){return g.jsx("svg",Ne({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Md=E.forwardRef(function(e,t){var n=st(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var a=i.join(" "),s=Ne(Ne({},o.button_reset),o.button);return e.style&&Object.assign(s,e.style),g.jsx("button",Ne({},e,{ref:t,type:"button",className:a,style:s}))});function LK(e){var t,n,r=st(),o=r.dir,i=r.locale,a=r.classNames,s=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return g.jsx(g.Fragment,{});var f=c(e.previousMonth,{locale:i}),h=[a.nav_button,a.nav_button_previous].join(" "),p=u(e.nextMonth,{locale:i}),m=[a.nav_button,a.nav_button_next].join(" "),v=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:FK,w=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:$K;return g.jsxs("div",{className:a.nav,style:s.nav,children:[!e.hidePrevious&&g.jsx(Md,{name:"previous-month","aria-label":f,className:h,style:s.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?g.jsx(v,{className:a.nav_icon,style:s.nav_icon}):g.jsx(w,{className:a.nav_icon,style:s.nav_icon})}),!e.hideNext&&g.jsx(Md,{name:"next-month","aria-label":p,className:m,style:s.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?g.jsx(w,{className:a.nav_icon,style:s.nav_icon}):g.jsx(v,{className:a.nav_icon,style:s.nav_icon})})]})}function _M(e){var t=st().numberOfMonths,n=kl(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,a=n.displayMonths,s=a.findIndex(function(p){return ew(e.displayMonth,p)}),l=s===0,c=s===a.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),f=function(){r&&i(r)},h=function(){o&&i(o)};return g.jsx(LK,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:f,onNextClick:h})}function zK(e){var t,n=st(),r=n.classNames,o=n.disableNavigation,i=n.styles,a=n.captionLayout,s=n.components,l=(t=s==null?void 0:s.CaptionLabel)!==null&&t!==void 0?t:vM,c;return o?c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?c=g.jsx(xM,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?c=g.jsxs(g.Fragment,{children:[g.jsx(xM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),g.jsx(_M,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=g.jsxs(g.Fragment,{children:[g.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(_M,{displayMonth:e.displayMonth,id:e.id})]}),g.jsx("div",{className:r.caption,style:i.caption,children:c})}function BK(e){var t=st(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?g.jsx("tfoot",{className:o,style:r.tfoot,children:g.jsx("tr",{children:g.jsx("td",{colSpan:8,children:n})})}):g.jsx(g.Fragment,{})}function HK(e,t,n){for(var r=n?ii(new Date):Cr(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var a=Zt(r,i);o.push(a)}return o}function UK(){var e=st(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=HK(o,i,a);return g.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&g.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return g.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:s(u,{locale:o})},d)})]})}function VK(){var e,t=st(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:UK;return g.jsx("thead",{style:r.head,className:n.head,children:g.jsx(i,{})})}function WK(e){var t=st(),n=t.locale,r=t.formatters.formatDay;return g.jsx(g.Fragment,{children:r(e.date,{locale:n})})}var rw=E.createContext(void 0);function GK(e){if(!Dl(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return g.jsx(rw.Provider,{value:t,children:e.children})}return g.jsx(qK,{initialProps:e.initialProps,children:e.children})}function qK(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,a=function(c,u,d){var f,h;(f=t.onDayClick)===null||f===void 0||f.call(t,c,u,d);var p=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!p){var m=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var v=r?gM([],r):[];if(u.selected){var w=v.findIndex(function(b){return sn(c,b)});v.splice(w,1)}else v.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,v,c,u,d)}}},s={disabled:[]};r&&s.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(f){return sn(f,c)});return!!(u&&!d)});var l={selected:r,onDayClick:a,modifiers:s};return g.jsx(rw.Provider,{value:l,children:n})}function ow(){var e=E.useContext(rw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function YK(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?sn(o,e)&&sn(r,e)?void 0:sn(o,e)?{from:o,to:void 0}:sn(r,e)?void 0:Qg(r,e)?{from:e,to:o}:{from:r,to:e}:o?Qg(e,o)?{from:o,to:e}:{from:e,to:o}:r?pM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var iw=E.createContext(void 0);function KK(e){if(!Al(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return g.jsx(iw.Provider,{value:t,children:e.children})}return g.jsx(XK,{initialProps:e.initialProps,children:e.children})}function XK(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,a=o.to,s=t.min,l=t.max,c=function(h,p,m){var v,w;(v=t.onDayClick)===null||v===void 0||v.call(t,h,p,m);var b=YK(h,r);(w=t.onSelect)===null||w===void 0||w.call(t,b,h,p,m)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],a?(u.range_end=[a],sn(i,a)||(u.range_middle=[{after:i,before:a}])):u.range_end=[i]):a&&(u.range_start=[a],u.range_end=[a]),s&&(i&&!a&&u.disabled.push({after:tw(i,s-1),before:Zt(i,s-1)}),i&&a&&u.disabled.push({after:i,before:Zt(i,s-1)}),!i&&a&&u.disabled.push({after:tw(a,s-1),before:Zt(a,s-1)})),l){if(i&&!a&&(u.disabled.push({before:Zt(i,-l+1)}),u.disabled.push({after:Zt(i,l-1)})),i&&a){var d=Er(a,i)+1,f=l-d;u.disabled.push({before:tw(i,f)}),u.disabled.push({after:Zt(a,f)})}!i&&a&&(u.disabled.push({before:Zt(a,-l+1)}),u.disabled.push({after:Zt(a,l-1)}))}return g.jsx(iw.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function aw(){var e=E.useContext(iw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Dd(e){return Array.isArray(e)?gM([],e):e!==void 0?[e]:[]}function ZK(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Dd(o)}),t}var Xn;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Xn||(Xn={}));var JK=Xn.Selected,Ur=Xn.Disabled,QK=Xn.Hidden,eX=Xn.Today,sw=Xn.RangeEnd,lw=Xn.RangeMiddle,cw=Xn.RangeStart,tX=Xn.Outside;function nX(e,t,n){var r,o=(r={},r[JK]=Dd(e.selected),r[Ur]=Dd(e.disabled),r[QK]=Dd(e.hidden),r[eX]=[e.today],r[sw]=[],r[lw]=[],r[cw]=[],r[tX]=[],r);return e.fromDate&&o[Ur].push({before:e.fromDate}),e.toDate&&o[Ur].push({after:e.toDate}),Dl(e)?o[Ur]=o[Ur].concat(t.modifiers[Ur]):Al(e)&&(o[Ur]=o[Ur].concat(n.modifiers[Ur]),o[cw]=n.modifiers[cw],o[lw]=n.modifiers[lw],o[sw]=n.modifiers[sw]),o}var SM=E.createContext(void 0);function rX(e){var t=st(),n=ow(),r=aw(),o=nX(t,n,r),i=ZK(t.modifiers),a=Ne(Ne({},o),i);return g.jsx(SM.Provider,{value:a,children:e.children})}function CM(){var e=E.useContext(SM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function oX(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function iX(e){return!!(e&&typeof e=="object"&&"from"in e)}function aX(e){return!!(e&&typeof e=="object"&&"after"in e)}function sX(e){return!!(e&&typeof e=="object"&&"before"in e)}function lX(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function cX(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Er(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var a=Er(e,r)>=0&&Er(o,e)>=0;return a}return o?sn(o,e):r?sn(r,e):!1}function uX(e){return Kg(e)}function dX(e){return Array.isArray(e)&&e.every(Kg)}function fX(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(uX(n))return sn(e,n);if(dX(n))return n.includes(e);if(iX(n))return cX(e,n);if(lX(n))return n.dayOfWeek.includes(e.getDay());if(oX(n)){var r=Er(n.before,e),o=Er(n.after,e),i=r>0,a=o<0,s=Qg(n.before,n.after);return s?a&&i:i||a}return aX(n)?Er(e,n.after)>0:sX(n)?Er(n.before,e)>0:typeof n=="function"?n(e):!1})}function uw(e,t,n){var r=Object.keys(t).reduce(function(i,a){var s=t[a];return fX(e,s)&&i.push(a),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!ew(e,n)&&(o.outside=!0),o}function hX(e,t){for(var n=ln(e[0]),r=Xg(e[e.length-1]),o,i,a=n;a<=r;){var s=uw(a,t),l=!s.disabled&&!s.hidden;if(!l){a=Zt(a,1);continue}if(s.selected)return a;s.today&&!i&&(i=a),o||(o=a),a=Zt(a,1)}return i||o}var pX=365;function EM(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,f={day:Zt,week:Yg,month:Kn,year:o6,startOfWeek:function(v){return o.ISOWeek?ii(v):Cr(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?oM(v):Zg(v,{locale:d,weekStartsOn:l})}},h=f[n](e,r==="after"?1:-1);r==="before"&&c?h=i6([c,h]):r==="after"&&u&&(h=a6([u,h]));var p=!0;if(i){var m=uw(h,i);p=!m.disabled&&!m.hidden}return p?h:s.count>pX?s.lastFocused:EM(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:Ne(Ne({},s),{count:s.count+1})})}var PM=E.createContext(void 0);function mX(e){var t=kl(),n=CM(),r=E.useState(),o=r[0],i=r[1],a=E.useState(),s=a[0],l=a[1],c=hX(t.displayMonths,n),u=o??(s&&t.isDateDisplayed(s))?s:c,d=function(){l(o),i(void 0)},f=function(v){i(v)},h=st(),p=function(v,w){if(o){var b=EM(o,{moveBy:v,direction:w,context:h,modifiers:n});sn(o,b)||(t.goToDate(b,o),f(b))}},m={focusedDay:o,focusTarget:u,blur:d,focus:f,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return g.jsx(PM.Provider,{value:m,children:e.children})}function dw(){var e=E.useContext(PM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function gX(e,t){var n=CM(),r=uw(e,n,t);return r}var fw=E.createContext(void 0);function wX(e){if(!Td(e.initialProps)){var t={selected:void 0};return g.jsx(fw.Provider,{value:t,children:e.children})}return g.jsx(vX,{initialProps:e.initialProps,children:e.children})}function vX(e){var t=e.initialProps,n=e.children,r=function(i,a,s){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,a,s),a.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,a,s);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,a,s)},o={selected:t.selected,onDayClick:r};return g.jsx(fw.Provider,{value:o,children:n})}function RM(){var e=E.useContext(fw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function yX(e,t){var n=st(),r=RM(),o=ow(),i=aw(),a=dw(),s=a.focusDayAfter,l=a.focusDayBefore,c=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,f=a.focus,h=a.focusMonthBefore,p=a.focusMonthAfter,m=a.focusYearBefore,v=a.focusYearAfter,w=a.focusStartOfWeek,b=a.focusEndOfWeek,x=function(X){var B,ee,Z,J;Td(n)?(B=r.onDayClick)===null||B===void 0||B.call(r,e,t,X):Dl(n)?(ee=o.onDayClick)===null||ee===void 0||ee.call(o,e,t,X):Al(n)?(Z=i.onDayClick)===null||Z===void 0||Z.call(i,e,t,X):(J=n.onDayClick)===null||J===void 0||J.call(n,e,t,X)},S=function(X){var B;f(e),(B=n.onDayFocus)===null||B===void 0||B.call(n,e,t,X)},C=function(X){var B;d(),(B=n.onDayBlur)===null||B===void 0||B.call(n,e,t,X)},N=function(X){var B;(B=n.onDayMouseEnter)===null||B===void 0||B.call(n,e,t,X)},R=function(X){var B;(B=n.onDayMouseLeave)===null||B===void 0||B.call(n,e,t,X)},T=function(X){var B;(B=n.onDayPointerEnter)===null||B===void 0||B.call(n,e,t,X)},M=function(X){var B;(B=n.onDayPointerLeave)===null||B===void 0||B.call(n,e,t,X)},A=function(X){var B;(B=n.onDayTouchCancel)===null||B===void 0||B.call(n,e,t,X)},k=function(X){var B;(B=n.onDayTouchEnd)===null||B===void 0||B.call(n,e,t,X)},F=function(X){var B;(B=n.onDayTouchMove)===null||B===void 0||B.call(n,e,t,X)},L=function(X){var B;(B=n.onDayTouchStart)===null||B===void 0||B.call(n,e,t,X)},Y=function(X){var B;(B=n.onDayKeyUp)===null||B===void 0||B.call(n,e,t,X)},ne=function(X){var B;switch(X.key){case"ArrowLeft":X.preventDefault(),X.stopPropagation(),n.dir==="rtl"?s():l();break;case"ArrowRight":X.preventDefault(),X.stopPropagation(),n.dir==="rtl"?l():s();break;case"ArrowDown":X.preventDefault(),X.stopPropagation(),c();break;case"ArrowUp":X.preventDefault(),X.stopPropagation(),u();break;case"PageUp":X.preventDefault(),X.stopPropagation(),X.shiftKey?m():h();break;case"PageDown":X.preventDefault(),X.stopPropagation(),X.shiftKey?v():p();break;case"Home":X.preventDefault(),X.stopPropagation(),w();break;case"End":X.preventDefault(),X.stopPropagation(),b();break}(B=n.onDayKeyDown)===null||B===void 0||B.call(n,e,t,X)},q={onClick:x,onFocus:S,onBlur:C,onKeyDown:ne,onKeyUp:Y,onMouseEnter:N,onMouseLeave:R,onPointerEnter:T,onPointerLeave:M,onTouchCancel:A,onTouchEnd:k,onTouchMove:F,onTouchStart:L};return q}function bX(){var e=st(),t=RM(),n=ow(),r=aw(),o=Td(e)?t.selected:Dl(e)?n.selected:Al(e)?r.selected:void 0;return o}function xX(e){return Object.values(Xn).includes(e)}function _X(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(xX(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function SX(e,t){var n=Ne({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Ne(Ne({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function CX(e,t,n){var r,o,i,a=st(),s=dw(),l=gX(e,t),c=yX(e,l),u=bX(),d=!!(a.onDayClick||a.mode!=="default");E.useEffect(function(){var N;l.outside||s.focusedDay&&d&&sn(s.focusedDay,e)&&((N=n.current)===null||N===void 0||N.focus())},[s.focusedDay,e,n,d,l.outside]);var f=_X(a,l).join(" "),h=SX(a,l),p=!!(l.outside&&!a.showOutsideDays||l.hidden),m=(i=(o=a.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:WK,v=g.jsx(m,{date:e,displayMonth:t,activeModifiers:l}),w={style:h,className:f,children:v,role:"gridcell"},b=s.focusTarget&&sn(s.focusTarget,e)&&!l.outside,x=s.focusedDay&&sn(s.focusedDay,e),S=Ne(Ne(Ne({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=x||b?0:-1,r)),c),C={isButton:d,isHidden:p,activeModifiers:l,selectedDays:u,buttonProps:S,divProps:w};return C}function EX(e){var t=E.useRef(null),n=CX(e.date,e.displayMonth,t);return n.isHidden?g.jsx("div",{role:"gridcell"}):n.isButton?g.jsx(Md,Ne({name:"day",ref:t},n.buttonProps)):g.jsx("div",Ne({},n.divProps))}function PX(e){var t=e.number,n=e.dates,r=st(),o=r.onWeekNumberClick,i=r.styles,a=r.classNames,s=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:s});if(!o)return g.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:s}),f=function(h){o(t,n,h)};return g.jsx(Md,{name:"week-number","aria-label":d,className:a.weeknumber,style:i.weeknumber,onClick:f,children:u})}function RX(e){var t,n,r=st(),o=r.styles,i=r.classNames,a=r.showWeekNumber,s=r.components,l=(t=s==null?void 0:s.Day)!==null&&t!==void 0?t:EX,c=(n=s==null?void 0:s.WeekNumber)!==null&&n!==void 0?n:PX,u;return a&&(u=g.jsx("td",{className:i.cell,style:o.cell,children:g.jsx(c,{number:e.weekNumber,dates:e.dates})})),g.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return g.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:g.jsx(l,{displayMonth:e.displayMonth,date:d})},rK(d))})]})}function NM(e,t,n){for(var r=n!=null&&n.ISOWeek?oM(t):Zg(t,n),o=n!=null&&n.ISOWeek?ii(e):Cr(e,n),i=Er(r,o),a=[],s=0;s<=i;s++)a.push(Zt(o,s));var l=a.reduce(function(c,u){var d=n!=null&&n.ISOWeek?aM(u):lM(u,n),f=c.find(function(h){return h.weekNumber===d});return f?(f.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function NX(e,t){var n=NM(ln(e),Xg(e),t);if(t!=null&&t.useFixedWeeks){var r=iK(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],a=Yg(i,6-r),s=NM(Yg(i,1),a,t);n.push.apply(n,s)}}return n}function TX(e){var t,n,r,o=st(),i=o.locale,a=o.classNames,s=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,h=o.ISOWeek,p=NX(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:d,firstWeekContainsDate:f}),m=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:VK,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:RX,w=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:BK;return g.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&g.jsx(m,{}),g.jsx("tbody",{className:a.tbody,style:s.tbody,children:p.map(function(b){return g.jsx(v,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),g.jsx(w,{displayMonth:e.displayMonth})]})}function MX(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var DX=MX()?E.useLayoutEffect:E.useEffect,hw=!1,AX=0;function TM(){return"react-day-picker-".concat(++AX)}function kX(e){var t,n=e??(hw?TM():null),r=E.useState(n),o=r[0],i=r[1];return DX(function(){o===null&&i(TM())},[]),E.useEffect(function(){hw===!1&&(hw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function IX(e){var t,n,r=st(),o=r.dir,i=r.classNames,a=r.styles,s=r.components,l=kl().displayMonths,c=kX(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],f=a.month,h=e.displayIndex===0,p=e.displayIndex===l.length-1,m=!h&&!p;o==="rtl"&&(t=[h,p],p=t[0],h=t[1]),h&&(d.push(i.caption_start),f=Ne(Ne({},f),a.caption_start)),p&&(d.push(i.caption_end),f=Ne(Ne({},f),a.caption_end)),m&&(d.push(i.caption_between),f=Ne(Ne({},f),a.caption_between));var v=(n=s==null?void 0:s.Caption)!==null&&n!==void 0?n:zK;return g.jsxs("div",{className:d.join(" "),style:f,children:[g.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(TX,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function OX(e){var t=st(),n=t.classNames,r=t.styles;return g.jsx("div",{className:n.months,style:r.months,children:e.children})}function jX(e){var t,n,r=e.initialProps,o=st(),i=dw(),a=kl(),s=E.useState(!1),l=s[0],c=s[1];E.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=Ne(Ne({},o.styles.root),o.style),f=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,m){var v;return Ne(Ne({},p),(v={},v[m]=r[m],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:OX;return g.jsx("div",Ne({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:g.jsx(h,{children:a.displayMonths.map(function(p,m){return g.jsx(IX,{displayIndex:m,displayMonth:p},m)})})}))}function $X(e){var t=e.children,n=sK(e,["children"]);return g.jsx(PK,{initialProps:n,children:g.jsx(jK,{children:g.jsx(wX,{initialProps:n,children:g.jsx(GK,{initialProps:n,children:g.jsx(KK,{initialProps:n,children:g.jsx(rX,{children:g.jsx(mX,{children:t})})})})})})})}function FX(e){return g.jsx($X,Ne({},e,{children:g.jsx(jX,{initialProps:e})}))}function Ad({className:e,classNames:t,showOutsideDays:n=!0,...r}){const{variants:o}=Ro(),i=E.useMemo(()=>Cn(o.button.defaultStyles,{variants:o.button.variantStyles,defaultVariants:o.button.defaultVariants}),[o]);return g.jsx(FX,{showOutsideDays:n,className:K("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:K(i({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:K(i({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>g.jsx(Ed,{className:"h-4 w-4"}),IconRight:()=>g.jsx(Eo,{className:"h-4 w-4"})},...r})}Ad.displayName="Calendar";const MM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));MM.displayName="Card";const DM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("flex flex-col space-y-1.5 p-6",e),...t}));DM.displayName="CardHeader";const AM=y.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:K("text-2xl font-semibold leading-none tracking-tight",e),...t}));AM.displayName="CardTitle";const kM=y.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:K("text-sm text-muted-foreground",e),...t}));kM.displayName="CardDescription";const IM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("p-6 pt-0",e),...t}));IM.displayName="CardContent";const OM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("flex items-center p-6 pt-0",e),...t}));OM.displayName="CardFooter";function LX(e){return Object.prototype.toString.call(e)==="[object Object]"}function jM(e){return LX(e)||Array.isArray(e)}function zX(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function pw(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!jM(s)||!jM(l)?s===l:pw(s,l)})}function $M(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function BX(e,t){if(e.length!==t.length)return!1;const n=$M(e),r=$M(t);return n.every((o,i)=>{const a=r[i];return pw(o,a)})}function mw(e){return typeof e=="number"}function gw(e){return typeof e=="string"}function kd(e){return typeof e=="boolean"}function FM(e){return Object.prototype.toString.call(e)==="[object Object]"}function mt(e){return Math.abs(e)}function ww(e){return Math.sign(e)}function Il(e,t){return mt(e-t)}function HX(e,t){if(e===0||t===0||mt(e)<=mt(t))return 0;const n=Il(mt(e),mt(t));return mt(n/e)}function UX(e){return Math.round(e*100)/100}function Ol(e){return $l(e).map(Number)}function Zn(e){return e[jl(e)]}function jl(e){return Math.max(0,e.length-1)}function vw(e,t){return t===jl(e)}function LM(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function $l(e){return Object.keys(e)}function zM(e,t){return[e,t].reduce((n,r)=>($l(r).forEach(o=>{const i=n[o],a=r[o],s=FM(i)&&FM(a);n[o]=s?zM(i,a):a}),n),{})}function yw(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function VX(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function a(l,c){return gw(e)?n[e](l):e(t,l,c)}return{measure:a}}function Fl(){let e=[];function t(o,i,a,s={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,a,s),l=()=>o.removeEventListener(i,a,s);else{const c=o;c.addListener(a),l=()=>c.removeListener(a)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function WX(e,t,n,r){const o=Fl(),i=1e3/60;let a=null,s=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&p()})}function u(){h(),o.clear()}function d(v){if(!l)return;a||(a=v,n(),n());const w=v-a;for(a=v,s+=w;s>=i;)n(),s-=i;const b=s/i;r(b),l&&(l=t.requestAnimationFrame(d))}function f(){l||(l=t.requestAnimationFrame(d))}function h(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function p(){a=null,s=0}return{init:c,destroy:u,start:f,stop:h,update:n,render:r}}function GX(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",a=!r&&n?-1:1,s=u(),l=d();function c(p){const{height:m,width:v}=p;return r?m:v}function u(){return r?"top":n?"right":"left"}function d(){return r?"bottom":n?"left":"right"}function f(p){return p*a}return{scroll:o,cross:i,startEdge:s,endEdge:l,measureSize:c,direction:f}}function si(e=0,t=0){const n=mt(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function a(c){return i(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:s}}function BM(e,t,n){const{constrain:r}=si(0,e),o=e+1;let i=a(t);function a(f){return n?mt((o+f)%o):r(f)}function s(){return i}function l(f){return i=a(f),d}function c(f){return u().set(s()+f)}function u(){return BM(e,s(),n)}const d={get:s,set:l,add:c,clone:u};return d}function qX(e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b){const{cross:x,direction:S}=e,C=["INPUT","SELECT","TEXTAREA"],N={passive:!1},R=Fl(),T=Fl(),M=si(50,225).constrain(h.measure(20)),A={mouse:300,touch:400},k={mouse:500,touch:600},F=p?43:25;let L=!1,Y=0,ne=0,q=!1,X=!1,B=!1,ee=!1;function Z(z){if(!b)return;function se(fe){(kd(b)||b(z,fe))&&j(fe)}const oe=t;R.add(oe,"dragstart",fe=>fe.preventDefault(),N).add(oe,"touchmove",()=>{},N).add(oe,"touchend",()=>{}).add(oe,"touchstart",se).add(oe,"mousedown",se).add(oe,"touchcancel",$).add(oe,"contextmenu",$).add(oe,"click",te,!0)}function J(){R.clear(),T.clear()}function H(){const z=ee?n:t;T.add(z,"touchmove",G,N).add(z,"touchend",$).add(z,"mousemove",G,N).add(z,"mouseup",$)}function O(z){const se=z.nodeName||"";return C.includes(se)}function V(){return(p?k:A)[ee?"mouse":"touch"]}function ae(z,se){const oe=d.add(ww(z)*-1),fe=u.byDistance(z,!p).distance;return p||mt(z)<M?fe:v&&se?fe*.5:u.byIndex(oe.get(),0).distance}function j(z){const se=yw(z,r);ee=se,B=p&&se&&!z.buttons&&L,L=Il(o.get(),a.get())>=2,!(se&&z.button!==0)&&(O(z.target)||(q=!0,i.pointerDown(z),c.useFriction(0).useDuration(0),o.set(a),H(),Y=i.readPoint(z),ne=i.readPoint(z,x),f.emit("pointerDown")))}function G(z){if(!yw(z,r)&&z.touches.length>=2)return $(z);const oe=i.readPoint(z),fe=i.readPoint(z,x),ge=Il(oe,Y),pe=Il(fe,ne);if(!X&&!ee&&(!z.cancelable||(X=ge>pe,!X)))return $(z);const me=i.pointerMove(z);ge>m&&(B=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(S(me)),z.preventDefault()}function $(z){const oe=u.byDistance(0,!1).index!==d.get(),fe=i.pointerUp(z)*V(),ge=ae(S(fe),oe),pe=HX(fe,ge),me=F-10*pe,_e=w+pe/50;X=!1,q=!1,T.clear(),c.useDuration(me).useFriction(_e),l.distance(ge,!p),ee=!1,f.emit("pointerUp")}function te(z){B&&(z.stopPropagation(),z.preventDefault(),B=!1)}function ie(){return q}return{init:Z,destroy:J,pointerDown:ie}}function YX(e,t){let r,o;function i(d){return d.timeStamp}function a(d,f){const p=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(yw(d,t)?d:d.touches[0])[p]}function s(d){return r=d,o=d,a(d)}function l(d){const f=a(d)-a(o),h=i(d)-i(r)>170;return o=d,h&&(r=d),f}function c(d){if(!r||!o)return 0;const f=a(o)-a(r),h=i(d)-i(r),p=i(d)-i(o)>170,m=f/h;return h&&!p&&mt(m)>.1?m:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function KX(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:a}=n;return{top:r,right:o+i,bottom:r+a,left:o,width:i,height:a}}return{measure:e}}function XX(e){function t(r){return e*(r/100)}return{measure:t}}function ZX(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,u=[],d=!1;function f(v){return o.measureSize(a.measure(v))}function h(v){if(!i)return;c=f(e),u=r.map(f);function w(b){for(const x of b){if(d)return;const S=x.target===e,C=r.indexOf(x.target),N=S?c:u[C],R=f(S?e:r[C]);if(mt(R-N)>=.5){v.reInit(),t.emit("resize");break}}}l=new ResizeObserver(b=>{(kd(i)||i(v,b))&&w(b)}),n.requestAnimationFrame(()=>{s.forEach(b=>l.observe(b))})}function p(){d=!0,l&&l.disconnect()}return{init:h,destroy:p}}function JX(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,u=e.get(),d=0;function f(){const N=r.get()-e.get(),R=!l;let T=0;return R?(a=0,n.set(r),e.set(r),T=N):(n.set(e),a+=N/l,a*=c,u+=a,e.add(a),T=u-d),s=ww(T),d=u,C}function h(){const N=r.get()-t.get();return mt(N)<.001}function p(){return l}function m(){return s}function v(){return a}function w(){return x(o)}function b(){return S(i)}function x(N){return l=N,C}function S(N){return c=N,C}const C={direction:m,duration:p,velocity:v,seek:f,settled:h,useBaseFriction:b,useBaseDuration:w,useFriction:S,useDuration:x};return C}function QX(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=si(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(h){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=mt(e[p]-t.get()),v=n.get()-t.get(),w=s.constrain(m/a);n.subtract(v*w),!h&&mt(v)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(h){l=!h}return{shouldConstrain:c,constrain:u,toggleActive:d}}function eZ(e,t,n,r,o){const i=si(-t+e,0),a=d(),s=u(),l=f();function c(p,m){return Il(p,m)<=1}function u(){const p=a[0],m=Zn(a),v=a.lastIndexOf(p),w=a.indexOf(m)+1;return si(v,w)}function d(){return n.map((p,m)=>{const{min:v,max:w}=i,b=i.constrain(p),x=!m,S=vw(n,m);return x?w:S||c(v,b)?v:c(w,b)?w:b}).map(p=>parseFloat(p.toFixed(3)))}function f(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return a;const{min:p,max:m}=s;return a.slice(p,m)}return{snapsContained:l,scrollContainLimit:s}}function tZ(e,t,n){const r=t[0],o=n?r-e:Zn(t);return{limit:si(o,r)}}function nZ(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=si(i,a);function c(f){return f===1?l(n.get()):f===-1?s(n.get()):!1}function u(f){if(!c(f))return;const h=e*(f*-1);r.forEach(p=>p.add(h))}return{loop:u}}function rZ(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function oZ(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=d().map(t.measure),c=f(),u=h();function d(){return s(r).map(m=>Zn(m)[a]-m[0][i]).map(mt)}function f(){return r.map(m=>n[i]-m[i]).map(m=>-mt(m))}function h(){return s(c).map(m=>m[0]).map((m,v)=>m+l[v])}return{snaps:c,snapsAligned:u}}function iZ(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=u();function u(){const f=a(i),h=!e||t==="keepSnaps";return n.length===1?[i]:h?f:f.slice(s,l).map((p,m,v)=>{const w=!m,b=vw(v,m);if(w){const x=Zn(v[0])+1;return LM(x)}if(b){const x=jl(i)-Zn(v)[0]+1;return LM(x,Zn(v)[0])}return p})}return{slideRegistry:c}}function aZ(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(p){return p.concat().sort((m,v)=>mt(m)-mt(v))[0]}function c(p){const m=e?a(p):s(p),v=t.map((b,x)=>({diff:u(b-m,0),index:x})).sort((b,x)=>mt(b.diff)-mt(x.diff)),{index:w}=v[0];return{index:w,distance:m}}function u(p,m){const v=[p,p+n,p-n];if(!e)return p;if(!m)return l(v);const w=v.filter(b=>ww(b)===m);return w.length?l(w):Zn(v)-n}function d(p,m){const v=t[p]-o.get(),w=u(v,m);return{index:p,distance:w}}function f(p,m){const v=o.get()+p,{index:w,distance:b}=c(v),x=!e&&i(v);if(!m||x)return{index:w,distance:p};const S=t[w]-b,C=p+u(S,0);return{index:w,distance:C}}return{byDistance:f,byIndex:d,shortcut:u}}function sZ(e,t,n,r,o,i,a){function s(d){const f=d.distance,h=d.index!==t.get();i.add(f),f&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),h&&(n.set(t.get()),t.set(d.index),a.emit("select"))}function l(d,f){const h=o.byDistance(d,f);s(h)}function c(d,f){const h=t.clone().set(d),p=o.byIndex(h.get(),f);s(p)}return{distance:l,index:c}}function lZ(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function u(h){if(!s)return;function p(m){if(new Date().getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const b=n.findIndex(x=>x.includes(m));mw(b)&&(o.useDuration(0),r.index(b,0),a.emit("slideFocus"))}i.add(document,"keydown",d,!1),t.forEach((m,v)=>{i.add(m,"focus",w=>{(kd(s)||s(h,w))&&p(v)},l)})}function d(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function Ll(e){let t=e;function n(){return t}function r(l){t=a(l)}function o(l){t+=a(l)}function i(l){t-=a(l)}function a(l){return mw(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function HM(e,t){const n=e.scroll==="x"?a:s,r=t.style;let o=null,i=!1;function a(f){return`translate3d(${f}px,0px,0px)`}function s(f){return`translate3d(0px,${f}px,0px)`}function l(f){if(i)return;const h=UX(e.direction(f));h!==o&&(r.transform=n(h),o=h)}function c(f){i=!f}function u(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function cZ(e,t,n,r,o,i,a,s,l){const u=Ol(o),d=Ol(o).reverse(),f=w().concat(b());function h(R,T){return R.reduce((M,A)=>M-o[A],T)}function p(R,T){return R.reduce((M,A)=>h(M,T)>0?M.concat([A]):M,[])}function m(R){return i.map((T,M)=>({start:T-r[M]+.5+R,end:T+t-.5+R}))}function v(R,T,M){const A=m(T);return R.map(k=>{const F=M?0:-n,L=M?n:0,Y=M?"end":"start",ne=A[k][Y];return{index:k,loopPoint:ne,slideLocation:Ll(-1),translate:HM(e,l[k]),target:()=>s.get()>ne?F:L}})}function w(){const R=a[0],T=p(d,R);return v(T,n,!1)}function b(){const R=t-a[0]-1,T=p(u,R);return v(T,-n,!0)}function x(){return f.every(({index:R})=>{const T=u.filter(M=>M!==R);return h(T,t)<=.1})}function S(){f.forEach(R=>{const{target:T,translate:M,slideLocation:A}=R,k=T();k!==A.get()&&(M.to(k),A.set(k))})}function C(){f.forEach(R=>R.translate.clear())}return{canLoop:x,clear:C,loop:S,loopPoints:f}}function uZ(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(u){for(const d of u)if(d.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{o||(kd(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function dZ(e,t,n,r){const o={};let i=null,a=null,s,l=!1;function c(){s=new IntersectionObserver(p=>{l||(p.forEach(m=>{const v=t.indexOf(m.target);o[v]=m}),i=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(p=>s.observe(p))}function u(){s&&s.disconnect(),l=!0}function d(p){return $l(o).reduce((m,v)=>{const w=parseInt(v),{isIntersecting:b}=o[w];return(p&&b||!p&&!b)&&m.push(w),m},[])}function f(p=!0){if(p&&i)return i;if(!p&&a)return a;const m=d(p);return p&&(i=m),p||(a=m),m}return{init:c,destroy:u,get:f}}function fZ(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,u=p(),d=m(),f=n.map(a),h=v();function p(){if(!c)return 0;const b=n[0];return mt(t[s]-b[s])}function m(){if(!c)return 0;const b=i.getComputedStyle(Zn(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function v(){return n.map((b,x,S)=>{const C=!x,N=vw(S,x);return C?f[x]+u:N?f[x]+d:S[x+1][s]-b[s]}).map(mt)}return{slideSizes:f,slideSizesWithGaps:h,startGap:u,endGap:d}}function hZ(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,f=mw(n);function h(w,b){return Ol(w).filter(x=>x%b===0).map(x=>w.slice(x,x+b))}function p(w){return w.length?Ol(w).reduce((b,x,S)=>{const C=Zn(b)||0,N=C===0,R=x===jl(w),T=o[c]-i[C][c],M=o[c]-i[x][u],A=!r&&N?d(a):0,k=!r&&R?d(s):0,F=mt(M-k-(T+A));return S&&F>t+l&&b.push(x),R&&b.push(w.length),b},[]).map((b,x,S)=>{const C=Math.max(S[x-1]||0);return w.slice(C,b)}):[]}function m(w){return f?h(w,n):p(w)}return{groupSlides:m}}function pZ(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:f,dragFree:h,dragThreshold:p,inViewThreshold:m,slidesToScroll:v,skipSnaps:w,containScroll:b,watchResize:x,watchSlides:S,watchDrag:C,watchFocus:N}=i,R=2,T=KX(),M=T.measure(t),A=n.map(T.measure),k=GX(l,c),F=k.measureSize(M),L=XX(F),Y=VX(s,F),ne=!d&&!!b,q=d||!!b,{slideSizes:X,slideSizesWithGaps:B,startGap:ee,endGap:Z}=fZ(k,M,A,n,q,o),J=hZ(k,F,v,d,M,A,ee,Z,R),{snaps:H,snapsAligned:O}=oZ(k,Y,M,A,J),V=-Zn(H)+Zn(B),{snapsContained:ae,scrollContainLimit:j}=eZ(F,V,O,b,R),G=ne?ae:O,{limit:$}=tZ(V,G,d),te=BM(jl(G),u,d),ie=te.clone(),re=Ol(n),z=({dragHandler:I,scrollBody:U,scrollBounds:Q,options:{loop:ce}})=>{ce||Q.constrain(I.pointerDown()),U.seek()},se=({scrollBody:I,translate:U,location:Q,offsetLocation:ce,previousLocation:Ae,scrollLooper:rt,slideLooper:Je,dragHandler:it,animation:Ue,eventHandler:xe,scrollBounds:Ye,options:{loop:Xe}},ze)=>{const we=I.settled(),Ve=!Ye.shouldConstrain(),We=Xe?we:we&&Ve;We&&!it.pointerDown()&&(Ue.stop(),xe.emit("settle")),We||xe.emit("scroll");const pt=Q.get()*ze+Ae.get()*(1-ze);ce.set(pt),Xe&&(rt.loop(I.direction()),Je.loop()),U.to(ce.get())},oe=WX(r,o,()=>z(P),I=>se(P,I)),fe=.68,ge=G[te.get()],pe=Ll(ge),me=Ll(ge),_e=Ll(ge),Re=Ll(ge),nt=JX(pe,_e,me,Re,f,fe),Ie=aZ(d,G,V,$,Re),Me=sZ(oe,te,ie,nt,Ie,Re,a),Ce=rZ($),Le=Fl(),pn=dZ(t,n,a,m),{slideRegistry:D}=iZ(ne,b,G,j,J,re),_=lZ(e,n,D,Me,nt,Le,a,N),P={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:M,slideRects:A,animation:oe,axis:k,dragHandler:qX(k,e,r,o,Re,YX(k,o),pe,oe,Me,nt,Ie,te,a,L,h,p,w,fe,C),eventStore:Le,percentOfView:L,index:te,indexPrevious:ie,limit:$,location:pe,offsetLocation:_e,previousLocation:me,options:i,resizeHandler:ZX(t,a,o,n,k,x,T),scrollBody:nt,scrollBounds:QX($,_e,Re,nt,L),scrollLooper:nZ(V,$,_e,[pe,_e,me,Re]),scrollProgress:Ce,scrollSnapList:G.map(Ce.get),scrollSnaps:G,scrollTarget:Ie,scrollTo:Me,slideLooper:cZ(k,F,V,X,B,H,G,_e,n),slideFocus:_,slidesHandler:uZ(t,a,S),slidesInView:pn,slideIndexes:re,slideRegistry:D,slidesToScroll:J,target:Re,translate:HM(k,t)};return P}function mZ(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(u=>u(t,c)),l}function i(c,u){return e[c]=r(c).concat([u]),l}function a(c,u){return e[c]=r(c).filter(d=>d!==u),l}function s(){e={}}const l={init:n,emit:o,off:a,on:i,clear:s};return l}const gZ={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function wZ(e){function t(i,a){return zM(i,a||{})}function n(i){const a=i.breakpoints||{},s=$l(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(i,s)}function r(i){return i.map(a=>$l(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function vZ(e){let t=[];function n(i,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(i,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function Id(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=wZ(o),a=vZ(i),s=Fl(),l=mZ(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:f,off:h,emit:p}=l,m=k;let v=!1,w,b=c(gZ,Id.globalOptions),x=c(b),S=[],C,N,R;function T(){const{container:re,slides:z}=x;N=(gw(re)?e.querySelector(re):re)||e.children[0];const oe=gw(z)?N.querySelectorAll(z):z;R=[].slice.call(oe||N.children)}function M(re){const z=pZ(e,N,R,r,o,re,l);if(re.loop&&!z.slideLooper.canLoop()){const se=Object.assign({},re,{loop:!1});return M(se)}return z}function A(re,z){v||(b=c(b,re),x=u(b),S=z||S,T(),w=M(x),d([b,...S.map(({options:se})=>se)]).forEach(se=>s.add(se,"change",k)),x.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(ie),w.eventHandler.init(ie),w.resizeHandler.init(ie),w.slidesHandler.init(ie),w.options.loop&&w.slideLooper.loop(),N.offsetParent&&R.length&&w.dragHandler.init(ie),C=a.init(ie,S)))}function k(re,z){const se=J();F(),A(c({startIndex:se},re),z),l.emit("reInit")}function F(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),a.destroy(),s.clear()}function L(){v||(v=!0,s.clear(),F(),l.emit("destroy"),l.clear())}function Y(re,z,se){!x.active||v||(w.scrollBody.useBaseFriction().useDuration(z===!0?0:x.duration),w.scrollTo.index(re,se||0))}function ne(re){const z=w.index.add(1).get();Y(z,re,-1)}function q(re){const z=w.index.add(-1).get();Y(z,re,1)}function X(){return w.index.add(1).get()!==J()}function B(){return w.index.add(-1).get()!==J()}function ee(){return w.scrollSnapList}function Z(){return w.scrollProgress.get(w.location.get())}function J(){return w.index.get()}function H(){return w.indexPrevious.get()}function O(){return w.slidesInView.get()}function V(){return w.slidesInView.get(!1)}function ae(){return C}function j(){return w}function G(){return e}function $(){return N}function te(){return R}const ie={canScrollNext:X,canScrollPrev:B,containerNode:$,internalEngine:j,destroy:L,off:h,on:f,emit:p,plugins:ae,previousScrollSnap:H,reInit:m,rootNode:G,scrollNext:ne,scrollPrev:q,scrollProgress:Z,scrollSnapList:ee,scrollTo:Y,selectedScrollSnap:J,slideNodes:te,slidesInView:O,slidesNotInView:V};return A(t,n),setTimeout(()=>l.emit("init"),0),ie}Id.globalOptions=void 0;function bw(e={},t=[]){const n=E.useRef(e),r=E.useRef(t),[o,i]=E.useState(),[a,s]=E.useState(),l=E.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return E.useEffect(()=>{pw(n.current,e)||(n.current=e,l())},[e,l]),E.useEffect(()=>{BX(r.current,t)||(r.current=t,l())},[t,l]),E.useEffect(()=>{if(zX()&&a){Id.globalOptions=bw.globalOptions;const c=Id(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}bw.globalOptions=void 0;const UM=E.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a},s)=>{const[l,c]=bw({...t,axis:e==="horizontal"?"x":"y"},r),[u,d]=E.useState(!1),[f,h]=E.useState(!1),[p,m]=E.useState(0),v=E.useCallback(()=>{c&&(m(c.selectedScrollSnap()),d(c.canScrollPrev()),h(c.canScrollNext()))},[c]);return E.useEffect(()=>{c&&(v(),c.on("select",v),c.on("reInit",v),n&&n(c))},[c,v,n]),g.jsxs("div",{ref:s,className:K("relative",o),...a,children:[g.jsx("div",{ref:l,className:"overflow-hidden",dir:"ltr",children:g.jsx("div",{className:K("flex",e==="horizontal"?"-ml-4":"-mt-4 flex-col",[e==="horizontal"?"touch-pan-x":"touch-pan-y"]),children:E.Children.map(i,w=>g.jsx("div",{className:K("min-w-0 flex-[0_0_100%]",e==="horizontal"?"pl-4":"pt-4"),children:w}))})}),g.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[g.jsxs(Yn,{variant:"outline",size:"icon",className:K("h-8 w-8 rounded-full",!u&&"opacity-50"),disabled:!u,onClick:()=>c==null?void 0:c.scrollPrev(),children:[g.jsx(Ed,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}),g.jsx("div",{className:"flex gap-1",children:E.Children.map(i,(w,b)=>g.jsx(Yn,{variant:"outline",size:"icon",className:K("h-2 w-2 rounded-full",p===b?"bg-primary":"bg-muted"),onClick:()=>c==null?void 0:c.scrollTo(b),children:g.jsxs("span",{className:"sr-only",children:["Jump to slide ",b+1]})},b))}),g.jsxs(Yn,{variant:"outline",size:"icon",className:K("h-8 w-8 rounded-full",!f&&"opacity-50"),disabled:!f,onClick:()=>c==null?void 0:c.scrollNext(),children:[g.jsx(Eo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]})]})]})});UM.displayName="Carousel";const VM=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"list",className:K("",e),...t}));VM.displayName="CarouselContent";const WM=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"listitem",className:K("",e),...t}));WM.displayName="CarouselItem";const GM=E.forwardRef(({className:e,...t},n)=>g.jsxs(Yn,{ref:n,variant:"outline",size:"icon",className:K("absolute left-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Ed,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}));GM.displayName="CarouselPrevious";const qM=E.forwardRef(({className:e,...t},n)=>g.jsxs(Yn,{ref:n,variant:"outline",size:"icon",className:K("absolute right-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Eo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]}));qM.displayName="CarouselNext";const YM=E.forwardRef(({className:e,...t},n)=>g.jsx(P1,{ref:n,className:K("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:g.jsx(cV,{className:K("flex items-center justify-center text-current"),children:g.jsx(Ta,{className:"h-4 w-4"})})}));YM.displayName=P1.displayName;const yZ=q_,bZ=Ip,KM=E.forwardRef(({children:e,...t},n)=>g.jsx(jp,{ref:n,className:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",...t,children:e}));KM.displayName="CollapsibleContent";var XM=1,xZ=.9,_Z=.8,SZ=.17,xw=.1,_w=.999,CZ=.9999,EZ=.99,PZ=/[\\\/_+.#"@\[\(\{&]/,RZ=/[\\\/_+.#"@\[\(\{&]/g,NZ=/[\s-]/,ZM=/[\s-]/g;function Sw(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?XM:EZ;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,f,h,p;c>=0;)d=Sw(e,t,n,r,c+1,i+1,a),d>u&&(c===o?d*=XM:PZ.test(e.charAt(c-1))?(d*=_Z,h=e.slice(o,c-1).match(RZ),h&&o>0&&(d*=Math.pow(_w,h.length))):NZ.test(e.charAt(c-1))?(d*=xZ,p=e.slice(o,c-1).match(ZM),p&&o>0&&(d*=Math.pow(_w,p.length))):(d*=SZ,o>0&&(d*=Math.pow(_w,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=CZ)),(d<xw&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(f=Sw(e,t,n,r,c+1,i+2,a),f*xw>d&&(d=f*xw)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function JM(e){return e.toLowerCase().replace(ZM," ")}function TZ(e,t){return Sw(e,t,JM(e),JM(t),0,0,{})}function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mt.apply(null,arguments)}function li(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 MZ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function QM(...e){return t=>e.forEach(n=>MZ(n,t))}function zl(...e){return E.useCallback(QM(...e),e)}function DZ(e,t=[]){let n=[];function r(i,a){const s=E.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:f,children:h,...p}=d,m=(f==null?void 0:f[e][l])||s,v=E.useMemo(()=>p,Object.values(p));return E.createElement(m.Provider,{value:v},h)}function u(d,f){const h=(f==null?void 0:f[e][l])||s,p=E.useContext(h);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,AZ(o,...t)]}function AZ(...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:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const Cw=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},kZ=y.useId||(()=>{});let IZ=0;function Ew(e){const[t,n]=y.useState(kZ());return Cw(()=>{e||n(r=>r??String(IZ++))},[e]),e||(t?`radix-${t}`:"")}function ci(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function OZ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=jZ({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=ci(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function jZ({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=ci(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Pw=E.forwardRef((e,t)=>{const{children:n,...r}=e,o=E.Children.toArray(n),i=o.find(FZ);if(i){const a=i.props.children,s=o.map(l=>l===i?E.Children.count(a)>1?E.Children.only(null):E.isValidElement(a)?a.props.children:null:l);return E.createElement(Rw,Mt({},r,{ref:t}),E.isValidElement(a)?E.cloneElement(a,void 0,s):null)}return E.createElement(Rw,Mt({},r,{ref:t}),n)});Pw.displayName="Slot";const Rw=E.forwardRef((e,t)=>{const{children:n,...r}=e;return E.isValidElement(n)?E.cloneElement(n,{...LZ(r,n.props),ref:QM(t,n.ref)}):E.Children.count(n)>1?E.Children.only(null):null});Rw.displayName="SlotClone";const $Z=({children:e})=>E.createElement(E.Fragment,null,e);function FZ(e){return E.isValidElement(e)&&e.type===$Z}function LZ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{i==null||i(...s),o==null||o(...s)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const ui=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=E.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Pw:t;return E.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),E.createElement(s,Mt({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zZ(e,t){e&&tr.flushSync(()=>e.dispatchEvent(t))}function BZ(e){const t=ci(e);E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const Nw="dismissableLayer.update",HZ="dismissableLayer.pointerDownOutside",UZ="dismissableLayer.focusOutside";let eD;const VZ=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),WZ=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=E.useContext(VZ),[u,d]=E.useState(null),[,f]=E.useState({}),h=zl(t,N=>d(N)),p=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(m),w=u?p.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,x=w>=v,S=GZ(N=>{const R=N.target,T=[...c.branches].some(M=>M.contains(R));!x||T||(o==null||o(N),a==null||a(N),N.defaultPrevented||s==null||s())}),C=qZ(N=>{const R=N.target;[...c.branches].some(M=>M.contains(R))||(i==null||i(N),a==null||a(N),N.defaultPrevented||s==null||s())});return BZ(N=>{w===c.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))}),E.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(eD=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),tD(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=eD)}},[u,n,c]),E.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),tD())},[u,c]),E.useEffect(()=>{const N=()=>f({});return document.addEventListener(Nw,N),()=>document.removeEventListener(Nw,N)},[]),E.createElement(ui.div,Mt({},l,{ref:h,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:li(e.onFocusCapture,C.onFocusCapture),onBlurCapture:li(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:li(e.onPointerDownCapture,S.onPointerDownCapture)}))});function GZ(e){const t=ci(e),n=E.useRef(!1),r=E.useRef(()=>{});return E.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){nD(HZ,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function qZ(e){const t=ci(e),n=E.useRef(!1);return E.useEffect(()=>{const r=o=>{o.target&&!n.current&&nD(UZ,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function tD(){const e=new CustomEvent(Nw);document.dispatchEvent(e)}function nD(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?zZ(o,i):o.dispatchEvent(i)}const Tw="focusScope.autoFocusOnMount",Mw="focusScope.autoFocusOnUnmount",rD={bubbles:!1,cancelable:!0},YZ=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=E.useState(null),c=ci(o),u=ci(i),d=E.useRef(null),f=zl(t,m=>l(m)),h=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let m=function(w){if(h.paused||!s)return;const b=w.target;s.contains(b)?d.current=b:di(d.current,{select:!0})},v=function(w){h.paused||!s||s.contains(w.relatedTarget)||di(d.current,{select:!0})};return document.addEventListener("focusin",m),document.addEventListener("focusout",v),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v)}}},[r,s,h.paused]),E.useEffect(()=>{if(s){aD.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Tw,rD);s.addEventListener(Tw,c),s.dispatchEvent(w),w.defaultPrevented||(KZ(eJ(oD(s)),{select:!0}),document.activeElement===m&&di(s))}return()=>{s.removeEventListener(Tw,c),setTimeout(()=>{const w=new CustomEvent(Mw,rD);s.addEventListener(Mw,u),s.dispatchEvent(w),w.defaultPrevented||di(m??document.body,{select:!0}),s.removeEventListener(Mw,u),aD.remove(h)},0)}}},[s,c,u,h]);const p=E.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(v&&w){const b=m.currentTarget,[x,S]=XZ(b);x&&S?!m.shiftKey&&w===S?(m.preventDefault(),n&&di(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&di(S,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return E.createElement(ui.div,Mt({tabIndex:-1},a,{ref:f,onKeyDown:p}))});function KZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(di(r,{select:t}),document.activeElement!==n)return}function XZ(e){const t=oD(e),n=iD(t,e),r=iD(t.reverse(),e);return[n,r]}function oD(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 iD(e,t){for(const n of e)if(!ZZ(n,{upTo:t}))return n}function ZZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function JZ(e){return e instanceof HTMLInputElement&&"select"in e}function di(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&JZ(e)&&t&&e.select()}}const aD=QZ();function QZ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sD(e,t),e.unshift(t)},remove(t){var n;e=sD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function sD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eJ(e){return e.filter(t=>t.tagName!=="A")}const tJ=E.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?tr.createPortal(E.createElement(ui.div,Mt({},o,{ref:t})),r):null});function nJ(e,t){return E.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Od=e=>{const{present:t,children:n}=e,r=rJ(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=zl(r.ref,o.ref);return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};Od.displayName="Presence";function rJ(e){const[t,n]=E.useState(),r=E.useRef({}),o=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=nJ(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=jd(r.current);i.current=s==="mounted"?c:"none"},[s]),Cw(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=jd(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Cw(()=>{if(t){const c=d=>{const h=jd(r.current).includes(d.animationName);d.target===t&&h&&tr.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=jd(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function jd(e){return(e==null?void 0:e.animationName)||"none"}let Dw=0;function oJ(){E.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:lD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:lD()),Dw++,()=>{Dw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Dw--}},[])}function lD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var cD=vS(),Aw=function(){},$d=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Aw,onWheelCapture:Aw,onTouchMoveCapture:Aw}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=Gp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,S=wS([n,t]),C=Lt(Lt({},b),o);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:cD,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),a?y.cloneElement(y.Children.only(s),Lt(Lt({},C),{ref:S})):y.createElement(w,Lt({},C,{className:l,ref:S}),s))});$d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$d.classNames={fullWidth:ol,zeroRight:rl};var kw=!1;if(typeof window<"u")try{var Fd=Object.defineProperty({},"passive",{get:function(){return kw=!0,!0}});window.addEventListener("test",Fd,Fd),window.removeEventListener("test",Fd,Fd)}catch{kw=!1}var Oa=kw?{passive:!1}:!1,iJ=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},aJ=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},uD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=dD(e,n);if(r){var o=fD(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},sJ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},lJ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dD=function(e,t){return e==="v"?iJ(t):aJ(t)},fD=function(e,t){return e==="v"?sJ(t):lJ(t)},cJ=function(e,t){return e==="h"&&t==="rtl"?-1:1},uJ=function(e,t,n,r,o){var i=cJ(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{var h=fD(e,s),p=h[0],m=h[1],v=h[2],w=m-v-i*p;(p||w)&&dD(e,s)&&(d+=w,f+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&d===0||!u&&f===0)&&(c=!0),c},Ld=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hD=function(e){return[e.deltaX,e.deltaY]},pD=function(e){return e&&"current"in e?e.current:e},dJ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fJ=function(e){return`
414
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
415
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
416
+ `)},hJ=0,ja=[];function pJ(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(hJ++)[0],i=y.useState(function(){return Kp()})[0],a=y.useRef(e);y.useEffect(function(){a.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=mS([e.lockRef.current],(e.shards||[]).map(pD),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var w=Ld(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-w[0],S="deltaY"in m?m.deltaY:b[1]-w[1],C,N=m.target,R=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&R==="h"&&N.type==="range")return!1;var T=uD(R,N);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=uD(R,N)),!T)return!1;if(!r.current&&"changedTouches"in m&&(x||S)&&(r.current=C),!C)return!0;var M=r.current||C;return uJ(M,v,m,M==="h"?x:S)},[]),l=y.useCallback(function(m){var v=m;if(!(!ja.length||ja[ja.length-1]!==i)){var w="deltaY"in v?hD(v):Ld(v),b=t.current.filter(function(C){return C.name===v.type&&C.target===v.target&&dJ(C.delta,w)})[0];if(b&&b.should){v.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(pD).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?s(v,x[0]):!a.current.noIsolation;S&&v.preventDefault()}}},[]),c=y.useCallback(function(m,v,w,b){var x={name:m,delta:v,target:w,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=y.useCallback(function(m){n.current=Ld(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,hD(m),m.target,s(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,Ld(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return ja.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Oa),document.addEventListener("touchmove",l,Oa),document.addEventListener("touchstart",u,Oa),function(){ja=ja.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Oa),document.removeEventListener("touchmove",l,Oa),document.removeEventListener("touchstart",u,Oa)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(i,{styles:fJ(o)}):null,h?y.createElement(SS,{gapMode:"margin"}):null)}const mJ=bS(cD,pJ);var mD=y.forwardRef(function(e,t){return y.createElement($d,Lt({},e,{ref:t,sideCar:mJ}))});mD.classNames=$d.classNames;const gD="Dialog",[wD,Ire]=DZ(gD),[gJ,Rr]=wD(gD),wJ=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=E.useRef(null),l=E.useRef(null),[c=!1,u]=OZ({prop:r,defaultProp:o,onChange:i});return E.createElement(gJ,{scope:t,triggerRef:s,contentRef:l,contentId:Ew(),titleId:Ew(),descriptionId:Ew(),open:c,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(d=>!d),[u]),modal:a},n)},vD="DialogPortal",[vJ,yD]=wD(vD,{forceMount:void 0}),yJ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Rr(vD,t);return E.createElement(vJ,{scope:t,forceMount:n},E.Children.map(r,a=>E.createElement(Od,{present:n||i.open},E.createElement(tJ,{asChild:!0,container:o},a))))},Iw="DialogOverlay",bJ=E.forwardRef((e,t)=>{const n=yD(Iw,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Rr(Iw,e.__scopeDialog);return i.modal?E.createElement(Od,{present:r||i.open},E.createElement(xJ,Mt({},o,{ref:t}))):null}),xJ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(Iw,n);return E.createElement(mD,{as:Pw,allowPinchZoom:!0,shards:[o.contentRef]},E.createElement(ui.div,Mt({"data-state":ED(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),$a="DialogContent",bD=E.forwardRef((e,t)=>{const n=yD($a,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Rr($a,e.__scopeDialog);return E.createElement(Od,{present:r||i.open},i.modal?E.createElement(_J,Mt({},o,{ref:t})):E.createElement(SJ,Mt({},o,{ref:t})))}),_J=E.forwardRef((e,t)=>{const n=Rr($a,e.__scopeDialog),r=E.useRef(null),o=zl(t,n.contentRef,r);return E.useEffect(()=>{const i=r.current;if(i)return al(i)},[]),E.createElement(xD,Mt({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:li(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:li(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:li(e.onFocusOutside,i=>i.preventDefault())}))}),SJ=E.forwardRef((e,t)=>{const n=Rr($a,e.__scopeDialog),r=E.useRef(!1);return E.createElement(xD,Mt({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const s=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&o.preventDefault()}}))}),xD=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Rr($a,n),l=E.useRef(null),c=zl(t,l);return oJ(),E.createElement(E.Fragment,null,E.createElement(YZ,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},E.createElement(WZ,Mt({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ED(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),_D="DialogTitle",CJ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(_D,n);return E.createElement(ui.h2,Mt({id:o.titleId},r,{ref:t}))}),SD="DialogDescription",EJ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(SD,n);return E.createElement(ui.p,Mt({id:o.descriptionId},r,{ref:t}))}),CD="DialogClose",PJ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(CD,n);return E.createElement(ui.button,Mt({type:"button"},r,{ref:t,onClick:li(e.onClick,()=>o.onOpenChange(!1))}))});function ED(e){return e?"open":"closed"}const RJ=wJ,NJ=yJ,TJ=bJ,MJ=bD;var DJ='[cmdk-list-sizer=""]',Bl='[cmdk-group=""]',Ow='[cmdk-group-items=""]',AJ='[cmdk-group-heading=""]',jw='[cmdk-item=""]',PD=`${jw}:not([aria-disabled="true"])`,$w="cmdk-item-select",Vr="data-value",kJ=(e,t)=>TZ(e,t),RD=y.createContext(void 0),Hl=()=>y.useContext(RD),ND=y.createContext(void 0),Fw=()=>y.useContext(ND),TD=y.createContext(void 0),MD=y.forwardRef((e,t)=>{let n=y.useRef(null),r=La(()=>{var Z,J,H;return{search:"",value:(H=(J=e.value)!=null?J:(Z=e.defaultValue)==null?void 0:Z.toLowerCase())!=null?H:"",filtered:{count:0,items:new Map,groups:new Set}}}),o=La(()=>new Set),i=La(()=>new Map),a=La(()=>new Map),s=La(()=>new Set),l=DD(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,vimBindings:m=!0,...v}=e,w=y.useId(),b=y.useId(),x=y.useId(),S=VJ();Fa(()=>{if(d!==void 0){let Z=d.trim().toLowerCase();r.current.value=Z,S(6,k),C.emit()}},[d]);let C=y.useMemo(()=>({subscribe:Z=>(s.current.add(Z),()=>s.current.delete(Z)),snapshot:()=>r.current,setState:(Z,J,H)=>{var O,V,ae;if(!Object.is(r.current[Z],J)){if(r.current[Z]=J,Z==="search")A(),T(),S(1,M);else if(Z==="value")if(((O=l.current)==null?void 0:O.value)!==void 0){let j=J??"";(ae=(V=l.current).onValueChange)==null||ae.call(V,j);return}else H||S(5,k);C.emit()}},emit:()=>{s.current.forEach(Z=>Z())}}),[]),N=y.useMemo(()=>({value:(Z,J)=>{J!==a.current.get(Z)&&(a.current.set(Z,J),r.current.filtered.items.set(Z,R(J)),S(2,()=>{T(),C.emit()}))},item:(Z,J)=>(o.current.add(Z),J&&(i.current.has(J)?i.current.get(J).add(Z):i.current.set(J,new Set([Z]))),S(3,()=>{A(),T(),r.current.value||M(),C.emit()}),()=>{a.current.delete(Z),o.current.delete(Z),r.current.filtered.items.delete(Z);let H=F();S(4,()=>{A(),(H==null?void 0:H.getAttribute("id"))===Z&&M(),C.emit()})}),group:Z=>(i.current.has(Z)||i.current.set(Z,new Set),()=>{a.current.delete(Z),i.current.delete(Z)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],commandRef:n,listId:w,inputId:x,labelId:b}),[]);function R(Z){var J,H;let O=(H=(J=l.current)==null?void 0:J.filter)!=null?H:kJ;return Z?O(Z,r.current.search):0}function T(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let Z=r.current.filtered.items,J=[];r.current.filtered.groups.forEach(O=>{let V=i.current.get(O),ae=0;V.forEach(j=>{let G=Z.get(j);ae=Math.max(G,ae)}),J.push([O,ae])});let H=n.current.querySelector(DJ);L().sort((O,V)=>{var ae,j;let G=O.getAttribute(Vr),$=V.getAttribute(Vr);return((ae=Z.get($))!=null?ae:0)-((j=Z.get(G))!=null?j:0)}).forEach(O=>{let V=O.closest(Ow);V?V.appendChild(O.parentElement===V?O:O.closest(`${Ow} > *`)):H.appendChild(O.parentElement===H?O:O.closest(`${Ow} > *`))}),J.sort((O,V)=>V[1]-O[1]).forEach(O=>{let V=n.current.querySelector(`${Bl}[${Vr}="${O[0]}"]`);V==null||V.parentElement.appendChild(V)})}function M(){let Z=L().find(H=>!H.ariaDisabled),J=Z==null?void 0:Z.getAttribute(Vr);C.setState("value",J||void 0)}function A(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let Z=0;for(let J of o.current){let H=a.current.get(J),O=R(H);r.current.filtered.items.set(J,O),O>0&&Z++}for(let[J,H]of i.current)for(let O of H)if(r.current.filtered.items.get(O)>0){r.current.filtered.groups.add(J);break}r.current.filtered.count=Z}function k(){var Z,J,H;let O=F();O&&(((Z=O.parentElement)==null?void 0:Z.firstChild)===O&&((H=(J=O.closest(Bl))==null?void 0:J.querySelector(AJ))==null||H.scrollIntoView({block:"nearest"})),O.scrollIntoView({block:"nearest"}))}function F(){var Z;return(Z=n.current)==null?void 0:Z.querySelector(`${jw}[aria-selected="true"]`)}function L(){return Array.from(n.current.querySelectorAll(PD))}function Y(Z){let J=L()[Z];J&&C.setState("value",J.getAttribute(Vr))}function ne(Z){var J;let H=F(),O=L(),V=O.findIndex(j=>j===H),ae=O[V+Z];(J=l.current)!=null&&J.loop&&(ae=V+Z<0?O[O.length-1]:V+Z===O.length?O[0]:O[V+Z]),ae&&C.setState("value",ae.getAttribute(Vr))}function q(Z){let J=F(),H=J==null?void 0:J.closest(Bl),O;for(;H&&!O;)H=Z>0?HJ(H,Bl):UJ(H,Bl),O=H==null?void 0:H.querySelector(PD);O?C.setState("value",O.getAttribute(Vr)):ne(Z)}let X=()=>Y(L().length-1),B=Z=>{Z.preventDefault(),Z.metaKey?X():Z.altKey?q(1):ne(1)},ee=Z=>{Z.preventDefault(),Z.metaKey?Y(0):Z.altKey?q(-1):ne(-1)};return y.createElement("div",{ref:Ul([n,t]),...v,"cmdk-root":"",onKeyDown:Z=>{var J;if((J=v.onKeyDown)==null||J.call(v,Z),!Z.defaultPrevented)switch(Z.key){case"n":case"j":{m&&Z.ctrlKey&&B(Z);break}case"ArrowDown":{B(Z);break}case"p":case"k":{m&&Z.ctrlKey&&ee(Z);break}case"ArrowUp":{ee(Z);break}case"Home":{Z.preventDefault(),Y(0);break}case"End":{Z.preventDefault(),X();break}case"Enter":if(!Z.nativeEvent.isComposing){Z.preventDefault();let H=F();if(H){let O=new Event($w);H.dispatchEvent(O)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:WJ},c),y.createElement(ND.Provider,{value:C},y.createElement(RD.Provider,{value:N},u)))}),IJ=y.forwardRef((e,t)=>{var n,r;let o=y.useId(),i=y.useRef(null),a=y.useContext(TD),s=Hl(),l=DD(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Fa(()=>s.item(o,a==null?void 0:a.id),[]);let u=AD(o,i,[e.value,e.children,i]),d=Fw(),f=fi(C=>C.value&&C.value===u.current),h=fi(C=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);y.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener($w,p),()=>C.removeEventListener($w,p)},[h,e.onSelect,e.disabled]);function p(){var C,N;m(),(N=(C=l.current).onSelect)==null||N.call(C,u.current)}function m(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:w,onSelect:b,forceMount:x,...S}=e;return y.createElement("div",{ref:Ul([i,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":v||void 0,"aria-selected":f||void 0,"data-disabled":v||void 0,"data-selected":f||void 0,onPointerMove:v?void 0:m,onClick:v?void 0:p},e.children)}),OJ=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=y.useId(),s=y.useRef(null),l=y.useRef(null),c=y.useId(),u=Hl(),d=fi(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Fa(()=>u.group(a),[]),AD(a,s,[e.value,e.heading,l]);let f=y.useMemo(()=>({id:a,forceMount:o}),[o]),h=y.createElement(TD.Provider,{value:f},r);return y.createElement("div",{ref:Ul([s,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&y.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},h))}),jJ=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=y.useRef(null),i=fi(a=>!a.search);return!n&&!i?null:y.createElement("div",{ref:Ul([o,t]),...r,"cmdk-separator":"",role:"separator"})}),$J=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=Fw(),a=fi(u=>u.search),s=fi(u=>u.value),l=Hl(),c=y.useMemo(()=>{var u;let d=(u=l.commandRef.current)==null?void 0:u.querySelector(`${jw}[${Vr}="${s}"]`);return d==null?void 0:d.getAttribute("id")},[s,l.commandRef]);return y.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),y.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),FJ=y.forwardRef((e,t)=>{let{children:n,...r}=e,o=y.useRef(null),i=y.useRef(null),a=Hl();return y.useEffect(()=>{if(i.current&&o.current){let s=i.current,l=o.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=s.offsetHeight;l.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return u.observe(s),()=>{cancelAnimationFrame(c),u.unobserve(s)}}},[]),y.createElement("div",{ref:Ul([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},y.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),LJ=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return y.createElement(RJ,{open:n,onOpenChange:r},y.createElement(NJ,{container:a},y.createElement(TJ,{"cmdk-overlay":"",className:o}),y.createElement(MJ,{"aria-label":e.label,"cmdk-dialog":"",className:i},y.createElement(MD,{ref:t,...s}))))}),zJ=y.forwardRef((e,t)=>{let n=y.useRef(!0),r=fi(o=>o.filtered.count===0);return y.useEffect(()=>{n.current=!1},[]),n.current||!r?null:y.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),BJ=y.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return y.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},y.createElement("div",{"aria-hidden":!0},r))}),cn=Object.assign(MD,{List:FJ,Item:IJ,Input:$J,Group:OJ,Separator:jJ,Dialog:LJ,Empty:zJ,Loading:BJ});function HJ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function UJ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function DD(e){let t=y.useRef(e);return Fa(()=>{t.current=e}),t}var Fa=typeof window>"u"?y.useEffect:y.useLayoutEffect;function La(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Ul(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function fi(e){let t=Fw(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function AD(e,t,n){let r=y.useRef(),o=Hl();return Fa(()=>{var i;let a=(()=>{var s;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l)return l.current?(s=l.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();o.value(e,a),(i=t.current)==null||i.setAttribute(Vr,a),r.current=a}),r}var VJ=()=>{let[e,t]=y.useState(),n=La(()=>new Map);return Fa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},WJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const kD=zu,GJ=Bu,ID=Hu,qJ=fa,Lw=E.forwardRef(({className:e,...t},n)=>g.jsx(la,{ref:n,className:K("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}));Lw.displayName=la.displayName;const zw=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(ID,{children:[g.jsx(Lw,{}),g.jsxs(ca,{ref:r,className:K("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,g.jsxs(fa,{className:"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:[g.jsx(vT,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zw.displayName=ca.displayName;const OD=({className:e,...t})=>g.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});OD.displayName="DialogHeader";const jD=({className:e,...t})=>g.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jD.displayName="DialogFooter";const $D=E.forwardRef(({className:e,...t},n)=>g.jsx(ua,{ref:n,className:K("text-lg font-semibold leading-none tracking-tight",e),...t}));$D.displayName=ua.displayName;const FD=E.forwardRef(({className:e,...t},n)=>g.jsx(da,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));FD.displayName=da.displayName;const zd=y.forwardRef(({className:e,...t},n)=>g.jsx(cn,{ref:n,className:K("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));zd.displayName=cn.displayName;const YJ=({children:e,...t})=>g.jsx(kD,{...t,children:g.jsx(zw,{className:"overflow-hidden p-0 shadow-lg",children:g.jsx(zd,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Bw=y.forwardRef(({className:e,...t},n)=>g.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g.jsx(tY,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g.jsx(cn.Input,{ref:n,className:K("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Bw.displayName=cn.Input.displayName;const LD=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.List,{ref:n,className:K("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));LD.displayName=cn.List.displayName;const Hw=y.forwardRef((e,t)=>g.jsx(cn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Hw.displayName=cn.Empty.displayName;const Uw=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.Group,{ref:n,className:K("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Uw.displayName=cn.Group.displayName;const zD=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.Separator,{ref:n,className:K("-mx-1 h-px bg-border",e),...t}));zD.displayName=cn.Separator.displayName;const Vw=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.Item,{ref:n,className:K("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Vw.displayName=cn.Item.displayName;const BD=({className:e,...t})=>g.jsx("span",{className:K("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});BD.displayName="CommandShortcut";const Bd=V7,Hd=W7,Vl=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(G7,{children:g.jsx(eR,{ref:o,align:t,sideOffset:n,className:K("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[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),...r})}));Vl.displayName=eR.displayName;function KJ({options:e,value:t,onValueChange:n,placeholder:r="Select an option...",emptyText:o="No results found.",className:i}){var l;const[a,s]=E.useState(!1);return g.jsxs(Bd,{open:a,onOpenChange:s,children:[g.jsx(Hd,{asChild:!0,children:g.jsxs(Yn,{variant:"outline",role:"combobox","aria-expanded":a,className:K("w-[200px] justify-between",i),children:[t?(l=e.find(c=>c.value===t))==null?void 0:l.label:r,g.jsx(Qq,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(Vl,{className:"w-[200px] p-0",children:g.jsxs(zd,{children:[g.jsx(Bw,{placeholder:r}),g.jsx(Hw,{children:o}),g.jsx(Uw,{children:e.map(c=>g.jsxs(Vw,{value:c.value,onSelect:u=>{n==null||n(u),s(!1)},children:[g.jsx(Ta,{className:K("mr-2 h-4 w-4",t===c.value?"opacity-100":"opacity-0")}),c.label]},c.value))})]})})]})}const XJ=hG,ZJ=pG,JJ=mG,QJ=KC,eQ=wG,tQ=gG,HD=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(rE,{ref:o,className:K("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Eo,{className:"ml-auto h-4 w-4"})]}));HD.displayName=rE.displayName;const UD=E.forwardRef(({className:e,...t},n)=>g.jsx(oE,{ref:n,className:K("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[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),...t}));UD.displayName=oE.displayName;const VD=E.forwardRef(({className:e,...t},n)=>g.jsx(KC,{children:g.jsx(XC,{ref:n,className:K("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[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),...t})}));VD.displayName=XC.displayName;const WD=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(JC,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));WD.displayName=JC.displayName;const GD=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(QC,{ref:o,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(tE,{children:g.jsx(Ta,{className:"h-4 w-4"})})}),t]}));GD.displayName=QC.displayName;const qD=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(eE,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(tE,{children:g.jsx(Pd,{className:"h-2 w-2 fill-current"})})}),t]}));qD.displayName=eE.displayName;const YD=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(ZC,{ref:r,className:K("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));YD.displayName=ZC.displayName;const KD=E.forwardRef(({className:e,...t},n)=>g.jsx(nE,{ref:n,className:K("-mx-1 my-1 h-px bg-border",e),...t}));KD.displayName=nE.displayName;const XD=({className:e,...t})=>g.jsx("span",{className:K("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});XD.displayName="ContextMenuShortcut";/**
417
+ * table-core
418
+ *
419
+ * Copyright (c) TanStack
420
+ *
421
+ * This source code is licensed under the MIT license found in the
422
+ * LICENSE.md file in the root directory of this source tree.
423
+ *
424
+ * @license MIT
425
+ */function To(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return n=>{t.setState(r=>({...r,[e]:To(n,r[e])}))}}function Ud(e){return e instanceof Function}function nQ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function rQ(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const a=t(i);a!=null&&a.length&&r(a)})};return r(e),n}function Ee(e,t,n){let r=[],o;return i=>{let a;n.key&&n.debug&&(a=Date.now());const s=e(i);if(!(s.length!==r.length||s.some((u,d)=>r[d]!==u)))return o;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-a)*100)/100,d=Math.round((Date.now()-c)*100)/100,f=d/16,h=(p,m)=>{for(p=String(p);p.length<m;)p=" "+p;return p};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
426
+ font-size: .6rem;
427
+ font-weight: bold;
428
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Pe(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function oQ(e,t,n,r){const o=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Ee(()=>[e,n,t,i],(a,s,l,c)=>({table:a,column:s,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Pe(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function iQ(e,t,n,r){var o,i;const s={...e._getDefaultColumnDef(),...t},l=s.accessorKey;let c=(o=(i=s.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof s.header=="string"?s.header:void 0,u;if(s.accessorFn?u=s.accessorFn:l&&(l.includes(".")?u=f=>{let h=f;for(const m of l.split(".")){var p;h=(p=h)==null?void 0:p[m]}return h}:u=f=>f[s.accessorKey]),!c)throw new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:Ee(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Pe(e.options,"debugColumns")),getLeafColumns:Ee(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let p=d.columns.flatMap(m=>m.getLeafColumns());return f(p)}return[d]},Pe(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const Ut="debugHeaders";function ZD(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(s),a.push(l)};return s(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const aQ={createTable:e=>{e.getHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,a;const s=(i=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],l=(a=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?a:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Vd(t,[...s,...c,...l],e)},Pe(e.options,Ut)),e.getCenterHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Vd(t,n,e,"center")),Pe(e.options,Ut)),e.getLeftHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?o:[];return Vd(t,i,e,"left")},Pe(e.options,Ut)),e.getRightHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?o:[];return Vd(t,i,e,"right")},Pe(e.options,Ut)),e.getFooterGroups=Ee(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ut)),e.getLeftFooterGroups=Ee(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ut)),e.getCenterFooterGroups=Ee(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ut)),e.getRightFooterGroups=Ee(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ut)),e.getFlatHeaders=Ee(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ut)),e.getLeftFlatHeaders=Ee(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ut)),e.getCenterFlatHeaders=Ee(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ut)),e.getRightFlatHeaders=Ee(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ut)),e.getCenterLeafHeaders=Ee(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Pe(e.options,Ut)),e.getLeftLeafHeaders=Ee(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Pe(e.options,Ut)),e.getRightLeafHeaders=Ee(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Pe(e.options,Ut)),e.getLeafHeaders=Ee(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,a,s,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Pe(e.options,Ut))}};function Vd(e,t,n,r){var o,i;let a=0;const s=function(f,h){h===void 0&&(h=1),a=Math.max(a,h),f.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&s(p.columns,h+1)},0)};s(e);let l=[];const c=(f,h)=>{const p={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(v=>{const w=[...m].reverse()[0],b=v.column.depth===p.depth;let x,S=!1;if(b&&v.column.parent?x=v.column.parent:(x=v.column,S=!0),w&&(w==null?void 0:w.column)===x)w.subHeaders.push(v);else{const C=ZD(n,x,{id:[r,h,x.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(N=>N.column===x).length}`:void 0,depth:h,index:m.length});C.subHeaders.push(v),m.push(C)}p.headers.push(v),v.headerGroup=p}),l.push(p),h>0&&c(m,h-1)},u=t.map((f,h)=>ZD(n,f,{depth:a,index:h}));c(u,a-1),l.reverse();const d=f=>f.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,v=0,w=[0];p.subHeaders&&p.subHeaders.length?(w=[],d(p.subHeaders).forEach(x=>{let{colSpan:S,rowSpan:C}=x;m+=S,w.push(C)})):m=1;const b=Math.min(...w);return v=v+b,p.colSpan=m,p.rowSpan=v,{colSpan:m,rowSpan:v}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Ww=(e,t,n,r,o,i,a)=>{let s={id:t,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(s._valuesCache.hasOwnProperty(l))return s._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return s._valuesCache[l]=c.accessorFn(s.original,r),s._valuesCache[l]},getUniqueValues:l=>{if(s._uniqueValuesCache.hasOwnProperty(l))return s._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(s._uniqueValuesCache[l]=c.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[l]):(s._uniqueValuesCache[l]=[s.getValue(l)],s._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=s.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>rQ(s.subRows,l=>l.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let l=[],c=s;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Ee(()=>[e.getAllLeafColumns()],l=>l.map(c=>oQ(e,s,c,c.id)),Pe(e.options,"debugRows")),_getAllCellsByColumnId:Ee(()=>[s.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Pe(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(s,e)}return s},sQ={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},JD=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};JD.autoRemove=e=>Jn(e);const QD=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};QD.autoRemove=e=>Jn(e);const eA=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};eA.autoRemove=e=>Jn(e);const tA=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};tA.autoRemove=e=>Jn(e);const nA=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});nA.autoRemove=e=>Jn(e)||!(e!=null&&e.length);const rA=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});rA.autoRemove=e=>Jn(e)||!(e!=null&&e.length);const oA=(e,t,n)=>e.getValue(t)===n;oA.autoRemove=e=>Jn(e);const iA=(e,t,n)=>e.getValue(t)==n;iA.autoRemove=e=>Jn(e);const Gw=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Gw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(i>a){const s=i;i=a,a=s}return[i,a]},Gw.autoRemove=e=>Jn(e)||Jn(e[0])&&Jn(e[1]);const Wr={includesString:JD,includesStringSensitive:QD,equalsString:eA,arrIncludes:tA,arrIncludesAll:nA,arrIncludesSome:rA,equals:oA,weakEquals:iA,inNumberRange:Gw};function Jn(e){return e==null||e===""}const lQ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Pn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Wr.includesString:typeof r=="number"?Wr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wr.equals:Array.isArray(r)?Wr.arrIncludes:Wr.weakEquals},e.getFilterFn=()=>{var n,r;return Ud(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Wr[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),a=To(n,i?i.value:void 0);if(aA(o,a,e)){var s;return(s=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?s:[]}const l={id:e.id,value:a};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=To(t,o))==null?void 0:i.filter(a=>{const s=n.find(l=>l.id===a.id);if(s){const l=s.getFilterFn();if(aA(l,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function aA(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const qw={sum:(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!nQ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,a)=>i-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},cQ={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Pn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return qw.sum;if(Object.prototype.toString.call(r)==="[object Date]")return qw.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ud(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:qw[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function uQ(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...r]}const dQ={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Pn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ee(n=>[Wl(t,n)],n=>n.findIndex(r=>r.id===e.id),Pe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Wl(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Wl(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ee(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const a=[...t],s=[...o];for(;s.length&&a.length;){const l=a.shift(),c=s.findIndex(u=>u.id===l);c>-1&&i.push(s.splice(c,1)[0])}i=[...i,...s]}return uQ(i,n,r)},Pe(e.options,"debugTable"))}},Yw=()=>({left:[],right:[]}),fQ={getInitialState:e=>({columnPinning:Yw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Pn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,a;if(n==="right"){var s,l;return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((a=o==null?void 0:o.right)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(s=>r==null?void 0:r.includes(s)),a=n.some(s=>o==null?void 0:o.includes(s));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ee(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(a=>!i.includes(a.column.id))},Pe(t.options,"debugRows")),e.getLeftVisibleCells=Ee(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Pe(t.options,"debugRows")),e.getRightVisibleCells=Ee(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Pe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Yw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Yw())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ee(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Pe(e.options,"debugColumns")),e.getRightLeafColumns=Ee(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Pe(e.options,"debugColumns")),e.getCenterLeafColumns=Ee(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},Pe(e.options,"debugColumns"))}},Wd={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Kw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hQ={getDefaultColumnDef:()=>Wd,getInitialState:e=>({columnSizing:{},columnSizingInfo:Kw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Pn("columnSizing",e),onColumnSizingInfoChange:Pn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Wd.minSize,(r=i??e.columnDef.size)!=null?r:Wd.size),(o=e.columnDef.maxSize)!=null?o:Wd.maxSize)},e.getStart=Ee(n=>[n,Wl(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Pe(t.options,"debugColumns")),e.getAfter=Ee(n=>[n,Wl(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Pe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Xw(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=Xw(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(x=>{var S,C;const N=t.options.columnResizeDirection==="rtl"?-1:1,R=(b-((S=x==null?void 0:x.startOffset)!=null?S:0))*N,T=Math.max(R/((C=x==null?void 0:x.startSize)!=null?C:0),-.999999);return x.columnSizingStart.forEach(M=>{let[A,k]=M;c[A]=Math.round(Math.max(k+k*T,0)*100)/100}),{...x,deltaOffset:R,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...c})))},d=w=>u("move",w),f=w=>{u("end",w),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,p={moveHandler:w=>d(w.clientX),upHandler:w=>{h==null||h.removeEventListener("mousemove",p.moveHandler),h==null||h.removeEventListener("mouseup",p.upHandler),f(w.clientX)}},m={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),d(w.touches[0].clientX),!1),upHandler:w=>{var b;h==null||h.removeEventListener("touchmove",m.moveHandler),h==null||h.removeEventListener("touchend",m.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((b=w.touches[0])==null?void 0:b.clientX)}},v=pQ()?{passive:!1}:!1;Xw(i)?(h==null||h.addEventListener("touchmove",m.moveHandler,v),h==null||h.addEventListener("touchend",m.upHandler,v)):(h==null||h.addEventListener("mousemove",p.moveHandler,v),h==null||h.addEventListener("mouseup",p.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Kw():(n=e.initialState.columnSizingInfo)!=null?n:Kw())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Gd=null;function pQ(){if(typeof Gd=="boolean")return Gd;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Gd=e,Gd}function Xw(e){return e.type==="touchstart"}const mQ={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Pn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ee(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Pe(t.options,"debugRows")),e.getVisibleCells=Ee(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Pe(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ee(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Pe(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Wl(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const gQ={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},wQ={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Pn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wr.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ud(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wr[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},vQ={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Pn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(o=n)!=null?o:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:s,...l}=a;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Zw=0,Jw=10,Qw=()=>({pageIndex:Zw,pageSize:Jw}),yQ={getInitialState:e=>({...e,pagination:{...Qw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Pn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>To(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Qw():(o=e.initialState.pagination)!=null?o:Qw())},e.setPageIndex=r=>{e.setPagination(o=>{let i=To(r,o.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Zw:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Zw)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Jw:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Jw)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,To(r,o.pageSize)),a=o.pageSize*o.pageIndex,s=Math.floor(a/i);return{...o,pageIndex:s,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let a=To(r,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),e.getPageOptions=Ee(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,a)=>a)),o},Pe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},ev=()=>({top:[],bottom:[]}),bQ={getInitialState:e=>({rowPinning:ev(),...e}),getDefaultOptions:e=>({onRowPinningChange:Pn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],a=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],s=new Set([...a,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(m=>!(s!=null&&s.has(m))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(m=>!(s!=null&&s.has(m))),...Array.from(s)]}}if(n==="top"){var h,p;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(m=>!(s!=null&&s.has(m))),...Array.from(s)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(m=>!(s!=null&&s.has(m)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(m=>!(s!=null&&s.has(m))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(m=>!(s!=null&&s.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(s=>r==null?void 0:r.includes(s)),a=n.some(s=>o==null?void 0:o.includes(s));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?ev():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:ev())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(a=>t.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Ee(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Pe(e.options,"debugRows")),e.getBottomRows=Ee(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Pe(e.options,"debugRows")),e.getCenterRows=Ee(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},Pe(e.options,"debugRows"))}},xQ={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Pn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{tv(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ee(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?nv(e,n):{rows:[],flatRows:[],rowsById:{}},Pe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ee(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?nv(e,n):{rows:[],flatRows:[],rowsById:{}},Pe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ee(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?nv(e,n):{rows:[],flatRows:[],rowsById:{}},Pe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const s={...i};return tv(s,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return rv(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ov(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ov(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},tv=(e,t,n,r,o)=>{var i;const a=o.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>tv(e,s.id,n,r,o))};function nv(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(a,s){return a.map(l=>{var c;const u=rv(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function rv(e,t){var n;return(n=t[e.id])!=null?n:!1}function ov(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!o)&&(a.getCanSelect()&&(rv(a,t)?i=!0:o=!1),a.subRows&&a.subRows.length)){const s=ov(a,t);s==="all"?i=!0:(s==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const iv=/([0-9]+)/gm,_Q=(e,t,n)=>sA(Mo(e.getValue(n)).toLowerCase(),Mo(t.getValue(n)).toLowerCase()),SQ=(e,t,n)=>sA(Mo(e.getValue(n)),Mo(t.getValue(n))),CQ=(e,t,n)=>av(Mo(e.getValue(n)).toLowerCase(),Mo(t.getValue(n)).toLowerCase()),EQ=(e,t,n)=>av(Mo(e.getValue(n)),Mo(t.getValue(n))),PQ=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},RQ=(e,t,n)=>av(e.getValue(n),t.getValue(n));function av(e,t){return e===t?0:e>t?1:-1}function Mo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function sA(e,t){const n=e.split(iv).filter(Boolean),r=t.split(iv).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),a=parseInt(o,10),s=parseInt(i,10),l=[a,s].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const Gl={alphanumeric:_Q,alphanumericCaseSensitive:SQ,text:CQ,textCaseSensitive:EQ,datetime:PQ,basic:RQ},NQ=[aQ,mQ,dQ,fQ,sQ,lQ,gQ,wQ,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Pn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Gl.datetime;if(typeof i=="string"&&(r=!0,i.split(iv).length>1))return Gl.alphanumeric}return r?Gl.text:Gl.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Ud(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Gl[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a==null?void 0:a.find(h=>h.id===e.id),l=a==null?void 0:a.findIndex(h=>h.id===e.id);let c=[],u,d=i?n:o==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?u="toggle":u="add":a!=null&&a.length&&l!==a.length-1?u="replace":s?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var f;c=[...a,{id:e.id,desc:d}],c.splice(0,c.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=a.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=a.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},cQ,vQ,yQ,bQ,xQ,hQ];function TQ(e){var t,n;const r=[...NQ,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),a=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:f=>{c.push(f),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=To(f,o.options);o.options=a(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,p)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(f,h,p))!=null?m:`${p?[p.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let p=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!p&&(p=o.getCoreRowModel().rowsById[f],!p))throw new Error;return p},_getDefaultColumnDef:Ee(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:p=>{const m=p.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:p=>{var m,v;return(m=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?m:null},...o._features.reduce((p,m)=>Object.assign(p,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Pe(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Ee(()=>[o._getColumnDefs()],f=>{const h=function(p,m,v){return v===void 0&&(v=0),p.map(w=>{const b=iQ(o,w,v,m),x=w;return b.columns=x.columns?h(x.columns,b,v+1):[],b})};return h(f)},Pe(e,"debugColumns")),getAllFlatColumns:Ee(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Pe(e,"debugColumns")),_getAllFlatColumnsById:Ee(()=>[o.getAllFlatColumns()],f=>f.reduce((h,p)=>(h[p.id]=p,h),{}),Pe(e,"debugColumns")),getAllLeafColumns:Ee(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let p=f.flatMap(m=>m.getLeafColumns());return h(p)},Pe(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function MQ(){return e=>Ee(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,a){i===void 0&&(i=0);const s=[];for(let c=0;c<o.length;c++){const u=Ww(e,e._getRowId(o[c],c,a),o[c],c,i,void 0,a==null?void 0:a.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return s};return n.rows=r(t),n},Pe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function DQ(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function lA(e,t,n){return n.options.filterFromLeafRows?AQ(e,t,n):kQ(e,t,n)}function AQ(e,t,n){var r;const o=[],i={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(l,c){c===void 0&&(c=0);const u=[];for(let f=0;f<l.length;f++){var d;let h=l[f];const p=Ww(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(p.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&c<a){if(p.subRows=s(h.subRows,c+1),h=p,t(h)&&!p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}}else h=p,t(h)&&(u.push(h),i[h.id]=h,o.push(h))}return u};return{rows:s(e),flatRows:o,rowsById:i}}function kQ(e,t,n){var r;const o=[],i={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(l,c){c===void 0&&(c=0);const u=[];for(let f=0;f<l.length;f++){let h=l[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&c<a){const m=Ww(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);m.subRows=s(h.subRows,c+1),h=m}u.push(h),o.push(h),i[h.id]=h}}return u};return{rows:s(e),flatRows:o,rowsById:i}}function IQ(){return(e,t)=>Ee(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,o)=>{if(!n.rows.length||!(r!=null&&r.length)&&!o)return n;const i=[...r.map(s=>s.id).filter(s=>s!==t),o?"__global__":void 0].filter(Boolean),a=s=>{for(let l=0;l<i.length;l++)if(s.columnFilters[i[l]]===!1)return!1;return!0};return lA(n.rows,a,e)},Pe(e.options,"debugTable"))}function OQ(){return(e,t)=>Ee(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;i<n.flatRows.length;i++){const a=n.flatRows[i].getUniqueValues(t);for(let s=0;s<a.length;s++){const l=a[s];if(r.has(l)){var o;r.set(l,((o=r.get(l))!=null?o:0)+1)}else r.set(l,1)}}return r},Pe(e.options,"debugTable"))}function jQ(){return e=>Ee(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(f=>{var h;const p=e.getColumn(f.id);if(!p)return;const m=p.getFilterFn();m&&o.push({id:f.id,filterFn:m,resolvedValue:(h=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?h:f.value})});const a=(n??[]).map(f=>f.id),s=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&s&&l.length&&(a.push("__global__"),l.forEach(f=>{var h;i.push({id:f.id,filterFn:s,resolvedValue:(h=s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))!=null?h:r})}));let c,u;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let p=0;p<o.length;p++){c=o[p];const m=c.id;h.columnFilters[m]=c.filterFn(h,m,c.resolvedValue,v=>{h.columnFiltersMeta[m]=v})}if(i.length){for(let p=0;p<i.length;p++){u=i[p];const m=u.id;if(u.filterFn(h,m,u.resolvedValue,v=>{h.columnFiltersMeta[m]=v})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=f=>{for(let h=0;h<a.length;h++)if(f.columnFilters[a[h]]===!1)return!1;return!0};return lA(t.rows,d,e)},Pe(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function $Q(e){return t=>Ee(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:a,flatRows:s,rowsById:l}=r;const c=o*i,u=c+o;a=a.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:a,flatRows:s,rowsById:l}:d=DQ({rows:a,flatRows:s,rowsById:l}),d.flatRows=[];const f=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return d.rows.forEach(f),d},Pe(t.options,"debugTable"))}function FQ(){return e=>Ee(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),a={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(a[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const s=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let h=0;h<i.length;h+=1){var f;const p=i[h],m=a[p.id],v=m.sortUndefined,w=(f=p==null?void 0:p.desc)!=null?f:!1;let b=0;if(v){const x=u.getValue(p.id),S=d.getValue(p.id),C=x===void 0,N=S===void 0;if(C||N){if(v==="first")return C?-1:1;if(v==="last")return C?1:-1;b=C&&N?0:C?v:-v}}if(b===0&&(b=m.sortingFn(u,d,p.id)),b!==0)return w&&(b*=-1),m.invertSorting&&(b*=-1),b}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=s(u.subRows))}),c};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}},Pe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
429
+ * react-table
430
+ *
431
+ * Copyright (c) TanStack
432
+ *
433
+ * This source code is licensed under the MIT license found in the
434
+ * LICENSE.md file in the root directory of this source tree.
435
+ *
436
+ * @license MIT
437
+ */function sv(e,t){return e?LQ(e)?y.createElement(e,t):e:null}function LQ(e){return zQ(e)||typeof e=="function"||BQ(e)}function zQ(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function BQ(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function HQ(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=y.useState(()=>({current:TQ(t)})),[r,o]=y.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function za(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,a,s,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,p)=>r[p]!==h)))return o;r=u;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),o=t(...u),n.key&&((s=n.debug)!=null&&s.call(n))){const h=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-f)*100)/100,m=p/16,v=(w,b)=>{for(w=String(w);w.length<b;)w=" "+w;return w};console.info(`%c⏱ ${v(p,5)} /${v(h,5)} ms`,`
438
+ font-size: .6rem;
439
+ font-weight: bold;
440
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function lv(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const UQ=(e,t)=>Math.abs(e-t)<1,VQ=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},WQ=e=>e,GQ=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},cv={passive:!0},qQ=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener("resize",r,cv),()=>{n.removeEventListener("resize",r)}},cA=typeof window>"u"?!0:"onscrollend"in window,YQ=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&cA?()=>{}:VQ(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),a=u=>()=>{o=n[e.options.horizontal?"scrollX":"scrollY"],i(),t(o,u)},s=a(!0),l=a(!1);l(),n.addEventListener("scroll",s,cv);const c=e.options.useScrollendEvent&&cA;return c&&n.addEventListener("scrollend",l,cv),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},KQ=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},XQ=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const a=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class ZQ{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:WQ,rangeExtractor:GQ,onChange:()=>{},measureElement:KQ,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=za(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let a=r-1;a>=0;a--){const s=n[a];if(o.has(s.lane))continue;const l=i.get(s.lane);if(l==null||s.end>l.end?i.set(s.lane,s):s.end<l.end&&o.set(s.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,s)=>a.end===s.end?a.index-s.index:a.end-s.end)[0]:void 0},this.getMeasurementOptions=za(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=za(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:a},s)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),f=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=f?f.end+this.options.gap:r+o,p=s.get(d),m=typeof p=="number"?p:this.options.estimateSize(u),v=h+m,w=f?f.lane:u%this.options.lanes;c[u]={index:u,start:h,size:m,end:v,key:d,lane:w}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=za(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?JQ({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=za(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const a=i.key,s=this.elementsCache.get(a);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=za(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,a=n.length;i<a;i++){const s=n[i],l=r[s];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return lv(r[uA(0,r.length-1,o=>lv(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const s=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(o.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const s=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[a,s]=i;this._scrollToOffset(a,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=lv(this.getOffsetForIndex(n,s));UQ(c,this.getScrollOffset())||this.scrollToIndex(n,{align:s,behavior:o})}else this.scrollToIndex(n,{align:s,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const uA=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function JQ({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let a=uA(0,o,l=>e[l].start,n),s=a;for(;s<o&&e[s].end<n+t;)s++;return r>1&&(a=Math.max(0,a-a%r),s=Math.min(o,s+(r-1-s%r))),{startIndex:a,endIndex:s}}const dA=typeof document<"u"?y.useLayoutEffect:y.useEffect;function QQ(e){const t=y.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var a;i?tr.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,i)}},[r]=y.useState(()=>new ZQ(n));return r.setOptions(n),dA(()=>r._didMount(),[]),dA(()=>r._willUpdate()),r}function eee(e){return QQ({getScrollElement:()=>typeof document<"u"?window:null,observeElementRect:qQ,observeElementOffset:YQ,scrollToFn:XQ,initialOffset:()=>typeof document<"u"?window.scrollY:0,...e})}const uv=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:K("w-full caption-bottom text-sm",e),...t})}));uv.displayName="Table";const dv=E.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:K("[&_tr]:border-b",e),...t}));dv.displayName="TableHeader";const fv=E.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:K("[&_tr:last-child]:border-0",e),...t}));fv.displayName="TableBody";const fA=E.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:K("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));fA.displayName="TableFooter";const Ba=E.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:K("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ba.displayName="TableRow";const hv=E.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:K("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));hv.displayName="TableHead";const ql=E.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:K("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ql.displayName="TableCell";const hA=E.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:K("mt-4 text-sm text-muted-foreground",e),...t}));hA.displayName="TableCaption";function tee({columns:e,data:t,virtualizeRows:n=!1}){var m,v,w,b;const[r,o]=E.useState({}),[i,a]=E.useState({}),[s,l]=E.useState([]),[c,u]=E.useState([]),d=HQ({data:t,columns:e,state:{sorting:c,columnVisibility:i,rowSelection:r,columnFilters:s},enableRowSelection:!0,onRowSelectionChange:o,onSortingChange:u,onColumnFiltersChange:l,onColumnVisibilityChange:a,getCoreRowModel:MQ(),getFilteredRowModel:jQ(),getPaginationRowModel:$Q(),getSortedRowModel:FQ(),getFacetedRowModel:IQ(),getFacetedUniqueValues:OQ()}),f=E.useRef(null),{rows:h}=d.getRowModel(),p=eee({count:h.length,estimateSize:()=>40,scrollMargin:((m=f.current)==null?void 0:m.offsetTop)??0});return g.jsx("div",{ref:f,className:"relative w-full overflow-auto",children:g.jsxs(uv,{children:[g.jsx(dv,{children:d.getHeaderGroups().map(x=>g.jsx(Ba,{children:x.headers.map(S=>g.jsxs(hv,{colSpan:S.colSpan,className:K("select-none",S.column.getCanSort()&&"cursor-pointer"),onClick:S.column.getToggleSortingHandler(),children:[S.isPlaceholder?null:sv(S.column.columnDef.header,S.getContext()),{asc:" 🔼",desc:" 🔽"}[S.column.getIsSorted()]??null]},S.id))},x.id))}),g.jsx(fv,{children:n?g.jsxs(g.Fragment,{children:[g.jsx("tr",{children:g.jsx("td",{style:{height:`${((v=p.getVirtualItems()[0])==null?void 0:v.start)??0}px`}})}),p.getVirtualItems().map(x=>{const S=h[x.index];return g.jsx(Ba,{"data-state":(S==null?void 0:S.getIsSelected())&&"selected",style:{height:`${x.size}px`},children:S==null?void 0:S.getVisibleCells().map(C=>g.jsx(ql,{children:sv(C.column.columnDef.cell,C.getContext())},C.id))},S==null?void 0:S.id)}),g.jsx("tr",{children:g.jsx("td",{style:{height:`${p.getTotalSize()-(((w=p.getVirtualItems()[p.getVirtualItems().length-1])==null?void 0:w.end)??0)}px`}})})]}):g.jsx(g.Fragment,{children:(b=d.getRowModel().rows)!=null&&b.length?d.getRowModel().rows.map(x=>g.jsx(Ba,{"data-state":x.getIsSelected()&&"selected",children:x.getVisibleCells().map(S=>g.jsx(ql,{children:sv(S.column.columnDef.cell,S.getContext())},S.id))},x.id)):g.jsx(Ba,{children:g.jsx(ql,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})})]})})}function nee({date:e,onDateChange:t,placeholder:n="Pick a date",disabled:r=!1,className:o}){const[i,a]=E.useState(!1);return g.jsxs(Bd,{open:i,onOpenChange:a,children:[g.jsx(Hd,{asChild:!0,children:g.jsxs(Yn,{variant:"outline",className:K("w-[240px] justify-start text-left font-normal",!e&&"text-muted-foreground",o),disabled:r,children:[g.jsx(wT,{className:"mr-2 h-4 w-4"}),e?Pr(e,"PPP"):n]})}),g.jsx(Vl,{className:"w-auto p-0",align:"start",children:g.jsx(Ad,{mode:"single",selected:e,onSelect:s=>{t==null||t(s),a(!1)},initialFocus:!0})})]})}function ree({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",disabled:r=!1,className:o}){const[i,a]=E.useState(!1);return g.jsxs(Bd,{open:i,onOpenChange:a,children:[g.jsx(Hd,{asChild:!0,children:g.jsxs(Yn,{variant:"outline",className:K("w-[300px] justify-start text-left font-normal",!(e!=null&&e.from)&&!(e!=null&&e.to)&&"text-muted-foreground",o),disabled:r,children:[g.jsx(wT,{className:"mr-2 h-4 w-4"}),e!=null&&e.from||e!=null&&e.to?g.jsxs(g.Fragment,{children:[e.from&&Pr(e.from,"PPP"),e.to&&" - ",e.to&&Pr(e.to,"PPP")]}):n]})}),g.jsx(Vl,{className:"w-auto p-0",align:"start",children:g.jsx(Ad,{mode:"range",selected:{from:e==null?void 0:e.from,to:e==null?void 0:e.to},onSelect:s=>{t==null||t(s??{}),s!=null&&s.from&&(s!=null&&s.to)&&a(!1)},initialFocus:!0,numberOfMonths:2})})]})}function oee(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const pA=E.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Ha=()=>{const e=E.useContext(pA);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};oee(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
441
+ [data-state=closed]
442
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function iee(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function aee(){return pv(/^Mac/)}function see(){return pv(/^iPhone/)}function mA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function lee(){return pv(/^iPad/)||aee()&&navigator.maxTouchPoints>1}function gA(){return see()||lee()}function pv(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const cee=24,uee=typeof window<"u"?E.useLayoutEffect:E.useEffect;function wA(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const mv=typeof document<"u"&&window.visualViewport;function vA(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function yA(e){for(vA(e)&&(e=e.parentElement);e&&!vA(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const dee=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let qd=0,gv;function fee(e={}){let{isDisabled:t}=e;uee(()=>{if(!t)return qd++,qd===1&&gA()&&(gv=hee()),()=>{qd--,qd===0&&(gv==null||gv())}},[t])}function hee(){let e,t=0,n=d=>{e=yA(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,h=e.scrollTop,p=e.scrollHeight-e.clientHeight;p!==0&&((h<=0&&f>t||h>=p&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;wv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;wv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",mv&&(mv.height<window.innerHeight?requestAnimationFrame(()=>{bA(f)}):mv.addEventListener("resize",()=>bA(f),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=wA(pee(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=wA(Yl(document,"touchstart",n,{passive:!1,capture:!0}),Yl(document,"touchmove",r,{passive:!1,capture:!0}),Yl(document,"touchend",o,{passive:!1,capture:!0}),Yl(document,"focus",i,!0),Yl(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function pee(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Yl(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function bA(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=yA(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+cee;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function wv(e){return e instanceof HTMLInputElement&&!dee.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function mee(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gee(...e){return t=>e.forEach(n=>mee(n,t))}function xA(...e){return y.useCallback(gee(...e),e)}const _A=new WeakMap;function Pt(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&_A.set(e,r)}function wee(e,t){if(!e||!(e instanceof HTMLElement))return;let n=_A.get(e);n&&(e.style[t]=n[t])}const Ct=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Yd(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Ct(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Ct(t)?5:4]):null)}function vee(e){return 8*(Math.log(e+1)-2)}function vv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function yee(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const gt={DURATION:.5,EASE:[.32,.72,0,1]},SA=.4,bee=.25,xee=100,CA=8,Kd=16,yv=26,bv="vaul-dragging";function EA(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function _ee({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=EA(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function PA({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_ee({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=EA(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function See({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=PA({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,h]=E.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);E.useEffect(()=>{function R(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=E.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),m=E.useMemo(()=>{var R;return(R=n==null?void 0:n.findIndex(T=>T===u))!=null?R:null},[n,u]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,w=E.useMemo(()=>{const R=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n==null?void 0:n.map(M=>{const A=typeof M=="string";let k=0;if(A&&(k=parseInt(M,10)),Ct(s)){const L=A?k:f?M*R.height:0;return f?s==="bottom"?R.height-L:-R.height+L:L}const F=A?k:f?M*R.width:0;return f?s==="right"?R.width-F:-R.width+F:F}))!=null?T:[]},[n,f,l]),b=E.useMemo(()=>m!==null?w==null?void 0:w[m]:null,[w,m]),x=E.useCallback(R=>{var T;const M=(T=w==null?void 0:w.findIndex(A=>A===R))!=null?T:null;a(M),Pt(r.current,{transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,transform:Ct(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),w&&M!==w.length-1&&i!==void 0&&M!==i&&M<i?Pt(o.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,opacity:"0"}):Pt(o.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,opacity:"1"}),d(n==null?void 0:n[Math.max(M,0)])},[r.current,n,w,i,o,d]);E.useEffect(()=>{if(u||e){var R;const T=(R=n==null?void 0:n.findIndex(M=>M===e||M===u))!=null?R:-1;w&&T!==-1&&typeof w[T]=="number"&&x(w[T])}},[u,e,n,w,x]);function S({draggedDistance:R,closeDrawer:T,velocity:M,dismissible:A}){if(i===void 0)return;const k=s==="bottom"||s==="right"?(b??0)-R:(b??0)+R,F=m===i-1,L=m===0,Y=R>0;if(F&&Pt(o.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`}),!c&&M>2&&!Y){A?T():x(w[0]);return}if(!c&&M>2&&Y&&w&&n){x(w[n.length-1]);return}const ne=w==null?void 0:w.reduce((X,B)=>typeof X!="number"||typeof B!="number"?X:Math.abs(B-k)<Math.abs(X-k)?B:X),q=Ct(s)?window.innerHeight:window.innerWidth;if(M>SA&&Math.abs(R)<q*.4){const X=Y?1:-1;if(X>0&&p&&n){x(w[n.length-1]);return}if(L&&X<0&&A&&T(),m===null)return;x(w[m+X]);return}x(ne)}function C({draggedDistance:R}){if(b===null)return;const T=s==="bottom"||s==="right"?b-R:b+R;(s==="bottom"||s==="right")&&T<w[w.length-1]||(s==="top"||s==="left")&&T>w[w.length-1]||Pt(r.current,{transform:Ct(s)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function N(R,T){if(!n||typeof m!="number"||!w||i===void 0)return null;const M=m===i-1;if(m>=i&&T)return 0;if(M&&!T)return 1;if(!v&&!M)return null;const k=M?m+1:m-1,F=M?w[k]-w[k-1]:w[k+1]-w[k],L=R/Math.abs(F);return M?1-L:L}return{isLastSnapPoint:p,activeSnapPoint:u,shouldFade:v,getPercentageDragged:N,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:S,onDrag:C,snapPointsOffset:w}}const Cee=()=>()=>{};function Eee(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Ha(),i=E.useRef(null),a=E.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-yv)/window.innerWidth}E.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;yee(r&&!o?vv(document.body,{background:"black"}):Cee,vv(l,{transformOrigin:Ct(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${gt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${gt.EASE.join(",")})`}));const c=vv(l,{borderRadius:`${CA}px`,overflow:"hidden",...Ct(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},gt.DURATION*1e3)}}},[t,n,a])}let Kl=null;function Pee({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=E.useState(()=>typeof window<"u"?window.location.href:""),l=E.useRef(0),c=E.useCallback(()=>{if(mA()&&Kl===null&&e&&!i){Kl={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&l.current>=f&&(document.body.style.top=`${-(l.current+h)}px`)}),300)}},[e]),u=E.useCallback(()=>{if(mA()&&Kl!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Kl),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(f,d)}),Kl=null}},[a]);return E.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),E.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),E.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,a,t,n,c,u]),{restorePositionSetting:u}}function RA({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=bee,scrollLockTimeout:c=xee,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:p,fixed:m,modal:v=!0,onClose:w,nested:b,noBodyStyles:x=!1,direction:S="bottom",defaultOpen:C=!1,disablePreventScroll:N=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:T=!1,repositionInputs:M=!0,onAnimationEnd:A,container:k,autoFocus:F=!1}){var L,Y;const[ne=!1,q]=PA({defaultProp:C,prop:e,onChange:xe=>{t==null||t(xe),!xe&&!b&&D(),setTimeout(()=>{A==null||A(xe)},gt.DURATION*1e3),xe&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),xe||(document.body.style.pointerEvents="auto")}}),[X,B]=E.useState(!1),[ee,Z]=E.useState(!1),[J,H]=E.useState(!1),O=E.useRef(null),V=E.useRef(null),ae=E.useRef(null),j=E.useRef(null),G=E.useRef(null),$=E.useRef(!1),te=E.useRef(null),ie=E.useRef(0),re=E.useRef(!1),z=E.useRef(!C),se=E.useRef(0),oe=E.useRef(null),fe=E.useRef(((L=oe.current)==null?void 0:L.getBoundingClientRect().height)||0),ge=E.useRef(((Y=oe.current)==null?void 0:Y.getBoundingClientRect().width)||0),pe=E.useRef(0),me=E.useCallback(xe=>{i&&xe===Me.length-1&&(V.current=new Date)},[]),{activeSnapPoint:_e,activeSnapPointIndex:Re,setActiveSnapPoint:nt,onRelease:Ie,snapPointsOffset:Me,onDrag:Ce,shouldFade:Le,getPercentageDragged:pn}=See({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:p,drawerRef:oe,fadeFromIndex:f,overlayRef:O,onSnapPointChange:me,direction:S,container:k,snapToSequentialPoint:R});fee({isDisabled:!ne||ee||!v||J||!X||!M||!N});const{restorePositionSetting:D}=Pee({isOpen:ne,modal:v,nested:b??!1,hasBeenOpened:X,preventScrollRestoration:T,noBodyStyles:x});function _(){return(window.innerWidth-yv)/window.innerWidth}function P(xe){var Ye,Xe;!u&&!i||oe.current&&!oe.current.contains(xe.target)||(fe.current=((Ye=oe.current)==null?void 0:Ye.getBoundingClientRect().height)||0,ge.current=((Xe=oe.current)==null?void 0:Xe.getBoundingClientRect().width)||0,Z(!0),ae.current=new Date,gA()&&window.addEventListener("touchend",()=>$.current=!1,{once:!0}),xe.target.setPointerCapture(xe.pointerId),ie.current=Ct(S)?xe.pageY:xe.pageX)}function I(xe,Ye){var Xe;let ze=xe;const we=(Xe=window.getSelection())==null?void 0:Xe.toString(),Ve=oe.current?Yd(oe.current,S):null,We=new Date;if(ze.tagName==="SELECT"||ze.hasAttribute("data-vaul-no-drag")||ze.closest("[data-vaul-no-drag]"))return!1;if(S==="right"||S==="left")return!0;if(V.current&&We.getTime()-V.current.getTime()<500)return!1;if(Ve!==null&&(S==="bottom"?Ve>0:Ve<0))return!0;if(we&&we.length>0)return!1;if(G.current&&We.getTime()-G.current.getTime()<c&&Ve===0||Ye)return G.current=We,!1;for(;ze;){if(ze.scrollHeight>ze.clientHeight){if(ze.scrollTop!==0)return G.current=new Date,!1;if(ze.getAttribute("role")==="dialog")return!0}ze=ze.parentNode}return!0}function U(xe){if(oe.current&&ee){const Ye=S==="bottom"||S==="right"?1:-1,Xe=(ie.current-(Ct(S)?xe.pageY:xe.pageX))*Ye,ze=Xe>0,we=i&&!u&&!ze;if(we&&Re===0)return;const Ve=Math.abs(Xe),We=document.querySelector("[data-vaul-drawer-wrapper]"),pt=S==="bottom"||S==="top"?fe.current:ge.current;let Vt=Ve/pt;const ct=pn(Ve,ze);if(ct!==null&&(Vt=ct),we&&Vt>=1||!$.current&&!I(xe.target,ze))return;if(oe.current.classList.add(bv),$.current=!0,Pt(oe.current,{transition:"none"}),Pt(O.current,{transition:"none"}),i&&Ce({draggedDistance:Xe}),ze&&!i){const Jt=vee(Xe),Wt=Math.min(Jt*-1,0)*Ye;Pt(oe.current,{transform:Ct(S)?`translate3d(0, ${Wt}px, 0)`:`translate3d(${Wt}px, 0, 0)`});return}const St=1-Vt;if((Le||f&&Re===f-1)&&(r==null||r(xe,Vt),Pt(O.current,{opacity:`${St}`,transition:"none"},!0)),We&&O.current&&a){const Jt=Math.min(_()+Vt*(1-_()),1),Wt=8-Vt*8,mn=Math.max(0,14-Vt*14);Pt(We,{borderRadius:`${Wt}px`,transform:Ct(S)?`scale(${Jt}) translate3d(0, ${mn}px, 0)`:`scale(${Jt}) translate3d(${mn}px, 0, 0)`,transition:"none"},!0)}if(!i){const Jt=Ve*Ye;Pt(oe.current,{transform:Ct(S)?`translate3d(0, ${Jt}px, 0)`:`translate3d(${Jt}px, 0, 0)`})}}}E.useEffect(()=>{window.requestAnimationFrame(()=>{z.current=!0})},[]),E.useEffect(()=>{var xe;function Ye(){if(!oe.current||!M)return;const Xe=document.activeElement;if(wv(Xe)||re.current){var ze;const we=((ze=window.visualViewport)==null?void 0:ze.height)||0,Ve=window.innerHeight;let We=Ve-we;const pt=oe.current.getBoundingClientRect().height||0,Vt=pt>Ve*.8;pe.current||(pe.current=pt);const ct=oe.current.getBoundingClientRect().top;if(Math.abs(se.current-We)>60&&(re.current=!re.current),i&&i.length>0&&Me&&Re){const St=Me[Re]||0;We+=St}if(se.current=We,pt>we||re.current){const St=oe.current.getBoundingClientRect().height;let Jt=St;St>we&&(Jt=we-(Vt?ct:yv)),m?oe.current.style.height=`${St-Math.max(We,0)}px`:oe.current.style.height=`${Math.max(Jt,we-ct)}px`}else iee()||(oe.current.style.height=`${pe.current}px`);i&&i.length>0&&!re.current?oe.current.style.bottom="0px":oe.current.style.bottom=`${Math.max(We,0)}px`}}return(xe=window.visualViewport)==null||xe.addEventListener("resize",Ye),()=>{var Xe;return(Xe=window.visualViewport)==null?void 0:Xe.removeEventListener("resize",Ye)}},[Re,i,Me]);function Q(xe){Ae(),w==null||w(),xe||q(!1),setTimeout(()=>{i&&nt(i[0])},gt.DURATION*1e3)}function ce(){if(!oe.current)return;const xe=document.querySelector("[data-vaul-drawer-wrapper]"),Ye=Yd(oe.current,S);Pt(oe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`}),Pt(O.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,opacity:"1"}),a&&Ye&&Ye>0&&ne&&Pt(xe,{borderRadius:`${CA}px`,overflow:"hidden",...Ct(S)?{transform:`scale(${_()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${_()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${gt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${gt.EASE.join(",")})`},!0)}function Ae(){!ee||!oe.current||(oe.current.classList.remove(bv),$.current=!1,Z(!1),j.current=new Date)}function rt(xe){if(!ee||!oe.current)return;oe.current.classList.remove(bv),$.current=!1,Z(!1),j.current=new Date;const Ye=Yd(oe.current,S);if(!xe||!I(xe.target,!1)||!Ye||Number.isNaN(Ye)||ae.current===null)return;const Xe=j.current.getTime()-ae.current.getTime(),ze=ie.current-(Ct(S)?xe.pageY:xe.pageX),we=Math.abs(ze)/Xe;if(we>.05&&(H(!0),setTimeout(()=>{H(!1)},200)),i){Ie({draggedDistance:ze*(S==="bottom"||S==="right"?1:-1),closeDrawer:Q,velocity:we,dismissible:u}),o==null||o(xe,!0);return}if(S==="bottom"||S==="right"?ze>0:ze<0){ce(),o==null||o(xe,!0);return}if(we>SA){Q(),o==null||o(xe,!1);return}var Ve;const We=Math.min((Ve=oe.current.getBoundingClientRect().height)!=null?Ve:0,window.innerHeight);var pt;const Vt=Math.min((pt=oe.current.getBoundingClientRect().width)!=null?pt:0,window.innerWidth),ct=S==="left"||S==="right";if(Math.abs(Ye)>=(ct?Vt:We)*l){Q(),o==null||o(xe,!1);return}o==null||o(xe,!0),ce()}E.useEffect(()=>(ne&&(Pt(document.documentElement,{scrollBehavior:"auto"}),V.current=new Date),()=>{wee(document.documentElement,"scrollBehavior")}),[ne]);function Je(xe){const Ye=xe?(window.innerWidth-Kd)/window.innerWidth:1,Xe=xe?-16:0;te.current&&window.clearTimeout(te.current),Pt(oe.current,{transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,transform:Ct(S)?`scale(${Ye}) translate3d(0, ${Xe}px, 0)`:`scale(${Ye}) translate3d(${Xe}px, 0, 0)`}),!xe&&oe.current&&(te.current=setTimeout(()=>{const ze=Yd(oe.current,S);Pt(oe.current,{transition:"none",transform:Ct(S)?`translate3d(0, ${ze}px, 0)`:`translate3d(${ze}px, 0, 0)`})},500))}function it(xe,Ye){if(Ye<0)return;const Xe=(window.innerWidth-Kd)/window.innerWidth,ze=Xe+Ye*(1-Xe),we=-16+Ye*Kd;Pt(oe.current,{transform:Ct(S)?`scale(${ze}) translate3d(0, ${we}px, 0)`:`scale(${ze}) translate3d(${we}px, 0, 0)`,transition:"none"})}function Ue(xe,Ye){const Xe=Ct(S)?window.innerHeight:window.innerWidth,ze=Ye?(Xe-Kd)/Xe:1,we=Ye?-16:0;Ye&&Pt(oe.current,{transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,transform:Ct(S)?`scale(${ze}) translate3d(0, ${we}px, 0)`:`scale(${ze}) translate3d(${we}px, 0, 0)`})}return E.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),E.createElement(zu,{defaultOpen:C,onOpenChange:xe=>{!u&&!xe||(xe?B(!0):Q(!0),q(xe))},open:ne},E.createElement(pA.Provider,{value:{activeSnapPoint:_e,snapPoints:i,setActiveSnapPoint:nt,drawerRef:oe,overlayRef:O,onOpenChange:t,onPress:P,onRelease:rt,onDrag:U,dismissible:u,shouldAnimate:z,handleOnly:d,isOpen:ne,isDragging:ee,shouldFade:Le,closeDrawer:Q,onNestedDrag:it,onNestedOpenChange:Je,onNestedRelease:Ue,keyboardIsOpen:re,modal:v,snapPointsOffset:Me,activeSnapPointIndex:Re,direction:S,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:x,container:k,autoFocus:F}},n))}const NA=E.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Ha(),c=xA(t,n),u=r&&r.length>0;if(!s)return null;const d=E.useCallback(f=>o(f),[o]);return E.createElement(la,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l!=null&&l.current?"true":"false",...e})});NA.displayName="Drawer.Overlay";const TA=E.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:h,direction:p,snapPoints:m,container:v,handleOnly:w,shouldAnimate:b,autoFocus:x}=Ha(),[S,C]=E.useState(!1),N=xA(o,i),R=E.useRef(null),T=E.useRef(null),M=E.useRef(!1),A=m&&m.length>0;Eee();const k=(L,Y,ne=0)=>{if(M.current)return!0;const q=Math.abs(L.y),X=Math.abs(L.x),B=X>q,ee=["bottom","right"].includes(Y)?1:-1;if(Y==="left"||Y==="right"){if(!(L.x*ee<0)&&X>=0&&X<=ne)return B}else if(!(L.y*ee<0)&&q>=0&&q<=ne)return!B;return M.current=!0,!0};E.useEffect(()=>{A&&window.requestAnimationFrame(()=>{C(!0)})},[]);function F(L){R.current=null,M.current=!1,s(L)}return E.createElement(ca,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":h&&A?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":b!=null&&b.current?"true":"false",...r,ref:N,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:L=>{w||(r.onPointerDown==null||r.onPointerDown.call(r,L),R.current={x:L.pageX,y:L.pageY},a(L))},onOpenAutoFocus:L=>{n==null||n(L),x||L.preventDefault()},onPointerDownOutside:L=>{if(e==null||e(L),!f||L.defaultPrevented){L.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:L=>{if(!f){L.preventDefault();return}},onPointerMove:L=>{if(T.current=L,w||(r.onPointerMove==null||r.onPointerMove.call(r,L),!R.current))return;const Y=L.pageY-R.current.y,ne=L.pageX-R.current.x,q=L.pointerType==="touch"?10:2;k({x:ne,y:Y},p,q)?l(L):(Math.abs(ne)>q||Math.abs(Y)>q)&&(R.current=null)},onPointerUp:L=>{r.onPointerUp==null||r.onPointerUp.call(r,L),R.current=null,M.current=!1,s(L)},onPointerOut:L=>{r.onPointerOut==null||r.onPointerOut.call(r,L),F(T.current)},onContextMenu:L=>{r.onContextMenu==null||r.onContextMenu.call(r,L),T.current&&F(T.current)}})});TA.displayName="Drawer.Content";const Ree=250,Nee=120,MA=E.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:f,onDrag:h}=Ha(),p=E.useRef(null),m=E.useRef(!1);function v(){if(m.current){x();return}window.setTimeout(()=>{w()},Nee)}function w(){if(i||e||m.current){x();return}if(x(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const C=a.findIndex(R=>R===s);if(C===-1)return;const N=a[C+1];l(N)}function b(){p.current=window.setTimeout(()=>{m.current=!0},Ree)}function x(){p.current&&window.clearTimeout(p.current),m.current=!1}return E.createElement("div",{onClick:v,onPointerCancel:x,onPointerDown:S=>{u&&f(S),b()},onPointerMove:S=>{u&&h(S)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},E.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});MA.displayName="Drawer.Handle";function Tee({onDrag:e,onOpenChange:t,open:n,...r}){const{onNestedDrag:o,onNestedOpenChange:i,onNestedRelease:a}=Ha();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return E.createElement(RA,{nested:!0,open:n,onClose:()=>{i(!1)},onDrag:(s,l)=>{o(s,l),e==null||e(s,l)},onOpenChange:s=>{s&&i(s),t==null||t(s)},onRelease:a,...r})}function Mee(e){const t=Ha(),{container:n=t.container,...r}=e;return E.createElement(Hu,{container:n,...r})}const Qn={Root:RA,NestedRoot:Tee,Content:TA,Overlay:NA,Trigger:Bu,Portal:Mee,Handle:MA,Close:fa,Title:ua,Description:da},DA=({shouldScaleBackground:e=!0,...t})=>g.jsx(Qn.Root,{shouldScaleBackground:e,...t});DA.displayName="Drawer";const Dee=Qn.Trigger,AA=Qn.Portal,Aee=Qn.Close,xv=E.forwardRef(({className:e,...t},n)=>g.jsx(Qn.Overlay,{ref:n,className:K("fixed inset-0 z-50 bg-black/80",e),...t}));xv.displayName=Qn.Overlay.displayName;const kA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(AA,{children:[g.jsx(xv,{}),g.jsxs(Qn.Content,{ref:r,className:K("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[g.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));kA.displayName="DrawerContent";const IA=({className:e,...t})=>g.jsx("div",{className:K("grid gap-1.5 p-4 text-center sm:text-left",e),...t});IA.displayName="DrawerHeader";const OA=({className:e,...t})=>g.jsx("div",{className:K("mt-auto flex flex-col gap-2 p-4",e),...t});OA.displayName="DrawerFooter";const jA=E.forwardRef(({className:e,...t},n)=>g.jsx(Qn.Title,{ref:n,className:K("text-lg font-semibold leading-none tracking-tight",e),...t}));jA.displayName=Qn.Title.displayName;const $A=E.forwardRef(({className:e,...t},n)=>g.jsx(Qn.Description,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));$A.displayName=Qn.Description.displayName;const kee=IG,Iee=OG,Oee=jG,jee=_E,$ee=FG,Fee=$G,FA=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(ME,{ref:o,className:K("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,g.jsx(Eo,{className:"ml-auto h-4 w-4"})]}));FA.displayName=ME.displayName;const LA=E.forwardRef(({className:e,...t},n)=>g.jsx(DE,{ref:n,className:K("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[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),...t}));LA.displayName=DE.displayName;const zA=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(_E,{children:g.jsx(SE,{ref:r,sideOffset:t,className:K("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[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})}));zA.displayName=SE.displayName;const BA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(EE,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));BA.displayName=EE.displayName;const HA=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(PE,{ref:o,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(NE,{children:g.jsx(Ta,{className:"h-4 w-4"})})}),t]}));HA.displayName=PE.displayName;const UA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(RE,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(NE,{children:g.jsx(Pd,{className:"h-2 w-2 fill-current"})})}),t]}));UA.displayName=RE.displayName;const VA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(CE,{ref:r,className:K("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));VA.displayName=CE.displayName;const WA=E.forwardRef(({className:e,...t},n)=>g.jsx(TE,{ref:n,className:K("-mx-1 my-1 h-px bg-muted",e),...t}));WA.displayName=TE.displayName;const GA=({className:e,...t})=>g.jsx("span",{className:K("ml-auto text-xs tracking-widest opacity-60",e),...t});GA.displayName="DropdownMenuShortcut";let qA=0;function Lee(e="id"){const t=E.useRef(null);return t.current===null&&(qA+=1,t.current=`${e}-${qA}`),t.current}var zee=e=>e.type==="checkbox",Bee=e=>e instanceof Date,YA=e=>e==null;const Hee=e=>typeof e=="object";var Ua=e=>!YA(e)&&!Array.isArray(e)&&Hee(e)&&!Bee(e),Uee=e=>Ua(e)&&e.target?zee(e.target)?e.target.checked:e.target.value:e,Vee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Wee=(e,t)=>e.has(Vee(t)),Gee=e=>{const t=e.constructor&&e.constructor.prototype;return Ua(t)&&t.hasOwnProperty("isPrototypeOf")},qee=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function _v(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(!(qee&&(e instanceof Blob||r))&&(n||Ua(e)))if(t=n?[]:{},!n&&!Gee(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=_v(e[o]));else return e;return t}var KA=e=>Array.isArray(e)?e.filter(Boolean):[],Sv=e=>e===void 0,un=(e,t,n)=>{if(!t||!Ua(e))return n;const r=KA(t.split(/[,[\].]+?/)).reduce((o,i)=>YA(o)?o:o[i],e);return Sv(r)||r===e?Sv(e[t])?n:e[t]:r},XA=e=>typeof e=="boolean",Yee=e=>/^\w*$/.test(e),Kee=e=>KA(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ZA=(e,t,n)=>{let r=-1;const o=Yee(t)?[t]:Kee(t),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let l=n;if(r!==a){const c=e[s];l=Ua(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}return e};const JA={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},QA={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ek=E.createContext(null),Xd=()=>E.useContext(ek),Xee=e=>{const{children:t,...n}=e;return E.createElement(ek.Provider,{value:n},t)};var Zee=(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]!==QA.all&&(t._proxyFormState[a]=!r||QA.all),n&&(n[a]=!0),e[a]}});return o},Jee=e=>Ua(e)&&!Object.keys(e).length,Qee=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Jee(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===!0)},ete=e=>Array.isArray(e)?e:[e],tk=(e,t,n)=>!e||!t||e===t||ete(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function nk(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function tte(e){const t=Xd(),{control:n=t.control,disabled:r,name:o,exact:i}=e,[a,s]=E.useState(n._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(o);return u.current=o,nk({disabled:r,next:d=>l.current&&tk(u.current,d.name,i)&&Qee(d,c.current,n._updateFormState)&&s({...n._formState,...d}),subject:n._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),E.useMemo(()=>Zee(a,n,c.current,!1),[a,n])}var nte=e=>typeof e=="string",rte=(e,t,n,r,o)=>nte(e)?un(n,e,o):Array.isArray(e)?e.map(i=>un(n,i)):n;function ote(e){const t=Xd(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e,s=E.useRef(r);s.current=r,nk({disabled:i,subject:n._subjects.values,next:u=>{tk(s.current,u.name,a)&&c(_v(rte(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=E.useState(n._getWatch(r,o));return E.useEffect(()=>n._removeUnmounted()),l}function ite(e){const t=Xd(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,a=Wee(o._names.array,n),s=ote({control:o,name:n,defaultValue:un(o._formValues,n,un(o._defaultValues,n,e.defaultValue)),exact:!0}),l=tte({control:o,name:n,exact:!0}),c=E.useRef(o.register(n,{...e.rules,value:s,...XA(e.disabled)?{disabled:e.disabled}:{}})),u=E.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!un(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!un(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!un(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!un(l.validatingFields,n)},error:{enumerable:!0,get:()=>un(l.errors,n)}}),[l,n]),d=E.useMemo(()=>({name:n,value:s,...XA(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:Uee(f),name:n},type:JA.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:un(o._formValues,n),name:n},type:JA.BLUR}),ref:f=>{const h=un(o._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:p=>f.setCustomValidity(p),reportValidity:()=>f.reportValidity()})}}),[n,o._formValues,r,l.disabled,s,o._fields]);return E.useEffect(()=>{const f=o._options.shouldUnregister||i,h=(p,m)=>{const v=un(o._fields,p);v&&v._f&&(v._f.mount=m)};if(h(n,!0),f){const p=_v(un(o._options.defaultValues,n));ZA(o._defaultValues,n,p),Sv(un(o._formValues,n))&&ZA(o._formValues,n,p)}return!a&&o.register(n),()=>{(a?f&&!o._state.action:f)?o.unregister(n):h(n,!1)}},[n,o,a,i]),E.useEffect(()=>{o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),E.useMemo(()=>({field:d,formState:l,fieldState:u}),[d,l,u])}const ate=e=>e.render(ite(e)),ste=Cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Cv=E.forwardRef(({className:e,...t},n)=>g.jsx(kE,{ref:n,className:K(ste(),e),...t}));Cv.displayName=kE.displayName;const lte=Xee,rk=E.createContext({}),cte=({...e})=>g.jsx(rk.Provider,{value:{name:e.name},children:g.jsx(ate,{...e})}),Xl=()=>{const e=E.useContext(rk),t=E.useContext(ok),{getFieldState:n,formState:r}=Xd(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},ok=E.createContext({}),ik=E.forwardRef(({className:e,...t},n)=>{const r=Lee();return g.jsx(ok.Provider,{value:{id:r},children:g.jsx("div",{ref:n,className:K("space-y-2",e),...t})})});ik.displayName="FormItem";const ak=E.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Xl();return g.jsx(Cv,{ref:n,className:K(r&&"text-destructive",e),htmlFor:o,...t})});ak.displayName="FormLabel";const sk=E.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=Xl();return g.jsx(Hn,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});sk.displayName="FormControl";const lk=E.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Xl();return g.jsx("p",{ref:n,id:r,className:K("text-sm text-muted-foreground",e),...t})});lk.displayName="FormDescription";const ck=E.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=Xl(),a=o?String(o==null?void 0:o.message):t;return a?g.jsx("p",{ref:r,id:i,className:K("text-sm font-medium text-destructive",e),...n,children:a}):null});ck.displayName="FormMessage";const ute=qG,dte=YG,uk=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(LE,{ref:o,align:t,sideOffset:n,className:K("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[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),...r}));uk.displayName=LE.displayName;const dk=E.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:K("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));dk.displayName="Input";const fte=p7,hte=m7,pte=sP,mte=w7,gte=g7,fk=E.forwardRef(({className:e,...t},n)=>g.jsx(iP,{ref:n,className:K("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));fk.displayName=iP.displayName;const hk=E.forwardRef(({className:e,...t},n)=>g.jsx(aP,{ref:n,className:K("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));hk.displayName=aP.displayName;const pk=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(mP,{ref:o,className:K("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Eo,{className:"ml-auto h-4 w-4"})]}));pk.displayName=mP.displayName;const mk=E.forwardRef(({className:e,...t},n)=>g.jsx(gP,{ref:n,className:K("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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-[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),...t}));mk.displayName=gP.displayName;const gk=E.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...o},i)=>g.jsx(sP,{children:g.jsx(lP,{ref:i,align:t,alignOffset:n,sideOffset:r,className:K("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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-[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),...o})}));gk.displayName=lP.displayName;const wk=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(uP,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));wk.displayName=uP.displayName;const vk=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(dP,{ref:o,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(hP,{children:g.jsx(Ta,{className:"h-4 w-4"})})}),t]}));vk.displayName=dP.displayName;const yk=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(fP,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(hP,{children:g.jsx(Pd,{className:"h-2 w-2 fill-current"})})}),t]}));yk.displayName=fP.displayName;const bk=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(cP,{ref:r,className:K("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));bk.displayName=cP.displayName;const xk=E.forwardRef(({className:e,...t},n)=>g.jsx(pP,{ref:n,className:K("-mx-1 my-1 h-px bg-muted",e),...t}));xk.displayName=pP.displayName;const _k=({className:e,...t})=>g.jsx("span",{className:K("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});_k.displayName="MenubarShortcut";const Sk=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(FP,{ref:r,className:K("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,g.jsx(Ev,{})]}));Sk.displayName=FP.displayName;const Ck=E.forwardRef(({className:e,...t},n)=>g.jsx(LP,{ref:n,className:K("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));Ck.displayName=LP.displayName;const wte=k7,Ek=Cn("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),Pk=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(zP,{ref:r,className:K(Ek(),"group",e),...n,children:[t," ",g.jsx(Cd,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));Pk.displayName=zP.displayName;const Rk=E.forwardRef(({className:e,...t},n)=>g.jsx(HP,{ref:n,className:K("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));Rk.displayName=HP.displayName;const vte=I7,Ev=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:K("absolute left-0 top-full flex justify-center"),children:g.jsx(UP,{className:K("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));Ev.displayName=UP.displayName;const Nk=E.forwardRef(({className:e,...t},n)=>g.jsx(BP,{ref:n,className:K("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:g.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));Nk.displayName=BP.displayName;const Tk=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:K("mx-auto flex w-full justify-center",e),...t});Tk.displayName="Pagination";const Mk=E.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:K("flex flex-row items-center gap-1",e),...t}));Mk.displayName="PaginationContent";const Dk=E.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:K("",e),...t}));Dk.displayName="PaginationItem";const Va=E.forwardRef(({className:e,isActive:t,disabled:n,...r},o)=>g.jsx(Yn,{ref:o,"aria-current":t?"page":void 0,disabled:n,className:K("h-9 w-9",{"pointer-events-none bg-accent":t,"pointer-events-none opacity-50":n},e),...r}));Va.displayName="PaginationLink";const Ak=E.forwardRef(({className:e,...t},n)=>g.jsxs(Va,{ref:n,"aria-label":"Go to previous page",className:K("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx(Ed,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]}));Ak.displayName="PaginationPrevious";const kk=E.forwardRef(({className:e,...t},n)=>g.jsxs(Va,{ref:n,"aria-label":"Go to next page",className:K("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Eo,{className:"h-4 w-4"})]}));kk.displayName="PaginationNext";const Ik=E.forwardRef(({className:e,...t},n)=>g.jsx(Va,{ref:n,"aria-label":"Go to first page",className:K("",e),...t,children:g.jsx(Zq,{className:"h-4 w-4"})}));Ik.displayName="PaginationFirst";const Ok=E.forwardRef(({className:e,...t},n)=>g.jsx(Va,{ref:n,"aria-label":"Go to last page",className:K("",e),...t,children:g.jsx(Jq,{className:"h-4 w-4"})}));Ok.displayName="PaginationLast";const jk=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:K("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(eY,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});jk.displayName="PaginationEllipsis";const $k=E.forwardRef(({className:e,value:t,...n},r)=>g.jsx(sR,{ref:r,className:K("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:g.jsx(Q7,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));$k.displayName=sR.displayName;const Fk=E.forwardRef(({className:e,...t},n)=>g.jsx(yR,{className:K("grid gap-2",e),...t,ref:n}));Fk.displayName=yR.displayName;const Lk=E.forwardRef(({className:e,...t},n)=>g.jsx(bR,{ref:n,className:K("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(c9,{className:"flex items-center justify-center",children:g.jsx(Pd,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Lk.displayName=bR.displayName;const{createElement:Wa,createContext:yte,createRef:Wre,forwardRef:zk,useCallback:dn,useContext:Bk,useEffect:hi,useImperativeHandle:Hk,useLayoutEffect:bte,useMemo:xte,useRef:fn,useState:Ga}=y,Uk=y[`useId${Math.random()}`.slice(0,5)],_te=bte,Zd=yte(null);Zd.displayName="PanelGroupContext";const pi=_te,Ste=typeof Uk=="function"?Uk:()=>null;let Cte=0;function Pv(e=null){const t=Ste(),n=fn(e||t||null);return n.current===null&&(n.current=""+Cte++),e??n.current}function Vk({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:a,maxSize:s,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:f,style:h,tagName:p="div",...m}){const v=Bk(Zd);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:b,getPanelSize:x,getPanelStyle:S,groupId:C,isPanelCollapsed:N,reevaluatePanelConstraints:R,registerPanel:T,resizePanel:M,unregisterPanel:A}=v,k=Pv(a),F=fn({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:k,idIsFromProps:a!==void 0,order:f});fn({didLogMissingDefaultSizeWarning:!1}),pi(()=>{const{callbacks:Y,constraints:ne}=F.current,q={...ne};F.current.id=k,F.current.idIsFromProps=a!==void 0,F.current.order=f,Y.onCollapse=c,Y.onExpand=u,Y.onResize=d,ne.collapsedSize=n,ne.collapsible=r,ne.defaultSize=o,ne.maxSize=s,ne.minSize=l,(q.collapsedSize!==ne.collapsedSize||q.collapsible!==ne.collapsible||q.maxSize!==ne.maxSize||q.minSize!==ne.minSize)&&R(F.current,q)}),pi(()=>{const Y=F.current;return T(Y),()=>{A(Y)}},[f,k,T,A]),Hk(i,()=>({collapse:()=>{w(F.current)},expand:Y=>{b(F.current,Y)},getId(){return k},getSize(){return x(F.current)},isCollapsed(){return N(F.current)},isExpanded(){return!N(F.current)},resize:Y=>{M(F.current,Y)}}),[w,b,x,N,k,M]);const L=S(F.current,o);return Wa(p,{...m,children:e,className:t,id:a,style:{...L,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":k,"data-panel-size":parseFloat(""+L.flexGrow).toFixed(1)})}const Wk=zk((e,t)=>Wa(Vk,{...e,forwardedRef:t}));Vk.displayName="Panel",Wk.displayName="forwardRef(Panel)";let Rv=null,mi=null;function Ete(e,t){if(t){const n=(t&Qk)!==0,r=(t&eI)!==0,o=(t&tI)!==0,i=(t&nI)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Pte(){mi!==null&&(document.head.removeChild(mi),Rv=null,mi=null)}function Nv(e,t){const n=Ete(e,t);Rv!==n&&(Rv=n,mi===null&&(mi=document.createElement("style"),document.head.appendChild(mi)),mi.innerHTML=`*{cursor: ${n}!important;}`)}function Gk(e){return e.type==="keydown"}function qk(e){return e.type.startsWith("pointer")}function Yk(e){return e.type.startsWith("mouse")}function Jd(e){if(qk(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Yk(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Rte(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Nte(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Tte(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Zk(e),b:Zk(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;je(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Xk(Kk(n.a)),b:Xk(Kk(n.b))};if(o.a===o.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let s=i.length;for(;s--;){const l=i[s];if(l===a.a)return 1;if(l===a.b)return-1}}return Math.sign(o.a-o.b)}const Mte=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dte(e){var t;const n=getComputedStyle((t=Jk(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function Ate(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Dte(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Mte.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Kk(e){let t=e.length;for(;t--;){const n=e[t];if(je(n,"Missing node"),Ate(n))return n}return null}function Xk(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Zk(e){const t=[];for(;e;)t.push(e),e=Jk(e);return t}function Jk(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Qk=1,eI=2,tI=4,nI=8,kte=Rte()==="coarse";let er=[],qa=!1,Do=new Map,Qd=new Map;const Zl=new Set;function Ite(e,t,n,r,o){var i;const{ownerDocument:a}=t,s={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Do.get(a))!==null&&i!==void 0?i:0;return Do.set(a,l+1),Zl.add(s),ef(),function(){var u;Qd.delete(e),Zl.delete(s);const d=(u=Do.get(a))!==null&&u!==void 0?u:1;if(Do.set(a,d-1),ef(),d===1&&Do.delete(a),er.includes(s)){const f=er.indexOf(s);f>=0&&er.splice(f,1),Dv(),o("up",!0,null)}}}function rI(e){const{target:t}=e,{x:n,y:r}=Jd(e);qa=!0,Tv({target:t,x:n,y:r}),ef(),er.length>0&&(tf("down",e),e.preventDefault(),e.stopPropagation())}function Jl(e){const{x:t,y:n}=Jd(e);if(qa&&e.buttons===0&&(qa=!1,tf("up",e)),!qa){const{target:r}=e;Tv({target:r,x:t,y:n})}tf("move",e),Dv(),er.length>0&&e.preventDefault()}function Ya(e){const{target:t}=e,{x:n,y:r}=Jd(e);Qd.clear(),qa=!1,er.length>0&&e.preventDefault(),tf("up",e),Tv({target:t,x:n,y:r}),Dv(),ef()}function Tv({target:e,x:t,y:n}){er.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Zl.forEach(o=>{const{element:i,hitAreaMargins:a}=o,s=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=s,f=kte?a.coarse:a.fine;if(t>=c-f&&t<=u+f&&n>=d-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Tte(r,i)>0){let p=r,m=!1;for(;p&&!p.contains(i);){if(Nte(p.getBoundingClientRect(),s)){m=!0;break}p=p.parentElement}if(m)return}er.push(o)}})}function Mv(e,t){Qd.set(e,t)}function Dv(){let e=!1,t=!1;er.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Qd.forEach(r=>{n|=r}),e&&t?Nv("intersection",n):e?Nv("horizontal",n):t?Nv("vertical",n):Pte()}function ef(){Do.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Ya),n.removeEventListener("pointerdown",rI),n.removeEventListener("pointerleave",Jl),n.removeEventListener("pointermove",Jl)}),window.removeEventListener("pointerup",Ya),window.removeEventListener("pointercancel",Ya),Zl.size>0&&(qa?(er.length>0&&Do.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Ya),n.addEventListener("pointerleave",Jl),n.addEventListener("pointermove",Jl))}),window.addEventListener("pointerup",Ya),window.addEventListener("pointercancel",Ya)):Do.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",rI,{capture:!0}),n.addEventListener("pointermove",Jl))}))}function tf(e,t){Zl.forEach(n=>{const{setResizeHandlerState:r}=n,o=er.includes(n);r(e,o,t)})}function Ote(){const[e,t]=Ga(0);return dn(()=>t(n=>n+1),[])}function je(e,t){if(!e)throw console.error(t),Error(t)}const Av=10;function gi(e,t,n=Av){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Gr(e,t,n=Av){return gi(e,t,n)===0}function Rn(e,t,n){return gi(e,t,n)===0}function jte(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!Rn(o,i,n))return!1}return!0}function Ka({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];je(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;if(gi(n,s)<0)if(i){const l=(o+s)/2;gi(n,l)<0?n=o:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(Av)),n}function Ql({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(Rn(e,0))return t;const a=[...t],[s,l]=r;je(s!=null,"Invalid first pivot index"),je(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:s,f=n[d];je(f,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:p,minSize:m=0}=f;if(p){const v=t[d];if(je(v!=null,`Previous layout not found for panel index ${d}`),Rn(v,h)){const w=m-v;gi(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const d=e<0?s:l,f=n[d];je(f,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:p,minSize:m=0}=f;if(p){const v=t[d];if(je(v!=null,`Previous layout not found for panel index ${d}`),Rn(v,m)){const w=v-h;gi(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?l:s,h=0;for(;;){const m=t[f];je(m!=null,`Previous layout not found for panel index ${f}`);const w=Ka({panelConstraints:n,panelIndex:f,size:100})-m;if(h+=w,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-p:p}{let f=e<0?s:l;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(c),p=t[f];je(p!=null,`Previous layout not found for panel index ${f}`);const m=p-h,v=Ka({panelConstraints:n,panelIndex:f,size:m});if(!Rn(p,v)&&(c+=p-v,a[f]=v,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(jte(o,a))return o;{const d=e<0?l:s,f=t[d];je(f!=null,`Previous layout not found for panel index ${d}`);const h=f+c,p=Ka({panelConstraints:n,panelIndex:d,size:h});if(a[d]=p,!Rn(p,h)){let m=h-p,w=e<0?l:s;for(;w>=0&&w<n.length;){const b=a[w];je(b!=null,`Previous layout not found for panel index ${w}`);const x=b+m,S=Ka({panelConstraints:n,panelIndex:w,size:x});if(Rn(b,S)||(m-=S-b,a[w]=S),Rn(m,0))break;e>0?w--:w++}}}const u=a.reduce((d,f)=>f+d,0);return Rn(u,100)?a:o}function $te({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];je(s!=null,"No pivot index found"),t.forEach((d,f)=>{const{constraints:h}=d,{maxSize:p=100,minSize:m=0}=h;f===s?(r=m,o=p):(i+=m,a+=p)});const l=Math.min(o,100-i),c=Math.max(r,100-a),u=e[s];return{valueMax:l,valueMin:c,valueNow:u}}function ec(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function oI(e,t,n=document){const o=ec(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function iI(e,t,n){const r=oI(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function aI(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function nf(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Fte(e,t,n,r=document){var o,i,a,s;const l=nf(t,r),c=ec(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,f=(a=(s=n[u+1])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null;return[d,f]}function Lte({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:a}){fn({didWarnAboutMissingResizeHandle:!1}),pi(()=>{if(!i)return;const s=ec(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=$te({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=s[l];if(f!=null){const h=o[l];je(h,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),hi(()=>{if(!i)return;const s=t.current;je(s,"Eager values not found");const{panelDataArray:l}=s,c=aI(n,i);je(c!=null,`No group found for id "${n}"`);const u=ec(n,i);je(u,`No resize handles found for group id "${n}"`);const d=u.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");je(h,"Resize handle element has no handle id attribute");const[p,m]=Fte(n,h,l,i);if(p==null||m==null)return()=>{};const v=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const b=l.findIndex(x=>x.id===p);if(b>=0){const x=l[b];je(x,`No panel data found for index ${b}`);const S=r[b],{collapsedSize:C=0,collapsible:N,minSize:R=0}=x.constraints;if(S!=null&&N){const T=Ql({delta:Rn(S,C)?R-C:C-S,initialLayout:r,panelConstraints:l.map(M=>M.constraints),pivotIndices:iI(n,h,i),prevLayout:r,trigger:"keyboard"});r!==T&&a(T)}}break}}};return f.addEventListener("keydown",v),()=>{f.removeEventListener("keydown",v)}});return()=>{d.forEach(f=>f())}},[i,e,t,n,r,o,a])}function sI(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function lI(e,t){const n=e==="horizontal",{x:r,y:o}=Jd(t);return n?r:o}function zte(e,t,n,r,o){const i=n==="horizontal",a=nf(t,o);je(a,`No resize handle element found for id "${t}"`);const s=a.getAttribute("data-panel-group-id");je(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=lI(n,e),u=aI(s,o);je(u,`No group element found for id "${s}"`);const d=u.getBoundingClientRect(),f=i?d.width:d.height;return(c-l)/f*100}function Bte(e,t,n,r,o,i){if(Gk(e)){const a=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let l=0;switch(e.key){case"ArrowDown":l=a?0:s;break;case"ArrowLeft":l=a?-s:0;break;case"ArrowRight":l=a?s:0;break;case"ArrowUp":l=a?0:-s;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:zte(e,t,n,r,i)}function Hte({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const a=n[i];je(a,`Panel constraints not found for index ${i}`);const{defaultSize:s}=a;s!=null&&(r++,t[i]=s,o-=s)}for(let i=0;i<e.length;i++){const a=n[i];je(a,`Panel constraints not found for index ${i}`);const{defaultSize:s}=a;if(s!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function Xa(e,t,n){t.forEach((r,o)=>{const i=e[o];je(i,`Panel data not found for index ${o}`);const{callbacks:a,constraints:s,id:l}=i,{collapsedSize:c=0,collapsible:u}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:f,onExpand:h,onResize:p}=a;p&&p(r,d),u&&(f||h)&&(h&&(d==null||Gr(d,c))&&!Gr(r,c)&&h(),f&&(d==null||!Gr(d,c))&&Gr(r,c)&&f())}})}function rf(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Ute({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const a=n[o];let s;return a==null?s=e!=null?e.toPrecision(i):"1":r.length===1?s="1":s=a.toPrecision(i),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Vte(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function cI(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function uI(e){return`react-resizable-panels:${e}`}function dI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function fI(e,t){try{const n=uI(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Wte(e,t,n){var r,o;const i=(r=fI(e,n))!==null&&r!==void 0?r:{},a=dI(t);return(o=i[a])!==null&&o!==void 0?o:null}function Gte(e,t,n,r,o){var i;const a=uI(e),s=dI(t),l=(i=fI(e,o))!==null&&i!==void 0?i:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(l))}catch(c){console.error(c)}}function hI({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,a)=>i+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Rn(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const a=n[i];je(a!=null,`No layout data found for index ${i}`);const s=100/r*a;n[i]=s}let o=0;for(let i=0;i<t.length;i++){const a=n[i];je(a!=null,`No layout data found for index ${i}`);const s=Ka({panelConstraints:t,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!Rn(o,0))for(let i=0;i<t.length;i++){const a=n[i];je(a!=null,`No layout data found for index ${i}`);const s=a+o,l=Ka({panelConstraints:t,panelIndex:i,size:s});if(a!==l&&(o-=l-a,n[i]=l,Rn(o,0)))break}return n}const qte=100,tc={getItem:e=>(cI(tc),tc.getItem(e)),setItem:(e,t)=>{cI(tc),tc.setItem(e,t)}},pI={};function mI({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=tc,style:c,tagName:u="div",...d}){const f=Pv(i),h=fn(null),[p,m]=Ga(null),[v,w]=Ga([]),b=Ote(),x=fn({}),S=fn(new Map),C=fn(0),N=fn({autoSaveId:e,direction:r,dragState:p,id:f,keyboardResizeBy:s,onLayout:a,storage:l}),R=fn({layout:v,panelDataArray:[],panelDataArrayChanged:!1});fn({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Hk(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:O}=R.current;return O},setLayout:O=>{const{onLayout:V}=N.current,{layout:ae,panelDataArray:j}=R.current,G=hI({layout:O,panelConstraints:j.map($=>$.constraints)});sI(ae,G)||(w(G),R.current.layout=G,V&&V(G),Xa(j,G,x.current))}}),[]),pi(()=>{N.current.autoSaveId=e,N.current.direction=r,N.current.dragState=p,N.current.id=f,N.current.onLayout=a,N.current.storage=l}),Lte({committedValuesRef:N,eagerValuesRef:R,groupId:f,layout:v,panelDataArray:R.current.panelDataArray,setLayout:w,panelGroupElement:h.current}),hi(()=>{const{panelDataArray:O}=R.current;if(e){if(v.length===0||v.length!==O.length)return;let V=pI[e];V==null&&(V=Vte(Gte,qte),pI[e]=V);const ae=[...O],j=new Map(S.current);V(e,ae,j,v,l)}},[e,v,l]),hi(()=>{});const T=dn(O=>{const{onLayout:V}=N.current,{layout:ae,panelDataArray:j}=R.current;if(O.constraints.collapsible){const G=j.map(re=>re.constraints),{collapsedSize:$=0,panelSize:te,pivotIndices:ie}=wi(j,O,ae);if(je(te!=null,`Panel size not found for panel "${O.id}"`),!Gr(te,$)){S.current.set(O.id,te);const z=Za(j,O)===j.length-1?te-$:$-te,se=Ql({delta:z,initialLayout:ae,panelConstraints:G,pivotIndices:ie,prevLayout:ae,trigger:"imperative-api"});rf(ae,se)||(w(se),R.current.layout=se,V&&V(se),Xa(j,se,x.current))}}},[]),M=dn((O,V)=>{const{onLayout:ae}=N.current,{layout:j,panelDataArray:G}=R.current;if(O.constraints.collapsible){const $=G.map(oe=>oe.constraints),{collapsedSize:te=0,panelSize:ie=0,minSize:re=0,pivotIndices:z}=wi(G,O,j),se=V??re;if(Gr(ie,te)){const oe=S.current.get(O.id),fe=oe!=null&&oe>=se?oe:se,pe=Za(G,O)===G.length-1?ie-fe:fe-ie,me=Ql({delta:pe,initialLayout:j,panelConstraints:$,pivotIndices:z,prevLayout:j,trigger:"imperative-api"});rf(j,me)||(w(me),R.current.layout=me,ae&&ae(me),Xa(G,me,x.current))}}},[]),A=dn(O=>{const{layout:V,panelDataArray:ae}=R.current,{panelSize:j}=wi(ae,O,V);return je(j!=null,`Panel size not found for panel "${O.id}"`),j},[]),k=dn((O,V)=>{const{panelDataArray:ae}=R.current,j=Za(ae,O);return Ute({defaultSize:V,dragState:p,layout:v,panelData:ae,panelIndex:j})},[p,v]),F=dn(O=>{const{layout:V,panelDataArray:ae}=R.current,{collapsedSize:j=0,collapsible:G,panelSize:$}=wi(ae,O,V);return je($!=null,`Panel size not found for panel "${O.id}"`),G===!0&&Gr($,j)},[]),L=dn(O=>{const{layout:V,panelDataArray:ae}=R.current,{collapsedSize:j=0,collapsible:G,panelSize:$}=wi(ae,O,V);return je($!=null,`Panel size not found for panel "${O.id}"`),!G||gi($,j)>0},[]),Y=dn(O=>{const{panelDataArray:V}=R.current;V.push(O),V.sort((ae,j)=>{const G=ae.order,$=j.order;return G==null&&$==null?0:G==null?-1:$==null?1:G-$}),R.current.panelDataArrayChanged=!0,b()},[b]);pi(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:O,onLayout:V,storage:ae}=N.current,{layout:j,panelDataArray:G}=R.current;let $=null;if(O){const ie=Wte(O,G,ae);ie&&(S.current=new Map(Object.entries(ie.expandToSizes)),$=ie.layout)}$==null&&($=Hte({panelDataArray:G}));const te=hI({layout:$,panelConstraints:G.map(ie=>ie.constraints)});sI(j,te)||(w(te),R.current.layout=te,V&&V(te),Xa(G,te,x.current))}}),pi(()=>{const O=R.current;return()=>{O.layout=[]}},[]);const ne=dn(O=>{let V=!1;const ae=h.current;return ae&&window.getComputedStyle(ae,null).getPropertyValue("direction")==="rtl"&&(V=!0),function(G){G.preventDefault();const $=h.current;if(!$)return()=>null;const{direction:te,dragState:ie,id:re,keyboardResizeBy:z,onLayout:se}=N.current,{layout:oe,panelDataArray:fe}=R.current,{initialLayout:ge}=ie??{},pe=iI(re,O,$);let me=Bte(G,O,te,ie,z,$);const _e=te==="horizontal";_e&&V&&(me=-me);const Re=fe.map(Me=>Me.constraints),nt=Ql({delta:me,initialLayout:ge??oe,panelConstraints:Re,pivotIndices:pe,prevLayout:oe,trigger:Gk(G)?"keyboard":"mouse-or-touch"}),Ie=!rf(oe,nt);(qk(G)||Yk(G))&&C.current!=me&&(C.current=me,!Ie&&me!==0?_e?Mv(O,me<0?Qk:eI):Mv(O,me<0?tI:nI):Mv(O,0)),Ie&&(w(nt),R.current.layout=nt,se&&se(nt),Xa(fe,nt,x.current))}},[]),q=dn((O,V)=>{const{onLayout:ae}=N.current,{layout:j,panelDataArray:G}=R.current,$=G.map(oe=>oe.constraints),{panelSize:te,pivotIndices:ie}=wi(G,O,j);je(te!=null,`Panel size not found for panel "${O.id}"`);const z=Za(G,O)===G.length-1?te-V:V-te,se=Ql({delta:z,initialLayout:j,panelConstraints:$,pivotIndices:ie,prevLayout:j,trigger:"imperative-api"});rf(j,se)||(w(se),R.current.layout=se,ae&&ae(se),Xa(G,se,x.current))},[]),X=dn((O,V)=>{const{layout:ae,panelDataArray:j}=R.current,{collapsedSize:G=0,collapsible:$}=V,{collapsedSize:te=0,collapsible:ie,maxSize:re=100,minSize:z=0}=O.constraints,{panelSize:se}=wi(j,O,ae);se!=null&&($&&ie&&Gr(se,G)?Gr(G,te)||q(O,te):se<z?q(O,z):se>re&&q(O,re))},[q]),B=dn((O,V)=>{const{direction:ae}=N.current,{layout:j}=R.current;if(!h.current)return;const G=nf(O,h.current);je(G,`Drag handle element not found for id "${O}"`);const $=lI(ae,V);m({dragHandleId:O,dragHandleRect:G.getBoundingClientRect(),initialCursorPosition:$,initialLayout:j})},[]),ee=dn(()=>{m(null)},[]),Z=dn(O=>{const{panelDataArray:V}=R.current,ae=Za(V,O);ae>=0&&(V.splice(ae,1),delete x.current[O.id],R.current.panelDataArrayChanged=!0,b())},[b]),J=xte(()=>({collapsePanel:T,direction:r,dragState:p,expandPanel:M,getPanelSize:A,getPanelStyle:k,groupId:f,isPanelCollapsed:F,isPanelExpanded:L,reevaluatePanelConstraints:X,registerPanel:Y,registerResizeHandle:ne,resizePanel:q,startDragging:B,stopDragging:ee,unregisterPanel:Z,panelGroupElement:h.current}),[T,p,r,M,A,k,f,F,L,X,Y,ne,q,B,ee,Z]),H={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Wa(Zd.Provider,{value:J},Wa(u,{...d,children:t,className:n,id:i,ref:h,style:{...H,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const gI=zk((e,t)=>Wa(mI,{...e,forwardedRef:t}));mI.displayName="PanelGroup",gI.displayName="forwardRef(PanelGroup)";function Za(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function wi(e,t,n){const r=Za(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function Yte({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){hi(()=>{if(e||n==null||r==null)return;const o=nf(t,r);if(o==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const s=o.getAttribute("data-panel-group-id");je(s,`No group element found for id "${s}"`);const l=ec(s,r),c=oI(s,t,r);je(c!==null,`No resize element found for id "${t}"`);const u=a.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function wI({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:a,onFocus:s,style:l={},tabIndex:c=0,tagName:u="div",...d}){var f,h;const p=fn(null),m=fn({onDragging:a});hi(()=>{m.current.onDragging=a});const v=Bk(Zd);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:b,registerResizeHandle:x,startDragging:S,stopDragging:C,panelGroupElement:N}=v,R=Pv(o),[T,M]=Ga("inactive"),[A,k]=Ga(!1),[F,L]=Ga(null),Y=fn({state:T});pi(()=>{Y.current.state=T}),hi(()=>{if(n)L(null);else{const B=x(R);L(()=>B)}},[n,R,x]);const ne=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,q=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return hi(()=>{if(n||F==null)return;const B=p.current;return je(B,"Element ref not attached"),Ite(R,B,w,{coarse:ne,fine:q},(Z,J,H)=>{if(J)switch(Z){case"down":{M("drag"),je(H,'Expected event to be defined for "down" action'),S(R,H);const{onDragging:O}=m.current;O&&O(!0);break}case"move":{const{state:O}=Y.current;O!=="drag"&&M("hover"),je(H,'Expected event to be defined for "move" action'),F(H);break}case"up":{M("hover"),C();const{onDragging:O}=m.current;O&&O(!1);break}}else M("inactive")})},[ne,w,n,q,x,R,F,S,C]),Yte({disabled:n,handleId:R,resizeHandler:F,panelGroupElement:N}),Wa(u,{...d,children:e,className:t,id:o,onBlur:()=>{k(!1),i==null||i()},onFocus:()=>{k(!0),s==null||s()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":w,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":T==="drag"?"pointer":A?"keyboard":void 0,"data-resize-handle-state":T,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}wI.displayName="PanelResizeHandle";const vI=E.forwardRef(({className:e,...t},n)=>g.jsx(gI,{ref:n,className:K("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}));vI.displayName="ResizablePanelGroup";const yI=E.forwardRef(({className:e,...t},n)=>g.jsx(Wk,{ref:n,className:K("relative flex h-full w-full",e),...t}));yI.displayName="ResizablePanel";const bI=({className:e,...t})=>g.jsx(wI,{className:K("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...t,children:g.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"currentColor",children:[g.jsx("circle",{cx:"2",cy:"4",r:"0.75"}),g.jsx("circle",{cx:"6",cy:"4",r:"0.75"})]})})});bI.displayName="ResizableHandle";const xI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(IR,{ref:r,className:K("relative overflow-hidden",e),...n,children:[g.jsx(x9,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(kv,{}),g.jsx(_9,{})]}));xI.displayName=IR.displayName;const kv=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>g.jsx(bg,{ref:r,orientation:t,className:K("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:g.jsx(NR,{className:"relative flex-1 rounded-full bg-border"})}));kv.displayName=bg.displayName;const Kte=B9,Xte=G9,Zte=H9,_I=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(uN,{ref:r,className:K("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,g.jsx(U9,{asChild:!0,children:g.jsx(Cd,{className:"h-4 w-4 opacity-50"})})]}));_I.displayName=uN.displayName;const Iv=E.forwardRef(({className:e,...t},n)=>g.jsx(pN,{ref:n,className:K("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Xq,{className:"h-4 w-4"})}));Iv.displayName=pN.displayName;const Ov=E.forwardRef(({className:e,...t},n)=>g.jsx(mN,{ref:n,className:K("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Cd,{className:"h-4 w-4"})}));Ov.displayName=mN.displayName;const SI=E.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>g.jsx(V9,{children:g.jsxs(dN,{ref:o,className:K("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx(Iv,{}),g.jsx(W9,{className:K("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(Ov,{})]})}));SI.displayName=dN.displayName;const CI=E.forwardRef(({className:e,...t},n)=>g.jsx(fN,{ref:n,className:K("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));CI.displayName=fN.displayName;const EI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(hN,{ref:r,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Y9,{children:g.jsx(Ta,{className:"h-4 w-4"})})}),g.jsx(q9,{children:t})]}));EI.displayName=hN.displayName;const PI=E.forwardRef(({className:e,...t},n)=>g.jsx(gN,{ref:n,className:K("-mx-1 my-1 h-px bg-muted",e),...t}));PI.displayName=gN.displayName;const RI=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>g.jsx(yN,{ref:o,decorative:n,orientation:t,className:K("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));RI.displayName=yN.displayName;const Jte=zu,Qte=Bu,NI=fa,TI=Hu,jv=E.forwardRef(({className:e,...t},n)=>g.jsx(la,{className:K("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,ref:n}));jv.displayName=la.displayName;const ene=Cn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),MI=E.forwardRef(({side:e="right",className:t,children:n,...r},o)=>g.jsxs(TI,{children:[g.jsx(jv,{}),g.jsxs(ca,{ref:o,className:K(ene({side:e}),t),...r,children:[n,g.jsxs(NI,{className:"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-secondary",children:[g.jsx(vT,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));MI.displayName=ca.displayName;const DI=({className:e,...t})=>g.jsx("div",{className:K("flex flex-col space-y-2 text-center sm:text-left",e),...t});DI.displayName="SheetHeader";const AI=({className:e,...t})=>g.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});AI.displayName="SheetFooter";const kI=E.forwardRef(({className:e,...t},n)=>g.jsx(ua,{ref:n,className:K("text-lg font-semibold text-foreground",e),...t}));kI.displayName=ua.displayName;const II=E.forwardRef(({className:e,...t},n)=>g.jsx(da,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));II.displayName=da.displayName;const OI=E.forwardRef(({className:e,variant:t,size:n,collapsed:r,fixed:o,...i},a)=>{const{variants:s}=Ro(),l=E.useMemo(()=>Cn(s.sidebar.defaultStyles,{variants:s.sidebar.variantStyles,defaultVariants:s.sidebar.defaultVariants}),[s]);return g.jsx("div",{ref:a,className:K(l({variant:t,size:n,collapsed:r}),o&&"fixed inset-y-0 left-0",e),...i})});OI.displayName="Sidebar";const jI=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("flex items-center justify-center py-4",e),...t}));jI.displayName="SidebarHeader";const $I=E.forwardRef(({className:e,...t},n)=>g.jsx("nav",{ref:n,className:K("flex-1 space-y-1",e),...t}));$I.displayName="SidebarNav";const FI=E.forwardRef(({className:e,children:t,icon:n,badge:r,variant:o,active:i,...a},s)=>{const{variants:l}=Ro(),c=E.useMemo(()=>Cn(l.sidebarItem.defaultStyles,{variants:l.sidebarItem.variantStyles,defaultVariants:l.sidebarItem.defaultVariants}),[l]);return g.jsxs("div",{ref:s,className:K(c({variant:i?"active":o}),e),...a,children:[n&&g.jsx("span",{className:"shrink-0",children:n}),g.jsx("span",{className:"flex-1 truncate",children:t}),r&&g.jsx("span",{children:r})]})});FI.displayName="SidebarItem";const LI=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("space-y-3 py-2",e),role:"group",...t}));LI.displayName="SidebarGroup";const zI=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:K("mt-auto",e),...t}));zI.displayName="SidebarFooter";function tne({className:e,...t}){return g.jsx("div",{className:K("animate-pulse rounded-md bg-muted",e),...t})}const BI=E.forwardRef(({className:e,...t},n)=>g.jsxs(kN,{ref:n,className:K("relative flex w-full touch-none select-none items-center",e),...t,children:[g.jsx(hq,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:g.jsx(pq,{className:"absolute h-full bg-primary"})}),g.jsx(mq,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));BI.displayName=kN.displayName;var nne=(e,t,n,r,o,i,a,s)=>{let l=document.documentElement,c=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(p=>{let m=p==="class",v=m&&i?o.map(w=>i[w]||w):o;m?(l.classList.remove(...v),l.classList.add(h)):l.setAttribute(p,h)}),d(h)}function d(h){s&&c.includes(h)&&(l.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let h=localStorage.getItem(t)||n,p=a&&h==="system"?f():h;u(p)}catch{}},rne=y.createContext(void 0),one={setTheme:e=>{},themes:[]},ine=()=>{var e;return(e=y.useContext(rne))!=null?e:one};y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:a,themes:s,nonce:l,scriptProps:c})=>{let u=JSON.stringify([n,t,i,e,s,a,r,o]).slice(1,-1);return y.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${nne.toString()})(${u})`}})});function ane(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const sne=e=>{switch(e){case"success":return une;case"info":return fne;case"warning":return dne;case"error":return hne;default:return null}},lne=Array(12).fill(0),cne=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},lne.map((n,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),une=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),dne=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),fne=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),hne=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),pne=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),mne=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let $v=1;class gne{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:$v++,a=this.toasts.find(l=>l.id===i),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:s,title:r}):l):this.addToast({title:r,...o,dismissible:s,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,a;const s=o.then(async c=>{if(a=["resolve",c],E.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(vne(c)&&!c.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:f,...h})}else if(c instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:f,...h})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"success",description:f,...h})}}).catch(async c=>{if(a=["reject",c],n.error!==void 0){i=!1;const u=typeof n.error=="function"?await n.error(c):n.error,d=typeof n.description=="function"?await n.description(c):n.description,f=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:d,...f})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,u)=>s.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||$v++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const hn=new gne,wne=(e,t)=>{const n=(t==null?void 0:t.id)||$v++;return hn.addToast({title:e,...t,id:n}),n},vne=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yne=wne,bne=()=>hn.toasts,xne=()=>hn.getActiveToasts();Object.assign(yne,{success:hn.success,info:hn.info,warning:hn.warning,error:hn.error,custom:hn.custom,message:hn.message,promise:hn.promise,dismiss:hn.dismiss,loading:hn.loading},{getHistory:bne,getToasts:xne}),ane("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function of(e){return e.label!==void 0}const _ne=3,Sne="24px",Cne="16px",HI=4e3,Ene=356,Pne=14,Rne=45,Nne=200;function Nr(...e){return e.filter(Boolean).join(" ")}function Tne(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Mne=e=>{var t,n,r,o,i,a,s,l,c;const{invert:u,toast:d,unstyled:f,interacting:h,setHeights:p,visibleToasts:m,heights:v,index:w,toasts:b,expanded:x,removeToast:S,defaultRichColors:C,closeButton:N,style:R,cancelButtonStyle:T,actionButtonStyle:M,className:A="",descriptionClassName:k="",duration:F,position:L,gap:Y,expandByDefault:ne,classNames:q,icons:X,closeButtonAriaLabel:B="Close toast"}=e,[ee,Z]=E.useState(null),[J,H]=E.useState(null),[O,V]=E.useState(!1),[ae,j]=E.useState(!1),[G,$]=E.useState(!1),[te,ie]=E.useState(!1),[re,z]=E.useState(!1),[se,oe]=E.useState(0),[fe,ge]=E.useState(0),pe=E.useRef(d.duration||F||HI),me=E.useRef(null),_e=E.useRef(null),Re=w===0,nt=w+1<=m,Ie=d.type,Me=d.dismissible!==!1,Ce=d.className||"",Le=d.descriptionClassName||"",pn=E.useMemo(()=>v.findIndex(we=>we.toastId===d.id)||0,[v,d.id]),D=E.useMemo(()=>{var we;return(we=d.closeButton)!=null?we:N},[d.closeButton,N]),_=E.useMemo(()=>d.duration||F||HI,[d.duration,F]),P=E.useRef(0),I=E.useRef(0),U=E.useRef(0),Q=E.useRef(null),[ce,Ae]=L.split("-"),rt=E.useMemo(()=>v.reduce((we,Ve,We)=>We>=pn?we:we+Ve.height,0),[v,pn]),Je=mne(),it=d.invert||u,Ue=Ie==="loading";I.current=E.useMemo(()=>pn*Y+rt,[pn,rt]),E.useEffect(()=>{pe.current=_},[_]),E.useEffect(()=>{V(!0)},[]),E.useEffect(()=>{const we=_e.current;if(we){const Ve=we.getBoundingClientRect().height;return ge(Ve),p(We=>[{toastId:d.id,height:Ve,position:d.position},...We]),()=>p(We=>We.filter(pt=>pt.toastId!==d.id))}},[p,d.id]),E.useLayoutEffect(()=>{if(!O)return;const we=_e.current,Ve=we.style.height;we.style.height="auto";const We=we.getBoundingClientRect().height;we.style.height=Ve,ge(We),p(pt=>pt.find(ct=>ct.toastId===d.id)?pt.map(ct=>ct.toastId===d.id?{...ct,height:We}:ct):[{toastId:d.id,height:We,position:d.position},...pt])},[O,d.title,d.description,p,d.id]);const xe=E.useCallback(()=>{j(!0),oe(I.current),p(we=>we.filter(Ve=>Ve.toastId!==d.id)),setTimeout(()=>{S(d)},Nne)},[d,S,p,I]);E.useEffect(()=>{if(d.promise&&Ie==="loading"||d.duration===1/0||d.type==="loading")return;let we;return x||h||Je?(()=>{if(U.current<P.current){const pt=new Date().getTime()-P.current;pe.current=pe.current-pt}U.current=new Date().getTime()})():(()=>{pe.current!==1/0&&(P.current=new Date().getTime(),we=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),xe()},pe.current))})(),()=>clearTimeout(we)},[x,h,d,Ie,Je,xe]),E.useEffect(()=>{d.delete&&xe()},[xe,d.delete]);function Ye(){var we;if(X!=null&&X.loading){var Ve;return E.createElement("div",{className:Nr(q==null?void 0:q.loader,d==null||(Ve=d.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":Ie==="loading"},X.loading)}return E.createElement(cne,{className:Nr(q==null?void 0:q.loader,d==null||(we=d.classNames)==null?void 0:we.loader),visible:Ie==="loading"})}var Xe,ze;return E.createElement("li",{tabIndex:0,ref:_e,className:Nr(A,Ce,q==null?void 0:q.toast,d==null||(t=d.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[Ie],d==null||(n=d.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(Xe=d.richColors)!=null?Xe:C,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":O,"data-promise":!!d.promise,"data-swiped":re,"data-removed":ae,"data-visible":nt,"data-y-position":ce,"data-x-position":Ae,"data-index":w,"data-front":Re,"data-swiping":G,"data-dismissible":Me,"data-type":Ie,"data-invert":it,"data-swipe-out":te,"data-swipe-direction":J,"data-expanded":!!(x||ne&&O),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${ae?se:I.current}px`,"--initial-height":ne?"auto":`${fe}px`,...R,...d.style},onDragEnd:()=>{$(!1),Z(null),Q.current=null},onPointerDown:we=>{Ue||!Me||(me.current=new Date,oe(I.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&($(!0),Q.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,Ve,We;if(te||!Me)return;Q.current=null;const pt=Number(((we=_e.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Vt=Number(((Ve=_e.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ct=new Date().getTime()-((We=me.current)==null?void 0:We.getTime()),St=ee==="x"?pt:Vt,Jt=Math.abs(St)/ct;if(Math.abs(St)>=Rne||Jt>.11){oe(I.current),d.onDismiss==null||d.onDismiss.call(d,d),H(ee==="x"?pt>0?"right":"left":Vt>0?"down":"up"),xe(),ie(!0);return}else{var Wt,mn;(Wt=_e.current)==null||Wt.style.setProperty("--swipe-amount-x","0px"),(mn=_e.current)==null||mn.style.setProperty("--swipe-amount-y","0px")}z(!1),$(!1),Z(null)},onPointerMove:we=>{var Ve,We,pt;if(!Q.current||!Me||((Ve=window.getSelection())==null?void 0:Ve.toString().length)>0)return;const ct=we.clientY-Q.current.y,St=we.clientX-Q.current.x;var Jt;const Wt=(Jt=e.swipeDirections)!=null?Jt:Tne(L);!ee&&(Math.abs(St)>1||Math.abs(ct)>1)&&Z(Math.abs(St)>Math.abs(ct)?"x":"y");let mn={x:0,y:0};const tO=vi=>1/(1.5+Math.abs(vi)/20);if(ee==="y"){if(Wt.includes("top")||Wt.includes("bottom"))if(Wt.includes("top")&&ct<0||Wt.includes("bottom")&&ct>0)mn.y=ct;else{const vi=ct*tO(ct);mn.y=Math.abs(vi)<Math.abs(ct)?vi:ct}}else if(ee==="x"&&(Wt.includes("left")||Wt.includes("right")))if(Wt.includes("left")&&St<0||Wt.includes("right")&&St>0)mn.x=St;else{const vi=St*tO(St);mn.x=Math.abs(vi)<Math.abs(St)?vi:St}(Math.abs(mn.x)>0||Math.abs(mn.y)>0)&&z(!0),(We=_e.current)==null||We.style.setProperty("--swipe-amount-x",`${mn.x}px`),(pt=_e.current)==null||pt.style.setProperty("--swipe-amount-y",`${mn.y}px`)}},D&&!d.jsx&&Ie!=="loading"?E.createElement("button",{"aria-label":B,"data-disabled":Ue,"data-close-button":!0,onClick:Ue||!Me?()=>{}:()=>{xe(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Nr(q==null?void 0:q.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(ze=X==null?void 0:X.close)!=null?ze:pne):null,Ie||d.icon||d.promise?E.createElement("div",{"data-icon":"",className:Nr(q==null?void 0:q.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ye():null,d.type!=="loading"?d.icon||(X==null?void 0:X[Ie])||sne(Ie):null):null,E.createElement("div",{"data-content":"",className:Nr(q==null?void 0:q.content,d==null||(i=d.classNames)==null?void 0:i.content)},E.createElement("div",{"data-title":"",className:Nr(q==null?void 0:q.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?E.createElement("div",{"data-description":"",className:Nr(k,Le,q==null?void 0:q.description,d==null||(s=d.classNames)==null?void 0:s.description)},typeof d.description=="function"?d.description():d.description):null),E.isValidElement(d.cancel)?d.cancel:d.cancel&&of(d.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:we=>{of(d.cancel)&&Me&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,we),xe())},className:Nr(q==null?void 0:q.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,E.isValidElement(d.action)?d.action:d.action&&of(d.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:we=>{of(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,we),!we.defaultPrevented&&xe())},className:Nr(q==null?void 0:q.actionButton,d==null||(c=d.classNames)==null?void 0:c.actionButton)},d.action.label):null)};function UI(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Dne(e,t){const n={};return[e,t].forEach((r,o)=>{const i=o===1,a=i?"--mobile-offset":"--offset",s=i?Cne:Sne;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}const Ane=E.forwardRef(function(t,n){const{invert:r,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:s,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:m=_ne,toastOptions:v,dir:w=UI(),gap:b=Pne,icons:x,containerAriaLabel:S="Notifications"}=t,[C,N]=E.useState([]),R=E.useMemo(()=>Array.from(new Set([o].concat(C.filter(J=>J.position).map(J=>J.position)))),[C,o]),[T,M]=E.useState([]),[A,k]=E.useState(!1),[F,L]=E.useState(!1),[Y,ne]=E.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=E.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=E.useRef(null),ee=E.useRef(!1),Z=E.useCallback(J=>{N(H=>{var O;return(O=H.find(V=>V.id===J.id))!=null&&O.delete||hn.dismiss(J.id),H.filter(({id:V})=>V!==J.id)})},[]);return E.useEffect(()=>hn.subscribe(J=>{if(J.dismiss){const H=C.map(O=>O.id===J.id?{...O,delete:!0}:O);requestAnimationFrame(()=>{N(H)});return}setTimeout(()=>{tr.flushSync(()=>{N(H=>{const O=H.findIndex(V=>V.id===J.id);return O!==-1?[...H.slice(0,O),{...H[O],...J},...H.slice(O+1)]:[J,...H]})})})}),[C]),E.useEffect(()=>{if(d!=="system"){ne(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:H})=>{ne(H?"dark":"light")})}catch{J.addListener(({matches:O})=>{try{ne(O?"dark":"light")}catch(V){console.error(V)}})}},[d]),E.useEffect(()=>{C.length<=1&&k(!1)},[C]),E.useEffect(()=>{const J=H=>{var O;if(i.every(j=>H[j]||H.code===j)){var ae;k(!0),(ae=q.current)==null||ae.focus()}H.code==="Escape"&&(document.activeElement===q.current||(O=q.current)!=null&&O.contains(document.activeElement))&&k(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[i]),E.useEffect(()=>{if(q.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,ee.current=!1)}},[q.current]),E.createElement("section",{ref:n,"aria-label":`${S} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((J,H)=>{var O;const[V,ae]=J.split("-");return C.length?E.createElement("ol",{key:J,dir:w==="auto"?UI():w,tabIndex:-1,ref:q,className:l,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":V,"data-lifted":A&&C.length>1&&!a,"data-x-position":ae,style:{"--front-toast-height":`${((O=T[0])==null?void 0:O.height)||0}px`,"--width":`${Ene}px`,"--gap":`${b}px`,...p,...Dne(c,u)},onBlur:j=>{ee.current&&!j.currentTarget.contains(j.relatedTarget)&&(ee.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,B.current=j.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{F||k(!1)},onDragEnd:()=>k(!1),onPointerDown:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},C.filter(j=>!j.position&&H===0||j.position===J).map((j,G)=>{var $,te;return E.createElement(Mne,{key:j.id,icons:x,index:G,toast:j,defaultRichColors:f,duration:($=v==null?void 0:v.duration)!=null?$:h,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:m,closeButton:(te=v==null?void 0:v.closeButton)!=null?te:s,interacting:F,position:J,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:Z,toasts:C.filter(ie=>ie.position==j.position),heights:T.filter(ie=>ie.position==j.position),setHeights:M,expandByDefault:a,gap:b,expanded:A,swipeDirections:t.swipeDirections})})):null}))}),kne=({...e})=>{const{theme:t="system"}=ine();return g.jsx(Ane,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},VI=E.forwardRef(({className:e,...t},n)=>g.jsx(FN,{className:K("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:g.jsx(bq,{className:K("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));VI.displayName=FN.displayName;const Ine=Sq,WI=y.forwardRef(({className:e,...t},n)=>g.jsx(KN,{ref:n,className:K("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));WI.displayName=KN.displayName;const GI=y.forwardRef(({className:e,...t},n)=>g.jsx(XN,{ref:n,className:K("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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-sm",e),...t}));GI.displayName=XN.displayName;const qI=y.forwardRef(({className:e,...t},n)=>g.jsx(ZN,{ref:n,className:K("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qI.displayName=ZN.displayName;const YI=E.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:K("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));YI.displayName="Textarea";const KI=Cn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground 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=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),XI=E.forwardRef(({className:e,variant:t,size:n,...r},o)=>{const{variants:i}=Ro(),a=E.useMemo(()=>Cn(i.toggle.defaultStyles,{variants:i.toggle.variantStyles,defaultVariants:i.toggle.defaultVariants}),[i]);return g.jsx(JN,{ref:o,className:K(a({variant:t,size:n,className:e})),...r})});XI.displayName=JN.displayName;const ZI=E.createContext({size:"default",variant:"default"}),JI=E.forwardRef(({className:e,variant:t,size:n,children:r,...o},i)=>g.jsx(aT,{ref:i,className:K("flex items-center justify-center gap-1",e),...o,children:g.jsx(ZI.Provider,{value:{variant:t,size:n},children:r})}));JI.displayName=aT.displayName;const QI=E.forwardRef(({className:e,children:t,variant:n,size:r,...o},i)=>{const a=E.useContext(ZI);return g.jsx(sT,{ref:i,className:K(KI({variant:a.variant||n,size:a.size||r}),e),...o,children:t})});QI.displayName=sT.displayName;const One=Vq,jne=Wq,$ne=Gq,eO=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(mT,{ref:r,sideOffset:t,className:K("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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}));eO.displayName=mT.displayName;const Fne=Object.freeze(Object.defineProperty({__proto__:null,Accordion:HY,AccordionContent:AT,AccordionItem:MT,AccordionTrigger:DT,Alert:jT,AlertDescription:FT,AlertDialog:YY,AlertDialogAction:WT,AlertDialogCancel:GT,AlertDialogContent:zT,AlertDialogDescription:VT,AlertDialogFooter:HT,AlertDialogHeader:BT,AlertDialogTitle:UT,AlertDialogTrigger:KY,AlertTitle:$T,AspectRatio:ZY,Avatar:qT,AvatarFallback:KT,AvatarImage:YT,Badge:QY,Breadcrumb:XT,BreadcrumbItem:JT,BreadcrumbLink:QT,BreadcrumbList:ZT,BreadcrumbPage:eM,BreadcrumbSeparator:tM,Button:Yn,Calendar:Ad,Card:MM,CardContent:IM,CardDescription:kM,CardFooter:OM,CardHeader:DM,CardTitle:AM,Carousel:UM,CarouselContent:VM,CarouselItem:WM,CarouselNext:qM,CarouselPrevious:GM,Checkbox:YM,Collapsible:yZ,CollapsibleContent:KM,CollapsibleTrigger:bZ,Combobox:KJ,Command:zd,CommandDialog:YJ,CommandEmpty:Hw,CommandGroup:Uw,CommandInput:Bw,CommandItem:Vw,CommandList:LD,CommandSeparator:zD,CommandShortcut:BD,ContextMenu:XJ,ContextMenuCheckboxItem:GD,ContextMenuContent:VD,ContextMenuGroup:JJ,ContextMenuItem:WD,ContextMenuLabel:YD,ContextMenuPortal:QJ,ContextMenuRadioGroup:tQ,ContextMenuRadioItem:qD,ContextMenuSeparator:KD,ContextMenuShortcut:XD,ContextMenuSub:eQ,ContextMenuSubContent:UD,ContextMenuSubTrigger:HD,ContextMenuTrigger:ZJ,DataTable:tee,DatePicker:nee,DateRangePicker:ree,Dialog:kD,DialogClose:qJ,DialogContent:zw,DialogDescription:FD,DialogFooter:jD,DialogHeader:OD,DialogOverlay:Lw,DialogPortal:ID,DialogTitle:$D,DialogTrigger:GJ,Drawer:DA,DrawerClose:Aee,DrawerContent:kA,DrawerDescription:$A,DrawerFooter:OA,DrawerHeader:IA,DrawerOverlay:xv,DrawerPortal:AA,DrawerTitle:jA,DrawerTrigger:Dee,DropdownMenu:kee,DropdownMenuCheckboxItem:HA,DropdownMenuContent:zA,DropdownMenuGroup:Oee,DropdownMenuItem:BA,DropdownMenuLabel:VA,DropdownMenuPortal:jee,DropdownMenuRadioGroup:Fee,DropdownMenuRadioItem:UA,DropdownMenuSeparator:WA,DropdownMenuShortcut:GA,DropdownMenuSub:$ee,DropdownMenuSubContent:LA,DropdownMenuSubTrigger:FA,DropdownMenuTrigger:Iee,Form:lte,FormControl:sk,FormDescription:lk,FormField:cte,FormItem:ik,FormLabel:ak,FormMessage:ck,HoverCard:ute,HoverCardContent:uk,HoverCardTrigger:dte,Input:dk,Label:Cv,Menubar:fk,MenubarCheckboxItem:vk,MenubarContent:gk,MenubarGroup:hte,MenubarItem:wk,MenubarLabel:bk,MenubarMenu:fte,MenubarPortal:pte,MenubarRadioGroup:gte,MenubarRadioItem:yk,MenubarSeparator:xk,MenubarShortcut:_k,MenubarSub:mte,MenubarSubContent:mk,MenubarSubTrigger:pk,MenubarTrigger:hk,NavigationMenu:Sk,NavigationMenuContent:Rk,NavigationMenuIndicator:Nk,NavigationMenuItem:wte,NavigationMenuLink:vte,NavigationMenuList:Ck,NavigationMenuTrigger:Pk,NavigationMenuViewport:Ev,Pagination:Tk,PaginationContent:Mk,PaginationEllipsis:jk,PaginationFirst:Ik,PaginationItem:Dk,PaginationLast:Ok,PaginationLink:Va,PaginationNext:kk,PaginationPrevious:Ak,Popover:Bd,PopoverContent:Vl,PopoverTrigger:Hd,Progress:$k,RadioGroup:Fk,RadioGroupItem:Lk,ResizableHandle:bI,ResizablePanel:yI,ResizablePanelGroup:vI,ScrollArea:xI,ScrollBar:kv,Select:Kte,SelectContent:SI,SelectGroup:Xte,SelectItem:EI,SelectLabel:CI,SelectScrollDownButton:Ov,SelectScrollUpButton:Iv,SelectSeparator:PI,SelectTrigger:_I,SelectValue:Zte,Separator:RI,Sheet:Jte,SheetClose:NI,SheetContent:MI,SheetDescription:II,SheetFooter:AI,SheetHeader:DI,SheetOverlay:jv,SheetPortal:TI,SheetTitle:kI,SheetTrigger:Qte,Sidebar:OI,SidebarFooter:zI,SidebarGroup:LI,SidebarHeader:jI,SidebarItem:FI,SidebarNav:$I,Skeleton:tne,Slider:BI,Switch:VI,Table:uv,TableBody:fv,TableCaption:hA,TableCell:ql,TableFooter:fA,TableHead:hv,TableHeader:dv,TableRow:Ba,Tabs:Ine,TabsContent:qI,TabsList:WI,TabsTrigger:GI,Textarea:YI,Toaster:kne,Toggle:XI,ToggleGroup:JI,ToggleGroupItem:QI,Tooltip:jne,TooltipContent:eO,TooltipProvider:One,TooltipTrigger:$ne,Variants:UY,badgeVariants:JY,buttonVariants:e6,navigationMenuTriggerStyle:Ek,toggleVariants:KI,useFormField:Xl},Symbol.toStringTag,{value:"Module"})),Lne=()=>{typeof window<"u"&&(window.Buffer=uf.Buffer,window.fs=new XO("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};$e.APIHandler=$h,$e.APIProxyHandler=Fh,$e.DreamspaceElements=Fne,$e.MiniApp=Y3,$e.ProjectProvider=h5,$e.RGComponent=K3,$e.RGComponentErrorBoundary=X3,$e.RGDroppable=Z3,$e.RGEditLayout=tH,$e.RGPreviewLayout=B_,$e.TailwindThemeContext=WY,$e.TailwindThemeHooks=qY,$e.applySxtIgnore=o4,$e.getHeadCommit=QB,$e.getRedoTargetCommitForFile=t4,$e.getTags=_h,$e.getUndoTargetCommitForFile=e4,$e.initializeMakeInfinite=Lne,$e.listAllFiles=i4,$e.listDir=ex,$e.loadLibraryComponents=zB,$e.loadProjectComponents=sx,$e.setTailwindTheme=HB,$e.syncAndRetry=ux,$e.useAPI=Ox,$e.useAppMetadata=VB,$e.useAppSettings=WB,$e.useAppVersions=GB,$e.useB64UrlForProjectImage=UB,$e.useProject=Bh,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});