beadscope 0.5.1 → 0.6.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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +4 -4
- package/.next/required-server-files.js +3 -3
- package/.next/required-server-files.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +4 -4
- package/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/attachments/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/attachments/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/archive/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/assist/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/comments/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/deps/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/gate/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/human/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/[id]/status/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/beads/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/doctor/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/gamification/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/insights/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/order/route.js.nft.json +1 -1
- package/.next/server/app/api/p/[projectId]/publish/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/server/app/api/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/update/check/route.js +3 -3
- package/.next/server/app/api/update/check/route.js.nft.json +1 -1
- package/.next/server/app/api/update/run/route.js +3 -3
- package/.next/server/app/api/update/run/route.js.nft.json +1 -1
- package/.next/server/app/api/viewer-mode/route.js.nft.json +1 -1
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +7 -7
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/index.segments/_full.segment.rsc +7 -7
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/p/[projectId]/page.js.nft.json +1 -1
- package/.next/server/app/p/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0190u3x31o2kc._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0190u3x31o2kc._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__1-f7qk3-8a266._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1zrubp2jc8bi0._.js +1 -1
- package/.next/server/chunks/_004qegokrf7fy._.js +1 -1
- package/.next/server/chunks/_004qegokrf7fy._.js.map +1 -1
- package/.next/server/chunks/_10s9tyeasgb0i._.js +1 -1
- package/.next/server/chunks/_10s9tyeasgb0i._.js.map +1 -1
- package/.next/server/chunks/_146xyuw6iu78n._.js +1 -1
- package/.next/server/chunks/_146xyuw6iu78n._.js.map +1 -1
- package/.next/server/chunks/_1n-6yntr59hz-._.js +1 -1
- package/.next/server/chunks/_1n-6yntr59hz-._.js.map +1 -1
- package/.next/server/chunks/_1tji4d-rsralm._.js +1 -1
- package/.next/server/chunks/lib_beads-view_ts_1fvxcrevh9zu_._.js +1 -1
- package/.next/server/chunks/lib_beads-view_ts_1fvxcrevh9zu_._.js.map +1 -1
- package/.next/server/chunks/lib_config_ts_0zrjxh_mm8sv8._.js +1 -1
- package/.next/server/chunks/lib_config_ts_0zrjxh_mm8sv8._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__10sjsc4ko7y98._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__10sjsc4ko7y98._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1xizcyi5hek65._.js +7 -7
- package/.next/server/chunks/ssr/[root-of-the-server]__1xizcyi5hek65._.js.map +1 -1
- package/.next/server/chunks/ssr/_0_ky_k50rh6-9._.js +1 -1
- package/.next/server/chunks/ssr/_0_ky_k50rh6-9._.js.map +1 -1
- package/.next/server/chunks/ssr/_16j7dxy5pqj44._.js +291 -0
- package/.next/server/chunks/ssr/_16j7dxy5pqj44._.js.map +1 -0
- package/.next/server/chunks/ssr/_1bulx6_unf6c7._.js +3 -0
- package/.next/server/chunks/ssr/_1bulx6_unf6c7._.js.map +1 -0
- package/.next/server/chunks/ssr/_1mzldxegsozij._.js +1 -1
- package/.next/server/chunks/ssr/_1mzldxegsozij._.js.map +1 -1
- package/.next/server/chunks/ssr/_1obdc2e416ry-._.js +3 -0
- package/.next/server/chunks/ssr/_1obdc2e416ry-._.js.map +1 -0
- package/.next/server/chunks/ssr/components_launcher_tsx_1i40oht1v6miz._.js +1 -1
- package/.next/server/chunks/ssr/components_launcher_tsx_1i40oht1v6miz._.js.map +1 -1
- package/.next/server/chunks/ssr/components_providers_tsx_0thx-xfvr_dtx._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/middleware.js.nft.json +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0gexf4-utluu4.js +1 -0
- package/.next/static/chunks/23nopl40nheqr.js +1 -0
- package/.next/static/chunks/2c10hhzk7mgkf.js +58 -0
- package/.next/static/chunks/2n4lv4u0xo5oz.css +3 -0
- package/.next/static/chunks/3m8u_309a1_fw.js +1 -0
- package/.next/static/chunks/3tepw2noo82tm.js +1 -0
- package/README.md +47 -1
- package/bin/beadscope.mjs +75 -32
- package/package.json +2 -1
- package/.next/server/chunks/ssr/_02mwe4ucwaopu._.js +0 -291
- package/.next/server/chunks/ssr/_02mwe4ucwaopu._.js.map +0 -1
- package/.next/server/chunks/ssr/_1020o02v8ucmf._.js +0 -3
- package/.next/server/chunks/ssr/_1020o02v8ucmf._.js.map +0 -1
- package/.next/server/chunks/ssr/_1i_x4qkev3tax._.js +0 -3
- package/.next/server/chunks/ssr/_1i_x4qkev3tax._.js.map +0 -1
- package/.next/static/chunks/07balm4l-kilq.js +0 -1
- package/.next/static/chunks/0lf_v5uyq3i9q.js +0 -1
- package/.next/static/chunks/1j-4i4b4rc0hy.js +0 -58
- package/.next/static/chunks/21v6r4y8vgqng.css +0 -3
- package/.next/static/chunks/2xh00k9l33qnb.js +0 -1
- package/.next/static/chunks/3yqhmu1hny1_2.js +0 -1
- /package/.next/static/{xa_jNrYAvP6guImijiv2P → BoR0CvHf7BXhmN1hRjwWk}/_buildManifest.js +0 -0
- /package/.next/static/{xa_jNrYAvP6guImijiv2P → BoR0CvHf7BXhmN1hRjwWk}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{xa_jNrYAvP6guImijiv2P → BoR0CvHf7BXhmN1hRjwWk}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[48026,e=>{let t,n,r,i,o,a,l,s,c,u,d,f,p;e.s(["BIGINT_FORMAT_RANGES",()=>tb,"CONSTANT_CATCH",()=>t3,"Class",()=>tV,"NUMBER_FORMAT_RANGES",()=>ty,"aborted",()=>tN,"allowsEval",()=>ti,"assert",()=>eF,"assertEqual",()=>ez,"assertIs",()=>e$,"assertNever",()=>eB,"assertNotEqual",()=>eR,"assignProp",()=>eQ,"attachSchema",()=>tT,"base64ToUint8Array",()=>tU,"base64urlToUint8Array",()=>tK,"cached",()=>eq,"captureStackTrace",()=>tn,"cleanEnum",()=>tF,"cleanRegex",()=>eV,"clone",()=>tf,"cloneDef",()=>e5,"codePointLength",()=>tR,"constantCatch",()=>t4,"createTransparentProxy",()=>th,"defineLazy",()=>eY,"defineLazyInternal",()=>t1,"derived",()=>tJ,"esc",()=>te,"escapeRegex",()=>td,"explicitlyAborted",()=>tC,"extend",()=>tk,"finalizeIssue",()=>tI,"floatSafeRemainder",()=>eG,"getElementAtPath",()=>e6,"getEnumValues",()=>eU,"getLengthableOrigin",()=>tL,"getParsedType",()=>ts,"getSizableOrigin",()=>tD,"hexToUint8Array",()=>tq,"hide",()=>tY,"installLazyProp",()=>t2,"isObject",()=>tr,"isPlainObject",()=>to,"issue",()=>tB,"joinValues",()=>eH,"jsonStringifyReplacer",()=>eK,"members",()=>tG,"merge",()=>tE,"mergeDefs",()=>e9,"normalizeParams",()=>tp,"nullish",()=>eZ,"numKeys",()=>tl,"objectClone",()=>eJ,"omit",()=>tw,"optionalKeys",()=>tg,"own",()=>tX,"parsedType",()=>t$,"partial",()=>tj,"pick",()=>tv,"prefixIssues",()=>tA,"primitiveTypes",()=>tu,"promiseAllObject",()=>e8,"propertyKeyTypes",()=>tc,"randomString",()=>e7,"rawShape",()=>e0,"required",()=>tO,"safeExtend",()=>tS,"shallowClone",()=>ta,"sizeCaps",()=>tP,"slugify",()=>tt,"stringifyPrimitive",()=>tm,"toZod",()=>eL,"uint8ArrayToBase64",()=>tH,"uint8ArrayToBase64url",()=>tW,"uint8ArrayToHex",()=>tZ,"unwrapMessage",()=>tM],49873);var h,m,g,y,b,v,x,w,k,_,S,E,j,O,N,C,A,M,P,T,I,D,z,R,L,$,B,F,U,H,K,W,q,Z,V=e.i(18050),G=e.i(71645),X=e.i(46696),Y=e.i(22016),J=e.i(18566),Q=e.i(75260),ee=e.i(66027),et=e.i(12598),en=e.i(57675),er=e.i(67539),ei=e.i(44215);function eo({cmd:e,note:t}){let[n,r]=G.useState(!1);return(0,V.jsxs)("div",{className:"flex items-center gap-2",children:[(0,V.jsx)("code",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-[var(--surface-2)] px-[7px] py-[3px] font-mono text-meta text-[var(--text-2)]",children:e}),(0,V.jsx)("span",{className:"flex-shrink-0 text-meta text-[var(--text-3)]",children:t}),(0,V.jsx)(er._,{size:"sm",label:`Copy command: ${e}`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)},()=>r(!1))},title:"Copy command",children:(0,V.jsx)(en.W,{name:n?"check":"link",size:11})})]})}function ea({detail:e}){let[t,n]=G.useState(!1);return(0,V.jsxs)("div",{className:"flex w-full flex-col gap-[7px]",children:[(0,V.jsx)("div",{className:"text-body font-semibold",children:"Your beads database needs a one-time upgrade"}),(0,V.jsxs)("p",{className:"m-0 text-label leading-[1.5] text-[var(--text-2)]",children:["Your ",(0,V.jsx)("span",{className:"font-mono",children:"bd"})," tool is newer than this project’s database, so writes are paused until they’re reconciled."," ",(0,V.jsx)("strong",{children:"Your data is safe and nothing has been lost."})," In a terminal, from this project folder:"]}),(0,V.jsx)(eo,{cmd:"bd export --all -o beads-backup.jsonl",note:"safety copy"}),(0,V.jsx)(eo,{cmd:"BD_ALLOW_REMOTE_MIGRATE=1 bd migrate",note:"one-time"}),(0,V.jsxs)("p",{className:"m-0 text-meta leading-[1.45] text-[var(--text-3)]",children:["Then reload. If this database is shared, run the migrate on"," ",(0,V.jsx)("strong",{children:"one machine only"})," — coordinate with anyone else using it first."]}),e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(er.W,{underline:!0,onClick:()=>n(e=>!e),className:"self-start text-meta font-medium",children:t?"Hide technical details":"Show technical details"}),t&&(0,V.jsx)("pre",{className:"m-0 max-h-[180px] overflow-auto whitespace-pre-wrap rounded-md border border-border bg-[var(--surface-2)] p-2 font-mono text-meta leading-[1.45] text-[var(--text-3)]",children:e})]})]})}function el(e){e instanceof ei.a&&"schema_migration_required"===e.code?X.c.error((0,V.jsx)(ea,{detail:e.detail}),{duration:1/0,closeButton:!0,className:"w-[420px]"}):X.c.error(e instanceof Error?e.message:"Something went wrong")}let es=G.createContext(null);function ec({value:e,children:t}){return(0,V.jsx)(es.Provider,{value:e,children:t})}function eu(){let e=G.useContext(es);if(!e)throw Error("useApp must be used within AppProvider");return e}let ed=e=>["beads",e],ef=e=>["activity",e];function ep(e){return(0,ee.f)({queryKey:ef(e),queryFn:()=>ei.k.activity(e),refetchInterval:2e4})}function eh(e,t){return(0,ee.f)({queryKey:["gamification",e],queryFn:()=>ei.k.gamification(e),enabled:t,refetchInterval:3e4})}function em(){let{projectId:e}=eu(),t=(0,et.d)(),n=ed(e);return(0,Q.f)({mutationFn:({id:t,status:n,reason:r})=>ei.k.setStatus(e,t,n,r),onMutate:async({id:e,status:r})=>{await t.cancelQueries({queryKey:n});let i=t.getQueryData(n);return t.setQueryData(n,t=>{var n;return n={status:r},t?{...t,beads:t.beads.map(t=>t.id===e?{...t,...n}:t)}:t}),{prev:i}},onError:(e,r,i)=>{i?.prev&&t.setQueryData(n,i.prev),el(e)},onSettled:()=>t.invalidateQueries({queryKey:n})})}function eg(e,t,n,r){return{mutationFn:e,onSuccess:(e,i)=>{X.c.success(t(i,e)),n.invalidateQueries({queryKey:r})},onError:e=>el(e)}}function ey(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t,patch:n})=>ei.k.update(e,t,n),()=>"Updated · bd update",t,ed(e)))}function eb(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t,dependsOnId:n,type:r})=>ei.k.addDep(e,t,n,r),()=>"Dependency added · bd dep add",t,ed(e)))}let ev=["board","focus","list","epics","graph","insights","activity","needsyou","achievements","publish","settings"],ex=[{key:"focus",label:"Focus",icon:"bolt"},{key:"board",label:"Board",icon:"board"},{key:"list",label:"List",icon:"list"},{key:"epics",label:"Epics",icon:"target"},{key:"graph",label:"Graph",icon:"graph"},{key:"insights",label:"Insights",icon:"milestone"},{key:"activity",label:"Activity",icon:"comment"},{key:"needsyou",label:"Needs You",icon:"user"},{key:"achievements",label:"Achievements",icon:"feature"},{key:"publish",label:"Publish",icon:"rocket"},{key:"settings",label:"Settings",icon:"settings"}],ew=["graph"];function ek(e){return ew.includes(e)}function e_(e,t=!1){return ex.filter(n=>("achievements"!==n.key||e)&&!(t&&ek(n.key)))}let eS="(max-width: 767px)",eE="beadscope:open-palette";function ej(e){let t=window.matchMedia(eS);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function eO(){return G.useSyncExternalStore(ej,()=>window.matchMedia(eS).matches,()=>!1)}let eN="beadscope.default-focus",eC="beadscope:default-view";function eA(e){return window.addEventListener(eC,e),window.addEventListener("storage",e),()=>{window.removeEventListener(eC,e),window.removeEventListener("storage",e)}}function eM(){try{return globalThis.localStorage?.getItem(eN)==="true"}catch{return!1}}function eP(e){localStorage.setItem(eN,String(e)),window.dispatchEvent(new Event(eC))}function eT(){return{enabled:G.useSyncExternalStore(eA,eM,()=>!1),save:eP}}function eI(){let e=(0,J.useSearchParams)(),t=G.useCallback((e,t="push")=>{let n=new URL(window.location.href);e(n);let r=`${n.pathname}${n.search}${n.hash}`;r!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&("replace"===t?window.history.replaceState(null,"",r):window.history.pushState(null,"",r))},[]),n=G.useCallback((e,n="push")=>{t(t=>e(t.searchParams),n)},[t]);return{searchParams:e,updateLocation:t,updateUrl:n}}var eD=e.i(89554);function ez(e){return e}function eR(e){return e}function eL(){return e=>e}function e$(e){}function eB(e){throw Error("Unexpected value in exhaustive check")}function eF(e){}function eU(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eH(e,t="|"){return e.map(e=>tm(e)).join(t)}function eK(e,t){return"bigint"==typeof t?t.toString():t}class eW{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function eq(e){return new eW(e)}function eZ(e){return null==e}function eV(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function eG(e,t){let n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}let eX=Symbol("evaluating");function eY(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==eX)return void 0===r&&(r=eX,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function eJ(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function eQ(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function e0(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function e1(e){return e0(e._zod.def)??e._zod.def.shape}function e2(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return eQ(this,t,e),e},enumerable:!0,configurable:!0})}function e3(e,t,n){t in e?eQ(e,t,n):e[t]=n}function e4(e,t,n,r){let i=e1(t);for(let o of n){let n=Object.getOwnPropertyDescriptor(i,o);n.enumerable&&(n.get?e2(e,o,()=>{let e=t._zod.def.shape[o];return r?r(e,o):e}):e3(e,o,r?r(n.value,o):n.value))}}function e9(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function e5(e){return e9(e._zod.def)}function e6(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function e8(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function e7(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function te(e){return JSON.stringify(e)}function tt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let tn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ti=eq(()=>{if(ne.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function to(e){if(!1===tr(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==tr(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ta(e){return to(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function tl(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}let ts=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},tc=new Set(["string","number","symbol"]),tu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function td(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tf(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function tp(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function th(e){let t;return new Proxy({},{get:(n,r,i)=>(t??(t=e()),Reflect.get(t,r,i)),set:(n,r,i,o)=>(t??(t=e()),Reflect.set(t,r,i,o)),has:(n,r)=>(t??(t=e()),Reflect.has(t,r)),deleteProperty:(n,r)=>(t??(t=e()),Reflect.deleteProperty(t,r)),ownKeys:n=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(n,r)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)),defineProperty:(n,r,i)=>(t??(t=e()),Reflect.defineProperty(t,r,i))})}function tm(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function tg(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let ty={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tv(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return e4(i,e,tx(e,t)),tf(e,e9(n,{shape:i,checks:[]}))}function tx(e,t){let n=e1(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function tw(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(tx(e,t)),o={};return e4(o,e,Reflect.ownKeys(e1(e)).filter(e=>!i.has(e))),tf(e,e9(n,{shape:o,checks:[]}))}function tk(e,t){if(!to(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e1(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return tf(e,e9(e._zod.def,{shape:t_(e,t)}))}function t_(e,t){let n={};e4(n,e,Reflect.ownKeys(e1(e)));for(let e of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,e);r.enumerable&&(r.get?e2(n,e,()=>t[e]):e3(n,e,r.value))}return n}function tS(e,t){if(!to(t))throw Error("Invalid input to safeExtend: expected a plain object");return tf(e,e9(e._zod.def,{shape:t_(e,t)}))}function tE(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};e4(n,e,Reflect.ownKeys(e1(e))),e4(n,t,Reflect.ownKeys(e1(t)));let r=e9(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return tf(e,r)}function tj(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let o=n?new Set(tx(t,n)):void 0,a={};return e4(a,t,Reflect.ownKeys(e1(t)),e&&((t,n)=>o&&!o.has(n)?t:new e({type:"optional",innerType:t}))),tf(t,e9(t._zod.def,{shape:a,checks:[]}))}function tO(e,t,n){let r=n?new Set(tx(t,n)):void 0,i={};return e4(i,t,Reflect.ownKeys(e1(t)),(t,n)=>r&&!r.has(n)?t:new e({type:"nonoptional",innerType:t})),tf(t,e9(t._zod.def,{shape:i}))}function tN(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tC(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function tA(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function tM(e){return"string"==typeof e?e:e?.message}function tP(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function tT(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function tI(e,t,n){let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:tM(e.inst?._zod.def?.error?.(e))??tM(i?.(e))??tM(t?.error?.(e))??tM(n.customError?.(e))??tM(n.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}function tD(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let tz=/[\uD800-\uDBFF]/;function tR(e){let t=e.length;if(!tz.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(64512&e.charCodeAt(r))==55296&&(64512&e.charCodeAt(r+1))==56320&&(n--,r++);return n}function tL(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function t$(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function tB(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function tF(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function tU(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function tH(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function tK(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return tU(t+n)}function tW(e){return tH(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function tq(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function tZ(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class tV{constructor(...e){}}function tG(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:tX(this,t,n.bind(this))},set(e){tX(this,t,e)}})}(e,n,r.value)}}function tX(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function tY(e,t,n){return tX(e,t,n,!1)}function tJ(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return tX(this,n,r(this))},set(e){tX(this,n,e)}})}return t}let tQ=!1,t0={configurable:!0,get(){tQ=!0}};function t1(e,n,r){let i=Object.getPrototypeOf(e._zod);if(n in i&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(i,n,{configurable:!0,get(){Object.defineProperty(this,n,t0);let e=tQ;tQ=!1;try{let t=r(this);return tQ?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t}),tQ=tQ||e,t}catch(t){throw delete this[n],tQ=tQ||e,t}},set(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})}function t2(e,t,n,r){let i,o=t in(i=Object.getPrototypeOf(e))?void 0:i;o&&Object.defineProperty(o,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}let t3="~constantCatch";function t4(e){let t=()=>e;return t[t3]=!0,t}let t9={value:void 0,enumerable:!1},t5="captureStackTrace"in Error?Error:null;function t6(e,t,n,r){function i(e){this.def=e,this.constr=c,this.traits=new Set}i.prototype={};let o=n&&new WeakSet;function a(r,a){if(r._zod){if(r._zod.traits.has(e))return}else{t9.value=new i(a);try{Object.defineProperty(r,"_zod",t9)}finally{t9.value=void 0}}if(r._zod.traits.add(e),t(r,a),o){let e=Object.getPrototypeOf(r),t=r._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;o.has(a)||(o.add(a),tG(a,n))}let l=c.prototype;for(let e in l)Object.prototype.hasOwnProperty.call(l,e)&&(e in r||(r[e]=l[e].bind(r)))}let l=r?.Parent??Object;class s extends l{}function c(e){let t=r?.Parent?function(e){let t=t5;if(t){let n=t.stackTraceLimit;if("number"==typeof n){try{t.stackTraceLimit=0}catch{return t5=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}(s):this;a(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class t8 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class t7 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(hH=globalThis).__zod_globalConfig??(hH.__zod_globalConfig={});let ne=globalThis.__zod_globalConfig;function nt(e){return e&&Object.assign(ne,e),ne}class nn extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let nr="~memo",ni=[];function no(e){return null!==e&&"object"==typeof e}function na(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let nl=new WeakMap,ns=[],nc={alloc(e,t,r){let i=n;if(!i)return r;n=void 0;let o={value:r,issues:null};return i.set(t.value,o),ns.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{var r,i;let o;if("backward"!==n.direction&&(r=n,i=e.value,void 0!==(o=r[nr]?.backEdges)&&no(i)&&o.has(i)))throw new nn;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let r,i,o,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,l=(s,c)=>{let u;if(void 0===r){let n=function e(t,n,r){var i,o;let a=nl.get(t);if(void 0!==a)return 2*!!a;if(n.has(t))return 2;n.add(t);let l=0,s=t=>{if(2!==l&&t?._zod){let i=e(t,n,r);i>l&&(l=i)}},c=e=>{e>l&&(l=e)},u=t._zod.def;switch(u.type){case"object":{let t=e0(u);c(t?((t,i)=>{let o=0;for(let a of Reflect.ownKeys(t)){let l=Object.getOwnPropertyDescriptor(t,a);if(i&&!l.enumerable)continue;let s=l.get?1:l.value?._zod?e(l.value,n,r):0;s>o&&(o=s)}return o})(t,!0):1),s(u.catchall);break}case"array":s(u.element);break;case"tuple":for(let e of u.items)s(e);s(u.rest);break;case"record":case"map":s(u.keyType),s(u.valueType);break;case"set":s(u.valueType);break;case"union":for(let e of u.options)s(e);break;case"intersection":s(u.left),s(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(u.innerType);break;case"pipe":s(u.in),s(u.out);break;case"function":s(u.input),s(u.output);break;case"lazy":{let i=u._cachedInner??(r?t._zod.innerType:void 0);c(i?e(i,n,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let n=t.value;if(n&&"object"==typeof n){if(n._zod)s(n);else if(Array.isArray(n))for(let e of n)s(e)}}}return n.delete(t),i=t,1!==(o=l)&&nl.set(i,2===o),o}(e,new Set,!1);if(0===n)return e._zod.parse=t,e._zod.run===l&&(e._zod.run=t),t(s,c);2===n||a?r=!0:a=!0}let d=s.value;if(!no(d))return t(s,c);let f=c[nr];if(f||(f={buckets:new WeakMap,backEdges:void 0},c[nr]=f),i===c)u=o;else{var p;let t;(t=(p=f).buckets.get(e))||(t=new WeakMap,p.buckets.set(e,t)),u=t,i=c,o=u}let h=u.get(d);if(h)return s.value=h.value,h.issues?h.issues.length&&s.issues.push(...na(h.issues)):(s.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(h.value)),s;n=u;let m=ns.length,g=t(s,c);n=void 0;let y=ns.length>m?ns.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?na(e.issues):ni),e)):(y&&(y.issues=g.issues.length?na(g.issues):ni),g)};e._zod.parse=l,e._zod.run===t&&(e._zod.run=l)})}};(hK=globalThis).__zod_globalRegistry??(hK.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let nu=globalThis.__zod_globalRegistry,nd=/^[cC][0-9a-z]{6,}$/,nf=/^[0-9a-z]+$/,np=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,nh=/^[0-9a-vA-V]{20}$/,nm=/^[A-Za-z0-9]{27}$/,ng=/^[a-zA-Z0-9_-]{21}$/;function ny(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let nb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nv=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nx=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,nw=nx(4),nk=nx(6),n_=nx(7),nS=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nE=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function nj(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let nO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,nC=e=>{let t=td(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},nA=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,nM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nT=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,nI=/^https?$/,nD=/^\+[1-9]\d{6,14}$/,nz=/^\d(?:[ -]?\d){11,18}$/,nR=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,nL="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",n$=RegExp(`^${nL}$`);function nB(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nF(e){return RegExp(`^${nB(e)}$`)}function nU(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${nB({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${nB({precision:e.precision})}`:n;return RegExp(`^${nL}T(?:${r})$`)}let nH=/^[\s\S]{0,}$/,nK=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},nW=/^-?\d+n?$/,nq=/^-?\d+$/,nZ=/^-?\d+(?:\.\d+)?$/,nV=/^(?:true|false)$/i,nG=/^null$/i,nX=/^undefined$/i,nY=/^[^A-Z]*$/,nJ=/^[^a-z]*$/;function nQ(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function n0(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let n1=nQ(22,"=="),n2=n0(22),n3=nQ(27,"="),n4=n0(27),n9=nQ(43,"="),n5=n0(43),n6=nQ(64,""),n8=n0(64),n7=nQ(86,"=="),re=n0(86);e.s(["anyString",0,nH,"base64",0,nP,"base64url",0,nT,"bigint",0,nW,"boolean",0,nV,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,nA,"cidrv6",0,nM,"creditCard",0,nz,"cuid",0,nd,"cuid2",0,nf,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,n$,"datetime",0,nU,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,nb,"e164",0,nD,"email",0,nS,"emoji",0,nj,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,nv,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,nI,"iban",0,nR,"idnEmail",0,nE,"integer",0,nq,"ipv4",0,nO,"ipv6",0,nN,"ksuid",0,nm,"lowercase",0,nY,"mac",0,nC,"md5_base64",0,n1,"md5_base64url",0,n2,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,ng,"nanoidOfLength",0,ny,"null",0,nG,"number",0,nZ,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,n3,"sha1_base64url",0,n4,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,n9,"sha256_base64url",0,n5,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,n6,"sha384_base64url",0,n8,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,n7,"sha512_base64url",0,re,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,nK,"time",0,nF,"ulid",0,np,"undefined",0,nX,"unicodeEmail",0,nE,"uppercase",0,nJ,"uuid",0,nx,"uuid4",0,nw,"uuid6",0,nk,"uuid7",0,n_,"xid",0,nh],82358);let rt=t6("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!eZ(t)&&void 0!==t.size},rr=e=>{let t=e.value;return!eZ(t)&&void 0!==t.length},ri={number:"number",bigint:"bigint",object:"date"},ro=t6("$ZodCheckLessThan",(e,t)=>{rt.init(e,t);let n=ri[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:ri[typeof r.value]??n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ra=t6("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);let n=ri[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ri[typeof r.value]??n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=t6("$ZodCheckMultipleOf",(e,t)=>{rt.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):0===eG(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),rs=t6("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=ty[t.format];e._zod.check=a=>{let l=a.value;if(n){if(!Number.isInteger(l))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});if(!Number.isSafeInteger(l))return void(l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),rc=t6("$ZodCheckBigIntFormat",(e,t)=>{rt.init(e,t);let[n,r]=tb[t.format];e._zod.check=i=>{let o=i.value;o<n&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>r&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),ru=t6("$ZodCheckMaxSize",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:tD(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rd=t6("$ZodCheckMinSize",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:tD(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rf=t6("$ZodCheckSizeEquals",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let o=i>t.size;n.issues.push({origin:tD(r),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rp=t6("$ZodCheckMaxLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=rr),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>t.maximum?tR(r):i)<=t.maximum)return;let o=tL(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rh=t6("$ZodCheckMinLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=rr),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>=t.minimum&&i<2*t.minimum?tR(r):i)>=t.minimum)return;let o=tL(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rm=t6("$ZodCheckLengthEquals",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=rr),e._zod.check=n=>{let r=n.value,i=r.length,o="string"==typeof r&&i>=t.length&&i<=2*t.length?tR(r):i;if(o===t.length)return;let a=tL(r),l=o>t.length;n.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rg=t6("$ZodCheckStringFormat",(e,t)=>{var n,r;rt.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ry=t6("$ZodCheckRegex",(e,t)=>{rg.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rb=t6("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nY),rg.init(e,t)}),rv=t6("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nJ),rg.init(e,t)}),rx=t6("$ZodCheckIncludes",(e,t)=>{rt.init(e,t);let n=td(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),rw=t6("$ZodCheckStartsWith",(e,t)=>{rt.init(e,t);let n=RegExp(`^${td(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),rk=t6("$ZodCheckEndsWith",(e,t)=>{rt.init(e,t);let n=RegExp(`.*${td(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function r_(e,t,n){e.issues.length&&t.issues.push(...tA(n,e.issues))}(e,t)=>{let n;rt.init(e,t),tY(e,Symbol.iterator,function*(){yield e}),e._zod.check=r=>{let i;if(null==r.value)return void r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});n??(n=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let o=r.value;for(let[e,t]of n){let n=t._zod.run({value:o[e],issues:[]},{});n instanceof Promise?(i??(i=[]),i.push(n.then(t=>r_(t,r,e)))):r_(n,r,e)}if(i)return Promise.all(i).then(()=>void 0)}},(e,t)=>{rt.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}};let rS=t6("$ZodCheckOverwrite",(e,t)=>{rt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rE{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
2
|
+
${t.join("\n")}
|
|
3
|
+
};`)(...Object.values(this.closed))}}let rj={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,eK,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},rO={value:void 0,enumerable:!1},rN=new WeakSet([Object.prototype,Error.prototype]),rC=(e,t)=>{e.name="$ZodError",rO.value=t,Object.defineProperty(e,"issues",rO),rO.value=void 0,Object.defineProperty(e,"message",rj);let n=Object.getPrototypeOf(e);rN.has(n)||(rN.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},rA=t6("$ZodError",rC),rM=t6("$ZodError",rC,void 0,{Parent:Error});function rP(e,t){return{callee:t?.callee??e,Err:t?.Err}}let rT=e=>{let t=(n,r,i,o)=>{let a=i?{...i,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},a);if(l instanceof Promise)throw new t8;if(l.issues.length){let n=new(o?.Err??e)(l.issues.map(e=>tI(e,a,nt())));throw tn(n,o?.callee??t),n}return l.value};return t},rI=rT(rM),rD=e=>{let t=async(n,r,i,o)=>{let a=i?{...i,async:!0}:{async:!0},l=n._zod.run({value:r,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){let n=new(o?.Err??e)(l.issues.map(e=>tI(e,a,nt())));throw tn(n,o?.callee??t),n}return l.value};return t},rz=rD(rM),rR=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new t8;return o.issues.length?rL(e,o.issues,i):{success:!0,data:o.value}};function rL(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>tI(e,n,nt()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let r$=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?rL(e,o.issues,i):{success:!0,data:o.value}},rB=Symbol.for("zod.compile.invalid"),rF=Symbol.for("zod.compile.fallback"),rU=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),0===i.issues.length},rH={major:4,minor:6,patch:7},rK=t6("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rH;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{let i;if(t.memo)return t;let o=tN(t);for(let a of n){if(a._zod.def.when){if(tC(t)||!a._zod.def.when(t))continue}else if(o)continue;let n=t.issues.length,l=a._zod.check(t);if(l instanceof Promise&&r?.async===!1)throw new t8;if(i||l instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await l,t.issues.length!==n&&(tT(t.issues,n,e),o||(o=tN(t,n)))});else{if(t.issues.length===n)continue;tT(t.issues,n,e),o||(o=tN(t,n))}}return i?i.then(()=>t):t},n=(n,r,o)=>{if(tN(n))return n.aborted=!0,n;let a=t(r,i,o);if(a instanceof Promise){if(!1===o.async)throw new t8;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(r,o)=>{if(o.skipChecks)return e._zod.parse(r,o);if("backward"===o.direction){let t=e._zod.parse({value:r.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,o)):n(t,r,o)}let a=e._zod.parse(r,o);if(a instanceof Promise){if(!1===o.async)throw new t8;return a.then(e=>t(e,i,o))}return t(a,i,o)}}},{get"~standard"(){return tY(this,"~standard",rZ(this))},set"~standard"(e){tX(this,"~standard",e)}}),rW=(e,t)=>e.issues.length?{issues:e.issues.map(e=>tI(e,t,nt()))}:{value:e.value};async function rq(e,t){let n={async:!0};return rW(await e._zod.run({value:t,issues:[]},n),n)}function rZ(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return rW(r,n)}catch(e){}return rq(e,t)},vendor:"zod",version:1}}let rV=t6("$ZodString",(e,t)=>{rK.init(e,t),e._zod.pattern=t.pattern??nH,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),rG=t6("$ZodStringFormat",(e,t)=>{rg.init(e,t),rV.init(e,t)}),rX=t6("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=nv),rG.init(e,t)}),rY=t6("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nx(e))}else t.pattern??(t.pattern=nx());rG.init(e,t)}),rJ=t6("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=nS),rG.init(e,t)});function rQ(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let r0=/[\t\n\r]/g;function r1(e){return e.replace(r0,"")}let r2=t6("$ZodURL",(e,t)=>{rG.init(e,t),e._zod.check=n=>{try{var r,i;let o=n.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===nI.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,t):rQ(o)||2;if(1===a)return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});if(2===a)return void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});if(!0===a){n.value=r1(o);return}t.hostname&&((r=t.hostname).lastIndex=0,!r.test(a.hostname))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?a.href:r1(o);return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),r3=t6("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=nj()),rG.init(e,t)}),r4=t6("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?ng:ny(t.length)),rG.init(e,t)}),r9=t6("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nd),rG.init(e,t)}),r5=t6("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nf),rG.init(e,t)}),r6=t6("$ZodULID",(e,t)=>{t.pattern??(t.pattern=np),rG.init(e,t)}),r8=t6("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nh),rG.init(e,t)}),r7=t6("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nm),rG.init(e,t)}),ie=t6("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nU(t)),rG.init(e,t)}),it=t6("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=n$),rG.init(e,t)}),ir=t6("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=nF(t)),rG.init(e,t)}),ii=t6("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nb),rG.init(e,t)}),io=t6("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=nO),rG.init(e,t)}),ia=/^[0-9a-fA-F:.]+$/;function il(e){return!!ia.test(e)&&rQ(`http://[${e}]`)}let is=t6("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=nN),rG.init(e,t),e._zod.check=n=>{il(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),ic=((e,t)=>{t.pattern??(t.pattern=nC(t.delimiter)),rG.init(e,t)},t6("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nA),rG.init(e,t)})),iu=t6("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=nM),rG.init(e,t),e._zod.check=n=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`===r&&!(i<0)&&!(i>128)&&il(n)}(n.value)&&n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function id(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ip=/^[0-9a-zA-Z+/]*={0,2}$/,ih=t6("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ip),rG.init(e,t),e._zod.check=n=>{id(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),im=/^[A-Za-z0-9_-]*$/,ig=t6("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=im),rG.init(e,t),e._zod.check=n=>{!function(e){if(!im.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return id(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),iy=t6("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nD),rG.init(e,t)}),ib=/[- ]/g,iv=((e,t)=>{t.pattern??(t.pattern=nz),rG.init(e,t),e._zod.check=n=>{var r;r=n.value,nz.test(r)&&function(e){let t=e.length,n=1,r=0;for(;t;){let i=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}(r.replace(ib,""))||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}},t6("$ZodJWT",(e,t)=>{rG.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),ix=((e,t)=>{rG.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}},t6("$ZodNumber",(e,t)=>{rK.init(e,t),e._zod.pattern=nZ,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}})),iw=t6("$ZodNumberFormat",(e,t)=>{rs.init(e,t),ix.init(e,t)}),ik=t6("$ZodBoolean",(e,t)=>{rK.init(e,t),e._zod.pattern=nV,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),i_=t6("$ZodBigInt",(e,t)=>{rK.init(e,t),e._zod.pattern=nW,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),iS=((e,t)=>{rc.init(e,t),i_.init(e,t)},t6("$ZodUnknown",(e,t)=>{rK.init(e,t),e._zod.parse=e=>e})),iE=t6("$ZodNever",(e,t)=>{rK.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),ij=((e,t)=>{rK.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}},t6("$ZodDate",(e,t)=>{rK.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}let i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}}));function iO(e,t){let n=tP(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,o)=>{let a=t(n.value);if(a>r&&!o?.skipChecks&&o?.direction!=="backward"){for(let[t,r]of tP(e._zod.def.checks))if(a>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,tT(n.issues,t,e),n}}return i(n,o)}}let iN=e=>Array.isArray(e)?e.length:-1,iC=e=>e instanceof Map?e.size:-1,iA=e=>e instanceof Set?e.size:-1;function iM(e,t,n){e.issues.length&&t.issues.push(...tA(n,e.issues)),t.value[n]=e.value}let iP=t6("$ZodArray",(e,t)=>{rK.init(e,t);let n=ne.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=n?n.alloc(e,r,Array(o.length),i):Array(o.length);let a=[],l=i?.abortEarly;for(let e=0;e<o.length;e++){let n=o[e],s=t.element._zod.run({value:n,issues:[]},i);if(s instanceof Promise)a.push(s.then(t=>iM(t,r,e)));else if(iM(s,r,e),l&&0!==s.issues.length&&tN(s))break}return a.length?Promise.all(a).then(()=>r):r},iO(e,iN)});function iT(e,t,n,r,i,o){let a=n in r,l="optional"===o;if(a||!l||"optional"!==i){if(e.issues.length){if(void 0!==i&&l&&!a)return;t.issues.push(...tA(n,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?(a||"defaulted"===i&&!l)&&(t.value[n]=void 0):t.value[n]=e.value}}let iI=[];function iD(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:iI,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let o=tg(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function iz(e,t,n,r,i,o,a){let l=[],s=i.keySet,c=i.catchall._zod,u=c.def.type,d=c.optin,f=c.optout,p=0;for(let i in t){if(a&&n.issues.length!==p){if(tN(n,p))break;p=n.issues.length}if(s.has(i))continue;if("__proto__"===i){"never"===u&&l.push(i);continue}if("never"===u){l.push(i);continue}let o=c.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>iT(e,n,i,t,d,f))):iT(o,n,i,t,d,f)}return(l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:o,continue:!0}),e.length)?Promise.all(e).then(()=>n):n}let iR=t6("$ZodObject",(e,t)=>{let n;rK.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),i=r?.get?r.get.raw:t.shape??{};if(i){let e=()=>{let n={...i};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let o=eq(()=>iD(t));t1(e,"propValues",e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){for(let t of(Object.prototype.hasOwnProperty.call(n,e)||eQ(n,e,new Set),r.values))n[e].add(t);void 0!==r.optin&&n[e].add(void 0)}}return n});let a=t.catchall,l=ne.memoizer;l?.attach(e),e._zod.parse=(t,r)=>{n??(n=o.value);let i=t.value;if(!tr(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=l?l.alloc(e,t,{},r):{};let s=[],c=n.shape,u=r?.abortEarly,d=t.issues.length;for(let e of n.allKeys){if(u&&t.issues.length!==d){if(tN(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let n=c[e],o=n._zod.optin,a=n._zod.optout,l=n._zod.run({value:i[e],issues:[]},r);l instanceof Promise?s.push(l.then(n=>iT(n,t,e,i,o,a))):iT(l,t,e,i,o,a)}return a?iz(s,i,t,r,o.value,e,!0===u):s.length?Promise.all(s).then(()=>t):t}}),iL=t6("$ZodObjectJIT",(e,t)=>{let n,r;iR.init(e,t);let i=e._zod.parse,o=eq(()=>iD(t)),a=ne.memoizer,l=!ne.jitless,s=l&&ti.value,c=t.catchall;e._zod.parse=(u,d)=>{r??(r=o.value);let f=u.value;return tr(f)?l&&s&&d?.async===!1&&!0!==d.jitless?(n||(n=(t=>{let n=o.value,r=n.symbolKeys,i=new rE(["payload","ctx"],{shape:t,inst:e,memo:a,syms:r}),l=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,s=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;i.write("const input = payload.value;");let c=Object.create(null),u=0;for(let e of n.allKeys)c[e]=`key_${u++}`;for(let e of(i.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),n.allKeys)){if("__proto__"===e)continue;let n=c[e],o="symbol"==typeof e?`syms[${r.indexOf(e)}]`:te(e),a=`${o} in input`,u=t[e],d=u?._zod?.optin,f=void 0!==d,p=u?._zod?.optout==="optional";if(i.write(`const ${n} = ${l(o)};`),f&&p){let e="optional"===d?`${n}_present`:`${n}.value !== undefined || ${n}_present`;i.write(`
|
|
15
|
+
const ${n}_present = ${a};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${s(n,o)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${o}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(i.write(`
|
|
26
|
+
if (${n}.issues.length) {${s(n,o)}
|
|
27
|
+
}
|
|
28
|
+
`),"defaulted"===d?i.write(`newResult[${o}] = ${n}.value;`):i.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${a}) {
|
|
30
|
+
newResult[${o}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):i.write(`
|
|
33
|
+
const ${n}_present = ${a};
|
|
34
|
+
if (${n}.issues.length) {${s(n,o)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${o}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${o}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),u=n(u,d),c)?iz([],f,u,d,r,e,d?.abortEarly===!0):u:i(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function i$(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!tN(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tI(e,r,nt())))}),t)}let iB=t6("$ZodUnion",(e,t)=>{rK.init(e,t),t1(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),t1(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),t1(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),t1(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>eV(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>i$(t,r,e,i)):i$(a,r,e,i)}});function iF(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&i.push(t);return 1===i.length?t.value=e[i[0]].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tI(e,r,nt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t}(e,t)=>{iB.init(e,t),t.inclusive=!1;let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(a.push(t),o=!0):a.push(t)}return o?Promise.all(a).then(t=>iF(t,r,e,i)):iF(a,r,e,i)}},(e,t)=>{t.inclusive=!1,iB.init(e,t);let n=e._zod.parse;t1(e,"propValues",e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);for(let[r,o]of(i[e.def.discriminator]?.has(void 0)&&n++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,r)||eQ(t,r,new Set),o))t[r].add(e)}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=e0(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=eq(()=>(function(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||0===r.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t})(t));e._zod.parse=(i,o)=>{let a=i.value;if(!tr(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let l=a?.[t.discriminator],s=r.value.get(l);return s&&(void 0!==l||"backward"!==o.direction)?s._zod.run(i,o):t.unionFallback||"backward"===o.direction?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>null!==r.value.get(e)),input:a,path:[t.discriminator],inst:e}),i)}};let iU=t6("$ZodIntersection",(e,t)=>{rK.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>iH(e,t,n)):iH(e,i,o)}});function iH(e,t,n){let r,i=new Map,o=new Map,a=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);o.has(t)||o.set(t,e),n=[t]}else r??(r=e),n=e.keys;for(let e of n)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let n of t.issues)a(n,"l")||e.issues.push(n);for(let t of n.issues)a(t,"r")||e.issues.push(t);let l=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(l.length){let t=r?l.filter(e=>r.keys.includes(e)):[];for(let n of(t.length&&e.issues.push({...r,keys:t}),l))!t.includes(n)&&o.has(n)&&e.issues.push(o.get(n))}let s=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(to(t)&&to(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,i)){if("__proto__"===r)continue;let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!s.valid){if(tN(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`)}return e.value=s.data,e}let iK=t6("$ZodTuple",(e,t)=>{rK.init(e,t);let n=t.items,r=ne.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],o):[];let l=[],s=iW(n,"optin"),c=iW(n,"optout");if(!t.rest){if(a.length<s)return i.issues.push({code:"too_small",minimum:s,inclusive:!0,input:a,inst:e,origin:"array"}),i;a.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:a,inst:e,origin:"array"})}let u=Array(n.length),d=t.rest?o?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},o);t instanceof Promise?l.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=tN(t)))}if(t.rest&&!f){let e=n.length-1,r=a.slice(n.length),s=i.issues.length;for(let n of r){if(d&&i.issues.length!==s){if(tN(i,s))break;s=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},o);r instanceof Promise?l.push(r.then(t=>iq(t,i,e))):iq(r,i,e)}}return l.length?Promise.all(l).then(()=>iZ(u,i,n,a,c)):iZ(u,i,n,a,c)}});function iW(e,t){for(let n=e.length-1;n>=0;n--)if(!("optin"===t?void 0!==e[n]._zod.optin:"optional"===e[n]._zod.optout))return n+1;return 0}function iq(e,t,n){e.issues.length&&t.issues.push(...tA(n,e.issues)),t.value[n]=e.value}function iZ(e,t,n,r,i){for(let o=0;o<n.length;o++){let a=e[o],l=o<r.length;if(!l&&o>=i&&"optional"===n[o]._zod.optin){t.value.length=o;break}if(a.issues.length){if(!l&&o>=i){t.value.length=o;break}t.issues.push(...tA(o,a.issues))}t.value[o]=a.value}for(let e=t.value.length-1;e>=r.length;e--)if("optional"===n[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}function iV(e,t,n,r,i,o,a){e.issues.length&&(tc.has(typeof r)?n.issues.push(...tA(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(e=>tI(e,a,nt()))})),t.issues.length&&(tc.has(typeof r)?n.issues.push(...tA(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(e=>tI(e,a,nt()))})),n.value.set(e.value,t.value)}function iG(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{rK.init(e,t);let n=ne.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!to(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],l=t.keyType._zod.values;if(l&&!t.partial){let s;r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of l)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(c.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>tI(e,i,nt())),input:n,path:[n],inst:e});continue}let s=l.value;if("__proto__"===s)continue;let u=t.valueType._zod.run({value:o[n],issues:[]},i);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&r.issues.push(...tA(n,e.issues)),r.value[s]=e.value})):(u.issues.length&&r.issues.push(...tA(n,u.issues)),r.value[s]=u.value)}for(let e in o)if(!c.has(e))if("loose"===t.mode){if("__proto__"===e)continue;r.value[e]=o[e]}else(s=s??[]).push(e);s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:s,continue:!0})}else{let s;for(let c of(r.value=n?n.alloc(e,r,{},i):{},Reflect.ownKeys(o))){if("__proto__"===c||!Object.prototype.propertyIsEnumerable.call(o,c))continue;let n=t.keyType._zod.run({value:c,issues:[]},i);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof c&&nZ.test(c)&&n.issues.length){let e=t.keyType._zod.run({value:Number(c),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[c]=o[c]:l?(s=s??[]).push(c):r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>tI(e,i,nt())),input:c,path:[c],inst:e});continue}let u=n.value;if("__proto__"===u)continue;let d=t.valueType._zod.run({value:o[c],issues:[]},i);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&r.issues.push(...tA(c,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...tA(c,d.issues)),r.value[u]=d.value)}s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:s,continue:!0})}return a.length?Promise.all(a).then(()=>r):r}},(e,t)=>{rK.init(e,t);let n=ne.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let l=i?.abortEarly,s=r.issues.length;for(let e of o){if(l&&r.issues.length!==s){if(tN(r,s))break;s=r.issues.length}let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?a.push(n.then(e=>iG(e,r))):iG(n,r)}return a.length?Promise.all(a).then(()=>r):r},iO(e,iA)};let iX=t6("$ZodEnum",(e,t)=>{rK.init(e,t);let n=eU(t.entries),r=new Set(n);e._zod.values=r,t1(e,"pattern",e=>{let t=eU(e.def.entries).filter(e=>tc.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>td(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),iY=((e,t)=>{rK.init(e,t);let n=new Set(t.values);e._zod.values=n,t1(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?td(e):e?td(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}},t6("$ZodTransform",(e,t)=>{rK.init(e,t),e._zod.optin="optional",ne.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new t7(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new t8;return n.value=i,n}}));function iJ(e,t){return e.value=t.issues.length?void 0:t.value,e}let iQ=t6("$ZodOptional",(e,t)=>{rK.init(e,t),t1(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",t1(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),t1(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${eV(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>iJ(e,t)):iJ(e,r)}return t.innerType._zod.run(e,n)}}),i0=t6("$ZodExactOptional",(e,t)=>{iQ.init(e,t),t1(e,"values",e=>e.def.innerType._zod.values),t1(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),i1=t6("$ZodNullable",(e,t)=>{rK.init(e,t),t1(e,"optin",e=>e.def.innerType._zod.optin),t1(e,"optout",e=>e.def.innerType._zod.optout),t1(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${eV(t.source)}|null)$`):void 0}),t1(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),i2=t6("$ZodDefault",(e,t)=>{rK.init(e,t),e._zod.optin="defaulted",t1(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>i3(e,t)):i3(r,t)}});function i3(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let i4=t6("$ZodPrefault",(e,t)=>{rK.init(e,t),e._zod.optin="defaulted",t1(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),i9=t6("$ZodNonOptional",(e,t)=>{rK.init(e,t),t1(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>i5(t,e)):i5(i,e)}});function i5(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function i6(e,t,n,r){return t.issues.length?e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>tI(e,r,nt()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{rK.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new t7("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}};let i8=t6("$ZodCatch",(e,t)=>{rK.init(e,t),t1(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),t1(e,"optout",e=>e.def.innerType._zod.optout),t1(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>i6(e,r,t,n)):i6(e,r,t,n)}}),i7=((e,t)=>{rK.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},t6("$ZodPipe",(e,t)=>{rK.init(e,t),t1(e,"values",e=>e.def.in._zod.values),t1(e,"optin",e=>e.def.in._zod.optin),t1(e,"optout",e=>e.def.out._zod.optout),t1(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>oe(e,t.in,n)):oe(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>oe(e,t.out,n)):oe(r,t.out,n)}}));function oe(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function ot(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>on(e,r,t.out,n)):on(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>on(e,r,t.in,n)):on(e,r,t.in,n)}}function on(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}(e,t)=>{rK.init(e,t),t1(e,"values",e=>e.def.in._zod.values),t1(e,"optin",e=>e.def.in._zod.optin),t1(e,"optout",e=>e.def.out._zod.optout),t1(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ot(e,t,n)):ot(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ot(e,t,n)):ot(r,t,n)}}},(e,t)=>{i7.init(e,t)};let or=t6("$ZodReadonly",(e,t)=>{rK.init(e,t),t1(e,"propValues",e=>e.def.innerType._zod.propValues),t1(e,"values",e=>e.def.innerType._zod.values),t1(e,"optin",e=>e.def.innerType?._zod?.optin),t1(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(oi):oi(r)}});function oi(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{rK.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let n=t._zod.def,r=t._zod.pattern?.source,i=n.innerType??t._zod.innerType;if(i){let t=i._zod.pattern?.source,n=e(i);return r&&t&&n&&n!==t?r.replace(eV(t),()=>eV(n)):r}if(n.options){let t=n.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>eV(e)).join("|")})$`}return function(e){let t,n,r=e._zod.def,i=r.pattern,o=!!r.format?.includes("int");for(let e of r.checks??[]){let r=e._zod.def;r.pattern&&(i=r.pattern),o||(o=!!r.format?.includes("int"));let a=r.minimum??r.length,l=r.maximum??r.length;void 0!==a&&(void 0===t||a>t)&&(t=a),void 0!==l&&(void 0===n||l<n)&&(n=l)}if(i)return i.source;if(void 0!==t&&void 0!==n&&t>n)return"(?!)";if(void 0!==t||void 0!==n)return nK({minimum:t,maximum:n}).source;let a=e._zod.pattern;return(o&&a===nZ?nq:a)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(eV(t))}else if(null===e||tu.has(typeof e))n.push(td(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)},(e,t)=>{rK.init(e,t),eY(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),t1(e,"pattern",e=>e.innerType?._zod?.pattern),t1(e,"propValues",e=>e.innerType?._zod?.propValues),t1(e,"optin",e=>e.innerType?._zod?.optin??void 0),t1(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)};let oo=t6("$ZodCustom",(e,t)=>{rt.init(e,t),rK.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>oa(t,n,r,e));oa(i,n,r,e)}});function oa(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(tB(e))}}function ol(e){return e.checks&&(e.checks=[...e.checks]),e}function os(e,t){return new ro({check:"less_than",...tp(t),value:e,inclusive:!1})}function oc(e,t){return new ro({check:"less_than",...tp(t),value:e,inclusive:!0})}function ou(e,t){return new ra({check:"greater_than",...tp(t),value:e,inclusive:!1})}function od(e,t){return new ra({check:"greater_than",...tp(t),value:e,inclusive:!0})}function of(e,t){return new rl({check:"multiple_of",...tp(t),value:e})}function op(e,t){return new rp({check:"max_length",...tp(t),maximum:e})}function oh(e,t){return new rh({check:"min_length",...tp(t),minimum:e})}function om(e,t){return new rm({check:"length_equals",...tp(t),length:e})}function og(e){return new rS({check:"overwrite",tx:e})}e.i(82358);var oy=e.i(49873),oy=oy,ob=oy,ov=oy,ox=oy,ow=oy,ok=oy,o_=oy,oS=oy,oE=oy,oj=oy,oO=oy,oN=oy,oC=oy,oA=oy,oM=oy,oP=oy;function oT(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&eQ(e,t,n[t]);return e}function oI(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??nu,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function oD(e,t,n,r,i){let o="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if("any"===o)return!1;if(void 0===o||"throw"===o)throw Error(i);return Object.assign(n,o),!0}function oz(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),oz(o,t,r),t.seen.get(o).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&oT(a.schema,s),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function oR(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function oL(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${oR(o)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+oR(o)}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle){i(n);continue}r.count>1&&"ref"===e.reused&&i(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}let o$=new Set(["type","properties","required","additionalProperties"]),oB=["oneOf","anyOf"];function oF(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function oU(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!o$.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??oF(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}eQ(n,r,1===e.length?e[0]:oU(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=oF(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function oH(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),l=n.schema;if(l.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(l)):oT(i,l),oT(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(l.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let l=t._zod.parent;if(l&&l!==a){r(l);let t=e.seen.get(l);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of o$)if(t in e)return;let n=t.filter(e=>oB.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=oB.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>oU([...o,e]));if(a.some(e=>!e))return;r={[i]:a}}else r=oU(t);r&&(delete e.allOf,oT(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}oT(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,eQ(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:oK(t,"input",e.processors),output:oK(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let oK=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=oI({...i??{},target:o,io:t,processors:n});return oz(e,a),oL(a,e),oH(a,e)},oW=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},oq=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},oZ=(e,t)=>{oW(e,"minimum",t),oq(e,"maximum",t)},oV=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},oG=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},oX=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},oY=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},oJ=(e,t)=>oW(e,"minimum",t.minimum),oQ=(e,t)=>oq(e,"maximum",t.maximum),o0=e=>(t,n)=>{oY(t,n.format);let[r,i]=e[n.format];oW(t,"minimum",r),oq(t,"maximum",i)},o1={greater_than:(e,t)=>oW(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>oq(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>oV(e,t.value),number_format:o0(ty),bigint_format:o0(tb),min_length:oJ,max_length:oQ,length_equals:(e,t)=>oZ(e,t.length),min_size:oJ,max_size:oQ,size_equals:(e,t)=>oZ(e,t.size),string_format:(e,t)=>{oY(e,t.format),t.pattern&&oG(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>oX(e,t.mime)};function o2(e){let t={},n=e._zod.def;for(let r of e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[])o1[r._zod.def.check]?.(t,r._zod.def);let r=e._zod.bag;for(let e of(void 0!==r.minimum&&oW(t,"minimum",r.minimum),void 0!==r.exclusiveMinimum&&oW(t,"exclusiveMinimum",r.exclusiveMinimum),void 0!==r.maximum&&oq(t,"maximum",r.maximum),void 0!==r.exclusiveMaximum&&oq(t,"exclusiveMaximum",r.exclusiveMaximum),void 0!==r.multipleOf&&oV(t,r.multipleOf),void 0!==r.format&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&oX(t,r.mime),r.patterns??[]))oG(t,e);return t}let o3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o4=new Map([[ip,nP],[im,nT]]),o9=e=>o4.get(e)??e;new WeakMap;let o5=Symbol();function o6(e,t,n,r,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(oD(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),o5):JSON.parse(a)}let o8=(e,t,n,r)=>{let i=e._zod.def;oz(i.innerType,t,r),t.seen.get(e).ref=i.innerType},o7=new WeakSet([Object.prototype,Error.prototype]);function ae(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let at=t6("ZodError",(e,t)=>{rA.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);o7.has(n)||(o7.add(n),ae(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){let n=e[i],a=i===e.length-1;if("_errors"===n){a&&r._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let l=r[n];a&&l._errors.push(t(o)),r=l,i++}}}};return r(e),n})(e,t)),ae(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):n[i]=o()),n[i]).push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)),ae(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eK,2)}),ae(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eK,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,at],89282);let an=rT(at),ar=rD(at),ai=rR(at),ao=r$(at),aa=(i=rT(at),o=(e,t,n,r)=>i(e,t,n?{...n,direction:"backward"}:{direction:"backward"},rP(o,r))),al=(a=rT(at),l=(e,t,n,r)=>a(e,t,n,rP(l,r))),as=(s=rD(at),c=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await s(e,t,i,rP(c,r))}),ac=(u=rD(at),d=async(e,t,n,r)=>await u(e,t,n,rP(d,r))),au=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return rR(at)(e,t,r)},ad=(e,t,n)=>rR(at)(e,t,n),af=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return r$(at)(e,t,r)},ap=async(e,t,n)=>r$(at)(e,t,n);function ah(){ne.memoizer||nt({memoizer:nc})}let am=t6("ZodType",(e,t)=>(ne.localeError||nt({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(t$(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${tm(n.values[0])}`;return`Invalid option: expected one of ${eH(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${eH(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),rK.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ob.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return tf(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new lf({type:"custom",check:"custom",fn:e,...tp(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(tB(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(tB(e)))},e(t.value,t)),(i=new rt({check:"custom",...tp(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(og(e))},optional(){return lt(this)},exactOptional(){var e;return e=this,new ln({type:"optional",innerType:e})},nullable(){return li(this)},nullish(){return lt(li(this))},nonoptional(e){var t,n;return t=this,n=e,new ll({type:"nonoptional",innerType:t,...ok.normalizeParams(n)})},array(){return a1(this)},or(e){return a9([this,e])},and(e){var t;return t=this,new a5({type:"intersection",left:t,right:e})},transform(e){return lu(this,new a7({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new lo({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():oP.shallowClone(n)}})},prefault(e){var t,n;return t=this,n=e,new la({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():oP.shallowClone(n)}})},catch(e){var t,n;return t=this,new ls({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:oy.constantCatch(n)})},pipe(e){return lu(this,e)},readonly(){var e;return e=this,new ld({type:"readonly",innerType:e})},describe(e){let t=this.clone();return nu.add(t,{description:e}),t},meta(...e){if(0===e.length)return nu.get(this);let t=this.clone();return nu.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return ov.hide(this,"~standard",{...rZ(this),jsonSchema:{input:oK(this,"input"),output:oK(this,"output")}})},set"~standard"(e){ox.own(this,"~standard",e)},parse:function e(t,n){return an(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ar(this,t,n,{callee:e})},safeParse(e,t){return ai(this,e,t)},async safeParseAsync(e,t){return ao(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ox.own(this,"spa",e)},validate(e,t){let n=this._zod.bag.validator;if(void 0!==n){if(n(e)!==rB)return!0;if(!0===n.definite&&void 0===t)return!1}return function(e,t,n){let r,i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;if(o?(i[rF]=!0,r=o({value:t,issues:[]},i)):r=e._zod.run({value:t,issues:[]},i),r instanceof Promise)throw new t8;return 0===r.issues.length}(this,e,t)},validateAsync(e,t){return rU(this,e,t)},encode:function e(t,n){return aa(this,t,n,{callee:e})},decode:function e(t,n){return al(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await as(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ac(this,t,n,{callee:e})},safeEncode(e,t){return au(this,e,t)},safeDecode(e,t){return ad(this,e,t)},async safeEncodeAsync(e,t){return af(this,e,t)},async safeDecodeAsync(e,t){return ap(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=oI({...n,processors:t});return oz(e,r),oL(r,e),oH(r,e)})(this,{})(e)},get description(){return nu.get(this)?.description},get _def(){return this._zod.def}}),ag=t6("_ZodString",(e,t)=>{rV.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:o,patterns:a,contentEncoding:l,laxFormat:s}=o2(e);if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),o&&(n.format=o3[o]??o,""===n.format&&delete n.format,("time"===o||s)&&delete n.format),l&&(n.contentEncoding=l),a&&a.size>0){let e=[...a].map(o9);1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},ow.derived({format:e=>o2(e).format??null,minLength:e=>o2(e).minimum??null,maxLength:e=>o2(e).maximum??null},{regex(...e){return this.check(function(e,t){return new ry({check:"string_format",format:"regex",...tp(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new rx({check:"string_format",format:"includes",...tp(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new rw({check:"string_format",format:"starts_with",...tp(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new rk({check:"string_format",format:"ends_with",...tp(t),suffix:e})}(...e))},min(...e){return this.check(oh(...e))},max(...e){return this.check(op(...e))},length(...e){return this.check(om(...e))},nonempty(...e){return this.check(oh(1,...e))},lowercase(e){return this.check(new rb({check:"string_format",format:"lowercase",...tp(e)}))},uppercase(e){return this.check(new rv({check:"string_format",format:"uppercase",...tp(e)}))},trim(){return this.check(og(e=>e.trim()))},normalize(...e){return this.check(function(e){return og(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(og(e=>e.toLowerCase()))},toUpperCase(){return this.check(og(e=>e.toUpperCase()))},slugify(){return this.check(og(e=>tt(e)))}})),ay=t6("ZodString",(e,t)=>{rV.init(e,t),ag.init(e,t)},{email(e){return this.check(new aS({type:"string",format:"email",check:"string_format",abort:!1,...tp(e)}))},url(e){return this.check(new aO({type:"string",format:"url",check:"string_format",abort:!1,...tp(e)}))},jwt(e){return this.check(new aU({type:"string",format:"jwt",check:"string_format",abort:!1,...tp(e)}))},emoji(e){return this.check(new aN({type:"string",format:"emoji",check:"string_format",abort:!1,...tp(e)}))},guid(e){return this.check(new aE({type:"string",format:"guid",check:"string_format",abort:!1,...tp(e)}))},uuid(e){return this.check(new aj({type:"string",format:"uuid",check:"string_format",abort:!1,...tp(e)}))},uuidv4(e){return this.check(new aj({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...tp(e)}))},uuidv6(e){return this.check(new aj({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...tp(e)}))},uuidv7(e){return this.check(new aj({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...tp(e)}))},nanoid(e){return this.check(new aC({type:"string",format:"nanoid",check:"string_format",abort:!1,...tp(e)}))},cuid(e){return this.check(new aA({type:"string",format:"cuid",check:"string_format",abort:!1,...tp(e)}))},cuid2(e){return this.check(new aM({type:"string",format:"cuid2",check:"string_format",abort:!1,...tp(e)}))},ulid(e){return this.check(new aP({type:"string",format:"ulid",check:"string_format",abort:!1,...tp(e)}))},base64(e){return this.check(new a$({type:"string",format:"base64",check:"string_format",abort:!1,...tp(e)}))},base64url(e){return this.check(new aB({type:"string",format:"base64url",check:"string_format",abort:!1,...tp(e)}))},xid(e){return this.check(new aT({type:"string",format:"xid",check:"string_format",abort:!1,...tp(e)}))},ksuid(e){return this.check(new aI({type:"string",format:"ksuid",check:"string_format",abort:!1,...tp(e)}))},ipv4(e){return this.check(new aD({type:"string",format:"ipv4",check:"string_format",abort:!1,...tp(e)}))},ipv6(e){return this.check(new az({type:"string",format:"ipv6",check:"string_format",abort:!1,...tp(e)}))},cidrv4(e){return this.check(new aR({type:"string",format:"cidrv4",check:"string_format",abort:!1,...tp(e)}))},cidrv6(e){return this.check(new aL({type:"string",format:"cidrv6",check:"string_format",abort:!1,...tp(e)}))},e164(e){return this.check(new aF({type:"string",format:"e164",check:"string_format",abort:!1,...tp(e)}))},datetime(e){return this.check(new ax({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...tp(e)}))},date(e){return this.check(new aw({type:"string",format:"date",check:"string_format",...tp(e)}))},time(e){return this.check(new ak({type:"string",format:"time",check:"string_format",precision:null,...tp(e)}))},duration(e){return this.check(new a_({type:"string",format:"duration",check:"string_format",...tp(e)}))}});function ab(e){return new ay(ol({type:"string",...tp(e)}))}let av=t6("ZodStringFormat",(e,t)=>{rG.init(e,t),ag.init(e,t)}),ax=t6("ZodISODateTime",(e,t)=>{ie.init(e,t),av.init(e,t)}),aw=t6("ZodISODate",(e,t)=>{it.init(e,t),av.init(e,t)}),ak=t6("ZodISOTime",(e,t)=>{ir.init(e,t),av.init(e,t)}),a_=t6("ZodISODuration",(e,t)=>{ii.init(e,t),av.init(e,t)}),aS=t6("ZodEmail",(e,t)=>{rJ.init(e,t),av.init(e,t)}),aE=t6("ZodGUID",(e,t)=>{rX.init(e,t),av.init(e,t)}),aj=t6("ZodUUID",(e,t)=>{rY.init(e,t),av.init(e,t)}),aO=t6("ZodURL",(e,t)=>{r2.init(e,t),av.init(e,t)}),aN=t6("ZodEmoji",(e,t)=>{r3.init(e,t),av.init(e,t)}),aC=t6("ZodNanoID",(e,t)=>{r4.init(e,t),av.init(e,t)}),aA=t6("ZodCUID",(e,t)=>{r9.init(e,t),av.init(e,t)}),aM=t6("ZodCUID2",(e,t)=>{r5.init(e,t),av.init(e,t)}),aP=t6("ZodULID",(e,t)=>{r6.init(e,t),av.init(e,t)}),aT=t6("ZodXID",(e,t)=>{r8.init(e,t),av.init(e,t)}),aI=t6("ZodKSUID",(e,t)=>{r7.init(e,t),av.init(e,t)}),aD=t6("ZodIPv4",(e,t)=>{io.init(e,t),av.init(e,t)}),az=t6("ZodIPv6",(e,t)=>{is.init(e,t),av.init(e,t)}),aR=t6("ZodCIDRv4",(e,t)=>{ic.init(e,t),av.init(e,t)}),aL=t6("ZodCIDRv6",(e,t)=>{iu.init(e,t),av.init(e,t)}),a$=t6("ZodBase64",(e,t)=>{ih.init(e,t),av.init(e,t)}),aB=t6("ZodBase64URL",(e,t)=>{ig.init(e,t),av.init(e,t)}),aF=t6("ZodE164",(e,t)=>{iy.init(e,t),av.init(e,t)}),aU=t6("ZodJWT",(e,t)=>{iv.init(e,t),av.init(e,t)}),aH=t6("ZodNumber",(e,t)=>{ix.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:l,exclusiveMinimum:s,isInt:c}=o2(e);n.type=c?"integer":"number";let u="number"==typeof s&&s>=(i??-1/0),d="number"==typeof l&&l<=(o??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;if(u?f?(n.minimum=s,n.exclusiveMinimum=!0):n.exclusiveMinimum=s:"number"==typeof i&&(n.minimum=i),d?f?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:"number"==typeof o&&(n.maximum=o),a){let i=new Set;for(let o of a)Number.isFinite(o)&&0!==o?i.add(Math.abs(o)):oD(e,t,n,r,`A multipleOf divisor of ${o} cannot be represented in JSON Schema`);let[o,...l]=i;void 0!==o&&(n.multipleOf=o),l.length&&(n.allOf=[...n.allOf??[],...l.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},ow.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=o2(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=o2(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=o2(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>o2(e).format??null},{gt(e,t){return this.check(ou(e,t))},gte(e,t){return this.check(od(e,t))},min(e,t){return this.check(od(e,t))},lt(e,t){return this.check(os(e,t))},lte(e,t){return this.check(oc(e,t))},max(e,t){return this.check(oc(e,t))},int(e){return this.check(aq(e))},safe(e){return this.check(aq(e))},positive(e){return this.check(ou(0,e))},nonnegative(e){return this.check(od(0,e))},negative(e){return this.check(os(0,e))},nonpositive(e){return this.check(oc(0,e))},multipleOf(e,t){return this.check(of(e,t))},step(e,t){return this.check(of(e,t))},finite(){return this}}));function aK(e){return new aH(ol({type:"number",checks:[],...tp(e)}))}let aW=t6("ZodNumberFormat",(e,t)=>{iw.init(e,t),aH.init(e,t)});function aq(e){return new aW({type:"number",check:"number_format",abort:!1,format:"safeint",...tp(e)})}let aZ=t6("ZodBoolean",(e,t)=>{ik.init(e,t),am.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function aV(e){return new aZ({type:"boolean",...tp(e)})}let aG=t6("ZodBigInt",(e,t)=>{i_.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{oD(e,t,n,r,"BigInt cannot be represented in JSON Schema")}},ow.derived({minValue:e=>o2(e).minimum??null,maxValue:e=>o2(e).maximum??null,format:e=>o2(e).format??null},{gte(e,t){return this.check(od(e,t))},min(e,t){return this.check(od(e,t))},gt(e,t){return this.check(ou(e,t))},lt(e,t){return this.check(os(e,t))},lte(e,t){return this.check(oc(e,t))},max(e,t){return this.check(oc(e,t))},positive(e){return this.check(ou(BigInt(0),e))},negative(e){return this.check(os(BigInt(0),e))},nonpositive(e){return this.check(oc(BigInt(0),e))},nonnegative(e){return this.check(od(BigInt(0),e))},multipleOf(e,t){return this.check(of(e,t))}})),aX=t6("ZodUnknown",(e,t)=>{iS.init(e,t),am.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function aY(){return new aX({type:"unknown"})}let aJ=t6("ZodNever",(e,t)=>{iE.init(e,t),am.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),aQ=t6("ZodDate",(e,t)=>{ij.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{oD(e,t,n,r,"Date cannot be represented in JSON Schema")},e.min=(t,n)=>e.check(od(t,n)),e.max=(t,n)=>e.check(oc(t,n))},ow.derived({minDate:e=>{let{minimum:t}=o2(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=o2(e);return t?new Date(t):null}},{})),a0=t6("ZodArray",(e,t)=>{ah(),iP.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=o2(e);"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=oz(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(oh(e,t))},nonempty(e){return this.check(oh(1,e))},max(e,t){return this.check(op(e,t))},length(e,t){return this.check(om(e,t))},unwrap(){return this.element}});function a1(e,t){return new a0({type:"array",element:e,...tp(t)})}let a2=t6("ZodObject",(e,t)=>{ah(),iL.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&oD(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},o)eQ(n.properties,e,oz(o[e],t,{...r,path:[...r.path,"properties",e]}));let a=[];for(let e of Object.keys(o)){let n=i.shape[e];("input"===t.io?void 0===function e(t){let n=t._zod.def;return"pipe"===n.type&&n.in._zod.traits.has("$ZodTransform")?e(n.out):"catch"===n.type?e(n.innerType):t._zod.optin}(n):void 0===n._zod.optout)&&a.push(e)}a.length>0&&(n.required=a),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=oz(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),oA.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return a8(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ob.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ob.mergeDefs(this._zod.def,{catchall:aY()}))},loose(){return this.clone(ob.mergeDefs(this._zod.def,{catchall:aY()}))},strict(){return this.clone(ob.mergeDefs(this._zod.def,{catchall:new aJ({type:"never",...tp(void 0)})}))},strip(){return this.clone(ob.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return o_.extend(this,e)},safeExtend(e){return oS.safeExtend(this,e)},merge(e){return oE.merge(this,e)},pick(e){return oj.pick(this,e)},omit(e){return oO.omit(this,e)},partial(...e){return oN.partial(le,this,e[0])},exactPartial(...e){return oN.partial(ln,this,e[0],"exactPartial")},required(...e){return oC.required(ll,this,e[0])}});function a3(e,t){return new a2({type:"object",shape:e??{},...ok.normalizeParams(t)})}let a4=t6("ZodUnion",(e,t)=>{iB.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{var i,o,a,l;let s,c,u;return i=e,o=t,a=n,l=r,c=!1===(s=i._zod.def).inclusive,u=s.options.map((e,t)=>oz(e,o,{...l,path:[...l.path,c?"oneOf":"anyOf",t]})),void(c?a.oneOf=u:a.anyOf=u)},e.options=t.options});function a9(e,t){return new a4({type:"union",options:e,...ok.normalizeParams(t)})}let a5=t6("ZodIntersection",(e,t)=>{iU.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,l,s;return o=oz((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=oz(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=s=[...(l=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...l(a)?a.allOf:[a]],t.intersections.push(s))}}),a6=t6("ZodEnum",(e,t)=>{iX.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=eU(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new a6({...t,checks:[],...ok.normalizeParams(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new a6({...t,checks:[],...ok.normalizeParams(r),entries:i})}});function a8(e,t){return new a6({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ok.normalizeParams(t)})}let a7=t6("ZodTransform",(e,t)=>{ah(),iY.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{oD(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new t7(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(oM.issue(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(oM.issue(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),le=t6("ZodOptional",(e,t)=>{iQ.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>o8(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lt(e){return new le({type:"optional",innerType:e})}let ln=t6("ZodExactOptional",(e,t)=>{i0.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>o8(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),lr=t6("ZodNullable",(e,t)=>{i1.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=oz((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function li(e){return new lr({type:"nullable",innerType:e})}let lo=t6("ZodDefault",(e,t)=>{i2.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return oz((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((o=o6(i.defaultValue,e,t,n,r))!==o5&&(n.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),la=t6("ZodPrefault",(e,t)=>{i4.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(oz(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=o6(i.defaultValue,e,t,n,r);o!==o5&&(n._prefault=o)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),ll=t6("ZodNonOptional",(e,t)=>{i9.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;oz((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),ls=t6("ZodCatch",(e,t)=>{i8.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;oz(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{oD(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),lc=t6("ZodPipe",(e,t)=>{i7.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(oz(a="input"===t.io?o?i.out:i.in:i.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function lu(e,t){return new lc({type:"pipe",in:e,out:t})}let ld=t6("ZodReadonly",(e,t)=>{or.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;oz((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),lf=t6("ZodCustom",(e,t)=>{oo.init(e,t),am.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{oD(e,t,n,r,"Custom types cannot be represented in JSON Schema")}});e.s(["ZodBigInt",0,aG,"ZodBoolean",0,aZ,"ZodDate",0,aQ,"ZodNumber",0,aH,"ZodString",0,ay,"array",0,a1,"boolean",0,aV,"enum",0,a8,"number",0,aK,"object",0,a3,"string",0,ab,"union",0,a9],62201),e.i(62201),e.s([],30421),e.i(30421),e.i(89282),e.s([],364),e.i(364),e.s([],58829),e.i(58829),e.s(["bigint",0,function(e){return new aG({type:"bigint",coerce:!0,...tp(e)})},"boolean",0,function(e){return new aZ({type:"boolean",coerce:!0,...tp(e)})},"date",0,function(e){return new aQ({type:"date",coerce:!0,...tp(e)})},"number",0,function(e){return new aH(ol({type:"number",coerce:!0,checks:[],...tp(e)}))},"string",0,function(e){return new ay(ol({type:"string",coerce:!0,...tp(e)}))}],13657);var lp=e.i(13657);e.s(["array",0,a1,"boolean",0,aV,"coerce",0,lp,"enum",0,a8,"number",0,aK,"object",0,a3,"string",0,ab,"union",0,a9],22219);var lh=e.i(22219),lh=lh,lm=lh,lg=lh,ly=lh,lb=lh,lv=lh,lx=lh,lw=lh;let lk=["open","in_progress","blocked","deferred","closed","pinned","hooked"],l_=["task","feature","bug","chore","epic","decision","spike","story","milestone"],lS=["blocks","parent-child","conditional-blocks","waits-for"],lE=lm.string(),lj=lm.string(),lO=lh.object({issue_id:lm.string().optional(),depends_on_id:lm.string(),type:lm.string(),created_by:lm.string().optional(),created_at:lm.string().optional()}),lN=lh.object({id:lm.string(),dependency_type:lm.string()}).transform(e=>({depends_on_id:e.id,type:e.dependency_type})),lC=lx.union([lO,lN]),lA=lh.object({id:lm.string().optional(),issue_id:lm.string().optional(),author:lm.string().default(""),text:lm.string().default(""),created_at:lm.string().optional()}),lM=lh.object({id:lm.string(),title:lm.string(),description:lm.string().optional().default(""),notes:lm.string().optional().default(""),design:lm.string().optional().default(""),acceptance_criteria:lm.string().optional().default(""),status:lE,priority:ly.coerce.number().int().min(0).max(4).default(2),issue_type:lj,assignee:lm.string().optional().default(""),owner:lm.string().optional(),created_by:lm.string().optional().default(""),created_at:lm.string().optional(),updated_at:lm.string().optional(),started_at:lm.string().optional().nullable(),closed_at:lm.string().optional().nullable(),close_reason:lm.string().optional().nullable(),labels:lb.array(lm.string()).optional().default([]),dependencies:lb.array(lC).optional().default([]),comments:lb.array(lA).optional().default([]),dependency_count:lw.number().optional(),dependent_count:lw.number().optional(),comment_count:lw.number().optional(),parent:lm.string().nullable().optional(),await_type:lm.string().optional()});function lP(e){return(e.labels??[]).includes("human")&&"closed"!==e.status&&"deferred"!==e.status}function lT(e){return"gate"===e.issue_type&&"human"===e.await_type}function lI(e,t){return lT(e)&&"closed"!==e.status&&!lG(e,t)}lb.array(lM),lh.object({title:lm.string().min(1,"Title is required").max(500),issue_type:lg.enum(l_).default("task"),priority:ly.coerce.number().int().min(0).max(4).default(2),description:lm.string().optional().default(""),assignee:lm.string().optional().default(""),labels:lb.array(lm.string()).optional().default([]),parent:lm.string().optional().default(""),backlog:lv.boolean().optional().default(!1)}),lh.object({title:lm.string().min(1).max(500).optional(),description:lm.string().optional(),status:lg.enum(lk).optional(),priority:ly.coerce.number().int().min(0).max(4).optional(),issue_type:lg.enum(l_).optional(),assignee:lm.string().optional(),labels:lb.array(lm.string()).optional(),parent:lm.string().optional()}),lh.object({text:lm.string().min(1)}),lh.object({depends_on_id:lm.string().min(1),type:lg.enum(["blocks","parent-child","conditional-blocks","waits-for","related","relates-to","discovered-from","duplicates","supersedes","caused-by","validates","tracks"]).default("blocks")});let lD=/^(\s*(?:[-*+]|\d+\.)\s+)\[([ xX])\]/gm;function lz(e){let t;if(!e)return{done:0,total:0};let n=new RegExp(lD),r=0,i=0;for(;null!==(t=n.exec(e));)i++,"x"===t[2].toLowerCase()&&r++;return{done:r,total:i}}let lR={done:"#16a34a",wip:"#d97706",blocked:"#ef4444",frozen:"#64748b",active:"#3b82f6"};function lL(e){return lR["closed"===e?"done":"in_progress"===e||"hooked"===e?"wip":"blocked"===e?"blocked":"deferred"===e||"pinned"===e?"frozen":"active"]}let l$={open:"Open",in_progress:"In progress",blocked:"Blocked",deferred:"Deferred",closed:"Closed",pinned:"Pinned",hooked:"Hooked"};function lB(e){return l$[e]??e}let lF=["#ef4444","#f97316","#eab308","#0ea5e9","#64748b"],lU=["Critical","High","Medium","Low","Backlog"];function lH(e){return lU[e]??String(e)}function lK(e){return"epic"===e?"var(--brand)":"bug"===e?"#ef4444":"var(--text-3)"}function lW(e){return e.charAt(0).toUpperCase()+e.slice(1)}let lq=["#5f50e6","#0369a1","#15803d","#b45309","#be185d","#0e7490","#6d28d9"];function lZ(e){if(!e)return"#6b7280";let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)>>>0;return lq[t%lq.length]}function lV(e){if(!e)return"?";let t=e.split(/[-_ .]/).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function lG(e,t){return"blocked"===e.status||"open"===e.status&&lX(e,t).length>0}function lX(e,t){return(e.dependencies??[]).filter(e=>"parent-child"!==e.type&&lS.includes(e.type)&&(t.get(e.depends_on_id)?.status??"open")!=="closed").map(e=>e.depends_on_id)}function lY(e,t){let n=(e.dependencies??[]).find(e=>"parent-child"===e.type);return n?t.get(n.depends_on_id)??null:null}function lJ(e){let t=new Map;for(let n of e)for(let e of n.dependencies??[])"parent-child"===e.type&&t.set(e.depends_on_id,(t.get(e.depends_on_id)??0)+1);return t}function lQ(e,t){return t.filter(t=>(t.dependencies??[]).some(t=>"parent-child"===t.type&&t.depends_on_id===e))}function l0(e,t){let n=lQ(e,t),r=n.length,i=n.filter(e=>"closed"===e.status).length;return{closed:i,total:r,pct:r?Math.round(i/r*100):0}}function l1(e,t=new Date){if(!e)return"";let n=(t.getTime()-new Date(e).getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<2592e3?`${Math.floor(n/86400)}d ago`:`${Math.floor(n/2592e3)}mo ago`}function l2(e){return e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}):""}function l3(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}var l4=e.i(93539),l9=e.i(89664),l5=e.i(77071),l6=e.i(56420);let l8=(0,l6.f)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),l7=(0,l6.f)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),se=(0,l6.f)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);function st({controlled:e,default:t,name:n,state:r="value"}){let{current:i}=G.useRef(void 0!==e),[o,a]=G.useState(t),l=G.useCallback(e=>{i||a(e)},[]);return[i?e:o,l]}var sn=e.i(33332);let sr=G.createContext(void 0);var si=e.i(28918),so=e.i(40886),sa=e.i(76782),sl=e.i(22162),ss=e.i(16856),ss=ss;let sc=G.createContext(void 0);function su(e=!0){let t=G.useContext(sc);if(void 0===t&&!e)throw Error((0,sn.f)(25));return t}let sd={type:"regular-item"};function sf(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:o,typingRef:a=o.context.typingRef,nativeButton:l,itemMetadata:s,nodeId:c}=e,u=o.useState("disabled"),d=G.useRef(null),{getButtonProps:f,buttonRef:p}=(0,so.f)({disabled:n||u,focusableWhenDisabled:!0,native:l,composite:!0}),h=function(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:o,typingRef:a,itemRef:l,itemMetadata:s}=e,{events:c}=o.useState("floatingTreeRoot"),u=o.useState("open"),d=su(!0),f=void 0!==d;return G.useMemo(()=>({id:r,role:"menuitem",tabIndex:u&&n?0:-1,onKeyDown(e){" "===e.key&&a?.current&&e.preventDefault()},onMouseMove(e){i&&c.emit("itemhover",{nodeId:i,target:e.currentTarget})},onClick(e){t&&c.emit("close",{domEvent:e,reason:ss.itemPress})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y)||f&&!sl.f.os.mac&&2===e.button)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!f||2===e.button)&&(!s||"regular-item"===s.type)&&l.current.click()}}),[t,n,r,c,i,u,o,a,l,d,f,s])}({closeOnClick:t,highlighted:r,id:i,nodeId:c,store:o,typingRef:a,itemRef:d,itemMetadata:s}),m=G.useCallback(e=>(0,sa.w)(h,{onMouseEnter(){"submenu-trigger"===s.type&&s.setActive()}},e,f),[h,f,s]),g=(0,si.A)(d,p);return G.useMemo(()=>({getItemProps:m,itemRef:g}),[m,g])}var sp=e.i(46376);let sh=G.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}}),sm=((hP={})[hP.None=0]="None",hP[hP.GuessFromOrder=1]="GuessFromOrder",hP);function sg(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:o}=e,{register:a,unregister:l,subscribeMapChange:s,elementsRef:c,labelsRef:u,nextIndexRef:d}=G.useContext(sh),f=G.useRef(-1),[p,h]=G.useState(o??(i===sm.GuessFromOrder?()=>{if(-1===f.current){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),m=G.useRef(null),g=G.useCallback(e=>{if(m.current=e,-1!==p&&null!==e&&(c.current[p]=e,u)){let n=void 0!==t;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,c,u,t,r]);return(0,sp.f)(()=>{if(null!=o)return;let e=m.current;if(e)return a(e,n),()=>{l(e)}},[o,a,l,n]),(0,sp.f)(()=>{if(null==o)return s(e=>{let t=m.current?e.get(m.current)?.index:null;null!=t&&h(t)})},[o,s,h]),{ref:g,index:p}}let sy=G.createContext(void 0);function sb(e){let t=G.useContext(sy);if(void 0===t&&!e)throw Error((0,sn.f)(36));return t}var sv=e.i(52245),sx=e.i(88015),sw=e.i(9407);let sk=((hT={}).checked="data-checked",hT.unchecked="data-unchecked",hT.disabled="data-disabled",hT.highlighted="data-highlighted",hT),s_={checked:e=>e?{[sk.checked]:""}:{[sk.unchecked]:""},...sw.T},sS=G.createContext(void 0);function sE(e){let t=G.useContext(sS);if(void 0===t&&!e)throw Error((0,sn.f)(33));return t}var sj=e.i(75606),ss=ss;let sO=G.forwardRef(function(e,t){let{render:n,className:r,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:s=!1,checked:c,defaultChecked:u,onCheckedChange:d,style:f,...p}=e,h=sg({label:o}),m=sE(!0),g=(0,sx.f)(i),{store:y}=sb(),b=y.useState("isActive",h.index),v=y.useState("itemProps"),[x,w]=st({controlled:c,default:u??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:k,itemRef:_}=sf({closeOnClick:s,disabled:l,highlighted:b,id:g,store:y,nativeButton:a,nodeId:m?.context.nodeId,itemMetadata:sd}),S=G.useMemo(()=>({disabled:l,highlighted:b,checked:x}),[l,b,x]),E=(0,sv.f)("div",e,{state:S,stateAttributesMapping:s_,props:[v,{role:"menuitemcheckbox","aria-checked":x,onClick:function(e){let t=(0,sj.f)(ss.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose(){}});d?.(!x,t),t.isCanceled||w(e=>!e)}},p,k],ref:[_,t,h.ref]});return(0,V.jsx)(sr.Provider,{value:S,children:E})});var sN=e.i(23910),sC=e.i(37584);let sA=G.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:o=!1,...a}=e,l=function(){let e=G.useContext(sr);if(void 0===e)throw Error((0,sn.f)(30));return e}(),s=G.useRef(null),{transitionStatus:c,setMounted:u}=(0,sN.f)(l.checked);(0,sC.f)({open:l.checked,ref:s,onComplete(){l.checked||u(!1)}});let d={checked:l.checked,disabled:l.disabled,highlighted:l.highlighted,transitionStatus:c};return(0,sv.f)("span",e,{state:d,ref:[t,s],stateAttributesMapping:s_,props:{"aria-hidden":!0,...a},enabled:o||l.checked})}),sM=G.createContext(void 0),sP=G.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,[a,l]=G.useState(void 0),s=(0,sv.f)("div",e,{ref:t,props:{role:"group","aria-labelledby":a,...o}});return(0,V.jsx)(sM.Provider,{value:l,children:s})}),sT=G.forwardRef(function(e,t){let{render:n,className:r,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:s=!0,style:c,...u}=e,d=sg({label:o}),f=sE(!0),p=(0,sx.f)(i),{store:h}=sb(),m=h.useState("isActive",d.index),g=h.useState("itemProps"),{getItemProps:y,itemRef:b}=sf({closeOnClick:s,disabled:l,highlighted:m,id:p,store:h,nativeButton:a,nodeId:f?.context.nodeId,itemMetadata:sd});return(0,sv.f)("div",e,{state:{disabled:l,highlighted:m},props:[g,u,y],ref:[b,t,d.ref]})});var sI=e.i(61487),sD=e.i(31157),sz=e.i(5005),sR=e.i(90098);let sL=G.createContext(void 0);var s$=e.i(73327),sB=e.i(15982);let sF={...sz.E,...sw.T},sU=G.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:o,...a}=e,{store:l}=sb(),{side:s,align:c}=sE(),u=null!=function(e){let t=G.useContext(sL);if(void 0===t&&!e)throw Error((0,sn.f)(69));return t}(!0),d=l.useState("open"),f=l.useState("transitionStatus"),p=l.useState("popupProps"),h=l.useState("mounted"),m=l.useState("instantType"),g=l.useState("activeTriggerElement"),y=l.useState("parent"),b=l.useState("lastOpenChangeReason"),v=l.useState("rootId"),x=l.useState("floatingRootContext"),w=l.useState("floatingTreeRoot"),k=l.useState("closeDelay"),_=l.useState("activeTriggerElement"),S=l.useState("hoverEnabled"),E=l.useState("disabled"),j=l.useState("openMethod"),O="context-menu"===y.type;(0,sC.f)({open:d,ref:l.context.popupRef,onComplete(){d&&l.context.onOpenChangeComplete?.(!0)}}),G.useEffect(()=>{function e(e){l.setOpen(!1,(0,sj.f)(e.reason,e.domEvent))}return w.events.on("close",e),()=>{w.events.off("close",e)}},[w.events,l]),(0,sD.f)(x,{enabled:S&&!E&&!O&&"menubar"!==y.type,closeDelay:k});let N=G.useCallback(e=>{l.set("popupElement",e)},[l]),C={transitionStatus:f,side:s,align:c,open:d,nested:"menu"===y.type,instant:m},A=(0,sv.f)("div",e,{state:C,ref:[t,l.context.popupRef,N],stateAttributesMapping:sF,props:[p,{onKeyDown(e){u&&s$.f.has(e.key)&&e.stopPropagation()}},(0,sB.f)(f),a,{"data-rootownerid":v}]}),M=void 0===y.type||O;return(g||"menubar"===y.type&&b!==sR.f.outsidePress)&&(M=!0),(0,V.jsx)(sI.f,{context:x,openInteractionType:j,modal:O,disabled:!h,returnFocus:void 0===o?M:o,initialFocus:"menu"!==y.type,restoreFocus:!0,externalTree:"menubar"!==y.type?w:void 0,previousFocusableElement:_,nextFocusableElement:void 0===y.type?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===y.type?l.context.beforeContentFocusGuardRef:void 0,children:A})});var sH=e.i(26674);let sK=G.createContext(void 0),sW=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=sb();return i.useState("mounted")||n?(0,V.jsx)(sK.Provider,{value:n,children:(0,V.jsx)(sH.r,{ref:t,...r})}):null});var sq=e.i(44394),sZ=e.i(39957),sV=e.i(46420),sG=e.i(29365),sX=e.i(88940),sY=e.i(67865);function sJ(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=(0,sY.f)(i),a=G.useRef(0),l=(0,sX.f)(s0).current,s=(0,sX.f)(sQ).current,[c,u]=G.useState(0),d=G.useRef(c),f=(0,sY.f)((e,t)=>{s.set(e,t??null),d.current+=1,u(d.current)}),p=(0,sY.f)(e=>{s.delete(e),d.current+=1,u(d.current)}),h=G.useMemo(()=>{let e=new Map;return Array.from(s.keys()).filter(e=>e.isConnected).sort(s1).forEach((t,n)=>{let r=s.get(t)??{};e.set(t,{...r,index:n})}),e},[s,c]);(0,sp.f)(()=>{if("function"!=typeof MutationObserver||0===h.size)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(d.current+=1,u(d.current))});return h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),(0,sp.f)(()=>{d.current===c&&(n.current.length!==h.size&&(n.current.length=h.size),r&&r.current.length!==h.size&&(r.current.length=h.size),a.current=h.size),o(h)},[o,h,n,r,c]),(0,sp.f)(()=>()=>{n.current=[]},[n]),(0,sp.f)(()=>()=>{r&&(r.current=[])},[r]);let m=(0,sY.f)(e=>(l.add(e),()=>{l.delete(e)}));(0,sp.f)(()=>{l.forEach(e=>e(h))},[l,h]);let g=G.useMemo(()=>({register:f,unregister:p,subscribeMapChange:m,elementsRef:n,labelsRef:r,nextIndexRef:a}),[f,p,m,n,r,a]);return(0,V.jsx)(sh.Provider,{value:g,children:t})}function sQ(){return new Map}function s0(){return new Set}function s1(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var s2=e.i(426),s3=e.i(38396),s4=ss,s9=e.i(22428),s5=e.i(60495),s6=e.i(22640),s8=e.i(89579),s7=e.i(8868),ce=e.i(45484);let ct=G.forwardRef(function(e,t){let{anchor:n,positionMethod:r="absolute",className:i,render:o,side:a,align:l,sideOffset:s=0,alignOffset:c=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:h=!1,collisionAvoidance:m=s3.B,style:g,...y}=e,{store:b}=sb(),v=function(){let e=G.useContext(sK);if(void 0===e)throw Error((0,sn.f)(32));return e}(),x=su(!0),w=b.useState("parent"),k=b.useState("floatingRootContext"),_=b.useState("floatingTreeRoot"),S=b.useState("mounted"),E=b.useState("open"),j=b.useState("modal"),O=b.useState("openMethod"),N=b.useState("activeTriggerElement"),C=b.useState("transitionStatus"),A=b.useState("positionerElement"),M=b.useState("instantType"),P=b.useState("hasViewport"),T=b.useState("lastOpenChangeReason"),I=b.useState("floatingNodeId"),D=b.useState("floatingParentNodeId"),z=k.useState("domReferenceElement"),R=G.useRef(null),L=(0,s6.f)(A,!1,!1),$=n,B=s,F=c,U=l,H=m;"context-menu"===w.type&&($=n??w.context?.anchor,U=U??"start",a||"center"===U||(F=e.alignOffset??2,B=e.sideOffset??-5));let K=a,W=U;"menu"===w.type?(K=K??"inline-end",W=W??"start",H=e.collisionAvoidance??s3.n):"menubar"===w.type&&(K=K??("vertical"===w.context.orientation?"inline-end":"bottom"),W=W??"start");let q="context-menu"===w.type,Z=(0,sG.f)({anchor:$,floatingRootContext:k,positionMethod:x?"fixed":r,mounted:S,side:K,sideOffset:B,align:W,alignOffset:F,arrowPadding:q?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:v,disableAnchorTracking:h,collisionAvoidance:H,shiftCrossAxis:q&&!("side"in H&&"flip"===H.side),externalTree:_,adaptiveOrigin:P?s5.e:void 0});G.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&b.set("hoverEnabled",!1),e.nodeId!==I&&e.parentNodeId===b.select("floatingParentNodeId")&&b.setOpen(!1,(0,sj.f)(s4.siblingOpen)))}return _.events.on("menuopenchange",e),()=>{_.events.off("menuopenchange",e)}},[b,_.events,I]),G.useEffect(()=>{if(null!=b.select("floatingParentNodeId"))return _.events.on("menuopenchange",e),()=>{_.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==b.select("floatingParentNodeId"))return;let t=e.reason??s4.siblingOpen;b.setOpen(!1,(0,sj.f)(t))}},[_.events,b]);let X=(0,sZ.e)();G.useEffect(()=>{E||X.clear()},[E,X]),G.useEffect(()=>{function e(e){if(E&&e.nodeId===b.select("floatingParentNodeId"))if(e.target&&N&&N!==e.target){let e=b.select("closeDelay");e>0?X.isStarted()||X.start(e,()=>{b.setOpen(!1,(0,sj.f)(s4.siblingOpen))}):b.setOpen(!1,(0,sj.f)(s4.siblingOpen))}else X.clear()}return _.events.on("itemhover",e),()=>{_.events.off("itemhover",e)}},[_.events,E,N,b,X]),G.useEffect(()=>{let e={open:E,nodeId:I,parentNodeId:D,reason:b.select("lastOpenChangeReason")};_.events.emit("menuopenchange",e)},[_.events,E,b,I,D]),(0,sp.f)(()=>{let e=R.current;if(z&&(R.current=z),e&&z&&z!==e){b.set("instantType",void 0);let e=new AbortController;return L(()=>{b.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[z,L,b]);let Y={open:E,side:Z.side,align:Z.align,anchorHidden:Z.anchorHidden,nested:"menu"===w.type,instant:M},J="menubar"===w.type&&w.context.modal,Q=j&&T!==s9.f.triggerHover;!function(e,t,n,r){let[i,o]=G.useState(!1);(0,sp.f)(()=>{if(!e||!t||null==n)return void o(!1);let r=(0,s7.f)(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-20)},[e,t,n]),(0,ce.f)(e&&(!t||i),r)}(E&&(J||Q),"touch"===O,A,N);let ee=(0,s8.f)(e,Y,{styles:Z.positionerStyles,transitionStatus:C,props:y,refs:[t,b.useStateSetter("positionerElement")],hidden:!S,inert:!E}),et=S&&"menu"!==w.type&&("menubar"!==w.type&&j&&T!==s9.f.triggerHover||"menubar"===w.type&&w.context.modal),en=null;return"menubar"===w.type?en=w.context.contentElement:void 0===w.type&&(en=N),(0,V.jsxs)(sS.Provider,{value:Z,children:[et&&(0,V.jsx)(s2.f,{ref:"context-menu"===w.type||"nested-context-menu"===w.type?w.context.internalBackdropRef:null,inert:(0,sq.f)(!E),cutout:en}),(0,V.jsx)(sV.s,{id:I,children:(0,V.jsx)(sJ,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,children:ee})})]})}),cn=G.createContext(void 0),cr=G.memo(G.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:o,onValueChange:a,disabled:l=!1,style:s,"aria-labelledby":c,...u}=e,[d,f]=G.useState(void 0),[p,h]=st({controlled:i,default:o,name:"MenuRadioGroup"}),m=(0,sY.f)((e,t)=>{a?.(e,t),t.isCanceled||h(e)}),g=(0,sv.f)("div",e,{state:{disabled:l},ref:t,props:{role:"group","aria-labelledby":c??d,"aria-disabled":l||void 0,...u}}),y=G.useMemo(()=>({value:p,setValue:m,disabled:l}),[p,m,l]);return(0,V.jsx)(sM.Provider,{value:f,children:(0,V.jsx)(cn.Provider,{value:y,children:g})})})),ci=G.createContext(void 0);var ss=ss;let co=G.forwardRef(function(e,t){let{render:n,className:r,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:s=!1,value:c,style:u,...d}=e,f=sg({label:o}),p=sE(!0),h=(0,sx.f)(i),{store:m}=sb(),g=m.useState("isActive",f.index),y=m.useState("itemProps"),{value:b,setValue:v,disabled:x}=function(){let e=G.useContext(cn);if(void 0===e)throw Error((0,sn.f)(34));return e}(),w=x||l,k=b===c,{getItemProps:_,itemRef:S}=sf({closeOnClick:s,disabled:w,highlighted:g,id:h,store:m,nativeButton:a,nodeId:p?.context.nodeId,itemMetadata:sd}),E=G.useMemo(()=>({disabled:w,highlighted:g,checked:k}),[w,g,k]),j=(0,sv.f)("div",e,{state:E,stateAttributesMapping:s_,props:[y,{role:"menuitemradio","aria-checked":k,onClick:function(e){v(c,(0,sj.f)(ss.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose(){}}))}},d,_],ref:[S,t,f.ref]});return(0,V.jsx)(ci.Provider,{value:E,children:j})}),ca=G.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:o=!1,...a}=e,l=function(){let e=G.useContext(ci);if(void 0===e)throw Error((0,sn.f)(35));return e}(),s=G.useRef(null),{transitionStatus:c,setMounted:u}=(0,sN.f)(l.checked);(0,sC.f)({open:l.checked,ref:s,onComplete(){l.checked||u(!1)}});let d={checked:l.checked,disabled:l.disabled,highlighted:l.highlighted,transitionStatus:c};return(0,sv.f)("span",e,{state:d,stateAttributesMapping:s_,ref:[t,s],props:{"aria-hidden":!0,...a},enabled:o||l.checked})});var cl=e.i(83977),cs=e.i(56789),cc=e.i(96499),cu=e.i(17989),cd=e.i(8445),cf=e.i(46265),cp=e.i(29315),ch=ss,cm=e.i(6304),cg=e.i(21082),cy=e.i(49055),cb=e.i(47554),cv=e.i(96296),cx=e.i(3596),cw=e.i(57940);function ck(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function c_(e,t){return ck(t,e===cy.V||e===cy.e,e===cy.b||e===cy.q)}function cS(e,t,n){return ck(t,e===cy.e,n?e===cy.b:e===cy.q)||"Enter"===e||" "===e||""===e}var cE=e.i(50527);let cj=G.createContext(null);function cO(e){let t=G.useContext(cj);if(null===t&&!e)throw Error((0,sn.f)(5));return t}var cN=e.i(72855),cC=e.i(32199),cA=e.i(36512),cM=e.i(41530),ss=ss,cP=e.i(50446),ch=ss,s4=ss,cT=e.i(68765),cI=e.i(16269),cD=e.i(1252),cz=e.i(79248),cR=e.i(16786),cL=e.i(90627);let c$={...cR.j,disabled:(0,cI.f)(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:(0,cI.f)(e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0)),openMethod:(0,cI.f)(e=>e.openMethod),allowMouseEnter:(0,cI.f)(e=>e.allowMouseEnter),highlightItemOnHover:(0,cI.f)(e=>e.highlightItemOnHover),stickIfOpen:(0,cI.f)(e=>e.stickIfOpen),parent:(0,cI.f)(e=>e.parent),rootId:(0,cI.f)(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:(0,cI.f)(e=>e.activeIndex),isActive:(0,cI.f)((e,t)=>e.activeIndex===t),hoverEnabled:(0,cI.f)(e=>e.hoverEnabled),instantType:(0,cI.f)(e=>e.instantType),lastOpenChangeReason:(0,cI.f)(e=>e.openChangeReason),floatingTreeRoot:(0,cI.f)(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:(0,cI.f)(e=>e.floatingNodeId),floatingParentNodeId:(0,cI.f)(e=>e.floatingParentNodeId),itemProps:(0,cI.f)(e=>e.itemProps),closeDelay:(0,cI.f)(e=>e.closeDelay),hasViewport:(0,cI.f)(e=>e.hasViewport),keyboardEventRelay:(0,cI.f)(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};class cB extends cD.f{constructor(e){super({...{...(0,cR.i)(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new cz.f,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:cs.w,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1},...e},{positionerRef:G.createRef(),popupRef:G.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:G.createRef(),beforeContentFocusGuardRef:G.createRef(),onOpenChangeComplete:void 0,triggerElements:new cL.f},c$),this.unsubscribeParentListener=this.observe("parent",e=>{if(this.unsubscribeParentListener?.(),"menu"===e.type){let t=e.store.select("rootId"),n=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),a=e.store.select("keyboardEventRelay");(t!==i||n!==o||r!==a)&&(t=i,n=o,r=a,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){let n=(0,sX.f)(()=>new cB(t)).current;return e??n}unsubscribeParentListener=null}var cF=e.i(64111);let cU=G.createContext(void 0);function cH(){return G.useContext(cU)}let cK=(0,cc.U)(function(e){let t,{children:n,open:r,onOpenChange:i,onOpenChangeComplete:o,defaultOpen:a=!1,disabled:l=!1,modal:s,loopFocus:c=!0,orientation:u="vertical",actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:h,defaultTriggerId:m=null,highlightItemOnHover:g=!0}=e,y=su(!0),b=sb(!0),v=cO(!0),x=cH(),w=G.useMemo(()=>x&&b?{type:"menu",store:b.store}:v?{type:"menubar",context:v}:y&&!b?{type:"context-menu",context:y}:{type:void 0},[y,b,v,x]),k=cB.useStore(p?.store,{open:a,openProp:r,activeTriggerId:m,triggerIdProp:h,parent:w});(0,cF.T)(k,r,a,m),k.useControlledProp("openProp",r),k.useControlledProp("triggerIdProp",h),k.useContextCallback("onOpenChangeComplete",o);let _=(0,cl.f)(),S=(0,cl.f)(),E=k.useState("floatingTreeRoot"),j=(0,sV.T)(E),O=(0,sV.G)(),N=k.useState("open"),C=k.useState("activeTriggerElement"),A=k.useState("positionerElement"),M=k.useState("hoverEnabled"),P=k.useState("disabled"),T=k.useState("lastOpenChangeReason"),I=k.useState("parent"),D=k.useState("activeIndex"),z=k.useState("payload"),R=k.useState("floatingParentNodeId"),L=G.useRef(null),$=G.useRef("context-menu"!==I.type),B=(0,sZ.e)(),F=G.useRef(!0),U=(0,sZ.e)(),H=null!=R,{openMethod:K,triggerProps:W}=(0,cC.$)(N);k.useSyncedValues({disabled:l,highlightItemOnHover:g,modal:void 0===I.type?s:void 0,openMethod:K,rootId:_}),(0,cF.z)(k);let{forceUnmount:q}=(0,cF.L)(N,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0})});(0,sp.f)(()=>{y&&!b?k.update({parent:{type:"context-menu",context:y},floatingNodeId:j,floatingParentNodeId:O}):b&&k.update({floatingNodeId:j,floatingParentNodeId:O})},[y,b,j,O,k]),G.useEffect(()=>{if(N||(L.current=null),"context-menu"===I.type){if(!N){B.clear(),$.current=!1;return}B.start(500,()=>{$.current=!0})}},[B,N,I.type]),(0,sp.f)(()=>{N||M||k.set("hoverEnabled",!0)},[N,M,k]);let Z=(0,sY.f)((e,t)=>{let n=t.reason;if(N===e&&t.trigger===C&&T===n)return;let r=(0,cF.x)(t);if(e||null!=t.trigger||(t.trigger=C??void 0),i?.(e,t),t.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(e,t);let o=t.event;if(!1===e&&o?.type==="click"&&"touch"===o.pointerType&&!F.current)return;e&&n===cA.f.triggerFocus?(F.current=!1,U.start(300,()=>{F.current=!0})):(F.current=!0,U.clear());let a=(n===cM.f.triggerPress||n===ss.itemPress)&&0===o.detail&&o?.isTrusted,l=!e&&(n===cP.f.escapeKey||null==n),s={open:e,openChangeReason:n};L.current=t.event??null,(0,cF.s)(s,e,t.trigger,r()),k.update(s),"menubar"===I.type&&(n===cA.f.triggerFocus||n===cm.f.focusOut||n===s9.f.triggerHover||n===ch.listNavigation||n===s4.siblingOpen)?k.set("instantType","group"):a||l?k.set("instantType",a?"click":"dismiss"):k.set("instantType",void 0)}),X=(0,cE.f)({popupStore:k,floatingId:S,nested:null!=O,onOpenChange:Z}),Y=X.context.events;G.useEffect(()=>{let e=({open:e,eventDetails:t})=>Z(e,t);return Y.on("setOpen",e),()=>{Y?.off("setOpen",e)}},[Y,Z]);let J=G.useCallback(()=>{k.setOpen(!1,(0,sj.f)(cT.f.imperativeAction))},[k]);G.useImperativeHandle(d,()=>({unmount:q,close:J}),[q,J]),"context-menu"===I.type&&(t=I.context),G.useImperativeHandle(t?.positionerRef,()=>A,[A]),G.useImperativeHandle(t?.actionsRef,()=>({setOpen:Z}),[Z]);let Q=(0,cu.f)(X,{enabled:!P,bubbles:{escapeKey:f&&"menu"===I.type},outsidePress:()=>"context-menu"!==I.type||L.current?.type==="contextmenu"||$.current,externalTree:H?E:void 0}),ee=(0,cN.f)(),et=G.useCallback(e=>{k.select("activeIndex")!==e&&k.set("activeIndex",e)},[k]),en=function(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:o=!0,selectedIndex:a=null,allowEscape:l=!1,loopFocus:s=!1,nested:c=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f="auto",focusItemOnHover:p=!0,openOnArrowKeyDown:h=!0,disabledIndices:m,orientation:g="vertical",parentOrientation:y,id:b,resetOnPointerLeave:v=!0,externalTree:x,grid:w}=t,k=null!=w,_="rootStore"in e?e.rootStore:e,S=_.useState("open"),E=_.useState("floatingElement"),j=_.useState("domReferenceElement"),O=_.context.dataRef,N=(0,cv.G)(E),C=(0,cv.J)(j),A=(0,cf.f)(N),M=(0,sV.G)(),P=(0,sV.$)(x),T=G.useRef(f),I=G.useRef(a??-1),D=G.useRef(null),z=G.useRef(!0),R=(0,sY.f)(e=>{i(-1===I.current?null:I.current,e)}),L=G.useRef(!!E),$=G.useRef(S),B=G.useRef(!1),F=G.useRef(!1),U=G.useRef(null),H=(0,cf.f)(m),K=(0,cf.f)(S),W=(0,cf.f)(a),q=(0,cf.f)(v),Z=(0,cd.z)(),V=(0,cd.z)(),X=(0,sY.f)(()=>{function e(e){d?P?.events.emit("virtualfocus",e):U.current=(0,cx.f)(e,{sync:B.current,preventScroll:!0})}let t=n.current[I.current],r=F.current;t&&e(t),(B.current?e=>e():e=>Z.request(e))(()=>{let i=n.current[I.current]||t;!i||(t||e(i),en&&(r||!z.current)&&i.scrollIntoView?.({block:"nearest",inline:"nearest"}))})});(0,sp.f)(()=>{O.current.orientation=g},[O,g]),(0,sp.f)(()=>{o&&(S&&E?(I.current=a??-1,T.current&&null!=a&&(F.current=!0,R())):L.current&&(I.current=-1,R()))},[o,S,E,a,R]),(0,sp.f)(()=>{if(o){if(!S){B.current=!1;return}if(E)if(null==r){if(B.current=!1,null!=W.current)return;if(L.current&&(I.current=-1,X()),(!$.current||!L.current)&&T.current&&(null!=D.current||!0===T.current&&null==D.current)){let e=0,t=()=>{null==n.current[0]?(e<2&&(e?e=>V.request(e):queueMicrotask)(t),e+=1):(I.current=null==D.current||cS(D.current,g,u)||c?(0,cg.J)(n):(0,cg._)(n),D.current=null,R())};t()}}else(0,cg.c)(n.current,r)||(I.current=r,X(),F.current=!1)}},[o,S,E,r,W,c,n,g,u,R,X,V]),(0,sp.f)(()=>{if(!o||E||!P||d||!L.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=(0,cb.T)((0,s7.f)(j??t??null)),r=e.some(e=>e.context&&(0,cb.I)(e.context.elements.floating,n));t&&!r&&z.current&&t.focus({preventScroll:!0})},[o,E,j,P,M,d]),(0,sp.f)(()=>{$.current=S,L.current=!!E}),(0,sp.f)(()=>{S||(D.current=null,T.current=f)},[S,f]);let Y=null!=r,J=(0,sY.f)(e=>{if(!K.current)return;let t=n.current.indexOf(e.currentTarget);-1!==t&&(I.current!==t||r!==t)&&(I.current=t,R(e))}),Q=(0,sY.f)(()=>y??P?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),ee=(0,sY.f)(()=>(0,cg.J)(n,H.current)),et=(0,sY.f)(e=>{var t;let r,i;if(z.current=!1,B.current=!0,229===e.which||!K.current&&e.currentTarget===A.current)return;if(c&&(t=e.key,r=u?t===cy.q:t===cy.b,i=t===cy.V,"both"===g||"horizontal"===g&&k?"Escape"===t:ck(g,r,i))){c_(e.key,Q())||(0,cw.Y)(e),_.setOpen(!1,(0,sj.f)(ch.listNavigation,e.nativeEvent)),(0,cp.E)(j)&&(d?P?.events.emit("virtualfocus",j):j.focus());return}let o=I.current,a=(0,cg.J)(n,m),f=(0,cg._)(n,m);if(C||("Home"===e.key&&((0,cw.Y)(e),I.current=a,R(e)),"End"===e.key&&((0,cw.Y)(e),I.current=f,R(e))),null!=w){let t=w(e,I.current,n,g,s,u,m,a,f);if(null!=t&&(I.current=t,R(e)),"both"===g)return}if(c_(e.key,g)){if((0,cw.Y)(e),S&&!d&&(0,cb.T)(e.currentTarget.ownerDocument)===e.currentTarget){I.current=cS(e.key,g,u)?a:f,R(e);return}cS(e.key,g,u)?s?o>=f?l&&o!==n.current.length?I.current=-1:(B.current=!1,I.current=a):I.current=(0,cg.e)(n.current,{startingIndex:o,disabledIndices:m}):I.current=Math.min(f,(0,cg.e)(n.current,{startingIndex:o,disabledIndices:m})):s?o<=a?l&&-1!==o?I.current=n.current.length:(B.current=!1,I.current=f):I.current=(0,cg.e)(n.current,{startingIndex:o,decrement:!0,disabledIndices:m}):I.current=Math.max(a,(0,cg.e)(n.current,{startingIndex:o,decrement:!0,disabledIndices:m})),(0,cg.c)(n.current,I.current)&&(I.current=-1),R(e)}}),en=G.useMemo(()=>({onFocus(e){B.current=!0,J(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){B.current=!0,F.current=!1,p&&J(e)},onPointerLeave(e){if(!K.current||!z.current||"touch"===e.pointerType)return;B.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&q.current&&(U.current?.(),U.current=null,I.current=-1,R(e),!d)){let e=A.current,t=(0,cb.T)((0,s7.f)(e));e&&(0,cb.I)(e,t)&&e.focus({preventScroll:!0})}}}),[J,K,A,p,n,R,q,d]),er=G.useMemo(()=>d&&S&&Y&&{"aria-activedescendant":`${b}-${r}`},[d,S,Y,b,r]),ei=G.useMemo(()=>({"aria-orientation":"both"===g?void 0:g,...!C?er:{},onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&S&&!d){let t=(0,cb.Z)(e.nativeEvent);if(t&&!(0,cb.I)(A.current,t))return;(0,cw.Y)(e),_.setOpen(!1,(0,sj.f)(cm.f.focusOut,e.nativeEvent)),(0,cp.E)(j)&&j.focus();return}et(e)},onPointerMove(){z.current=!0}}),[er,et,A,g,C,_,S,d,j]),eo=G.useMemo(()=>{function e(e){_.setOpen(!0,(0,sj.f)(ch.listNavigation,e.nativeEvent,e.currentTarget))}function t(e){"auto"===f&&(0,cw.E)(e.nativeEvent)&&(T.current=!d)}function n(e){T.current=f,"auto"===f&&(0,cw.$)(e.nativeEvent)&&(T.current=!0)}return{onKeyDown(t){var n,r;let i=_.select("open");z.current=!1;let o=t.key.startsWith("Arrow"),a=(n=t.key,r=Q(),ck(r,u?n===cy.b:n===cy.q,n===cy.e)),l=c_(t.key,g),s=(c?a:l)||"Enter"===t.key||""===t.key.trim();if(d&&i)return et(t);if(i||h||!o){if(s){let e=c_(t.key,Q());D.current=c&&e?null:t.key}if(c){a&&((0,cw.Y)(t),i?(I.current=ee(),R(t)):e(t));return}l&&(null!=W.current&&(I.current=W.current),(0,cw.Y)(t),!i&&h?e(t):et(t),i&&R(t))}},onFocus(e){_.select("open")&&!d&&(I.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[et,f,ee,c,R,_,h,g,Q,u,W,d]),ea=G.useMemo(()=>({...er,...eo}),[er,eo]);return G.useMemo(()=>o?{reference:ea,floating:ei,item:en,trigger:eo}:{},[o,ea,ei,eo,en])}(X,{enabled:!P,listRef:k.context.itemDomElements,activeIndex:D,nested:void 0!==I.type,loopFocus:c,orientation:u,parentOrientation:"menubar"===I.type?I.context.orientation:void 0,rtl:"rtl"===ee,disabledIndices:cs.v,onNavigate:et,openOnArrowKeyDown:"context-menu"!==I.type,externalTree:H?E:void 0,focusItemOnHover:g}),er=G.useCallback(e=>{k.context.typingRef.current=e},[k]),ei=function(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:o,disabledIndices:a,onTyping:l,enabled:s=!0,resetMs:c=750,selectedIndex:u=null}=t,d="rootStore"in e?e.rootStore:e,f=d.useState("open"),p=(0,sZ.e)(),h=G.useRef(""),m=G.useRef(u??i??-1),g=G.useRef(null),y=(0,sY.f)(e=>{function t(e){let t;return!!(!(t=r?.current[e])||(0,cg.v)(t))&&(null==a||!(0,cg.K)(cs.v,e,a))}function s(e,n,r=0){if(0===e.length)return -1;let i=(r%e.length+e.length)%e.length,o=n.toLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length,a=e[r];if(a?.toLowerCase().startsWith(o)&&t(r))return r}return -1}let d=n.current;if(h.current.length>0&&" "===e.key&&((0,cw.Y)(e),l?.(!0)),h.current.length>0&&" "!==h.current[0]&&-1===s(d,h.current)&&" "!==e.key&&l?.(!1),null==d||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;f&&" "!==e.key&&((0,cw.Y)(e),l?.(!0));let y=""===h.current;y&&(m.current=u??i??-1),d.every((e,n)=>!(e&&t(n))||e[0]?.toLowerCase()!==e[1]?.toLowerCase())&&h.current===e.key&&(h.current="",m.current=g.current),h.current+=e.key,p.start(c,()=>{h.current="",m.current=g.current,l?.(!1)});let b=y?u??i??-1:m.current,v=s(d,h.current,(b??0)+1);-1!==v?(o?.(v),g.current=v):" "!==e.key&&(h.current="",l?.(!1))}),b=(0,sY.f)(e=>{let t=e.relatedTarget,n=d.select("domReferenceElement"),r=d.select("floatingElement");(0,cb.I)(n,t)||(0,cb.I)(r,t)||(p.clear(),h.current="",m.current=g.current,l?.(!1))});(0,sp.f)(()=>{(f||null===u)&&(p.clear(),g.current=null,""!==h.current&&(h.current=""))},[f,u,p]),(0,sp.f)(()=>{f&&""===h.current&&(m.current=u??i??-1)},[f,u,i]);let v=G.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return G.useMemo(()=>s?{reference:v,floating:v}:{},[s,v])}(X,{enabled:!P,listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:D,resetMs:s3.g,onMatch:e=>{N&&e!==D&&k.set("activeIndex",e)},onTyping:er}),eo=G.useMemo(()=>{let e=(0,sa.w)(ei.reference,en.reference,Q.reference,{onMouseMove(){k.set("allowMouseEnter",!0)}},W);return e["aria-haspopup"]="menu",e["aria-expanded"]=N,e},[k,ei.reference,en.reference,Q.reference,W,N]),ea=G.useMemo(()=>{let e=(0,sa.w)(en.trigger,Q.trigger,W);return e["aria-haspopup"]="menu",e["aria-expanded"]=!1,e},[en.trigger,Q.trigger,W]),el=G.useMemo(()=>(0,sa.w)(cF.X,{id:S,role:"menu","aria-labelledby":C?.id,onMouseMove(){k.set("allowMouseEnter",!0),"menu"===I.type&&k.set("hoverEnabled",!1)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(e){let t=k.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}},ei.floating,en.floating,Q.floating),[C,S,I.type,k,ei.floating,en.floating,Q.floating]),es=en.item??cs.w;(0,cF.y)(k,{floatingRootContext:X,activeTriggerProps:eo,inactiveTriggerProps:ea,popupProps:el,itemProps:es});let ec=G.useMemo(()=>({store:k,parent:w}),[k,w]),eu=(0,V.jsx)(sy.Provider,{value:ec,children:"function"==typeof n?n({payload:z}):n});return void 0===I.type||"context-menu"===I.type?(0,V.jsx)(sV.V,{externalTree:E,children:eu}):eu});var cW=e.i(50316),cq=e.i(85689),cZ=e.i(13082),cV=e.i(72135),cG=e.i(33848),cX=e.i(70189),cY=e.i(38452);function cJ(e){let{render:t,className:n,style:r,state:i=cs.w,props:o=cs.v,refs:a=cs.v,metadata:l,stateAttributesMapping:s,tag:c="div",...u}=e,{compositeProps:d,compositeRef:f}=function(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=(0,cY.f)(),{ref:i,index:o}=sg(e),a=n===o,l=G.useRef(null),s=(0,si.A)(i,l);return{compositeProps:{tabIndex:a?0:-1,onFocus(){r(o)},onMouseMove(){let e=l.current;if(!t||!e)return;let n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;a||n||e.focus()}},compositeRef:s,index:o}}({metadata:l});return(0,sv.f)(c,e,{state:i,ref:[...a,f],props:[d,...o,u],stateAttributesMapping:s})}var cQ=e.i(74080),c0=e.i(83976),c1=ss,c2=e.i(52535);let c3=(0,cc.u)(function(e,t){let n,r,i,o,{render:a,className:l,style:s,disabled:c=!1,nativeButton:u=!0,id:d,openOnHover:f,delay:p=100,closeDelay:h=0,handle:m,payload:g,...y}=e,b=sb(!0),v=m?.store??b?.store;if(!v)throw Error((0,sn.f)(85));let x=(0,sx.f)(d),w=v.useState("isTriggerActive",x),k=v.useState("floatingRootContext"),_=v.useState("isOpenedByTrigger",x),S=v.useState("triggerPopupId",x),E=G.useRef(null),j=(n=su(!0),r=sb(!0),i=cO(!0),G.useMemo(()=>i?{type:"menubar",context:i}:n&&!r?{type:"context-menu",context:n}:{type:void 0},[n,r,i])),O=(0,cY.f)(!0),N=(0,sV.$)(),C=G.useMemo(()=>N??new cz.f,[N]),A=(0,sV.T)(C),M=(0,sV.G)(),{registerTrigger:P,isMountedByThisTrigger:T}=(0,cF.F)(x,E,v,{payload:g,closeDelay:h,parent:j,floatingTreeRoot:C,floatingNodeId:A,floatingParentNodeId:M,keyboardEventRelay:O?.relayKeyboardEvent}),I="menubar"===j.type,D=v.useState("disabled"),z=c||D||I&&j.context.disabled,{getButtonProps:R,buttonRef:L}=(0,so.f)({disabled:z,native:u});G.useEffect(()=>{_||void 0!==j.type||(v.context.allowMouseUpTriggerRef.current=!1)},[v,_,j.type]);let $=G.useRef(null),B=(0,sZ.e)(),F=(0,sY.f)(e=>{if(!$.current)return;B.clear(),v.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if((0,cb.I)($.current,t)||(0,cb.I)(v.select("positionerElement"),t)||t===$.current||null!=t&&function e(t){return(0,cp.E)(t)&&t.hasAttribute("data-rootownerid")?t.getAttribute("data-rootownerid")??void 0:(0,cp.Z)(t)?void 0:e((0,cp.J)(t))}(t)===v.select("rootId"))return;let n=function(e){let t=e.getBoundingClientRect(),n=(0,cG.f)(e);if(cX.f.env.jsdom)return t;let r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if("none"===r.content&&"none"===i.content)return t;let o=parseFloat(r.width)||0,a=parseFloat(r.height)||0,l=parseFloat(i.width)||0,s=parseFloat(i.height)||0,c=Math.max(t.width,o,l),u=Math.max(t.height,a,s),d=c-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}($.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||C.events.emit("close",{domEvent:e,reason:c1.cancelOpen})});G.useEffect(()=>{_&&v.select("lastOpenChangeReason")===s9.f.triggerHover&&(0,s7.f)($.current).addEventListener("mouseup",F,{once:!0})},[_,F,v]);let U=I&&j.context.hasSubmenuOpen,H=f??U,K=(0,cV.f)(k,{enabled:H&&!z&&"context-menu"!==j.type&&(!I||U&&!T),handleClose:(0,cW.f)({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:void 0===j.type?p:void 0,delay:{close:h},triggerElementRef:E,externalTree:C,isActiveTrigger:w,isClosing:()=>"ending"===v.select("transitionStatus")}),W=function(e,t){let n=(0,sZ.e)(),[r,i]=G.useState(!1);return(0,sp.f)(()=>{e&&"trigger-hover"===t?(i(!0),n.start(s3.K,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}(_,v.select("lastOpenChangeReason")),q=(0,cq.f)(k,{enabled:!z&&"context-menu"!==j.type,event:_&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===j.type&&W}),Z=(0,cZ.f)(k,{enabled:!z&&U}),X=function(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=G.useRef(!1);return G.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!r||"close"===n&&r)&&(i.current=!0,(0,s7.f)(e.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:cs.w,[t,n,r])}({open:_,enabled:I,mouseDownAction:"open"}),Y=G.useMemo(()=>(0,sa.w)(Z.reference,q.reference),[Z.reference,q.reference]),J=v.useState("triggerProps",T),{preFocusGuardRef:Q,handlePreFocusGuardFocus:ee,handleFocusTargetFocus:et}={preFocusGuardRef:o=G.useRef(null),handlePreFocusGuardFocus:function(e){cQ.flushSync(()=>{v.setOpen(!1,(0,sj.f)(cm.f.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,c0.E)(o.current);t?.focus()},handleFocusTargetFocus:function(e){let t=v.select("positionerElement");if(t&&(0,c0.A)(e,t))v.context.beforeContentFocusGuardRef.current?.focus();else{cQ.flushSync(()=>{v.setOpen(!1,(0,sj.f)(cm.f.focusOut,e.nativeEvent,e.currentTarget))});let n=(0,c0.W)(v.context.triggerFocusTargetRef.current||E.current);for(;null!==n&&(0,cb.I)(t,n);){let e=n;if((n=(0,c0.O)(n))===e)break}n?.focus()}}},en={disabled:z,open:_},er=[$,t,L,P,E],ei=[Y,K??cs.w,J,{"aria-haspopup":"menu","aria-controls":S,id:x,onMouseDown:e=>{v.select("open")||(B.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),(0,s7.f)(e.currentTarget).addEventListener("mouseup",F,{once:!0}))}},I?{role:"menuitem"}:{},X,y,R],eo=(0,sv.f)("button",e,{enabled:!I,stateAttributesMapping:sz.f,state:en,ref:er,props:ei});return I?(0,V.jsx)(cJ,{tag:"button",render:a,className:l,style:s,state:en,refs:er,props:ei,stateAttributesMapping:sz.f}):_?(0,V.jsxs)(G.Fragment,{children:[(0,V.jsx)(c2.f,{ref:Q,onFocus:ee},`${x}-pre-focus-guard`),(0,V.jsx)(G.Fragment,{children:eo},x),(0,V.jsx)(c2.f,{ref:v.context.triggerFocusTargetRef,onFocus:et},`${x}-post-focus-guard`)]}):(0,V.jsx)(G.Fragment,{children:eo},x)}),c4=G.forwardRef(function(e,t){let{className:n,render:r,orientation:i="horizontal",style:o,...a}=e;return(0,sv.f)("div",e,{state:{orientation:i},ref:t,props:[{role:"separator","aria-orientation":i},a]})}),c9=G.forwardRef(function(e,t){let{render:n,className:r,style:i,label:o,id:a,nativeButton:l=!1,openOnHover:s=!0,delay:c=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=sg({label:o}),h=sE(),{store:m}=sb(),g=(0,sx.f)(a),y=m.useState("open"),b=m.useState("floatingRootContext"),v=m.useState("floatingTreeRoot"),x=m.useState("triggerPopupId",g),w=(0,cF.w)(g,m),k=G.useCallback(e=>{let t=w(e);return null!==e&&m.select("open")&&null==m.select("activeTriggerId")&&m.update({activeTriggerId:g,activeTriggerElement:e,closeDelay:u}),t},[w,u,m,g]),_=G.useRef(null),S=G.useCallback(e=>{_.current=e,m.set("activeTriggerElement",e)},[m]),E=cH();if(!E?.parentMenu)throw Error((0,sn.f)(37));m.useSyncedValue("closeDelay",u);let j=E.parentMenu,O=m.useState("disabled"),N=j.useState("disabled"),C=d||O||N,A=j.useState("itemProps"),M=j.useState("isActive",p.index),P=G.useMemo(()=>({type:"submenu-trigger",setActive(){j.select("highlightItemOnHover")&&j.set("activeIndex",p.index)}}),[j,p.index]),{getItemProps:T,itemRef:I}=sf({closeOnClick:!1,disabled:C,highlighted:M,id:g,store:m,typingRef:j.context.typingRef,nativeButton:l,itemMetadata:P,nodeId:h?.context.nodeId}),D=m.useState("hoverEnabled"),z=(0,cV.f)(b,{enabled:D&&s&&!C,handleClose:(0,cW.f)({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:{open:c,close:u},shouldOpen:c>0?()=>j.select("allowMouseEnter"):void 0,triggerElementRef:_,externalTree:v,isClosing:()=>"ending"===m.select("transitionStatus")}),R=(0,cq.f)(b,{enabled:!C,event:"mousedown",toggle:!s,ignoreMouse:s,stickIfOpen:!1}).reference??cs.w,L=m.useState("triggerProps",!0);return delete L.id,(0,sv.f)("div",e,{state:{disabled:C,highlighted:M,open:y},stateAttributesMapping:sz.J,props:[R,z,L,A,{"aria-controls":x,tabIndex:y||M?0:-1,onBlur(){M&&j.set("activeIndex",null)}},f,T],ref:[t,p.ref,I,k,S]})});e.s(["CheckboxItem",0,sO,"CheckboxItemIndicator",0,sA,"Group",0,sP,"Item",0,sT,"Popup",0,sU,"Portal",0,sW,"Positioner",0,ct,"RadioGroup",0,cr,"RadioItem",0,co,"RadioItemIndicator",0,ca,"Root",0,cK,"Separator",0,c4,"SubmenuRoot",0,function(e){let t=sb().store,n=G.useMemo(()=>({parentMenu:t}),[t]);return(0,V.jsx)(cU.Provider,{value:n,children:(0,V.jsx)(cK,{...e})})},"SubmenuTrigger",0,c9,"Trigger",0,c3],60948);var c5=e.i(60948),c5=c5,c6=c5,c8=c5,c7=c5,ue=c5,ut=c5,un=c5,ur=c5,ui=c5,uo=e.i(47163);(0,l6.f)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var ua=e.i(43957),ua=ua;function ul({...e}){return(0,V.jsx)(c5.Root,{"data-slot":"dropdown-menu",...e})}function us({...e}){return(0,V.jsx)(c8.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function uc({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...o}){return(0,V.jsx)(c6.Portal,{children:(0,V.jsx)(c7.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:(0,V.jsx)(ue.Popup,{"data-slot":"dropdown-menu-content",className:(0,uo.f)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...o})})})}function uu({className:e,inset:t,...n}){return(0,V.jsx)("div",{"data-slot":"dropdown-menu-label","data-inset":t,className:(0,uo.f)("px-1.5 py-1 text-label font-medium text-muted-foreground data-inset:pl-7",e),...n})}function ud({className:e,inset:t,variant:n="default",...r}){return(0,V.jsx)(ut.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:(0,uo.f)("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 max-md:min-h-11 rounded-md px-1.5 py-1 text-body outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function uf({className:e,children:t,checked:n,inset:r,...i}){return(0,V.jsxs)(un.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:(0,uo.f)("relative flex cursor-default items-center gap-1.5 max-md:min-h-11 rounded-md py-1 pr-8 pl-1.5 text-body outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...i,children:[(0,V.jsx)("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:(0,V.jsx)(ur.CheckboxItemIndicator,{children:(0,V.jsx)(ua.f,{})})}),t]})}function up({className:e,...t}){return(0,V.jsx)(ui.Separator,{"data-slot":"dropdown-menu-separator",className:(0,uo.f)("-mx-1 my-1 h-px bg-border",e),...t})}var uh=e.i(89258),um=e.i(8014),ug=e.i(30374);let uy="Beadscope";var ub=e.i(89541);function uv({project:e,currentProjectId:t,onOpenChange:n}){return(0,V.jsx)(ug.N,{open:!!e,onOpenChange:n,children:(0,V.jsx)(ug.d,{className:"w-[420px] max-w-[100%] gap-0 rounded-2xl border border-border bg-[var(--surface)] p-0 shadow-[var(--shadow-lg)]",children:e&&(0,V.jsx)(ux,{project:e,currentProjectId:t,onClose:()=>n(!1)},e.id)})})}function ux({project:e,currentProjectId:t,onClose:n}){let r=(0,J.useRouter)(),i=(0,et.d)(),[o,a]=G.useState(e.name),[l,s]=G.useState(null),c=(0,Q.f)({mutationFn:t=>ei.k.projects.rename(e.id,t),onSuccess:o=>{if(i.invalidateQueries({queryKey:["projects"]}),e.id===t){let e;document.title=(e=o.name.trim())?`${e} | ${uy}`:uy,r.refresh()}X.c.success(`Renamed to ${o.name}`),n()},onError:e=>s(e.message)});return(0,V.jsxs)("form",{onSubmit:t=>{t.preventDefault();let r=o.trim();r?r===e.name?n():(s(null),c.mutate(r)):s("Enter a name for the project.")},noValidate:!0,className:"flex flex-col",children:[(0,V.jsxs)("div",{className:"border-b border-border p-[17px_20px]",children:[(0,V.jsx)(ug.F,{className:"text-section font-semibold",children:"Rename project"}),(0,V.jsx)(ug.C,{className:"text-meta text-[var(--text-3)]",children:"Only the name changes; the project's address stays the same."})]}),(0,V.jsxs)("div",{className:"flex flex-col gap-2 p-[16px_20px]",children:[(0,V.jsx)(er.C,{autoFocus:!0,value:o,onChange:e=>{a(e.target.value),s(null)},"aria-label":"Project name","aria-invalid":!!l||void 0,"aria-describedby":l?"rename-project-error":void 0,autoComplete:"off",spellCheck:!1}),l&&(0,V.jsx)("p",{id:"rename-project-error",role:"alert",className:"text-label text-destructive",children:l})]}),(0,V.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border p-[12px_20px]",children:[(0,V.jsx)(er.K,{onClick:n,children:"Cancel"}),(0,V.jsx)(ub.f,{type:"submit",disabled:c.isPending,children:c.isPending?"Saving…":"Save"})]})]})}function uw({projectId:e,kind:t,live:n,onNavigate:r}){let i=(0,J.useRouter)(),{data:o}=(0,uh.f)(),[a,l]=G.useState(!1),[s,c]=G.useState(null),u=o?.projects??[],d=u.find(e=>"demo"===e.id),f=u.filter(e=>"demo"!==e.id),p=u.find(t=>t.id===e),h=p?.name??("demo"===e?"Demo":e),m="demo"===t,g=!m&&!!n,y=(0,V.jsx)("span",{title:g?"Live — changes stream in instantly":void 0,className:"h-[7px] w-[7px] flex-shrink-0 rounded-full"+(g?" animate-pulse":""),style:{background:m?"#d97706":"#22c55e",boxShadow:`0 0 0 3px ${m?"#d9770622":"#22c55e22"}`}});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(ul,{children:[(0,V.jsxs)(us,{"aria-label":`Select project, current project ${h}`,className:"mb-[6px] flex w-full items-center gap-[9px] rounded-[10px] border border-border bg-[var(--surface-2)] px-[11px] py-[9px] text-left hover:bg-[var(--surface-3)] focus:outline-none tap-target",children:[y,(0,V.jsxs)("div",{className:"min-w-0 flex-1 leading-[1.15]",children:[(0,V.jsx)("div",{className:"truncate text-body font-semibold text-[var(--text)]",children:h}),(0,V.jsx)("div",{className:"text-meta text-[var(--text-3)]",children:m?"sample data":g?"bd · live":"bd · project"})]}),(0,V.jsx)(l7,{size:14,className:"flex-shrink-0 text-[var(--text-3)]"})]}),(0,V.jsxs)(uc,{className:"w-[210px]",children:[(0,V.jsx)(uu,{children:"Switch project"}),d&&(0,V.jsxs)(ud,{onClick:()=>{r?.(),i.push("/p/demo")},children:[(0,V.jsx)("span",{className:"flex-1 truncate",children:"Demo"}),"demo"===e&&(0,V.jsx)(l9.f,{size:14})]}),f.length>0&&(0,V.jsx)(up,{}),f.map(t=>(0,V.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,V.jsxs)(ud,{className:"min-w-0 flex-1",onClick:()=>{r?.(),i.push(`/p/${t.id}`)},children:[(0,V.jsx)("span",{className:"h-[6px] w-[6px] flex-shrink-0 rounded-full",style:{background:t.hasBeads?"#22c55e":"#ef4444"}}),(0,V.jsx)("span",{className:"flex-1 truncate",children:t.name}),t.id===e&&(0,V.jsx)(l9.f,{size:14})]}),(0,V.jsx)(ud,{"aria-label":`Rename ${t.name}`,title:"Rename",className:"flex-shrink-0 justify-center text-[var(--text-3)] max-md:min-w-11",onClick:()=>c({id:t.id,name:t.name}),children:(0,V.jsx)(se,{size:13})})]},t.id)),(0,V.jsx)(up,{}),(0,V.jsxs)(ud,{onClick:()=>l(!0),children:[(0,V.jsx)(l5.f,{size:14}),(0,V.jsx)("span",{children:"Add project…"})]}),(0,V.jsxs)(ud,{onClick:()=>{r?.(),i.push("/")},children:[(0,V.jsx)(l8,{size:14}),(0,V.jsx)("span",{children:"All projects"})]})]})]}),(0,V.jsx)(um.f,{open:a,onOpenChange:l}),(0,V.jsx)(uv,{project:s,currentProjectId:e,onOpenChange:e=>!e&&c(null)})]})}let uk="sai-manoj-kumar/beadscope",u_="6bf58e9";function uS(e){return`https://github.com/${uk}/commit/${e}#commitcomments`}function uE(){return(0,V.jsxs)("div",{className:"flex items-center gap-1 px-1 text-meta leading-none text-[var(--text-3)] max-md:min-h-11",children:[(0,V.jsxs)("span",{children:["v","0.6.0"]}),u_&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("span",{children:["Build ","260"," ",(0,V.jsx)("span",{className:"text-[var(--text-3)]",children:"·"})]}),(0,V.jsx)("a",{href:uS(u_),target:"_blank",rel:"noopener noreferrer",title:"View this commit’s comments on GitHub",className:"flex items-center font-mono text-[var(--text-3)] underline-offset-2 hover:text-[var(--text)] hover:underline max-md:min-h-11 max-md:min-w-11",children:u_})]})]})}let uj="beadscope.board",uO="beadscope.board.changed",uN={blockedColumn:"auto",sortMode:"manual",checkUpdates:!0,updateChannel:"stable"};function uC(e){return window.addEventListener(uO,e),window.addEventListener("storage",e),()=>{window.removeEventListener(uO,e),window.removeEventListener("storage",e)}}function uA(){return r??function(){try{return globalThis.localStorage?.getItem(uj)||""}catch{return""}}()}function uM(){return null}function uP(){let e=G.useSyncExternalStore(uC,uA,uM);return{prefs:function(e){try{let t=JSON.parse(e||"{}");return{blockedColumn:t?.blockedColumn==="always"?"always":"auto",sortMode:["priority","updated","manual"].includes(t?.sortMode)?t.sortMode:"manual",checkUpdates:"boolean"!=typeof t?.checkUpdates||t.checkUpdates,updateChannel:t?.updateChannel==="development"?"development":"stable"}}catch{return uN}}(e||""),setPrefs:G.useCallback(e=>{let t=JSON.stringify(e);try{localStorage.setItem(uj,t),r=void 0}catch{r=t}window.dispatchEvent(new Event(uO))},[]),ready:null!==e}}function uT(){let{data:e}=function(){let{prefs:e,ready:t}=uP(),n=(0,ee.f)({queryKey:["update-check",e.updateChannel],queryFn:async()=>{let t=await ei.k.selfUpdate.check(e.updateChannel);if(t.error)throw Error(t.error);return t},enabled:t&&e.checkUpdates,refetchInterval:3e5,refetchOnWindowFocus:!1,staleTime:6e4,retry:!1});return{...n,data:t&&e.checkUpdates?n.data:void 0}}(),t=(0,et.d)(),[n,r]=G.useState(null),i=(0,Q.f)({mutationFn:()=>{if(!n?.target)throw Error("Check for updates again.");return ei.k.selfUpdate.run(n.target)},onSuccess:()=>{n&&t.setQueryData(["update-check",n.channel],e=>e?{...e,updateAvailable:!1}:e)}});if(!e?.updateAvailable&&!n)return null;let o=e?.channel==="stable"?`Version ${e.latestVersion} available`:"Development update available";return(0,V.jsxs)(V.Fragment,{children:[e?.updateAvailable&&(0,V.jsx)(er.K,{size:"sm",icon:"rocket",onClick:()=>{i.reset(),r(e)},className:"border-[var(--brand)] bg-[var(--brand-weak)] font-semibold text-[var(--brand)] hover:bg-[var(--brand-weak)]",children:o}),(0,V.jsx)(ug.N,{open:!!n,onOpenChange:e=>{e||i.isPending||r(null)},children:n&&(0,V.jsxs)(ug.d,{className:"max-w-[480px]",children:[(0,V.jsx)(ug.F,{children:"stable"===n.channel?`Version ${n.latestVersion} available`:"Development update available"}),(0,V.jsx)(ug.C,{children:"stable"===n.channel?`You are running version ${n.currentVersion}. This update installs version ${n.latestVersion}.`:`There are ${n.behind} newer commits on main. This update installs the selected development build.`}),(0,V.jsx)("a",{href:n.releaseUrl||uS(n.remoteSha),target:"_blank",rel:"noopener noreferrer",className:"text-body text-[var(--brand)] underline",children:"stable"===n.channel?"Release notes and update instructions":"View selected development build"}),!n.canUpdate&&(0,V.jsx)("p",{className:"text-body leading-relaxed",children:n.manualReason||"Follow the release instructions to update this installation."}),n.canUpdate&&!i.data&&(0,V.jsxs)("p",{className:"text-label leading-relaxed text-[var(--text-3)]",children:["Update now installs the selected source version, restores its dependencies, and builds the app.",n.supervised?" The server then restarts automatically.":" Restart the server manually afterward to load the new version."]}),i.isError&&(0,V.jsx)("p",{role:"alert",className:"rounded-lg border border-red-400 p-3 text-label",children:i.error.message}),i.data&&(0,V.jsxs)("div",{className:"space-y-2 text-label",children:[i.data.steps.map(e=>(0,V.jsxs)("div",{children:["✓ ",e.name]},e.name)),(0,V.jsx)("p",{children:i.data.restarting?"The server is restarting. This page will reconnect shortly.":"Update built successfully. Restart the server to load the new version."})]}),(0,V.jsxs)("div",{className:"mt-2 flex justify-end gap-2",children:[(0,V.jsx)(er.K,{size:"sm",disabled:i.isPending,onClick:()=>r(null),children:i.data?"Close":"Not now"}),n.canUpdate&&n.target&&!i.data&&(0,V.jsx)(ub.f,{size:"sm",disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?"Updating…":"Update now"})]})]})})]})}function uI({label:e,onPointerDown:t,className:n}){return(0,V.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":e,title:"Drag to resize",onPointerDown:t,className:(0,uo.f)("absolute top-0 z-20 h-full w-1.5 cursor-ew-resize hover:bg-[var(--brand)]/40",n)})}function uD(e){let{storageKey:t,defaultWidth:n,min:r,max:i,deltaFactor:o}=e,a=G.useCallback(e=>Math.min(i,Math.max(r,e)),[r,i]),[l,s]=G.useState(()=>{try{let e=window.localStorage.getItem(t);if(null===e)return n;let o=Number(e);return Number.isFinite(o)?Math.min(i,Math.max(r,o)):n}catch{return n}}),c=G.useRef(l),u=G.useCallback(e=>{c.current=e,s(e)},[]);return{width:l,startResize:G.useCallback(e=>{e.preventDefault();let n=e.clientX,r=c.current,i=e=>{u(a(r+(e.clientX-n)*o))},l=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",l);try{window.localStorage.setItem(t,String(Math.round(c.current)))}catch{}};window.addEventListener("pointermove",i),window.addEventListener("pointerup",l)},[a,o,t,u])}}function uz(e){let t,n;window.open((n=new URLSearchParams({title:(t="bug"===e)?"[Bug] ":"[Feature] ",labels:t?"bug":"enhancement",body:t?"## Steps to reproduce\n\n1. \n2. \n\n## Expected\n\n## Actual\n\n---\n_Filed from Beadscope_":"## Problem\n\n## Proposed solution\n\n---\n_Filed from Beadscope_"}),`https://github.com/${uk}/issues/new?${n.toString()}`),"_blank","noopener,noreferrer")}function uR({view:e,onView:t,kind:n,projectId:r,live:i,mobile:o=!1,onProjectNavigate:a}){let{meta:l,beads:s,index:c}=eu(),u=l?.humanActor??"you",d=s.filter(e=>"epic"===e.issue_type).length,f=s.filter(lP).length+s.filter(e=>lI(e,c)).length,p=eh(r,!!l?.gamification),{width:h,startResize:m}=function(){let{width:e,startResize:t}=uD({storageKey:"beadscope.width.sidebar",defaultWidth:228,min:180,max:400,deltaFactor:1});return{width:G.useSyncExternalStore(uL,()=>!0,()=>!1)?e:228,startResize:t}}();return(0,V.jsxs)("aside",{style:o?void 0:{width:h},className:(0,uo.f)(o?"flex h-full w-full min-w-0 flex-col overflow-y-auto border-0 bg-[var(--surface)] p-[18px_14px]":"relative hidden flex-shrink-0 flex-col border-r border-border bg-[var(--surface)] p-[18px_14px] md:flex"),children:[!o&&(0,V.jsx)(uI,{label:"Resize sidebar",onPointerDown:m,className:"right-0"}),(0,V.jsxs)("div",{className:"flex items-center gap-[10px] px-2 pb-[18px] pt-1",children:[(0,V.jsx)("div",{className:"flex h-[30px] w-[30px] flex-shrink-0 items-center justify-center rounded-[9px] text-white",style:{background:"var(--brand-solid)",boxShadow:"0 2px 8px -2px var(--brand)"},children:(0,V.jsx)(en.W,{name:"logo",size:17})}),(0,V.jsx)("div",{className:"text-body font-semibold leading-[1.15] tracking-[-.01em]",children:"Beadscope"})]}),(0,V.jsx)(uw,{projectId:r,kind:n,live:i,onNavigate:a}),(0,V.jsx)("nav",{className:"flex flex-col gap-[2px]",children:e_(!!l?.gamification,o).map(n=>{let r=e===n.key;return(0,V.jsxs)("button",{onClick:()=>t(n.key),className:(0,uo.f)("flex w-full items-center gap-[10px] rounded-[9px] px-[10px] py-2 text-left text-body transition-colors tap-target",r?"bg-[var(--brand-weak)] font-semibold text-[var(--brand)]":"font-medium text-[var(--text-2)] hover:bg-[var(--surface-2)] hover:text-[var(--text)]"),children:[(0,V.jsx)(en.W,{name:n.icon,size:17,className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"flex-1",children:n.label}),"epics"===n.key&&d>0&&(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:d}),"needsyou"===n.key&&f>0&&(0,V.jsx)("span",{className:"min-w-[18px] rounded-full px-[6px] py-px text-center text-meta font-semibold text-white",style:{background:"var(--brand-solid)"},children:f})]},n.key)})}),(0,V.jsxs)("div",{className:"mt-auto flex flex-col gap-[10px]",children:[l?.gamification&&p.data&&(0,V.jsxs)("div",{className:"rounded-[10px] border border-border bg-[var(--surface)] px-[11px] py-[9px]",children:[(0,V.jsxs)("div",{className:"flex items-center justify-between text-meta",children:[(0,V.jsxs)("span",{className:"font-semibold",children:["Level ",p.data.you.level]}),(0,V.jsxs)("span",{className:"font-mono text-[var(--text-3)]",children:[p.data.you.xp," XP"]})]}),(0,V.jsx)("div",{className:"mt-[6px] h-[6px] overflow-hidden rounded-full bg-[var(--surface-3)]",children:(0,V.jsx)("div",{className:"h-full rounded-full transition-[width]",style:{width:`${Math.round(100*p.data.you.progress)}%`,background:"var(--brand-solid)"}})}),(0,V.jsxs)("div",{className:"mt-[4px] text-meta text-[var(--text-3)]",children:[p.data.you.closed," closed ·"," ",Math.max(0,p.data.you.span-p.data.you.intoLevel)," XP to L",p.data.you.level+1]})]}),(0,V.jsxs)(ul,{children:[(0,V.jsxs)(us,{className:"flex w-full items-center gap-[10px] rounded-[9px] border border-border bg-[var(--surface)] px-[10px] py-2 text-left text-label font-medium text-[var(--text-2)] hover:bg-[var(--surface-2)] hover:text-[var(--text)] focus:outline-none tap-target",children:[(0,V.jsx)(en.W,{name:"bug",size:16,className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"flex-1",children:"Report / request"}),(0,V.jsx)(en.W,{name:"chevron",size:14,className:"flex-shrink-0 text-[var(--text-3)]"})]}),(0,V.jsxs)(uc,{className:"w-[200px]",children:[(0,V.jsx)(uu,{children:"Open a GitHub issue"}),(0,V.jsxs)(ud,{onClick:()=>uz("bug"),children:[(0,V.jsx)(en.W,{name:"bug",size:14,style:{color:"#ef4444"}}),(0,V.jsx)("span",{children:"Report a bug"})]}),(0,V.jsxs)(ud,{onClick:()=>uz("feature"),children:[(0,V.jsx)(en.W,{name:"feature",size:14,style:{color:"var(--brand)"}}),(0,V.jsx)("span",{children:"Request a feature"})]})]})]}),(0,V.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,V.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:l?lZ(u):"var(--surface-3)"},children:l?lV(u):""}),(0,V.jsxs)("div",{className:"flex-1 leading-[1.15]",children:[(0,V.jsx)("div",{className:"text-label font-medium",children:l?u:"…"}),(0,V.jsx)("div",{className:"text-meta text-[var(--text-3)]",children:"human actor"})]}),(0,V.jsx)(l4.f,{})]}),(0,V.jsx)(uT,{}),(0,V.jsx)(uE,{})]})]})}function uL(){return()=>{}}let u$="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function uB(e){let t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function uF(e){return"nodeType"in e}function uU(e){var t,n;return e?uB(e)?e:uF(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function uH(e){let{Document:t}=uU(e);return e instanceof t}function uK(e){return!uB(e)&&e instanceof uU(e).HTMLElement}function uW(e){return e instanceof uU(e).SVGElement}function uq(e){return e?uB(e)?e.document:uF(e)?uH(e)?e:uK(e)||uW(e)?e.ownerDocument:document:document:document}let uZ=u$?G.useLayoutEffect:G.useEffect;function uV(e){let t=(0,G.useRef)(e);return uZ(()=>{t.current=e}),(0,G.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function uG(e,t){void 0===t&&(t=[e]);let n=(0,G.useRef)(e);return uZ(()=>{n.current!==e&&(n.current=e)},t),n}function uX(e,t){let n=(0,G.useRef)();return(0,G.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function uY(e){let t=uV(e),n=(0,G.useRef)(null),r=(0,G.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function uJ(e){let t=(0,G.useRef)();return(0,G.useEffect)(()=>{t.current=e},[e]),t.current}let uQ={};function u0(e,t){return(0,G.useMemo)(()=>{if(t)return t;let n=null==uQ[e]?0:uQ[e]+1;return uQ[e]=n,e+"-"+n},[e,t])}function u1(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{for(let[r,i]of Object.entries(n)){let n=t[r];null!=n&&(t[r]=n+e*i)}return t},{...t})}}let u2=u1(1),u3=u1(-1);function u4(e){if(!e)return!1;let{KeyboardEvent:t}=uU(e.target);return t&&e instanceof t}function u9(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=uU(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}let u5=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[u5.Translate.toString(e),u5.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),u6="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]",u8={display:"none"};function u7(e){let{id:t,value:n}=e;return G.default.createElement("div",{id:t,style:u8},n)}function de(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return G.default.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}let dt=(0,G.createContext)(null),dn={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},dr={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function di(e){var t;let n,{announcements:r=dr,container:i,hiddenTextDescribedById:o,screenReaderInstructions:a=dn}=e,{announce:l,announcement:s}=function(){let[e,t]=(0,G.useState)("");return{announce:(0,G.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),c=u0("DndLiveRegion"),[u,d]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{d(!0)},[]),t=(0,G.useMemo)(()=>({onDragStart(e){let{active:t}=e;l(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&l(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;l(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;l(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;l(r.onDragCancel({active:t,over:n}))}}),[l,r]),n=(0,G.useContext)(dt),(0,G.useEffect)(()=>{if(!n)throw Error("useDndMonitor must be used within a children of <DndContext>");return n(t)},[t,n]),!u)return null;let f=G.default.createElement(G.default.Fragment,null,G.default.createElement(u7,{id:o,value:a.draggable}),G.default.createElement(de,{id:c,announcement:s}));return i?(0,cQ.createPortal)(f,i):f}function da(){}function dl(e,t){return(0,G.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function ds(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,G.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}(hI=hW||(hW={})).DragStart="dragStart",hI.DragMove="dragMove",hI.DragEnd="dragEnd",hI.DragCancel="dragCancel",hI.DragOver="dragOver",hI.RegisterDroppable="registerDroppable",hI.SetDroppableDisabled="setDroppableDisabled",hI.UnregisterDroppable="unregisterDroppable";let dc=Object.freeze({x:0,y:0});function du(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dd(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function df(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function dp(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function dh(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}let dm=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=dh(t,t.left,t.top),o=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=du(dh(r),i);o.push({id:t,data:{droppableContainer:e,value:n}})}}return o.sort(dd)},dg=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,o=n.get(r);if(o){let n=function(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height);if(r<i&&n<o){let a=t.width*t.height,l=e.width*e.height,s=(i-r)*(o-n);return Number((s/(a+l-s)).toFixed(4))}return 0}(o,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(df)};function dy(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:dc}let db=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})};function dv(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}let dx={ignoreTransform:!1};function dw(e,t){void 0===t&&(t=dx);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=uU(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=dv(t);if(!r)return e;let{scaleX:i,scaleY:o,x:a,y:l}=r,s=e.left-a-(1-i)*parseFloat(n),c=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}let{top:r,left:i,width:o,height:a,bottom:l,right:s}=n;return{top:r,left:i,width:o,height:a,bottom:l,right:s}}function dk(e){return dw(e,{ignoreTransform:!0})}function d_(e,t){let n=[];return e?function r(i){var o,a;let l;if(null!=t&&n.length>=t||!i)return n;if(uH(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!uK(i)||uW(i)||n.includes(i))return n;let s=uU(e).getComputedStyle(i);return(i!==e&&(void 0===(o=s)&&(o=uU(i).getComputedStyle(i)),l=/(auto|scroll|overlay)/,["overflow","overflowX","overflowY"].some(e=>{let t=o[e];return"string"==typeof t&&l.test(t)}))&&n.push(i),void 0===(a=s)&&(a=uU(i).getComputedStyle(i)),"fixed"===a.position)?n:r(i.parentNode)}(e):n}function dS(e){let[t]=d_(e,1);return null!=t?t:null}function dE(e){return u$&&e?uB(e)?e:uF(e)?uH(e)||e===uq(e).scrollingElement?window:uK(e)?e:null:null:null}function dj(e){return uB(e)?e.scrollX:e.scrollLeft}function dO(e){return uB(e)?e.scrollY:e.scrollTop}function dN(e){return{x:dj(e),y:dO(e)}}function dC(e){return!!u$&&!!e&&e===document.scrollingElement}function dA(e){let t={x:0,y:0},n=dC(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x;return{isTop:i,isLeft:o,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(hD=hq||(hq={}))[hD.Forward=1]="Forward",hD[hD.Backward=-1]="Backward";let dM={x:.2,y:.2};function dP(e){return e.reduce((e,t)=>u2(e,dN(t)),dc)}function dT(e,t){if(void 0===t&&(t=dw),!e)return;let{top:n,left:r,bottom:i,right:o}=t(e);dS(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}let dI=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+dj(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+dO(t),0)}]];class dD{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=d_(t),r=dP(n);for(let[t,i,o]of(this.rect={...e},this.width=e.width,this.height=e.height,dI))for(let e of i)Object.defineProperty(this,e,{get:()=>{let i=o(n),a=r[t]-i;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class dz{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function dR(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}function dL(e){e.preventDefault()}function d$(e){e.stopPropagation()}(hz=hZ||(hZ={})).Click="click",hz.DragStart="dragstart",hz.Keydown="keydown",hz.ContextMenu="contextmenu",hz.Resize="resize",hz.SelectionChange="selectionchange",hz.VisibilityChange="visibilitychange",(hR=hV||(hV={})).Space="Space",hR.Down="ArrowDown",hR.Right="ArrowRight",hR.Left="ArrowLeft",hR.Up="ArrowUp",hR.Esc="Escape",hR.Enter="Enter",hR.Tab="Tab";let dB={start:[hV.Space,hV.Enter],cancel:[hV.Esc],end:[hV.Space,hV.Enter,hV.Tab]},dF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case hV.Right:return{...n,x:n.x+25};case hV.Left:return{...n,x:n.x-25};case hV.Down:return{...n,y:n.y+25};case hV.Up:return{...n,y:n.y-25}}};class dU{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new dz(uq(t)),this.windowListeners=new dz(uU(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(hZ.Resize,this.handleCancel),this.windowListeners.add(hZ.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(hZ.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&dT(n),t(dc)}handleKeyDown(e){if(u4(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=dB,coordinateGetter:o=dF,scrollBehavior:a="smooth"}=r,{code:l}=e;if(i.end.includes(l))return void this.handleEnd(e);if(i.cancel.includes(l))return void this.handleCancel(e);let{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:dc;this.referenceCoordinates||(this.referenceCoordinates=c);let u=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){let t=u3(u,c),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:o,isRight:l,isLeft:s,isBottom:c,maxScroll:d,minScroll:f}=dA(n),p=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}(n),h={x:Math.min(i===hV.Right?p.right-p.width/2:p.right,Math.max(i===hV.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===hV.Down?p.bottom-p.height/2:p.bottom,Math.max(i===hV.Down?p.top:p.top+p.height/2,u.y))},m=i===hV.Right&&!l||i===hV.Left&&!s,g=i===hV.Down&&!c||i===hV.Up&&!o;if(m&&h.x!==u.x){let e=n.scrollLeft+t.x,o=i===hV.Right&&e<=d.x||i===hV.Left&&e>=f.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:a});o?r.x=n.scrollLeft-e:r.x=i===hV.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&h.y!==u.y){let e=n.scrollTop+t.y,o=i===hV.Down&&e<=d.y||i===hV.Up&&e>=f.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:a});o?r.y=n.scrollTop-e:r.y=i===hV.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,u2(u3(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function dH(e){return!!(e&&"distance"in e)}function dK(e){return!!(e&&"delay"in e)}dU.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=dB,onActivation:i}=t,{active:o}=n,{code:a}=e.nativeEvent;if(r.start.includes(a)){let t=o.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class dW{constructor(e,t,n){var r;void 0===n&&(n=function(e){let{EventTarget:t}=uU(e);return e instanceof t?e:uq(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:i}=e,{target:o}=i;this.props=e,this.events=t,this.document=uq(o),this.documentListeners=new dz(this.document),this.listeners=new dz(n),this.windowListeners=new dz(uU(o)),this.initialCoordinates=null!=(r=u9(i))?r:dc,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(hZ.Resize,this.handleCancel),this.windowListeners.add(hZ.DragStart,dL),this.windowListeners.add(hZ.VisibilityChange,this.handleCancel),this.windowListeners.add(hZ.ContextMenu,dL),this.documentListeners.add(hZ.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dK(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(dH(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(hZ.Click,d$,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(hZ.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:n,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!r)return;let l=null!=(t=u9(e))?t:dc,s=u3(r,l);if(!n&&a){if(dH(a)){if(null!=a.tolerance&&dR(s,a.tolerance))return this.handleCancel();if(dR(s,a.distance))return this.handleStart()}return dK(a)&&dR(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),o(l)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===hV.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let dq={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class dZ extends dW{constructor(e){let{event:t}=e;super(e,dq,uq(t.target))}}dZ.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!!n.isPrimary&&0===n.button&&(null==r||r({event:n}),!0)}}];(hL=hG||(hG={}))[hL.RightClick=2]="RightClick";(h$=hX||(hX={}))[h$.Pointer=0]="Pointer",h$[h$.DraggableRect=1]="DraggableRect",(hB=hY||(hY={}))[hB.TreeOrder=0]="TreeOrder",hB[hB.ReversedTreeOrder=1]="ReversedTreeOrder";let dV={x:{[hq.Backward]:!1,[hq.Forward]:!1},y:{[hq.Backward]:!1,[hq.Forward]:!1}};(hF=hJ||(hJ={}))[hF.Always=0]="Always",hF[hF.BeforeDragging=1]="BeforeDragging",hF[hF.WhileDragging=2]="WhileDragging",(hQ||(hQ={})).Optimized="optimized";let dG=new Map;function dX(e,t){return uX(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function dY(e){let{callback:t,disabled:n}=e,r=uV(t),i=(0,G.useMemo)(()=>{if(n||"u"<typeof window||void 0===window.ResizeObserver)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,G.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function dJ(e){return new dD(dw(e),e)}function dQ(e,t,n){void 0===t&&(t=dJ);let[r,i]=(0,G.useState)(null);function o(){i(r=>{if(!e)return null;if(!1===e.isConnected){var i;return null!=(i=null!=r?r:n)?i:null}let o=t(e);return JSON.stringify(r)===JSON.stringify(o)?r:o})}let a=function(e){let{callback:t,disabled:n}=e,r=uV(t),i=(0,G.useMemo)(()=>{if(n||"u"<typeof window||void 0===window.MutationObserver)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,G.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),l=dY({callback:o});return uZ(()=>{o(),e?(null==l||l.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())},[e]),r}let d0=[];function d1(e,t){void 0===t&&(t=[]);let n=(0,G.useRef)(null);return(0,G.useEffect)(()=>{n.current=null},t),(0,G.useEffect)(()=>{let t=e!==dc;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?u3(e,n.current):dc}function d2(e){return(0,G.useMemo)(()=>{let t,n;return e?(t=e.innerWidth,{top:0,left:0,right:t,bottom:n=e.innerHeight,width:t,height:n}):null},[e])}let d3=[];function d4(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return uK(t)?t:e}let d9=[{sensor:dZ,options:{}},{sensor:dU,options:{}}],d5={current:{}},d6={draggable:{measure:dk},droppable:{measure:dk,strategy:hJ.WhileDragging,frequency:hQ.Optimized},dragOverlay:{measure:dw}};class d8 extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}let d7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new d8,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:da},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:d6,measureDroppableContainers:da,windowRect:null,measuringScheduled:!1},fe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:da,draggableNodes:new Map,over:null,measureDroppableContainers:da},ft=(0,G.createContext)(fe),fn=(0,G.createContext)(d7);function fr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new d8}}}function fi(e,t){switch(t.type){case hW.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case hW.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case hW.DragEnd:case hW.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case hW.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new d8(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case hW.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;let a=new d8(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case hW.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let o=new d8(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function fo(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,G.useContext)(ft),o=uJ(r),a=uJ(null==n?void 0:n.id);return(0,G.useEffect)(()=>{if(!t&&!r&&o&&null!=a){if(!u4(o)||document.activeElement===o.target)return;let e=i.get(a);if(!e)return;let{activatorNode:t,node:n}=e;(t.current||n.current)&&requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=e.matches(u6)?e:e.querySelector(u6);if(t){t.focus();break}}})}},[r,t,i,a,o]),null}function fa(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}let fl=(0,G.createContext)({...dc,scaleX:1,scaleY:1});(hU=h0||(h0={}))[hU.Uninitialized=0]="Uninitialized",hU[hU.Initializing=1]="Initializing",hU[hU.Initialized=2]="Initialized";let fs=(0,G.memo)(function(e){var t,n,r,i,o,a,l,s;let c,u,d,f,p,h,m,g,{id:y,accessibility:b,autoScroll:v=!0,children:x,sensors:w=d9,collisionDetection:k=dg,measuring:_,modifiers:S,...E}=e,[j,O]=(0,G.useReducer)(fi,void 0,fr),[N,C]=function(){let[e]=(0,G.useState)(()=>new Set),t=(0,G.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,G.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[A,M]=(0,G.useState)(h0.Uninitialized),P=A===h0.Initialized,{draggable:{active:T,nodes:I,translate:D},droppable:{containers:z}}=j,R=null!=T?I.get(T):null,L=(0,G.useRef)({initial:null,translated:null}),$=(0,G.useMemo)(()=>{var e;return null!=T?{id:T,data:null!=(e=null==R?void 0:R.data)?e:d5,rect:L}:null},[T,R]),B=(0,G.useRef)(null),[F,U]=(0,G.useState)(null),[H,K]=(0,G.useState)(null),W=uG(E,Object.values(E)),q=u0("DndDescribedBy",y),Z=(0,G.useMemo)(()=>z.getEnabled(),[z]),V=(0,G.useMemo)(()=>({draggable:{...d6.draggable,...null==_?void 0:_.draggable},droppable:{...d6.droppable,...null==_?void 0:_.droppable},dragOverlay:{...d6.dragOverlay,...null==_?void 0:_.dragOverlay}}),[null==_?void 0:_.draggable,null==_?void 0:_.droppable,null==_?void 0:_.dragOverlay]),{droppableRects:X,measureDroppableContainers:Y,measuringScheduled:J}=function(e,t){let{dragging:n,dependencies:r,config:i}=t,[o,a]=(0,G.useState)(null),{frequency:l,measure:s,strategy:c}=i,u=(0,G.useRef)(e),d=function(){switch(c){case hJ.Always:return!1;case hJ.BeforeDragging:return n;default:return!n}}(),f=uG(d),p=(0,G.useCallback)(function(e){void 0===e&&(e=[]),f.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),h=(0,G.useRef)(null),m=uX(t=>{if(d&&!n)return dG;if(!t||t===dG||u.current!==e||null!=o){let t=new Map;for(let n of e){if(!n)continue;if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new dD(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,o,n,d,s]);return(0,G.useEffect)(()=>{u.current=e},[e]),(0,G.useEffect)(()=>{d||p()},[n,d]),(0,G.useEffect)(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),(0,G.useEffect)(()=>{d||"number"!=typeof l||null!==h.current||(h.current=setTimeout(()=>{p(),h.current=null},l))},[l,d,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:null!=o}}(Z,{dragging:P,dependencies:[D.x,D.y],config:V.droppable}),Q=uX(e=>{var t;return null==T?null:null!=(t=null!=p?p:e)?t:null},[p=(f=null!=T?I.get(T):void 0)?f.node.current:null,T]),ee=(0,G.useMemo)(()=>H?u9(H):null,[H]),et=(c=(null==F?void 0:F.autoScrollEnabled)===!1,u="object"==typeof v?!1===v.enabled:!1===v,d=P&&!c&&!u,"object"==typeof v?{...v,enabled:d}:{enabled:d}),en=dX(Q,V.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,o=(0,G.useRef)(!1),{x:a,y:l}="boolean"==typeof i?{x:i,y:i}:i;uZ(()=>{if(!a&&!l||!t){o.current=!1;return}if(o.current||!r)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let i=dy(n(e),r);if(a||(i.x=0),l||(i.y=0),o.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=dS(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,a,l,r,n])}({activeNode:null!=T?I.get(T):null,config:et.layoutShiftCompensation,initialRect:en,measure:V.draggable.measure});let er=dQ(Q,V.draggable.measure,en),ei=dQ(Q?Q.parentElement:null),eo=(0,G.useRef)({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ea=z.getNodeFor(null==(t=eo.current.over)?void 0:t.id),el=function(e){let{measure:t}=e,[n,r]=(0,G.useState)(null),i=dY({callback:(0,G.useCallback)(e=>{for(let{target:n}of e)if(uK(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[o,a]=uY((0,G.useCallback)(e=>{let n=d4(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]));return(0,G.useMemo)(()=>({nodeRef:o,rect:n,setRef:a}),[n,o,a])}({measure:V.dragOverlay.measure}),es=null!=(n=el.nodeRef.current)?n:Q,ec=P?null!=(r=el.rect)?r:er:null,eu=!!(el.nodeRef.current&&el.rect),ed=(h=dX(o=eu?null:er),dy(o,h)),ef=d2(es?uU(es):null),ep=(a=P?null!=ea?ea:Q:null,m=(0,G.useRef)(a),g=uX(e=>a?e&&e!==d0&&a&&m.current&&a.parentNode===m.current.parentNode?e:d_(a):d0,[a]),(0,G.useEffect)(()=>{m.current=a},[a]),g),eh=function(e,t){void 0===t&&(t=dw);let[n]=e,r=d2(n?uU(n):null),[i,o]=(0,G.useState)(d3);function a(){o(()=>e.length?e.map(e=>dC(e)?r:new dD(t(e),e)):d3)}let l=dY({callback:a});return uZ(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),i}(ep),em=fa(S,{transform:{x:D.x-ed.x,y:D.y-ed.y,scaleX:1,scaleY:1},activatorEvent:H,active:$,activeNodeRect:er,containerNodeRect:ei,draggingNodeRect:ec,over:eo.current.over,overlayNodeRect:el.rect,scrollableAncestors:ep,scrollableAncestorRects:eh,windowRect:ef}),eg=ee?u2(ee,D):null,ey=function(e){let[t,n]=(0,G.useState)(null),r=(0,G.useRef)(e),i=(0,G.useCallback)(e=>{let t=dE(e.target);t&&n(e=>e?(e.set(t,dN(t)),new Map(e)):null)},[]);return(0,G.useEffect)(()=>{let t=r.current;if(e!==t){o(t);let a=e.map(e=>{let t=dE(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,dN(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{let t=dE(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),(0,G.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>u2(e,t),dc):dP(e):dc,[e,t])}(ep),eb=d1(ey),ev=d1(ey,[er]),ex=u2(em,eb),ew=ec?db(ec,em):null,ek=$&&ew?k({active:$,collisionRect:ew,droppableRects:X,droppableContainers:Z,pointerCoordinates:eg}):null,e_=function(e){if(!e||0===e.length)return null;let[t]=e;return t.id}(ek),[eS,eE]=(0,G.useState)(null),ej=(l=eu?em:u2(em,ev),s=null!=(i=null==eS?void 0:eS.rect)?i:null,{...l,scaleX:s&&er?s.width/er.width:1,scaleY:s&&er?s.height/er.height:1}),eO=(0,G.useRef)(null),eN=(0,G.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==B.current)return;let i=I.get(B.current);if(!i)return;let o=e.nativeEvent,a=new n({active:B.current,activeNode:i,event:o,options:r,context:eo,onAbort(e){if(!I.get(e))return;let{onDragAbort:t}=W.current,n={id:e};null==t||t(n),N({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!I.get(e))return;let{onDragPending:i}=W.current,o={id:e,constraint:t,initialCoordinates:n,offset:r};null==i||i(o),N({type:"onDragPending",event:o})},onStart(e){let t=B.current;if(null==t)return;let n=I.get(t);if(!n)return;let{onDragStart:r}=W.current,i={activatorEvent:o,active:{id:t,data:n.data,rect:L}};(0,cQ.unstable_batchedUpdates)(()=>{null==r||r(i),M(h0.Initializing),O({type:hW.DragStart,initialCoordinates:e,active:t}),N({type:"onDragStart",event:i}),U(eO.current),K(o)})},onMove(e){O({type:hW.DragMove,coordinates:e})},onEnd:l(hW.DragEnd),onCancel:l(hW.DragCancel)});function l(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=eo.current,a=null;if(t&&i){let{cancelDrop:l}=W.current;a={activatorEvent:o,active:t,collisions:n,delta:i,over:r},e===hW.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=hW.DragCancel)}B.current=null,(0,cQ.unstable_batchedUpdates)(()=>{O({type:e}),M(h0.Uninitialized),eE(null),U(null),K(null),eO.current=null;let t=e===hW.DragEnd?"onDragEnd":"onDragCancel";if(a){let e=W.current[t];null==e||e(a),N({type:t,event:a})}})}}eO.current=a},[I]),eC=(0,G.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,o=I.get(r);null!==B.current||!o||i.dndKit||i.defaultPrevented||!0===e(n,t.options,{active:o})&&(i.dndKit={capturedBy:t.sensor},B.current=r,eN(n,t))},[I,eN]),eA=(0,G.useMemo)(()=>w.reduce((e,t)=>{let{sensor:n}=t;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:eC(e.handler,t)}))]},[]),[w,eC]);(0,G.useEffect)(()=>{if(!u$)return;let e=w.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},w.map(e=>{let{sensor:t}=e;return t})),uZ(()=>{er&&A===h0.Initializing&&M(h0.Initialized)},[er,A]),(0,G.useEffect)(()=>{let{onDragMove:e}=W.current,{active:t,activatorEvent:n,collisions:r,over:i}=eo.current;if(!t||!n)return;let o={active:t,activatorEvent:n,collisions:r,delta:{x:ex.x,y:ex.y},over:i};(0,cQ.unstable_batchedUpdates)(()=>{null==e||e(o),N({type:"onDragMove",event:o})})},[ex.x,ex.y]),(0,G.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=eo.current;if(!e||null==B.current||!t||!i)return;let{onDragOver:o}=W.current,a=r.get(e_),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:l};(0,cQ.unstable_batchedUpdates)(()=>{eE(l),null==o||o(s),N({type:"onDragOver",event:s})})},[e_]),uZ(()=>{eo.current={activatorEvent:H,active:$,activeNode:Q,collisionRect:ew,collisions:ek,droppableRects:X,draggableNodes:I,draggingNode:es,draggingNodeRect:ec,droppableContainers:z,over:eS,scrollableAncestors:ep,scrollAdjustedTranslate:ex},L.current={initial:ec,translated:ew}},[$,Q,ek,ew,I,es,ec,X,z,eS,ep,ex]),function(e){let t,{acceleration:n,activator:r=hX.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:l=5,order:s=hY.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e,h=function(e){let{delta:t,disabled:n}=e,r=uJ(t);return uX(e=>{if(n||!r||!e)return dV;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[hq.Backward]:e.x[hq.Backward]||-1===i.x,[hq.Forward]:e.x[hq.Forward]||1===i.x},y:{[hq.Backward]:e.y[hq.Backward]||-1===i.y,[hq.Forward]:e.y[hq.Forward]||1===i.y}}},[n,t,r])}({delta:f,disabled:!a}),[m,g]=(t=(0,G.useRef)(null),[(0,G.useCallback)((e,n)=>{t.current=setInterval(e,n)},[]),(0,G.useCallback)(()=>{null!==t.current&&(clearInterval(t.current),t.current=null)},[])]),y=(0,G.useRef)({x:0,y:0}),b=(0,G.useRef)({x:0,y:0}),v=(0,G.useMemo)(()=>{switch(r){case hX.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case hX.DraggableRect:return o}},[r,o,c]),x=(0,G.useRef)(null),w=(0,G.useCallback)(()=>{let e=x.current;if(!e)return;let t=y.current.x*b.current.x,n=y.current.y*b.current.y;e.scrollBy(t,n)},[]),k=(0,G.useMemo)(()=>s===hY.TreeOrder?[...u].reverse():u,[s,u]);(0,G.useEffect)(()=>{if(!a||!u.length||!v)return void g();for(let e of k){if((null==i?void 0:i(e))===!1)continue;let t=d[u.indexOf(e)];if(!t)continue;let{direction:r,speed:o}=function(e,t,n,r,i){let{top:o,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===i&&(i=dM);let{isTop:c,isBottom:u,isLeft:d,isRight:f}=dA(e),p={x:0,y:0},h={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+m.height?(p.y=hq.Backward,h.y=r*Math.abs((t.top+m.height-o)/m.height)):!u&&s>=t.bottom-m.height&&(p.y=hq.Forward,h.y=r*Math.abs((t.bottom-m.height-s)/m.height)),!f&&l>=t.right-m.width?(p.x=hq.Forward,h.x=r*Math.abs((t.right-m.width-l)/m.width)):!d&&a<=t.left+m.width&&(p.x=hq.Backward,h.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:p,speed:h}}(e,t,v,n,p);for(let e of["x","y"])h[e][r[e]]||(o[e]=0,r[e]=0);if(o.x>0||o.y>0){g(),x.current=e,m(w,l),y.current=o,b.current=r;return}}y.current={x:0,y:0},b.current={x:0,y:0},g()},[n,w,i,g,a,l,JSON.stringify(v),JSON.stringify(h),m,u,k,d,JSON.stringify(p)])}({...et,delta:D,draggingRect:ew,pointerCoordinates:eg,scrollableAncestors:ep,scrollableAncestorRects:eh});let eM=(0,G.useMemo)(()=>({active:$,activeNode:Q,activeNodeRect:er,activatorEvent:H,collisions:ek,containerNodeRect:ei,dragOverlay:el,draggableNodes:I,droppableContainers:z,droppableRects:X,over:eS,measureDroppableContainers:Y,scrollableAncestors:ep,scrollableAncestorRects:eh,measuringConfiguration:V,measuringScheduled:J,windowRect:ef}),[$,Q,er,H,ek,ei,el,I,z,X,eS,Y,ep,eh,V,J,ef]),eP=(0,G.useMemo)(()=>({activatorEvent:H,activators:eA,active:$,activeNodeRect:er,ariaDescribedById:{draggable:q},dispatch:O,draggableNodes:I,over:eS,measureDroppableContainers:Y}),[H,eA,$,er,O,q,I,eS,Y]);return G.default.createElement(dt.Provider,{value:C},G.default.createElement(ft.Provider,{value:eP},G.default.createElement(fn.Provider,{value:eM},G.default.createElement(fl.Provider,{value:ej},x)),G.default.createElement(fo,{disabled:(null==b?void 0:b.restoreFocus)===!1})),G.default.createElement(di,{...b,hiddenTextDescribedById:q}))}),fc=(0,G.createContext)(null),fu="button";function fd(){return(0,G.useContext)(fn)}let ff={timeout:25};function fp(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,o=u0("Droppable"),{active:a,dispatch:l,over:s,measureDroppableContainers:c}=(0,G.useContext)(ft),u=(0,G.useRef)({disabled:n}),d=(0,G.useRef)(!1),f=(0,G.useRef)(null),p=(0,G.useRef)(null),{disabled:h,updateMeasurementsFor:m,timeout:g}={...ff,...i},y=uG(null!=m?m:r),b=dY({callback:(0,G.useCallback)(()=>{if(!d.current){d.current=!0;return}null!=p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),p.current=null},g)},[g]),disabled:h||!a}),[v,x]=uY((0,G.useCallback)((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b])),w=uG(t);return(0,G.useEffect)(()=>{b&&v.current&&(b.disconnect(),d.current=!1,b.observe(v.current))},[v,b]),(0,G.useEffect)(()=>(l({type:hW.RegisterDroppable,element:{id:r,key:o,disabled:n,node:v,rect:f,data:w}}),()=>l({type:hW.UnregisterDroppable,key:o,id:r})),[r]),(0,G.useEffect)(()=>{n!==u.current.disabled&&(l({type:hW.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,l]),{active:a,rect:f,isOver:(null==s?void 0:s.id)===r,node:v,over:s,setNodeRef:x}}function fh(e){let{animation:t,children:n}=e,[r,i]=(0,G.useState)(null),[o,a]=(0,G.useState)(null),l=uJ(n);return n||r||!l||i(l),uZ(()=>{if(!o)return;let e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null==e||null==n?i(null):Promise.resolve(t(n,o)).then(()=>{i(null)})},[t,r,o]),G.default.createElement(G.default.Fragment,null,n,r?(0,G.cloneElement)(r,{ref:a}):null)}let fm={x:0,y:0,scaleX:1,scaleY:1};function fg(e){let{children:t}=e;return G.default.createElement(ft.Provider,{value:fe},G.default.createElement(fl.Provider,{value:fm},t))}let fy={position:"fixed",touchAction:"none"},fb=e=>u4(e)?"transform 250ms ease":void 0,fv=(0,G.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:l,style:s,transform:c,transition:u=fb}=e;if(!l)return null;let d=i?c:{...c,scaleX:1,scaleY:1},f={...fy,width:l.width,height:l.height,top:l.top,left:l.left,transform:u5.Transform.toString(d),transformOrigin:i&&r?function(e,t){let n=u9(e);if(!n)return"0 0";let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}(r,l):void 0,transition:"function"==typeof u?u(r):u,...s};return G.default.createElement(n,{className:a,style:f,ref:t},o)}),fx={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:u5.Transform.toString(t)},{transform:u5.Transform.toString(n)}]},sideEffects:(f={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e,r={},{styles:i,className:o}=f;if(null!=i&&i.active)for(let[e,n]of Object.entries(i.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=i&&i.dragOverlay)for(let[e,t]of Object.entries(i.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=o&&o.active&&t.node.classList.add(o.active),null!=o&&o.dragOverlay&&n.node.classList.add(o.dragOverlay),function(){for(let[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=o&&o.active&&t.node.classList.remove(o.active)}})},fw=0,fk=G.default.memo(e=>{var t;let{adjustScale:n=!1,children:r,dropAnimation:i,style:o,transition:a,modifiers:l,wrapperElement:s="div",className:c,zIndex:u=999}=e,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:m,droppableContainers:g,dragOverlay:y,over:b,measuringConfiguration:v,scrollableAncestors:x,scrollableAncestorRects:w,windowRect:k}=fd(),_=(0,G.useContext)(fl),S=(t=null==f?void 0:f.id,(0,G.useMemo)(()=>{if(null!=t)return++fw},[t])),E=fa(l,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:y.rect,over:b,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:w,transform:_,windowRect:k}),j=dX(p),O=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return uV((e,o)=>{if(null===t)return;let a=n.get(e);if(!a)return;let l=a.node.current;if(!l)return;let s=d4(o);if(!s)return;let{transform:c}=uU(o).getComputedStyle(o),u=dv(c);if(!u)return;let d="function"==typeof t?t:function(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...fx,...e};return e=>{let{active:o,dragOverlay:a,transform:l,...s}=e;if(!t)return;let c={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},u={scaleX:1!==l.scaleX?o.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?o.rect.height*l.scaleY/a.rect.height:1},d={x:l.x-c.x,y:l.y-c.y,...u},f=i({...s,active:o,dragOverlay:a,transform:{initial:l,final:d}}),[p]=f,h=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(h))return;let m=null==r?void 0:r({active:o,dragOverlay:a,...s}),g=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{null==m||m(),e()}})}}(t);return dT(l,i.draggable.measure),d({active:{id:e,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:i,transform:u})})}({config:i,draggableNodes:m,droppableContainers:g,measuringConfiguration:v}),N=j?y.setRef:void 0;return G.default.createElement(fg,null,G.default.createElement(fh,{animation:O},f&&S?G.default.createElement(fv,{key:S,id:f.id,ref:N,as:s,activatorEvent:d,adjustScale:n,className:c,transition:a,rect:j,style:{zIndex:u,...o},transform:E},r):null))});function f_(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function fS(e){return null!==e&&e>=0}let fE=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,o=f_(t,r,n),a=t[i],l=o[i];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},fj={scaleX:1,scaleY:1},fO=e=>{var t,n,r,i;let o,a,l,{activeIndex:s,activeNodeRect:c,index:u,rects:d,overIndex:f}=e,p=null!=(t=d[s])?t:c;if(!p)return null;if(u===s){let e=d[f];return e?{x:0,y:s<f?e.top+e.height-(p.top+p.height):e.top-p.top,...fj}:null}let h=(n=d,r=u,i=s,o=n[r],a=n[r-1],l=n[r+1],o?i<r?a?o.top-(a.top+a.height):l?l.top-(o.top+o.height):0:l?l.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0);return u>s&&u<=f?{x:0,y:-p.height-h,...fj}:u<s&&u>=f?{x:0,y:p.height+h,...fj}:{x:0,y:0,...fj}},fN="Sortable",fC=G.default.createContext({activeIndex:-1,containerId:fN,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fE,disabled:{draggable:!1,droppable:!1}});function fA(e){let{children:t,id:n,items:r,strategy:i=fE,disabled:o=!1}=e,{active:a,dragOverlay:l,droppableRects:s,over:c,measureDroppableContainers:u}=fd(),d=u0(fN,n),f=null!==l.rect,p=(0,G.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),h=null!=a,m=a?p.indexOf(a.id):-1,g=c?p.indexOf(c.id):-1,y=(0,G.useRef)(p),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(p,y.current),v=-1!==g&&-1===m||b,x="boolean"==typeof o?{draggable:o,droppable:o}:o;uZ(()=>{b&&h&&u(p)},[b,p,h,u]),(0,G.useEffect)(()=>{y.current=p},[p]);let w=(0,G.useMemo)(()=>({activeIndex:m,containerId:d,disabled:x,disableTransforms:v,items:p,overIndex:g,useDragOverlay:f,sortedRects:p.reduce((e,t,n)=>{let r=s.get(t);return r&&(e[n]=r),e},Array(p.length)),strategy:i}),[m,d,x.draggable,x.droppable,v,p,g,s,f,i]);return G.default.createElement(fC.Provider,{value:w},t)}let fM=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return f_(n,r,i).indexOf(t)},fP=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:l,previousContainerId:s,transition:c}=e;return!!c&&!!r&&(l===o||i!==a)&&(!!n||a!==i&&t===s)},fT={duration:200,easing:"ease"},fI="transform",fD=u5.Transition.toString({property:fI,duration:0,easing:"linear"}),fz={roleDescription:"sortable"};function fR(e){var t,n,r,i;let{animateLayoutChanges:o=fP,attributes:a,disabled:l,data:s,getNewIndex:c=fM,id:u,strategy:d,resizeObserverConfig:f,transition:p=fT}=e,{items:h,containerId:m,activeIndex:g,disabled:y,disableTransforms:b,sortedRects:v,overIndex:x,useDragOverlay:w,strategy:k}=(0,G.useContext)(fC),_=(t=l,n=y,"boolean"==typeof t?{draggable:t,droppable:!1}:{draggable:null!=(r=null==t?void 0:t.draggable)?r:n.draggable,droppable:null!=(i=null==t?void 0:t.droppable)?i:n.droppable}),S=h.indexOf(u),E=(0,G.useMemo)(()=>({sortable:{containerId:m,index:S,items:h},...s}),[m,s,S,h]),j=(0,G.useMemo)(()=>h.slice(h.indexOf(u)),[h,u]),{rect:O,node:N,isOver:C,setNodeRef:A}=fp({id:u,data:E,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...f}}),{active:M,activatorEvent:P,activeNodeRect:T,attributes:I,setNodeRef:D,listeners:z,isDragging:R,over:L,setActivatorNodeRef:$,transform:B}=function(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,o=u0("Draggable"),{activators:a,activatorEvent:l,active:s,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:f}=(0,G.useContext)(ft),{role:p=fu,roleDescription:h="draggable",tabIndex:m=0}=null!=i?i:{},g=(null==s?void 0:s.id)===t,y=(0,G.useContext)(g?fl:fc),[b,v]=uY(),[x,w]=uY(),k=(0,G.useMemo)(()=>a.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[a,t]),_=uG(n);return uZ(()=>(d.set(t,{id:t,key:o,node:b,activatorNode:x,data:_}),()=>{let e=d.get(t);e&&e.key===o&&d.delete(t)}),[d,t]),{active:s,activatorEvent:l,activeNodeRect:c,attributes:(0,G.useMemo)(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":!!g&&p===fu||void 0,"aria-roledescription":h,"aria-describedby":u.draggable}),[r,p,m,g,h,u.draggable]),isDragging:g,listeners:r?void 0:k,node:b,over:f,setNodeRef:v,setActivatorNodeRef:w,transform:y}}({id:u,data:E,attributes:{...fz,...a},disabled:_.draggable}),F=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,G.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(A,D),U=!!M,H=U&&!b&&fS(g)&&fS(x),K=!w&&R,W=K&&H?B:null,q=H?null!=W?W:(null!=d?d:k)({rects:v,activeNodeRect:T,activeIndex:g,overIndex:x,index:S}):null,Z=fS(g)&&fS(x)?c({id:u,items:h,activeIndex:g,overIndex:x}):S,V=null==M?void 0:M.id,X=(0,G.useRef)({activeId:V,items:h,newIndex:Z,containerId:m}),Y=h!==X.current.items,J=o({active:M,containerId:m,isDragging:R,isSorting:U,id:u,index:S,items:h,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:p,wasDragging:null!=X.current.activeId}),Q=function(e){let{disabled:t,index:n,node:r,rect:i}=e,[o,a]=(0,G.useState)(null),l=(0,G.useRef)(n);return uZ(()=>{if(!t&&n!==l.current&&r.current){let e=i.current;if(e){let t=dw(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)},[t,n,r,i]),(0,G.useEffect)(()=>{o&&a(null)},[o]),o}({disabled:!J,index:S,node:N,rect:O});return(0,G.useEffect)(()=>{U&&X.current.newIndex!==Z&&(X.current.newIndex=Z),m!==X.current.containerId&&(X.current.containerId=m),h!==X.current.items&&(X.current.items=h)},[U,Z,m,h]),(0,G.useEffect)(()=>{if(V===X.current.activeId)return;if(null!=V&&null==X.current.activeId){X.current.activeId=V;return}let e=setTimeout(()=>{X.current.activeId=V},50);return()=>clearTimeout(e)},[V]),{active:M,activeIndex:g,attributes:I,data:E,rect:O,index:S,newIndex:Z,items:h,isOver:C,isSorting:U,isDragging:R,listeners:z,node:N,overIndex:x,over:L,setNodeRef:F,setActivatorNodeRef:$,setDroppableNodeRef:A,setDraggableNodeRef:D,transform:null!=Q?Q:q,transition:Q||Y&&X.current.newIndex===S?fD:(!K||u4(P))&&p&&(U||J)?u5.Transition.toString({...p,property:fI}):void 0}}hV.Down,hV.Right,hV.Up,hV.Left;let fL=e=>["order",e];function f$(e){return(0,ee.f)({queryKey:fL(e),queryFn:()=>ei.k.order.get(e),staleTime:6e4})}function fB(e){let t=(0,et.d)(),n=fL(e);return(0,Q.f)({mutationFn:({columnId:t,ids:n})=>ei.k.order.set(e,t,n),onMutate:async({columnId:e,ids:r})=>{await t.cancelQueries({queryKey:n});let i=t.getQueryData(n);return t.setQueryData(n,t=>({orders:{...t?.orders??{},[e]:r}})),{prev:i}},onError:(e,r,i)=>{i?.prev&&t.setQueryData(n,i.prev),el(e)},onSettled:()=>t.invalidateQueries({queryKey:n})})}function fF(e,t){return e&&t.includes(e)?"human":"agent"}function fU(e,t){return fF(e.created_by,t)}function fH(e,t){let n=e||"unknown";return"human"===t?`Human \xb7 ${n}`:`Agent \xb7 ${n}`}let fK={status:[],type:[],priority:[],origin:[],labels:[],assignee:[],search:""},fW=["status","type","priority","origin","label","assignee","q"];function fq(e,t){return[...new Set(e.getAll(t).filter(Boolean))]}function fZ(e,t,n){return fq(e,t).filter(e=>n.includes(e))}function fV(e,t){for(let t of fW)e.delete(t);for(let n of t.status)e.append("status",n);for(let n of t.type)e.append("type",n);for(let n of t.priority)e.append("priority",String(n));for(let n of t.origin)e.append("origin",n);for(let n of t.labels)e.append("label",n);for(let n of t.assignee)e.append("assignee",n);t.search&&e.set("q",t.search)}function fG(e){return e.assignee?.trim()||""}function fX(e){let t=new Set,n=!1;for(let r of e){let e=fG(r);""===e?n=!0:t.add(e)}let r=[...t].sort().map(e=>({value:e,label:e}));return n?[{value:"",label:"Unassigned"},...r]:r}function fY(e){let t=new Set;for(let n of e)for(let e of n.labels??[])"archived"!==e&&t.add(e);return[...t].sort().map(e=>({value:e,label:e}))}function fJ(e,t,n){if(t.status.length&&!t.status.includes(e.status)||t.type.length&&!t.type.includes(e.issue_type)||t.priority.length&&!t.priority.includes(e.priority)||t.origin.length&&!t.origin.includes(fU(e,n))||t.assignee.length&&!t.assignee.includes(fG(e))||t.labels.length&&!t.labels.some(t=>(e.labels??[]).includes(t)))return!1;let r=t.search.trim().toLowerCase();return!r||!!(e.title.toLowerCase().includes(r)||e.id.toLowerCase().includes(r)||(e.assignee??"").toLowerCase().includes(r)||(e.labels??[]).some(e=>e.toLowerCase().includes(r)))}function fQ(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function f0(){let{searchParams:e,updateUrl:t}=eI(),n=G.useMemo(()=>({status:fZ(e,"status",lk),type:fZ(e,"type",l_),priority:[...new Set(fq(e,"priority").filter(e=>/^[0-4]$/.test(e)).map(Number).filter(e=>Number.isInteger(e)&&e>=0&&e<=4))],origin:fZ(e,"origin",["human","agent"]),labels:fq(e,"label"),assignee:[...new Set(e.getAll("assignee"))],search:e.get("q")??""}),[e]),[r,i]=G.useState(null);null!==r&&r===n.search&&i(null);let o=G.useMemo(()=>null===r?n:{...n,search:r},[n,r]),a="1"===e.get("archived"),l=G.useRef(null);G.useEffect(()=>{let e=()=>{l.current=null,i(null)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]);let s=G.useCallback(e=>{let n=o.status.join("\0")===e.status.join("\0")&&o.type.join("\0")===e.type.join("\0")&&o.priority.join("\0")===e.priority.join("\0")&&o.origin.join("\0")===e.origin.join("\0")&&o.labels.join("\0")===e.labels.join("\0")&&o.assignee.join("\0")===e.assignee.join("\0")&&o.search!==e.search,r=n&&l.current===window.location.href?"replace":"push";i(e.search),t(t=>fV(t,e),r),l.current=n?window.location.href:null},[o,t]);return{filters:o,setFilters:s,showArchived:a,setShowArchived:G.useCallback(e=>{t(t=>{e?t.set("archived","1"):t.delete("archived")})},[t]),clearFilters:G.useCallback(()=>{i(""),t(e=>{fV(e,fK),e.delete("archived")})},[t])}}function f1({label:e,options:t,selected:n,onToggle:r,onClear:i}){let o=n.length>0;return(0,V.jsxs)(ul,{children:[(0,V.jsxs)(us,{className:"flex h-9 items-center gap-[6px] rounded-[9px] border px-[11px] text-label font-medium focus:outline-none tap-target",style:{borderColor:o?"var(--brand)":"var(--border)",background:o?"var(--brand-weak)":"var(--surface-2)",color:o?"var(--brand)":"var(--text-2)"},children:[(0,V.jsx)("span",{children:e}),o&&(0,V.jsx)("span",{className:"rounded-full bg-[var(--brand-solid)] px-[6px] text-meta font-semibold leading-[16px] text-white",children:n.length}),(0,V.jsx)(en.W,{name:"chevron",size:13,className:"opacity-60"})]}),(0,V.jsxs)(uc,{className:"w-[190px]",children:[(0,V.jsx)(uu,{children:e}),(0,V.jsx)(up,{}),t.map(e=>(0,V.jsx)(uf,{checked:n.includes(e.value),onCheckedChange:()=>r(e.value),closeOnClick:!1,children:e.label},e.value)),o&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(up,{}),(0,V.jsxs)(ud,{onClick:i,children:["Clear ",e.toLowerCase()]})]})]})]})}function f2({filters:e,onChange:t,labelOptions:n,assigneeOptions:r,showArchived:i,onShowArchived:o,onClearAllAction:a}){let l=n=>t({...e,...n}),[s,c]=G.useState(!1),u=G.useId(),d=+!!e.status.length+ +!!e.type.length+ +!!e.priority.length+ +!!e.origin.length+ +!!e.labels.length+ +!!e.assignee.length+ +!!e.search.trim()+ +!!i;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("div",{className:"relative h-9 min-w-9 max-w-[280px] flex-1 max-md:order-1 max-md:h-11 max-md:max-w-none max-md:basis-full",children:(0,V.jsxs)("label",{className:"absolute inset-y-0 left-0 z-10 flex w-full cursor-text items-center gap-[7px] overflow-hidden rounded-[9px] border border-border bg-[var(--surface-2)] px-[11px] transition-[width] duration-150 focus-within:z-30 focus-within:w-[280px] focus-within:shadow-lg max-md:focus-within:w-full",children:[(0,V.jsx)(en.W,{name:"search",size:15,className:`flex-shrink-0 ${e.search.trim()?"text-[var(--brand)]":"text-[var(--text-3)]"}`}),(0,V.jsx)("input",{"data-search":!0,value:e.search,onChange:e=>l({search:e.target.value}),placeholder:"Search beads… (/)",className:"w-full min-w-0 border-none bg-transparent text-body text-[var(--text)] outline-none"})]})}),(0,V.jsxs)(er.K,{"aria-expanded":s,"aria-controls":u,onClick:()=>c(e=>!e),className:"max-md:order-2 md:hidden",style:d>0?{borderColor:"var(--brand)",color:"var(--brand)"}:void 0,children:[(0,V.jsx)(en.W,{name:"settings",size:14}),(0,V.jsx)("span",{children:d>0?`Filters \xb7 ${d}`:"Filters"}),(0,V.jsx)(en.W,{name:"chevron",size:13,className:`opacity-60 transition-transform ${s?"rotate-180":""}`})]}),(0,V.jsxs)("div",{id:u,className:`${s?"flex":"max-md:hidden md:flex"} flex-wrap items-center gap-[7px] max-md:order-4 max-md:basis-full`,children:[(0,V.jsx)(f1,{label:"Status",options:lk.map(e=>({value:e,label:lB(e)})),selected:e.status,onToggle:t=>l({status:fQ(e.status,t)}),onClear:()=>l({status:[]})}),(0,V.jsx)(f1,{label:"Type",options:l_.filter(e=>"epic"!==e).map(e=>({value:e,label:lW(e)})),selected:e.type,onToggle:t=>l({type:fQ(e.type,t)}),onClear:()=>l({type:[]})}),(0,V.jsx)(f1,{label:"Priority",options:[0,1,2,3,4].map(e=>({value:String(e),label:lH(e)})),selected:e.priority.map(String),onToggle:t=>{var n,r;return l({priority:(n=e.priority,r=Number(t),n.includes(r)?n.filter(e=>e!==r):[...n,r])})},onClear:()=>l({priority:[]})}),n.length>0&&(0,V.jsx)(f1,{label:"Labels",options:n,selected:e.labels,onToggle:t=>l({labels:fQ(e.labels,t)}),onClear:()=>l({labels:[]})}),r.length>0&&(0,V.jsx)(f1,{label:"Assignee",options:r,selected:e.assignee,onToggle:t=>l({assignee:fQ(e.assignee,t)}),onClear:()=>l({assignee:[]})}),(0,V.jsx)(f1,{label:"Origin",options:[{value:"human",label:"Human"},{value:"agent",label:"Agent"}],selected:e.origin,onToggle:t=>l({origin:fQ(e.origin,t)}),onClear:()=>l({origin:[]})}),(0,V.jsx)(er.K,{icon:"archive",pressed:i,title:"Toggle archived",onClick:()=>o(!i),children:"Archived"}),d>0&&(0,V.jsxs)(er.K,{icon:"x",title:"Clear all filters",onClick:()=>{a?a():(t(fK),o(!1))},children:["Clear · ",d]})]})]})}function f3({title:e,subtitle:t,controls:n,actions:r}){return(0,V.jsxs)("header",{className:"flex flex-shrink-0 flex-wrap items-center gap-x-3 gap-y-3 border-b border-border bg-[var(--surface)] p-[14px_22px] max-md:p-[12px_16px]",children:[(0,V.jsxs)("div",{className:"mr-1 flex min-w-0 flex-col gap-px max-md:order-1 max-md:flex-1",children:[(0,V.jsx)("h1",{className:"m-0 text-page-title font-semibold tracking-[-.01em]",children:e}),t&&(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:t})]}),n&&(0,V.jsx)("div",{className:"contents max-md:order-3 max-md:flex max-md:basis-full max-md:flex-wrap max-md:items-center max-md:gap-2",children:n}),r&&(0,V.jsx)("div",{className:"flex flex-shrink-0 items-center gap-3 max-md:order-2",children:r})]})}let f4=[{id:"backlog",name:"Backlog",color:"#64748b",cmd:"deferred",droppable:!0,status:"deferred",test:e=>"deferred"===e.status},{id:"ready",name:"Ready",color:"#3b82f6",cmd:"bd ready",droppable:!0,status:"open",test:(e,t)=>"open"===e.status&&!t},{id:"in_progress",name:"In Progress",color:"#d97706",cmd:"in_progress",droppable:!0,status:"in_progress",test:e=>"in_progress"===e.status||"hooked"===e.status},{id:"blocked",name:"Blocked",color:"#ef4444",cmd:"bd blocked",droppable:!1,test:(e,t)=>t&&"deferred"!==e.status&&"closed"!==e.status},{id:"done",name:"Done",color:"#16a34a",cmd:"closed",droppable:!0,status:"closed",test:e=>"closed"===e.status}],f9=f4.map(e=>e.id);function f5(e){let t=Date.parse(e.updated_at||e.created_at||"");return Number.isFinite(t)?t:-1/0}function f6(e,t){return f5(t)-f5(e)||e.priority-t.priority||e.id.localeCompare(t.id)}function f8(e){navigator.clipboard?navigator.clipboard.writeText(e).then(()=>X.c.success(`Copied ${e}`),()=>X.c.error("Couldn’t copy to clipboard")):X.c.error("Clipboard unavailable in this context")}function f7({id:e,className:t}){return(0,V.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),t.preventDefault(),f8(e)},title:`Copy ${e}`,className:(0,uo.f)("cursor-pointer text-left underline-offset-2 hover:text-[var(--brand)] hover:underline",t),children:e})}function pe(e){return`color-mix(in srgb, ${e} 50%, var(--text))`}function pt(e,t="1c"){return{color:pe(e),background:`${e}${t}`,border:`1px solid ${e}33`}}function pn({color:e,tone:t="muted",mono:n=!1,className:r="",style:i,children:o,...a}){let l=`border border-border bg-[var(--surface-2)] ${"strong"===t?"text-[var(--text-2)]":"text-[var(--text-3)]"}`;return(0,V.jsx)("span",{...a,className:`inline-flex items-center rounded-full px-2 py-px text-meta ${e?"font-semibold tracking-[.01em]":l} ${n?"font-mono":""} ${r}`,style:e?{...pt(e),...i}:i,children:o})}function pr({status:e}){return(0,V.jsx)(pn,{color:lL(e),children:lB(e)})}function pi({bead:e,childCount:t=0}){let{openDetail:n,readOnly:r,selectedBeadId:i,selectBead:o}=eu(),a=eO(),l=r||a,{attributes:s,listeners:c,setNodeRef:u,transform:d,transition:f,isDragging:p}=fR({id:e.id,disabled:l});return(0,V.jsx)("article",{ref:u,...a?{}:c,...l?{role:"button",tabIndex:0}:s,...l?{onKeyDown:t=>{t.target===t.currentTarget&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(e.id))}}:{},"data-keyboard-bead-id":e.id,"aria-current":i===e.id?"true":void 0,onFocus:()=>o(e.id),onClick:()=>{o(e.id),n(e.id)},style:{transform:u5.Transform.toString(d),transition:f,opacity:p?.4:1,zIndex:p?10:void 0},className:`flex cursor-pointer flex-col md:touch-none gap-[9px] rounded-[11px] border bg-[var(--surface)] p-[12px_13px] shadow-[var(--shadow)] transition-[border-color] hover:border-2 hover:p-[11px_12px] focus-visible:outline-none ${i===e.id?"border-[var(--brand)] hover:border-[var(--text-3)] ring-2 ring-[var(--brand)]/30":"border-border hover:border-[var(--text-3)]"}`,children:(0,V.jsx)(pa,{bead:e,childCount:t})})}function po({bead:e,childCount:t=0}){return(0,V.jsx)("article",{"aria-hidden":"true",className:"flex cursor-grabbing flex-col gap-[9px] rounded-[11px] border-2 border-[var(--text-3)] bg-[var(--surface)] p-[11px_12px] shadow-[var(--shadow)]",children:(0,V.jsx)(pa,{bead:e,childCount:t,preview:!0})})}function pa({bead:e,childCount:t,preview:n=!1}){let r=eO(),{index:i,humanAllowlist:o}=eu(),a=fU(e,o),l=lY(e,i),s=lG(e,i),c=(e.labels??[]).filter(e=>"archived"!==e).slice(0,2),u=(e.dependencies??[]).filter(e=>"parent-child"!==e.type).length,d=(e.comments??[]).length,f=lz(e.description);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{className:"flex items-center gap-2",children:[(0,V.jsx)("span",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:lL(e.status)},title:lB(e.status)}),n||r?(0,V.jsx)("span",{className:"font-mono text-meta tracking-[-.01em] text-[var(--text-3)]",children:e.id}):(0,V.jsx)(f7,{id:e.id,className:"font-mono text-meta tracking-[-.01em] text-[var(--text-3)]"}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)(pl,{p:e.priority}),(0,V.jsx)(ps,{origin:a,title:fH(e.created_by,a)})]}),(0,V.jsx)("div",{className:"text-body font-medium leading-[1.35] tracking-[-.006em] text-[var(--text)] [text-wrap:pretty]",children:e.title}),(0,V.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,V.jsxs)("span",{className:"inline-flex items-center gap-[5px] text-meta text-[var(--text-2)]",children:[(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:13,style:{color:lK(e.issue_type)}}),(0,V.jsx)("span",{children:lW(e.issue_type)})]}),c.map(e=>(0,V.jsx)("span",{className:"rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px font-mono text-meta text-[var(--text-3)]",children:e},e))]}),(0,V.jsxs)("div",{className:"mt-px flex items-center gap-[10px] border-t border-border pt-[9px]",children:[(0,V.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-[6px]",children:[(0,V.jsx)("span",{className:"flex h-[19px] w-[19px] flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.assignee??"")},children:lV(e.assignee??"")}),(0,V.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-meta text-[var(--text-2)]",children:e.assignee||"Unassigned"})]}),(0,V.jsx)("span",{className:"flex-1"}),u>0&&(0,V.jsxs)("span",{title:"dependencies",className:"inline-flex items-center gap-[3px] font-mono text-meta",style:{color:s?pe("#ef4444"):"var(--text-3)"},children:[(0,V.jsx)(en.W,{name:"link",size:13}),u]}),d>0&&(0,V.jsxs)("span",{title:"comments",className:"inline-flex items-center gap-[3px] font-mono text-meta text-[var(--text-3)]",children:[(0,V.jsx)(en.W,{name:"comment",size:13}),d]}),f.total>0&&(0,V.jsxs)("span",{title:"checklist progress",className:"inline-flex items-center gap-[3px] font-mono text-meta",style:{color:f.done===f.total?pe("#16a34a"):"var(--text-3)"},children:[(0,V.jsx)(en.W,{name:"check",size:13}),f.done,"/",f.total]}),l&&(0,V.jsxs)("span",{title:`${l.id} \xb7 ${l.title}`,className:"epic"===l.issue_type?"inline-flex max-w-[96px] items-center gap-1 rounded-md bg-[var(--brand-weak)] px-[6px] py-px text-meta font-medium text-[var(--brand)]":"inline-flex max-w-[96px] items-center gap-1 rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px text-meta font-medium text-[var(--text-3)]",children:[(0,V.jsx)(en.W,{name:"epic"===l.issue_type?"target":(0,en.F)(l.issue_type),size:11,className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:l.title.replace(/\s*\([^)]*\)\s*/,"")})]}),t>0&&(0,V.jsxs)("span",{title:`${t} subtask${1===t?"":"s"}`,className:"inline-flex items-center gap-1 rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px text-meta font-medium text-[var(--text-3)]",children:[(0,V.jsx)(en.W,{name:"list",size:11,className:"flex-shrink-0"}),t]})]})]})}function pl({p:e}){let t=lF[e]??"#64748b";return(0,V.jsx)("span",{className:"inline-flex flex-shrink-0 items-center rounded-md px-[7px] py-[3px] text-meta font-semibold leading-none tracking-[.01em]",style:pt(t,"1f"),children:lH(e)})}function ps({origin:e,title:t,withLabel:n=!1}){let r="human"===e;return(0,V.jsxs)("span",{title:t,className:"inline-flex flex-shrink-0 items-center justify-center gap-[5px] rounded-md ",style:n?{padding:"3px 9px",color:r?"var(--text-2)":"var(--brand)",background:r?"var(--surface-2)":"var(--brand-weak)",border:`1px solid ${r?"var(--border)":"transparent"}`}:{width:20,height:20,color:r?"var(--text-2)":"var(--brand)",background:r?"var(--surface-2)":"var(--brand-weak)",border:`1px solid ${r?"var(--border)":"var(--brand-weak)"}`},children:[(0,V.jsx)(en.W,{name:r?"user":"bot",size:n?13:12}),n&&(r?"Human":"Agent")]})}function pc({col:e,cards:t,childCounts:n,control:r,manualSort:i=!0,dropTarget:o=!1}){let{setNodeRef:a}=fp({id:e.id,disabled:!e.droppable}),l=eO(),[s,c]=G.useState(null),u=l&&(s??"done"===e.id),d=G.useId();return(0,V.jsxs)("section",{className:"flex w-[296px] min-h-0 flex-shrink-0 flex-col max-md:w-full max-md:flex-shrink",children:[(0,V.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-2 px-1 pb-3 max-md:pb-2",children:[(0,V.jsxs)("button",{type:"button","aria-expanded":!u,"aria-controls":d,disabled:!l,onClick:()=>c(!u),className:"flex min-w-0 items-center gap-2 text-left max-md:min-h-11 max-md:flex-1 md:cursor-default",children:[(0,V.jsx)("span",{className:"h-[9px] w-[9px] flex-shrink-0 rounded-[3px]",style:{background:e.color}}),(0,V.jsx)("span",{className:"text-body font-semibold tracking-[-.005em]",children:e.name}),(0,V.jsx)(pn,{mono:!0,children:t.length}),(0,V.jsx)(en.W,{name:"chevron",size:14,className:`text-[var(--text-3)] transition-transform md:hidden ${u?"-rotate-90":""}`})]}),(0,V.jsx)("span",{className:"flex-1 max-md:hidden"}),r??(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:e.cmd})]}),(0,V.jsxs)("div",{id:d,ref:a,hidden:u,className:(0,uo.f)("bd-scroll flex min-h-0 flex-1 flex-col gap-[10px] overflow-y-auto overflow-x-hidden rounded-xl p-[4px_4px_14px] transition-[background,outline] max-md:overflow-visible max-md:p-[4px_0_14px]",u&&"hidden",o?"bg-[var(--brand-weak)] outline-2 outline-dashed outline-[var(--brand)] -outline-offset-2":"outline-2 outline-transparent"),children:[(0,V.jsx)(fA,{items:t.map(e=>e.id),strategy:i?fO:()=>null,children:t.map(e=>(0,V.jsx)(pi,{bead:e,childCount:n?.get(e.id)??0},e.id))}),0===t.length&&(0,V.jsx)("div",{className:"rounded-[11px] border-[1.5px] border-dashed border-border p-[22px_12px] text-center text-label text-[var(--text-3)]",children:"No beads"})]})]})}let pu=e=>{let t=(e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let i=[];for(let e of t){let{id:t}=e,o=n.get(t);if(o&&function(e,t){let{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}(r,o)){let n=Number((dp(o).reduce((e,t)=>e+du(r,t),0)/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(dd)})(e);return t.length>0?t:(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=dp(t),o=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=dp(r),a=Number((i.reduce((e,t,r)=>e+du(n[r],t),0)/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:a}})}}return o.sort(dd)})(e)};function pd(){let{beads:e,index:t,humanAllowlist:n,openCreate:r,loading:i,projectId:o,readOnly:a}=eu(),l=em(),{data:s}=f$(o),c=fB(o),{prefs:u,setPrefs:d}=uP(),f=G.useMemo(()=>s?.orders??{},[s]),{filters:p,setFilters:h,showArchived:m,setShowArchived:g,clearFilters:y}=f0(),{searchParams:b,updateUrl:v}=eI(),x=G.useMemo(()=>fY(e),[e]),w=G.useMemo(()=>fX(e),[e]),k=G.useMemo(()=>lJ(e),[e]),_=Number(b.get("done")),S=[7,28,90,365].includes(_)?_:null,E=G.useCallback(e=>{v(t=>{null===e?t.delete("done"):t.set("done",String(e))})},[v]),[j]=G.useState(()=>Date.now()),O=eO(),N=dl(dZ,{activationConstraint:{distance:5}}),C=ds(...O?[]:[N]),[A,M]=G.useState(null),[P,T]=G.useState(null),I=G.useCallback(e=>!("epic"===e.issue_type||!m&&(e.labels??[]).includes("archived"))&&fJ(e,p,n),[p,m,n]),D=G.useMemo(()=>e.filter(I),[e,I]),z=G.useMemo(()=>f4.map(e=>{var n,r;let i,o=D.filter(n=>e.test(n,lG(n,t)));if("done"===e.id&&null!==S){let e=j-864e5*S;o=o.filter(t=>{let n=Date.parse(t.closed_at||t.updated_at||"");return Number.isFinite(n)&&n>=e})}return{col:e,cards:(n=o,r=u.sortMode,i=new Map((f[e.id]??[]).map((e,t)=>[e,t])),[...n].sort((e,t)=>{if("updated"===r)return f6(e,t);if("priority"===r)return e.priority-t.priority||f6(e,t);let n=i.get(e.id)??1/0,o=i.get(t.id)??1/0;return n!==o?n-o:e.priority-t.priority}))}}),[D,t,f,u.sortMode,S,j]),R=G.useMemo(()=>z.filter(({col:e,cards:t})=>"blocked"!==e.id||t.length>0||"always"===u.blockedColumn),[z,u.blockedColumn]),L=G.useMemo(()=>{let e=new Map;for(let{col:t,cards:n}of z)for(let r of n)e.set(r.id,t.id);return e},[z]);function $(e){if(e)return f4.some(t=>t.id===e)?e:L.get(e)}function B(){M(null),T(null)}let F=A?t.get(A):void 0,U=A?L.get(A):void 0,H=f4.find(e=>e.id===P&&e.id!==U&&e.droppable&&e.status&&F?.status!==e.status);return(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"Board",subtitle:(0,V.jsxs)(V.Fragment,{children:[D.length," beads · live from ",(0,V.jsx)("span",{className:"font-mono",children:"bd list"})]}),actions:!a&&(0,V.jsx)(ub.f,{icon:"plus",onClick:()=>r(),children:"New"}),controls:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f2,{filters:p,onChange:h,labelOptions:x,assigneeOptions:w,showArchived:m,onShowArchived:g,onClearAllAction:y}),(0,V.jsxs)("label",{className:"flex h-9 flex-shrink-0 items-center gap-[7px] rounded-[9px] border border-border bg-[var(--surface-2)] px-[10px] text-label text-[var(--text-2)] tap-target max-md:order-3",title:"manual"===u.sortMode?"Drag to reorder cards or move them between status columns":"Drag between status columns; choose Manual to reorder within a column",children:[(0,V.jsx)("span",{className:"font-medium",children:"Sort"}),(0,V.jsxs)("select",{"aria-label":"Sort board cards",value:u.sortMode,onChange:e=>d({...u,sortMode:e.target.value}),className:"cursor-pointer border-none bg-transparent text-label font-semibold text-[var(--text)] outline-none",children:[(0,V.jsx)("option",{value:"priority",children:"Priority"}),(0,V.jsx)("option",{value:"updated",children:"Recently updated"}),(0,V.jsx)("option",{value:"manual",children:"Manual"})]})]})]})}),(0,V.jsx)("div",{className:"bd-scroll min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-[18px_22px] max-md:overflow-x-hidden max-md:overflow-y-auto max-md:p-[8px_16px_24px]",children:i&&0===e.length?(0,V.jsx)("div",{className:"text-body text-[var(--text-3)]",children:"Loading beads…"}):(0,V.jsxs)(fs,{sensors:C,collisionDetection:pu,onDragStart:function(e){M(String(e.active.id))},onDragOver:function(e){T($(e.over?.id?String(e.over.id):null)??null)},onDragEnd:function(e){if(B(),a)return;let n=String(e.active.id),r=e.over?.id?String(e.over.id):null;if(!r)return;let i=L.get(n);if(!i)return;let o=$(r);if(!o)return;if(o!==i){let e=f4.find(e=>e.id===o);if(!e||!e.droppable||!e.status)return;let r=t.get(n);if(!r||r.status===e.status)return;l.mutate({id:n,status:e.status});return}if("manual"!==u.sortMode)return;let s=(z.find(e=>e.col.id===i)?.cards??[]).map(e=>e.id),d=s.indexOf(n),f=r===i?s.length-1:s.indexOf(r);-1!==d&&-1!==f&&d!==f&&c.mutate({columnId:i,ids:f_(s,d,f)})},onDragCancel:B,children:[(0,V.jsx)("div",{className:"flex h-full min-h-0 gap-4 max-md:h-auto max-md:flex-col max-md:gap-1",children:R.map(({col:e,cards:t})=>(0,V.jsx)(pc,{col:e,cards:t,childCounts:k,manualSort:"manual"===u.sortMode,dropTarget:H?.id===e.id,control:"done"===e.id?(0,V.jsxs)("select",{value:S??"",onChange:e=>E(""===e.target.value?null:Number(e.target.value)),title:"Show only beads closed within this window",className:"tap-target cursor-pointer rounded-[7px] border border-border bg-[var(--surface-2)] px-[7px] py-[3px] text-meta text-[var(--text-2)] outline-none",children:[(0,V.jsx)("option",{value:"",children:"All time"}),(0,V.jsx)("option",{value:"7",children:"Last 7 days"}),(0,V.jsx)("option",{value:"28",children:"Last 4 weeks"}),(0,V.jsx)("option",{value:"90",children:"Last 3 months"}),(0,V.jsx)("option",{value:"365",children:"Last 12 months"})]}):void 0},e.id))}),(0,V.jsx)(fk,{dropAnimation:null,children:F?(0,V.jsx)(po,{bead:F,childCount:k.get(F.id)??0}):null})]})})]})}let pf=[{id:"claude-code",name:"claude-code",label:"Claude Code",color:"#d97757",enabled:!0},{id:"codex",name:"codex",label:"Codex",color:"#10a37f",enabled:!1},{id:"cursor",name:"cursor-agent",label:"Cursor",color:"#4b5563",enabled:!1},{id:"gemini",name:"gemini",label:"Gemini CLI",color:"#4285f4",enabled:!1},{id:"copilot",name:"copilot",label:"GitHub Copilot",color:"#8957e5",enabled:!1}],pp=["🤖","🧠","⚡","🛠️","🚀","🦾","🔮","🛰️","🦉","🐙","🦊","🐱","🧪","🎯","🌟","🧩"],ph=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#8b5cf6","#ec4899"],pm=ph[5];function pg(e){return pf.find(t=>t.id===e)}function py(e,t){let n=t?.trim().toLowerCase();if(n)return(e??[]).find(e=>e.name.trim().toLowerCase()===n)}let pb={"claude-code":(0,V.jsx)("path",{d:"M12 3.5v17M3.5 12h17M6 6l12 12M18 6 6 18",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",fill:"none"}),codex:(0,V.jsxs)("g",{stroke:"#fff",strokeWidth:"1.9",strokeLinejoin:"round",fill:"none",children:[(0,V.jsx)("path",{d:"M12 3.4 19.4 7.7v8.6L12 20.6 4.6 16.3V7.7z"}),(0,V.jsx)("path",{d:"M12 8.4l3.2 1.9v3.8L12 16l-3.2-1.9v-3.8z"})]}),cursor:(0,V.jsx)("path",{d:"M6.5 4.5 19 11l-5.6 1.8L11.5 18.5z",fill:"#fff"}),gemini:(0,V.jsx)("path",{d:"M12 3c.7 5 4 8.3 9 9-5 .7-8.3 4-9 9-.7-5-4-8.3-9-9 5-.7 8.3-4 9-9z",fill:"#fff"}),copilot:(0,V.jsxs)("g",{stroke:"#fff",strokeWidth:"1.9",fill:"none",strokeLinecap:"round",children:[(0,V.jsx)("path",{d:"M5 11a3 3 0 0 1 3-3h8a3 3 0 0 1 3 3v3a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3z"}),(0,V.jsx)("path",{d:"M9.2 12v1.6M14.8 12v1.6"})]})};function pv({agent:e,size:t=18}){let n=pg(e.id),r=n?n.color:e.emoji?"var(--surface-3)":e.color??pm;return(0,V.jsx)("span",{"aria-hidden":"true","data-agent-icon":e.id,className:"flex shrink-0 items-center justify-center overflow-hidden rounded-full font-semibold leading-none text-white",style:{width:t,height:t,background:r,fontSize:Math.round(.5*t)},children:n?(0,V.jsx)("svg",{viewBox:"0 0 24 24",width:Math.round(.72*t),height:Math.round(.72*t),children:pb[n.id]}):e.emoji?(0,V.jsx)("span",{style:{fontSize:Math.round(.62*t)},children:e.emoji}):lV(e.name)})}function px(e){return Number.isFinite(Date.parse(e.closed_at||""))?e.closed_at||void 0:Number.isFinite(Date.parse(e.updated_at||""))?e.updated_at:void 0}function pw(e){return Date.parse(px(e)||"")||0}function pk(e,t){let n=(e.labels??[]).find(e=>e.startsWith(t));return n?n.slice(t.length):null}function p_(){let{beads:e,index:t,meta:n,loading:r}=eu(),i=n?.lanePrefix??null,[o,a]=G.useState("none"),[l,s]=G.useState(!1),[c,u]=G.useState(!1),[d,f]=G.useState(null),[p,h]=G.useState(null),m=G.useMemo(()=>e.filter(e=>!(e.labels??[]).includes("archived")),[e]),g=G.useMemo(()=>{if(!i)return[];let e=new Set;for(let t of m){if(!["in_progress","hooked","blocked","open"].includes(t.status)&&!(l&&"closed"===t.status))continue;let n=pk(t,i);n&&e.add(n)}return[...e].sort()},[m,i,l]),y=d&&!g.includes(d)?null:d,b=G.useMemo(()=>(n?.agents??[]).filter(e=>e.enabled),[n?.agents]),v=b.find(e=>e.id===p)??null,x=G.useCallback(e=>{if(v&&py([v],e.assignee)?.id!==v.id)return!1;if(!i||null===y)return!0;let t=pk(e,i);return""===y?null===t:t===y},[i,y,v]),w=G.useMemo(()=>m.filter(e=>("in_progress"===e.status||"hooked"===e.status)&&x(e)),[m,x]),k=G.useMemo(()=>m.filter(e=>lG(e,t)&&x(e)),[m,t,x]),_=G.useMemo(()=>m.filter(e=>"open"===e.status&&(null!==v||e.priority<=1)&&!lG(e,t)&&x(e)),[m,t,x,v]),S=m.filter(e=>"closed"===e.status&&x(e)).sort((e,t)=>pw(t)-pw(e)||e.id.localeCompare(t.id)),E=c?S:S.slice(0,7),j=[{id:"flight",title:"In flight",hint:"in progress or hooked",items:w},{id:"blocked",title:"Blocked",hint:"waiting on a dependency or marked blocked",items:k},{id:"next",title:"Next up",hint:v?"ready · any priority":"ready · P0/P1",items:_},...l?[{id:"recent",title:"Recently finished",hint:"latest completions",items:E}]:[]],O="assignee"===o?function(e){let t=new Map;for(let[n,r]of e.entries())for(let i of r.items){let o=i.assignee?.trim()?`person:${i.assignee.trim()}`:"none",a=t.get(o);a||(a={key:o,label:i.assignee?.trim()||"No assignee",columns:e.map(e=>({...e,items:[]})),active:!1},t.set(o,a)),a.columns[n].items.push(i),a.active||="flight"===r.id}return[...t.values()].sort((e,t)=>Number("none"===e.key)-Number("none"===t.key)||Number(t.active)-Number(e.active)||e.label.localeCompare(t.label)||e.key.localeCompare(t.key))}(j):[];return(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"Focus",subtitle:r&&0===e.length?"what’s happening now · loading…":(0,V.jsxs)(V.Fragment,{children:["what’s happening now · ",w.length," in flight · ",k.length," blocked ·"," ",_.length," next up"]}),controls:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:"flex-1 max-md:hidden"}),(0,V.jsxs)("label",{className:"flex items-center gap-2 text-label text-[var(--text-2)] tap-target",children:["Group by",(0,V.jsxs)(er.$,{size:"sm",value:o,onChange:e=>a("assignee"===e.target.value?"assignee":"none"),children:[(0,V.jsx)("option",{value:"none",children:"None"}),(0,V.jsx)("option",{value:"assignee",children:"Assignee"})]})]}),(0,V.jsx)(er.K,{size:"sm",variant:"outline",pressed:l,onClick:()=>{s(!l),u(!1)},children:"Recently finished"}),b.length>0&&(0,V.jsxs)("div",{role:"group","aria-label":"Agent queue",className:"flex flex-wrap items-center gap-[6px] max-md:basis-full",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:"Agent"}),(0,V.jsx)(pE,{label:"All",selected:null===v,onClick:()=>h(null)}),b.map(e=>(0,V.jsx)(pE,{label:e.name,icon:(0,V.jsx)(pv,{agent:e,size:14}),selected:v?.id===e.id,onClick:()=>h(v?.id===e.id?null:e.id)},e.id))]}),i&&g.length>0&&(0,V.jsxs)("div",{className:"flex flex-wrap items-center gap-[6px] max-md:basis-full",children:[(0,V.jsx)(pE,{label:"All",selected:null===y,onClick:()=>f(null)}),g.map(e=>(0,V.jsx)(pE,{label:e,selected:y===e,onClick:()=>f(y===e?null:e)},e)),(0,V.jsx)(pE,{label:"unlabeled",selected:""===y,onClick:()=>f(""===y?null:"")})]})]})}),l&&(0,V.jsxs)("div",{className:"flex flex-shrink-0 flex-wrap items-center gap-3 border-b border-border px-[22px] py-2 text-label text-[var(--text-2)] max-md:px-4",children:[(0,V.jsxs)("span",{"aria-live":"polite",children:["Showing ",E.length," of ",S.length," completed beads"]}),S.length>7&&(0,V.jsx)(er.W,{tone:"brand",className:"rounded px-2 py-1 font-medium hover:bg-[var(--brand-weak)]",onClick:()=>u(!c),children:c?"Show latest 7":`Show all ${S.length} completed`}),(0,V.jsx)("span",{className:"text-[var(--text-3)]",children:"Current lane filter applies. Active and blocked work is always shown in full."})]}),"none"===o?(0,V.jsx)("div",{className:"bd-scroll min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-[18px_22px] max-md:overflow-x-hidden max-md:overflow-y-auto max-md:p-[8px_16px_24px]",children:(0,V.jsx)("div",{className:"flex h-full min-h-0 gap-4 max-md:h-auto max-md:flex-col max-md:gap-1",children:j.map(e=>(0,V.jsx)(pS,{column:e},e.id))})}):(0,V.jsx)("div",{className:"bd-scroll min-h-0 flex-1 overflow-auto p-[18px_22px] max-md:p-[8px_16px_24px]",children:0===O.length?(0,V.jsx)("p",{className:"p-4 text-body text-[var(--text-3)]",children:"No matching work. Try another lane or include recently finished work."}):(0,V.jsxs)("div",{className:"min-w-max max-md:min-w-0",children:[(0,V.jsxs)("div",{className:"sticky top-0 z-10 mb-2 flex gap-4 bg-[var(--bg)] py-2 max-md:hidden","aria-hidden":"true",children:[(0,V.jsx)("div",{className:"w-[160px] shrink-0 text-label font-medium text-[var(--text-3)]",children:"Assignee"}),j.map(e=>(0,V.jsxs)("div",{className:"w-[280px] shrink-0 text-body font-semibold",children:[e.title," ",(0,V.jsxs)("span",{className:"font-normal text-[var(--text-3)]",children:["· ",e.items.length]})]},e.id))]}),O.map(e=>(0,V.jsxs)("section",{"aria-label":`Assignee: ${e.label}`,className:"flex gap-4 border-t border-border py-4 max-md:flex-col max-md:gap-2",children:[(0,V.jsxs)("div",{className:"w-[160px] shrink-0 max-md:w-full",children:[(0,V.jsxs)("h2",{className:"flex items-center gap-[6px] break-words text-body font-semibold",children:[py(n?.agents,e.label)&&(0,V.jsx)(pv,{agent:py(n?.agents,e.label),size:16}),e.label]}),(0,V.jsxs)("p",{className:"mt-1 text-meta text-[var(--text-3)]",children:["none"===e.key?"Not assigned":"Assigned work"," · ",e.columns.reduce((e,t)=>e+t.items.length,0)]})]}),e.columns.map(e=>(0,V.jsx)(pS,{column:e,grouped:!0},e.id))]},e.key))]})})]})}function pS({column:e,grouped:t=!1}){let n=eO(),[r,i]=G.useState(null),o=n&&!t&&(r??0===e.items.length),a=G.useId();return(0,V.jsxs)("section",{"data-focus-column":e.id,"aria-label":t?e.title:void 0,className:t?"w-[280px] shrink-0 max-md:w-full":"flex h-full min-h-0 w-[320px] shrink-0 flex-col max-md:h-auto max-md:w-full max-md:shrink",children:[!t&&(0,V.jsxs)("div",{className:"relative mb-2 flex flex-wrap items-baseline gap-2 px-1 max-md:min-h-11 max-md:flex-nowrap max-md:items-center",children:[(0,V.jsx)("h2",{className:"m-0 text-body font-semibold text-[var(--text)]",children:n?(0,V.jsx)("button",{type:"button","aria-expanded":!o,"aria-controls":a,"aria-label":`${e.title} lane`,onClick:()=>i(!o),className:"tap-target flex items-center text-left after:absolute after:inset-0",children:e.title}):e.title}),(0,V.jsxs)("span",{className:"text-meta text-[var(--text-3)] max-md:min-w-0 max-md:truncate",children:[e.items.length," · ",e.hint]}),(0,V.jsx)(en.W,{name:"chevron",size:14,className:`pointer-events-none ml-auto text-[var(--text-3)] transition-transform md:hidden ${o?"-rotate-90":""}`})]}),(0,V.jsx)("div",{id:a,hidden:o,className:`rounded-[12px] border border-border bg-[var(--surface-2)] p-2 ${o?"hidden":""} ${t?"min-h-[70px]":"bd-scroll min-h-0 flex-1 overflow-y-auto max-md:overflow-visible"}`,children:0===e.items.length?(0,V.jsx)("div",{className:"p-4 text-center text-label text-[var(--text-3)]",children:"Nothing here."}):(0,V.jsx)("div",{className:"flex flex-col gap-2",children:e.items.map(t=>(0,V.jsx)(pj,{bead:t,showBlockers:"blocked"===e.id},t.id))})})]})}function pE({label:e,selected:t,onClick:n,icon:r}){return(0,V.jsxs)("button",{"aria-pressed":t,onClick:n,className:"tap-target inline-flex items-center gap-[6px] rounded-full border px-[10px] py-[3px] text-meta font-medium transition-colors",style:t?{borderColor:"var(--brand)",background:"var(--brand-weak)",color:"var(--brand)"}:{borderColor:"var(--border)",background:"var(--surface)",color:"var(--text-2)"},children:[r,e]})}function pj({bead:e,showBlockers:t}){let{index:n,openDetail:r,selectedBeadId:i,selectBead:o}=eu(),a=t?lX(e,n):[],l="closed"===e.status?px(e):e.updated_at;return(0,V.jsxs)("article",{role:"button",tabIndex:0,"aria-label":e.title,"data-keyboard-bead-id":e.id,"aria-current":i===e.id?"true":void 0,onFocus:()=>o(e.id),onKeyDown:t=>{t.target===t.currentTarget&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),r(e.id))},onClick:()=>{o(e.id),r(e.id)},className:`cursor-pointer rounded-[11px] border bg-[var(--surface)] p-[10px_12px] shadow-[var(--shadow)] hover:border-[var(--border-strong)] hover:shadow-[var(--shadow-lg)] focus-visible:outline-none ${i===e.id?"border-[var(--brand)] ring-2 ring-[var(--brand)]/30":"border-border"}`,children:[(0,V.jsxs)("div",{className:"mb-[5px] flex items-center gap-[7px]",children:[(0,V.jsx)("span",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:lL(e.status)}}),(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:e.id}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)(pl,{p:e.priority}),(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:13,style:{color:lK(e.issue_type)}})]}),(0,V.jsx)("div",{className:"text-label font-medium leading-[1.35] text-[var(--text)] [text-wrap:pretty]",children:e.title}),(0,V.jsxs)("div",{className:"mt-[6px] flex flex-wrap items-center gap-x-[8px] gap-y-1 text-meta text-[var(--text-3)]",children:[(0,V.jsx)("span",{title:l3(l),children:l1(l)}),a.length>0&&(0,V.jsxs)("span",{className:"truncate font-mono",title:`blocked by ${a.join(", ")}`,children:["⛔ ",a.join(", ")]})]})]})}function pO(e,t){if(!e)return 1/0;let n=e.indexOf(t);return -1===n?1/0:n}function pN(){let{beads:e,index:t,humanAllowlist:n,openDetail:r,openCreate:i,openEpic:o,loading:a,projectId:l,readOnly:s}=eu(),c=em(),{data:u}=f$(l),d=fB(l),f=G.useMemo(()=>u?.orders??{},[u]),{filters:p,setFilters:h,showArchived:m,setShowArchived:g,clearFilters:y}=f0(),b=G.useMemo(()=>fY(e),[e]),v=G.useMemo(()=>fX(e),[e]),x=G.useMemo(()=>lJ(e),[e]),w=ds(dl(dZ,{activationConstraint:{distance:5}})),k=G.useMemo(()=>{let n=new Map;for(let r of e){let e=function(e,t){let n=lG(e,t);for(let t of f4)if(t.test(e,n))return t.id;return null}(r,t);e&&n.set(r.id,e)}return n},[e,t]),_=G.useMemo(()=>e.filter(e=>!("epic"===e.issue_type||!m&&(e.labels??[]).includes("archived"))&&fJ(e,p,n)).sort((e,n)=>{let r=f9.indexOf(k.get(e.id)??""),i=f9.indexOf(k.get(n.id)??"");if(r!==i)return r-i;let o=k.get(e.id),a=o?f[o]:void 0,l=pO(a,e.id),s=pO(a,n.id);if(l!==s)return l-s;if(e.priority!==n.priority)return e.priority-n.priority;let c=lY(e,t)?.priority??2,u=lY(n,t)?.priority??2;return c!==u?c-u:(n.updated_at??"").localeCompare(e.updated_at??"")}),[e,p,m,n,k,f,t]),S=G.useMemo(()=>{let e=new Map;for(let t of _){let n=k.get(t.id);n&&e.set(n,(e.get(n)??0)+1)}return e},[_,k]);return(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"List",subtitle:a&&0===e.length?"Loading…":(0,V.jsxs)(V.Fragment,{children:[_.length," beads",(0,V.jsx)("span",{className:"max-md:hidden",children:" · drag to set run-order"})]}),actions:!s&&(0,V.jsx)(ub.f,{icon:"plus",onClick:()=>i(),children:"New"}),controls:(0,V.jsx)(f2,{filters:p,onChange:h,labelOptions:b,assigneeOptions:v,showArchived:m,onShowArchived:g,onClearAllAction:y})}),(0,V.jsx)("div",{className:"bd-scroll min-h-0 flex-1 overflow-y-auto p-[12px_22px]",children:a&&0===e.length?(0,V.jsx)("div",{className:"text-body text-[var(--text-3)]",children:"Loading beads…"}):0===_.length?(0,V.jsx)("div",{className:"flex h-[200px] items-center justify-center text-body text-[var(--text-3)]",children:"No beads match."}):(0,V.jsx)(fs,{sensors:w,collisionDetection:dm,onDragEnd:function(e){if(s)return;let n=String(e.active.id),r=e.over?.id?String(e.over.id):null;if(!r||r===n)return;let i=k.get(n),o=k.get(r);if(i&&o)if(o===i){let e=_.filter(e=>k.get(e.id)===i).map(e=>e.id),t=e.indexOf(n),o=e.indexOf(r);if(-1===t||-1===o||t===o)return;d.mutate({columnId:i,ids:f_(e,t,o)})}else{let e=f4.find(e=>e.id===o);if(!e||!e.droppable||!e.status)return;let r=t.get(n);if(!r||r.status===e.status)return;c.mutate({id:n,status:e.status})}},children:(0,V.jsx)(fA,{items:_.map(e=>e.id),strategy:fO,children:(0,V.jsx)("div",{className:"flex flex-col gap-[6px]",children:_.map((e,i)=>{let a=k.get(e.id),l=i>0?k.get(_[i-1].id):void 0,s=a&&a!==l,c=f4.find(e=>e.id===a);return(0,V.jsxs)(G.Fragment,{children:[s&&c&&(0,V.jsxs)("div",{className:"flex items-center gap-2 px-1 pb-px pt-3 first:pt-0",children:[(0,V.jsx)("span",{className:"h-[7px] w-[7px] rounded-[2px]",style:{background:c.color}}),(0,V.jsx)("span",{className:"text-meta font-semibold uppercase tracking-[.04em] text-[var(--text-3)]",children:c.name}),(0,V.jsx)(pn,{mono:!0,children:S.get(a)??0})]}),(0,V.jsx)(pC,{bead:e,blocked:lG(e,t),onOpen:()=>r(e.id),parent:lY(e,t),onOpenParent:o,onOpenDetail:r,childCount:x.get(e.id)??0,humanAllowlist:n})]},e.id)})})})})})]})}function pC({bead:e,blocked:t,onOpen:n,parent:r,onOpenParent:i,onOpenDetail:o,childCount:a,humanAllowlist:l}){let{readOnly:s,selectedBeadId:c,selectBead:u}=eu(),d=eO(),{attributes:f,listeners:p,setNodeRef:h,transform:m,transition:g,isDragging:y}=fR({id:e.id,disabled:s||d}),b=fU(e,l),v=(e.labels??[]).filter(e=>"archived"!==e).slice(0,2);return(0,V.jsxs)("div",{ref:h,...p,...s||d?{}:f,role:"button",tabIndex:0,"data-keyboard-bead-id":e.id,"aria-current":c===e.id?"true":void 0,onFocus:()=>u(e.id),onClick:()=>{u(e.id),n()},onKeyDown:e=>{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},style:{transform:u5.Transform.toString(m),transition:g,opacity:y?.4:1,zIndex:y?10:void 0},className:`flex w-full cursor-pointer items-center gap-3 rounded-[10px] border bg-[var(--surface)] px-[13px] py-[9px] text-left md:touch-none max-md:flex-wrap max-md:gap-x-2 max-md:gap-y-1 max-md:py-3 transition-[border-color,box-shadow] hover:border-[var(--border-strong)] hover:shadow-[var(--shadow)] focus-visible:outline-none ${c===e.id?"border-[var(--brand)] ring-2 ring-[var(--brand)]/30":"border-border"}`,children:[(0,V.jsx)("span",{className:"h-[9px] w-[9px] flex-shrink-0 rounded-full max-md:-order-2",style:{background:t?"#ef4444":lL(e.status)},title:t?"Blocked":lB(e.status)}),(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:15,className:"flex-shrink-0 max-md:-order-2",style:{color:lK(e.issue_type)}}),d?(0,V.jsx)("span",{className:"ml-[41px] flex-shrink-0 truncate font-mono text-meta text-[var(--text-3)]",children:e.id}):(0,V.jsx)(f7,{id:e.id,className:"w-[150px] flex-shrink-0 truncate font-mono text-meta text-[var(--text-3)]"}),(0,V.jsx)("span",{className:"min-w-0 flex-1 truncate text-body font-medium text-[var(--text)] max-md:-order-1 max-md:flex-[1_1_calc(100%-48px)] max-md:whitespace-normal max-md:line-clamp-2",children:e.title}),v.map(e=>(0,V.jsx)("span",{className:"hidden flex-shrink-0 rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px font-mono text-meta text-[var(--text-3)] lg:inline",children:e},e)),a>0&&(0,V.jsxs)("span",{title:`${a} subtask${1===a?"":"s"}`,className:"hidden flex-shrink-0 items-center gap-[4px] rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px text-meta text-[var(--text-3)] lg:flex",children:[(0,V.jsx)(en.W,{name:"list",size:10,className:"flex-shrink-0"}),a]}),r&&(0,V.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),"epic"===r.issue_type?i(r.id):o(r.id)},title:`${r.id} \xb7 ${r.title} \xb7 P${r.priority}`,className:"hidden max-w-[150px] flex-shrink-0 items-center gap-[4px] rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px text-meta text-[var(--text-3)] hover:border-[var(--brand)] hover:text-[var(--brand)] lg:flex",children:[(0,V.jsx)(en.W,{name:"epic"===r.issue_type?"target":(0,en.F)(r.issue_type),size:10,className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"truncate",children:r.title})]}),(0,V.jsx)("span",{className:"flex-shrink-0",children:(0,V.jsx)(pl,{p:e.priority})}),(0,V.jsx)("span",{className:"hidden w-[26px] flex-shrink-0 justify-center sm:flex",children:(0,V.jsx)(ps,{origin:b,title:fH(e.created_by,b)})}),(0,V.jsxs)("span",{className:"flex min-w-0 max-w-[130px] flex-shrink-0 items-center gap-[6px]",children:[(0,V.jsx)("span",{className:"flex h-[19px] w-[19px] flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.assignee??"")},children:lV(e.assignee??"")}),(0,V.jsx)("span",{className:"truncate text-meta text-[var(--text-2)]",children:e.assignee||"Unassigned"})]}),(0,V.jsx)("span",{title:l3(e.updated_at),className:"hidden w-[64px] flex-shrink-0 text-right font-mono text-meta text-[var(--text-3)] xl:inline",children:l1(e.updated_at)})]})}let pA="flex-shrink-0 rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-px font-mono text-meta text-[var(--text-3)]";function pM({labels:e,max:t}){let n=e.filter(e=>"archived"!==e);if(0===n.length)return null;let r=n.slice(0,t),i=n.slice(t);return(0,V.jsxs)(V.Fragment,{children:[r.map(e=>(0,V.jsx)("span",{className:`hidden ${pA} lg:inline`,children:e},e)),i.length>0&&(0,V.jsxs)("span",{className:`hidden ${pA} lg:inline`,title:i.join(", "),children:["+",i.length]})]})}function pP({focusEpic:e,onFocusHandledAction:t}){let{beads:n,humanAllowlist:r,openCreate:i,openDetail:o,selectedBeadId:a,selectBead:l,readOnly:s,loading:c}=eu(),[u,d]=G.useState({}),[f,p]=G.useState(!0),h=G.useRef(null),m=G.useRef(null),g=G.useRef(null),y=n.filter(e=>"epic"===e.issue_type).sort((e,t)=>Number("closed"===e.status)-Number("closed"===t.status)||e.priority-t.priority||e.id.localeCompare(t.id)),b=y.filter(t=>!f||"closed"!==t.status||t.id===e?.id);return G.useEffect(()=>{if(!e)return;let r=document.querySelector(`[data-epic-id="${CSS.escape(e.id)}"]`);if(!r)return;let i=n.find(t=>t.id===e.id);null!==m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{i?.status==="closed"&&p(!1),d(t=>({...t,[e.id]:!0})),t?.(),m.current=null}),g.current&&clearTimeout(g.current),h.current?.classList.remove("epic-flash"),h.current=r,r.scrollIntoView({behavior:"smooth",block:"start"}),r.classList.add("epic-flash"),g.current=setTimeout(()=>{r.classList.remove("epic-flash"),h.current=null,g.current=null},1600)},[n,e,t]),G.useEffect(()=>()=>{null!==m.current&&cancelAnimationFrame(m.current),g.current&&clearTimeout(g.current),h.current?.classList.remove("epic-flash")},[]),(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"Epics",subtitle:c&&0===y.length?"Loading…":(0,V.jsxs)(V.Fragment,{children:[b.length,f&&y.length!==b.length?` of ${y.length}`:""," epics · progress = closed ÷ children"]}),actions:(0,V.jsx)(ub.f,{icon:"plus",disabled:s,onClick:()=>i({type:"epic"}),children:"New epic"}),controls:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:"flex-1 max-md:hidden"}),(0,V.jsx)(er.K,{icon:f?"check":"x",onClick:()=>p(e=>!e),title:f?"Show closed epics and children":"Hide closed epics and children",children:f?"Show Closed":"Hide Closed"})]})}),(0,V.jsx)("div",{className:"bd-scroll min-h-0 flex-1 overflow-y-auto p-[20px_22px] max-md:p-[12px_16px_24px]",children:(0,V.jsxs)("div",{className:"mx-auto flex max-w-[880px] flex-col gap-[14px]",children:[b.map(t=>{let{closed:c,total:p,pct:h}=l0(t.id,n),m=lQ(t.id,n).filter(e=>!f||"closed"!==e.status).sort((e,t)=>Number("closed"===e.status)-Number("closed"===t.status)||e.priority-t.priority),g=u[t.id]??t.id===e?.id;return(0,V.jsxs)("section",{"data-epic-id":t.id,className:"overflow-hidden rounded-[14px] border border-border bg-[var(--surface)] shadow-[var(--shadow)]",children:[(0,V.jsxs)("div",{role:"button",tabIndex:0,"data-keyboard-bead-id":t.id,"aria-current":a===t.id?"true":void 0,"aria-expanded":g,onFocus:()=>l(t.id),onClick:()=>{l(t.id),d(e=>({...e,[t.id]:!g}))},onKeyDown:e=>{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),d(e=>({...e,[t.id]:!g})))},title:g?"Hide children":"Show children",className:`flex cursor-pointer items-center gap-[14px] p-[16px_18px] focus-visible:outline-none max-md:flex-wrap max-md:gap-x-3 max-md:gap-y-3 max-md:p-[14px] ${a===t.id?"ring-2 ring-inset ring-[var(--brand)]":""}`,children:[(0,V.jsx)("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-[10px] bg-[var(--brand-weak)] text-[var(--brand)]",children:(0,V.jsx)(en.W,{name:"target",size:19})}),(0,V.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,V.jsxs)("div",{className:"flex min-w-0 items-center gap-[9px] overflow-hidden max-md:flex-wrap max-md:gap-y-1",children:[(0,V.jsx)("span",{className:"flex-shrink-0 font-mono text-meta text-[var(--text-3)]",children:t.id}),(0,V.jsx)(pr,{status:t.status}),(0,V.jsx)(pl,{p:t.priority}),(0,V.jsx)(pM,{labels:t.labels??[],max:3})]}),(0,V.jsx)("div",{className:"mt-[3px] text-section font-semibold tracking-[-.01em]",children:t.title})]}),(0,V.jsxs)("div",{className:"flex w-[200px] flex-shrink-0 flex-col items-end gap-[7px] max-md:order-4 max-md:w-full max-md:basis-full max-md:items-stretch",children:[(0,V.jsxs)("div",{className:"flex items-baseline gap-[6px] max-md:justify-between",children:[(0,V.jsxs)("span",{className:"font-mono text-page-title font-semibold tracking-[-.02em]",children:[h,"%"]}),(0,V.jsxs)("span",{className:"text-meta text-[var(--text-3)]",children:[c,"/",p," done"]})]}),(0,V.jsx)("div",{className:"h-[7px] w-full overflow-hidden rounded-full bg-[var(--surface-3)]",children:(0,V.jsx)("div",{className:"h-full rounded-full transition-[width]",style:{width:`${h}%`,background:100===h?"#16a34a":"var(--brand)"}})})]}),(0,V.jsx)(er.K,{size:"sm",icon:"list",onClick:e=>{e.stopPropagation(),o(t.id)},"aria-label":`Open details for ${t.id}`,title:`Open details for ${t.id}`,className:"max-md:order-5 max-md:basis-full",children:"Details"}),(0,V.jsx)("button",{type:"button",tabIndex:-1,"aria-hidden":"true",onClick:e=>{e.stopPropagation(),d(e=>({...e,[t.id]:!g}))},className:"tap-target flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-[8px] text-[var(--text-3)] hover:bg-[var(--surface-2)] hover:text-[var(--text-2)] max-md:order-3",children:(0,V.jsx)(en.W,{name:"chevron",size:18,className:"transition-transform",style:{transform:g?"rotate(180deg)":"rotate(0deg)"}})})]}),g&&(0,V.jsxs)("div",{className:"border-t border-border bg-[var(--surface-2)] p-[6px]",children:[m.map(e=>{let t=fU(e,r);return(0,V.jsxs)("div",{role:"button",tabIndex:0,"data-keyboard-bead-id":e.id,"aria-current":a===e.id?"true":void 0,onFocus:()=>l(e.id),onClick:()=>{l(e.id),o(e.id)},className:`flex cursor-pointer items-center gap-[11px] rounded-[9px] p-[9px_12px] hover:bg-[var(--surface)] focus-visible:outline-none max-md:flex-wrap max-md:gap-x-2 max-md:gap-y-1 max-md:py-3 ${a===e.id?"ring-2 ring-inset ring-[var(--brand)]":""}`,children:[(0,V.jsx)("span",{className:"h-2 w-2 flex-shrink-0 rounded-full max-md:-order-2",style:{background:lL(e.status)}}),(0,V.jsx)("span",{className:"w-[74px] flex-shrink-0 font-mono text-meta text-[var(--text-3)] max-md:ml-[26px] max-md:w-auto",children:e.id}),(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:14,className:"flex-shrink-0 max-md:-order-2",style:{color:lK(e.issue_type)}}),(0,V.jsx)("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-body font-medium max-md:-order-1 max-md:flex-[1_1_calc(100%-50px)] max-md:whitespace-normal max-md:line-clamp-2",children:e.title}),(0,V.jsx)(pM,{labels:e.labels??[],max:2}),(0,V.jsx)(pl,{p:e.priority}),(0,V.jsx)(ps,{origin:t,title:fH(e.created_by,t)}),(0,V.jsx)("span",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.assignee??"")},children:lV(e.assignee??"")})]},e.id)}),(0,V.jsx)(er.K,{variant:"ghost",icon:"plus",disabled:s,onClick:()=>i({parent:t.id}),className:"m-[2px] w-[calc(100%-4px)] justify-start text-[var(--brand)] hover:bg-[var(--surface)] hover:text-[var(--brand)]",children:"Add child to this epic"})]})]},t.id)}),0===b.length&&(0,V.jsx)("div",{className:"rounded-[14px] border border-dashed border-border p-10 text-center text-body text-[var(--text-3)]",children:"No epics yet. Create one with type “epic”."})]})})]})}function pT(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)""!==(r=pT(e[n]))&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var pI={value:()=>{}};function pD(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new pz(r)}function pz(e){this._=e}function pR(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=pI,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function pL(){}function p$(e){return null==e?pL:function(){return this.querySelector(e)}}function pB(){return[]}function pF(e){return null==e?pB:function(){return this.querySelectorAll(e)}}function pU(e){return function(){return this.matches(e)}}function pH(e){return function(t){return t.matches(e)}}pz.prototype=pD.prototype={constructor:pz,on:function(e,t){var n,r=this._,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((n=(e=i[o]).type)&&(n=function(e,t){for(var n,r=0,i=e.length;r<i;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++o<a;)if(n=(e=i[o]).type)r[n]=pR(r[n],e.name,t);else if(null==t)for(n in r)r[n]=pR(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pz(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,i=Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],o=0,n=r.length;o<n;++o)r[o].value.apply(t,i)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};var pK=Array.prototype.find;function pW(){return this.firstElementChild}var pq=Array.prototype.filter;function pZ(){return Array.from(this.children)}function pV(e){return Array(e.length)}function pG(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function pX(e,t,n,r,i,o){for(var a,l=0,s=t.length,c=o.length;l<c;++l)(a=t[l])?(a.__data__=o[l],r[l]=a):n[l]=new pG(e,o[l]);for(;l<s;++l)(a=t[l])&&(i[l]=a)}function pY(e,t,n,r,i,o,a){var l,s,c,u=new Map,d=t.length,f=o.length,p=Array(d);for(l=0;l<d;++l)(s=t[l])&&(p[l]=c=a.call(s,s.__data__,l,t)+"",u.has(c)?i[l]=s:u.set(c,s));for(l=0;l<f;++l)c=a.call(e,o[l],l,o)+"",(s=u.get(c))?(r[l]=s,s.__data__=o[l],u.delete(c)):n[l]=new pG(e,o[l]);for(l=0;l<d;++l)(s=t[l])&&u.get(p[l])===s&&(i[l]=s)}function pJ(e){return e.__data__}function pQ(e,t){return e<t?-1:e>t?1:e>=t?0:0/0}pG.prototype={constructor:pG,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var p0="http://www.w3.org/1999/xhtml";let p1={svg:"http://www.w3.org/2000/svg",xhtml:p0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function p2(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),p1.hasOwnProperty(t)?{space:p1[t],local:e}:e}function p3(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function p4(e,t){return e.style.getPropertyValue(t)||p3(e).getComputedStyle(e,null).getPropertyValue(t)}function p9(e){return e.trim().split(/^|\s+/)}function p5(e){return e.classList||new p6(e)}function p6(e){this._node=e,this._names=p9(e.getAttribute("class")||"")}function p8(e,t){for(var n=p5(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function p7(e,t){for(var n=p5(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function he(){this.textContent=""}function ht(){this.innerHTML=""}function hn(){this.nextSibling&&this.parentNode.appendChild(this)}function hr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hi(e){var t=p2(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===p0&&t.documentElement.namespaceURI===p0?t.createElement(e):t.createElementNS(n,e)}})(t)}function ho(){return null}function ha(){var e=this.parentNode;e&&e.removeChild(this)}function hl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hs(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hc(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,o=t.length;r<o;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?t.length=i:delete this.__on}}}function hu(e,t,n){return function(){var r,i=this.__on,o=function(e){t.call(this,e,this.__data__)};if(i){for(var a=0,l=i.length;a<l;++a)if((r=i[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=t;return}}this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},i?i.push(r):this.__on=[r]}}function hd(e,t,n){var r=p3(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}p6.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var hf=[null];function hp(e,t){this._groups=e,this._parents=t}function hh(){return new hp([[document.documentElement]],hf)}function hm(e){return"string"==typeof e?new hp([[document.querySelector(e)]],[document.documentElement]):new hp([[e]],hf)}function hg(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}hp.prototype=hh.prototype={constructor:hp,select:function(e){"function"!=typeof e&&(e=p$(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var o,a,l=t[i],s=l.length,c=r[i]=Array(s),u=0;u<s;++u)(o=l[u])&&(a=e.call(o,o.__data__,u,l))&&("__data__"in o&&(a.__data__=o.__data__),c[u]=a);return new hp(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=pF(e);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var l,s=n[a],c=s.length,u=0;u<c;++u)(l=s[u])&&(i.push(e.call(l,l.__data__,u,s)),o.push(l));return new hp(i,o)},selectChild:function(e){var t;return this.select(null==e?pW:(t="function"==typeof e?e:pH(e),function(){return pK.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?pZ:(t="function"==typeof e?e:pH(e),function(){return pq.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=pU(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var o,a=t[i],l=a.length,s=r[i]=[],c=0;c<l;++c)(o=a[c])&&e.call(o,o.__data__,c,a)&&s.push(o);return new hp(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,pJ);var n=t?pY:pX,r=this._parents,i=this._groups;"function"!=typeof e&&(b=e,e=function(){return b});for(var o=i.length,a=Array(o),l=Array(o),s=Array(o),c=0;c<o;++c){var u=r[c],d=i[c],f=d.length,p="object"==typeof(y=e.call(u,u&&u.__data__,c,r))&&"length"in y?y:Array.from(y),h=p.length,m=l[c]=Array(h),g=a[c]=Array(h);n(u,d,m,g,s[c]=Array(f),p,t);for(var y,b,v,x,w=0,k=0;w<h;++w)if(v=m[w]){for(w>=k&&(k=w+1);!(x=g[k])&&++k<h;);v._next=x||null}}return(a=new hp(a,r))._enter=l,a._exit=s,a},enter:function(){return new hp(this._enter||this._groups.map(pV),this._parents)},exit:function(){return new hp(this._exit||this._groups.map(pV),this._parents)},join:function(e,t,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(i=t(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),l=Array(i),s=0;s<a;++s)for(var c,u=n[s],d=r[s],f=u.length,p=l[s]=Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;s<i;++s)l[s]=n[s];return new hp(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,i=e[t],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=pQ);for(var n=this._groups,r=n.length,i=Array(r),o=0;o<r;++o){for(var a,l=n[o],s=l.length,c=i[o]=Array(s),u=0;u<s;++u)(a=l[u])&&(c[u]=a);c.sort(t)}return new hp(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i,o=t[n],a=0,l=o.length;a<l;++a)(i=o[a])&&e.call(i,i.__data__,a,o);return this},attr:function(e,t){var n=p2(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):p4(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=p9(e+"");if(arguments.length<2){for(var r=p5(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?p8:p7)(this,e)}}:t?function(e){return function(){p8(this,e)}}:function(e){return function(){p7(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?he:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?ht:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(hn)},lower:function(){return this.each(hr)},append:function(e){var t="function"==typeof e?e:hi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:hi(e),r=null==t?ho:"function"==typeof t?t:p$(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(ha)},clone:function(e){return this.select(e?hs:hl)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,i,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),a=o.length;if(arguments.length<2){var l=this.node().__on;if(l){for(var s,c=0,u=l.length;c<u;++c)for(r=0,s=l[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value}return}for(l=t?hu:hc,r=0;r<a;++r)this.each(l(o[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return hd(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return hd(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,i=e[t],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};let hy={passive:!1},hb={capture:!0,passive:!1};function hv(e){e.stopImmediatePropagation()}function hx(e){e.preventDefault(),e.stopImmediatePropagation()}function hw(e){var t=e.document.documentElement,n=hm(e).on("dragstart.drag",hx,hb);"onselectstart"in t?n.on("selectstart.drag",hx,hb):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hk(e,t){var n=e.document.documentElement,r=hm(e).on("dragstart.drag",null);t&&(r.on("click.drag",hx,hb),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let h_=e=>()=>e;function hS(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:l,dx:s,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function hE(e){return!e.ctrlKey&&!e.button}function hj(){return this.parentNode}function hO(e,t){return null==t?{x:e.x,y:e.y}:t}function hN(){return navigator.maxTouchPoints||"ontouchstart"in this}function hC(){var e,t,n,r,i=hE,o=hj,a=hO,l=hN,s={},c=pD("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(l).on("touchstart.drag",g).on("touchmove.drag",y,hy).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,l){if(!r&&i.call(this,a,l)){var s=v(this,o.call(this,a,l),a,l,"mouse");s&&(hm(a.view).on("mousemove.drag",h,hb).on("mouseup.drag",m,hb),hw(a.view),hv(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function h(r){if(hx(r),!n){var i=r.clientX-e,o=r.clientY-t;n=i*i+o*o>d}s.mouse("drag",r)}function m(e){hm(e.view).on("mousemove.drag mouseup.drag",null),hk(e.view,n),hx(e),s.mouse("end",e)}function g(e,t){if(i.call(this,e,t)){var n,r,a=e.changedTouches,l=o.call(this,e,t),s=a.length;for(n=0;n<s;++n)(r=v(this,l,e,t,a[n].identifier,a[n]))&&(hv(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,i=r.length;for(t=0;t<i;++t)(n=s[r[t].identifier])&&(hx(e),n("drag",e,r[t]))}function b(e){var t,n,i=e.changedTouches,o=i.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<o;++t)(n=s[i[t].identifier])&&(hv(e),n("end",e,i[t]))}function v(e,t,n,r,i,o){var l,d,p,h=c.copy(),m=hg(o||n,t);if(null!=(p=a.call(e,new hS("beforestart",{sourceEvent:n,target:f,identifier:i,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return l=p.x-m[0]||0,d=p.y-m[1]||0,function n(o,a,c){var g,y=m;switch(o){case"start":s[i]=n,g=u++;break;case"end":delete s[i],--u;case"drag":m=hg(c||a,t),g=u}h.call(o,e,new hS(o,{sourceEvent:a,subject:p,target:f,identifier:i,active:g,x:m[0]+l,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(i="function"==typeof e?e:h_(!!e),f):i},f.container=function(e){return arguments.length?(o="function"==typeof e?e:h_(e),f):o},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:h_(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:h_(!!e),f):l},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,f):Math.sqrt(d)},f}function hA(e){return((e=Math.exp(e))+1/e)/2}hS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let hM=function e(t,n,r){function i(e,i){var o,a,l=e[0],s=e[1],c=e[2],u=i[0],d=i[1],f=i[2],p=u-l,h=d-s,m=p*p+h*h;if(m<1e-12)a=Math.log(f/c)/t,o=function(e){return[l+e*p,s+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),b=(f*f-c*c-r*m)/(2*f*n*g),v=Math.log(Math.sqrt(y*y+1)-y);a=(Math.log(Math.sqrt(b*b+1)-b)-v)/t,o=function(e){var r,i,o=e*a,u=hA(v),d=c/(n*g)*(u*(((r=Math.exp(2*(r=t*o+v)))-1)/(r+1))-((i=Math.exp(i=v))-1/i)/2);return[l+d*p,s+d*h,c*u/hA(t*o+v)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4);var hP,hT,hI,hD,hz,hR,hL,h$,hB,hF,hU,hH,hK,hW,hq,hZ,hV,hG,hX,hY,hJ,hQ,h0,h1,h2,h3=0,h4=0,h9=0,h5=0,h6=0,h8=0,h7="object"==typeof performance&&performance.now?performance:Date,me="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function mt(){return h6||(me(mn),h6=h7.now()+h8)}function mn(){h6=0}function mr(){this._call=this._time=this._next=null}function mi(e,t,n){var r=new mr;return r.restart(e,t,n),r}function mo(){h6=(h5=h7.now())+h8,h3=h4=0;try{mt(),++h3;for(var e,t=h1;t;)(e=h6-t._time)>=0&&t._call.call(void 0,e),t=t._next;--h3}finally{h3=0,function(){for(var e,t,n=h1,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:h1=t);h2=e,ml(r)}(),h6=0}}function ma(){var e=h7.now(),t=e-h5;t>1e3&&(h8-=t,h5=e)}function ml(e){!h3&&(h4&&(h4=clearTimeout(h4)),e-h6>24?(e<1/0&&(h4=setTimeout(mo,e-h7.now()-h8)),h9&&(h9=clearInterval(h9))):(h9||(h5=h7.now(),h9=setInterval(ma,1e3)),h3=1,me(mo)))}function ms(e,t,n){var r=new mr;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}mr.prototype=mi.prototype={constructor:mr,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?mt():+n)+(null==t?0:+t),this._next||h2===this||(h2?h2._next=this:h1=this,h2=this),this._call=e,this._time=n,ml()},stop:function(){this._call&&(this._call=null,this._time=1/0,ml())}};var mc=pD("start","end","cancel","interrupt"),mu=[];function md(e,t,n,r,i,o){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function o(s){var c,u,d,f;if(1!==n.state)return l();for(c in i)if((f=i[c]).name===n.name){if(3===f.state)return ms(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[c])}if(ms(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function a(t){for(var i=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(e,i);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete i[t],i)return;delete e.__transition}i[t]=n,n.timer=mi(function(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:i,on:mc,tween:mu,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function mf(e,t){var n=mh(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function mp(e,t){var n=mh(e,t);if(n.state>3)throw Error("too late; already running");return n}function mh(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function mm(e,t){var n,r,i,o=e.__transition,a=!0;if(o){for(i in t=null==t?null:t+"",o){if((n=o[i]).name!==t){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete o[i]}a&&delete e.__transition}}function mg(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var my=180/Math.PI,mb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mv(e,t,n,r,i,o){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*my,skewX:Math.atan(s)*my,scaleX:a,scaleY:l}}function mx(e,t,n,r){function i(e){return e.length?e.pop()+" ":""}return function(o,a){var l,s,c,u,d=[],f=[];return o=e(o),a=e(a),!function(e,r,i,o,a,l){if(e!==i||r!==o){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:mg(e,i)},{i:s-2,x:mg(r,o)})}else(i||o)&&a.push("translate("+i+t+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,d,f),l=o.rotate,s=a.rotate,l!==s?(l-s>180?s+=360:s-l>180&&(l+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:mg(l,s)})):s&&d.push(i(d)+"rotate("+s+r),c=o.skewX,u=a.skewX,c!==u?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:mg(c,u)}):u&&d.push(i(d)+"skewX("+u+r),!function(e,t,n,r,o,a){if(e!==n||t!==r){var l=o.push(i(o)+"scale(",null,",",null,")");a.push({i:l-4,x:mg(e,n)},{i:l-2,x:mg(t,r)})}else(1!==n||1!==r)&&o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,d,f),o=a=null,function(e){for(var t,n=-1,r=f.length;++n<r;)d[(t=f[n]).i]=t.x(e);return d.join("")}}}var mw=mx(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mb:mv(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),mk=mx(function(e){return null==e?mb:(A||(A=document.createElementNS("http://www.w3.org/2000/svg","g")),A.setAttribute("transform",e),e=A.transform.baseVal.consolidate())?mv((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):mb},", ",")",")");function m_(e,t,n){var r=e._id;return e.each(function(){var e=mp(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return mh(e,r).value[t]}}function mS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mj(){}var mO=1/.7,mN="\\s*([+-]?\\d+)\\s*",mC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mM=/^#([0-9a-f]{3,8})$/,mP=RegExp(`^rgb\\(${mN},${mN},${mN}\\)$`),mT=RegExp(`^rgb\\(${mA},${mA},${mA}\\)$`),mI=RegExp(`^rgba\\(${mN},${mN},${mN},${mC}\\)$`),mD=RegExp(`^rgba\\(${mA},${mA},${mA},${mC}\\)$`),mz=RegExp(`^hsl\\(${mC},${mA},${mA}\\)$`),mR=RegExp(`^hsla\\(${mC},${mA},${mA},${mC}\\)$`),mL={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function m$(){return this.rgb().formatHex()}function mB(){return this.rgb().formatRgb()}function mF(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mM.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?mU(t):3===n?new mW(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?mH(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?mH(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=mP.exec(e))?new mW(t[1],t[2],t[3],1):(t=mT.exec(e))?new mW(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=mI.exec(e))?mH(t[1],t[2],t[3],t[4]):(t=mD.exec(e))?mH(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=mz.exec(e))?mY(t[1],t[2]/100,t[3]/100,1):(t=mR.exec(e))?mY(t[1],t[2]/100,t[3]/100,t[4]):mL.hasOwnProperty(e)?mU(mL[e]):"transparent"===e?new mW(0/0,0/0,0/0,0):null}function mU(e){return new mW(e>>16&255,e>>8&255,255&e,1)}function mH(e,t,n,r){return r<=0&&(e=t=n=0/0),new mW(e,t,n,r)}function mK(e,t,n,r){var i;return 1==arguments.length?((i=e)instanceof mj||(i=mF(i)),i)?new mW((i=i.rgb()).r,i.g,i.b,i.opacity):new mW:new mW(e,t,n,null==r?1:r)}function mW(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mq(){return`#${mX(this.r)}${mX(this.g)}${mX(this.b)}`}function mZ(){let e=mV(this.opacity);return`${1===e?"rgb(":"rgba("}${mG(this.r)}, ${mG(this.g)}, ${mG(this.b)}${1===e?")":`, ${e})`}`}function mV(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mG(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mX(e){return((e=mG(e))<16?"0":"")+e.toString(16)}function mY(e,t,n,r){return r<=0?e=t=n=0/0:n<=0||n>=1?e=t=0/0:t<=0&&(e=0/0),new mQ(e,t,n,r)}function mJ(e){if(e instanceof mQ)return new mQ(e.h,e.s,e.l,e.opacity);if(e instanceof mj||(e=mF(e)),!e)return new mQ;if(e instanceof mQ)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=0/0,l=o-i,s=(o+i)/2;return l?(a=t===o?(n-r)/l+(n<r)*6:n===o?(r-t)/l+2:(t-n)/l+4,l/=s<.5?o+i:2-o-i,a*=60):l=s>0&&s<1?0:a,new mQ(a,l,s,e.opacity)}function mQ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function m0(e){return(e=(e||0)%360)<0?e+360:e}function m1(e){return Math.max(0,Math.min(1,e||0))}function m2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function m3(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}mS(mj,mF,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:m$,formatHex:m$,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mJ(this).formatHsl()},formatRgb:mB,toString:mB}),mS(mW,mK,mE(mj,{brighter(e){return e=null==e?mO:Math.pow(mO,e),new mW(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new mW(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mW(mG(this.r),mG(this.g),mG(this.b),mV(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mq,formatHex:mq,formatHex8:function(){return`#${mX(this.r)}${mX(this.g)}${mX(this.b)}${mX((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:mZ,toString:mZ})),mS(mQ,function(e,t,n,r){return 1==arguments.length?mJ(e):new mQ(e,t,n,null==r?1:r)},mE(mj,{brighter(e){return e=null==e?mO:Math.pow(mO,e),new mQ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new mQ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new mW(m2(e>=240?e-240:e+120,i,r),m2(e,i,r),m2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mQ(m0(this.h),m1(this.s),m1(this.l),mV(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=mV(this.opacity);return`${1===e?"hsl(":"hsla("}${m0(this.h)}, ${100*m1(this.s)}%, ${100*m1(this.l)}%${1===e?")":`, ${e})`}`}}));let m4=e=>()=>e;function m9(e,t){var n=t-e;return n?function(t){return e+t*n}:m4(isNaN(e)?t:e)}let m5=function e(t){var n,r=1==(n=+t)?m9:function(e,t){var r,i,o;return t-e?(r=e,i=t,r=Math.pow(r,o=n),i=Math.pow(i,o)-r,o=1/o,function(e){return Math.pow(r+e*i,o)}):m4(isNaN(e)?t:e)};function i(e,t){var n=r((e=mK(e)).r,(t=mK(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=m9(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function m6(e){return function(t){var n,r,i=t.length,o=Array(i),a=Array(i),l=Array(i);for(n=0;n<i;++n)r=mK(t[n]),o[n]=r.r||0,a[n]=r.g||0,l[n]=r.b||0;return o=e(o),a=e(a),l=e(l),r.opacity=1,function(e){return r.r=o(e),r.g=a(e),r.b=l(e),r+""}}}m6(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,l=r<t-1?e[r+2]:2*o-i;return m3((n-r/t)*t,a,i,o,l)}}),m6(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],a=e[(r+1)%t],l=e[(r+2)%t];return m3((n-r/t)*t,i,o,a,l)}});var m8=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,m7=RegExp(m8.source,"g");function ge(e,t){var n,r,i,o,a,l=m8.lastIndex=m7.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(i=m8.exec(e))&&(o=m7.exec(t));)(a=o.index)>l&&(a=t.slice(l,a),c[s]?c[s]+=a:c[++s]=a),(i=i[0])===(o=o[0])?c[s]?c[s]+=o:c[++s]=o:(c[++s]=null,u.push({i:s,x:mg(i,o)})),l=m7.lastIndex;return l<t.length&&(a=t.slice(l),c[s]?c[s]+=a:c[++s]=a),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}function gt(e,t){var n;return("number"==typeof t?mg:t instanceof mF?m5:(n=mF(t))?(t=n,m5):ge)(e,t)}var gn=hh.prototype.constructor;function gr(e){return function(){this.style.removeProperty(e)}}var gi=0;function go(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var ga=hh.prototype;go.prototype=(function(e){return hh().transition(e)}).prototype={constructor:go,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=p$(e));for(var r=this._groups,i=r.length,o=Array(i),a=0;a<i;++a)for(var l,s,c=r[a],u=c.length,d=o[a]=Array(u),f=0;f<u;++f)(l=c[f])&&(s=e.call(l,l.__data__,f,c))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,md(d[f],t,n,f,d,mh(l,n)));return new go(o,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=pF(e));for(var r=this._groups,i=r.length,o=[],a=[],l=0;l<i;++l)for(var s,c=r[l],u=c.length,d=0;d<u;++d)if(s=c[d]){for(var f,p=e.call(s,s.__data__,d,c),h=mh(s,n),m=0,g=p.length;m<g;++m)(f=p[m])&&md(f,t,n,m,p,h);o.push(p),a.push(s)}return new go(o,a,t,n)},selectChild:ga.selectChild,selectChildren:ga.selectChildren,filter:function(e){"function"!=typeof e&&(e=pU(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var o,a=t[i],l=a.length,s=r[i]=[],c=0;c<l;++c)(o=a[c])&&e.call(o,o.__data__,c,a)&&s.push(o);return new go(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=Array(r),l=0;l<o;++l)for(var s,c=t[l],u=n[l],d=c.length,f=a[l]=Array(d),p=0;p<d;++p)(s=c[p]||u[p])&&(f[p]=s);for(;l<r;++l)a[l]=t[l];return new go(a,this._parents,this._name,this._id)},selection:function(){return new gn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++gi,r=this._groups,i=r.length,o=0;o<i;++o)for(var a,l=r[o],s=l.length,c=0;c<s;++c)if(a=l[c]){var u=mh(a,t);md(a,e,n,c,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new go(r,this._parents,e,n)},call:ga.call,nodes:ga.nodes,node:ga.node,size:ga.size,empty:ga.empty,each:ga.each,on:function(e,t){var n,r,i,o,a,l,s=this._id;return arguments.length<2?mh(this.node(),s).on.on(e):this.each((n=s,r=e,i=t,l=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?mf:mp,function(){var e=l(this,n),t=e.on;t!==o&&(a=(o=t).copy()).on(r,i),e.on=a}))},attr:function(e,t){var n=p2(e),r="transform"===n?mk:gt;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,i,o;return function(){var a,l,s=n(this);return null==s?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}:function(e,t,n){var r,i,o;return function(){var a,l,s=n(this);return null==s?void this.removeAttribute(e):(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}})(n,r,m_(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===r?i:i=t(r=a,n)}}:function(e,t,n){var r,i,o=n+"";return function(){var a=this.getAttribute(e);return a===o?null:a===r?i:i=t(r=a,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=p2(e);return this.tween(n,(r.local?function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t){this.setAttributeNS(e.space,e.local,i.call(this,t))}),n}return i._value=t,i}:function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t){this.setAttribute(e,i.call(this,t))}),n}return i._value=t,i})(r,t))},style:function(e,t,n){var r,i,o,a,l,s,c,u,d,f,p,h,m,g,y,b,v,x,w,k,_,S="transform"==(e+="")?mw:gt;return null==t?this.styleTween(e,(r=e,function(){var e=p4(this,r),t=(this.style.removeProperty(r),p4(this,r));return e===t?null:e===i&&t===o?a:a=S(i=e,o=t)})).on("end.style."+e,gr(e)):"function"==typeof t?this.styleTween(e,(l=e,s=m_(this,"style."+e,t),function(){var e=p4(this,l),t=s(this),n=t+"";return null==t&&(this.style.removeProperty(l),n=t=p4(this,l)),e===n?null:e===c&&n===u?d:(u=n,d=S(c=e,t))})).each((f=this._id,v="end."+(b="style."+(p=e)),function(){var e=mp(this,f),t=e.on,n=null==e.value[b]?y||(y=gr(p)):void 0;(t!==h||g!==n)&&(m=(h=t).copy()).on(v,g=n),e.on=m})):this.styleTween(e,(x=e,_=t+"",function(){var e=p4(this,x);return e===_?null:e===w?k:k=S(w=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,i;function o(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t){this.style.setProperty(e,o.call(this,t),n)}),r}return o._value=t,o}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=m_(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=mh(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var i=mp(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}}i.tween=r}}:function(e,t,n){var r,i;if("function"!=typeof n)throw Error();return function(){var o=mp(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var l={name:t,value:n},s=0,c=i.length;s<c;++s)if(i[s].name===t){i[s]=l;break}s===c&&i.push(l)}o.tween=i}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){mf(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){mf(this,e).delay=t}})(t,e)):mh(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){mp(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){mp(this,e).duration=t}})(t,e)):mh(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){mp(this,e).ease=t}}(t,e)):mh(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();mp(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var l={value:a},s={value:function(){0==--i&&o()}};n.each(function(){var n=mp(this,r),i=n.on;i!==e&&((t=(e=i).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t}),0===i&&o()})},[Symbol.iterator]:ga[Symbol.iterator]};var gl={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};hh.prototype.interrupt=function(e){return this.each(function(){mm(this,e)})},hh.prototype.transition=function(e){var t,n;e instanceof go?(t=e._id,e=e._name):(t=++gi,(n=gl).time=mt(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,l=r[o],s=l.length,c=0;c<s;++c)(a=l[c])&&md(a,e,t,c,l,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new go(r,this._parents,e,t)};let gs=e=>()=>e;function gc(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function gu(e,t,n){this.k=e,this.x=t,this.y=n}gu.prototype={constructor:gu,scale:function(e){return 1===e?this:new gu(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new gu(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gd=new gu(1,0,0);function gf(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gd;return e.__zoom}function gp(e){e.stopImmediatePropagation()}function gh(e){e.preventDefault(),e.stopImmediatePropagation()}function gm(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function gg(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function gy(){return this.__zoom||gd}function gb(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function gv(){return navigator.maxTouchPoints||"ontouchstart"in this}function gx(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function gw(){var e,t,n,r=gm,i=gg,o=gx,a=gb,l=gv,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=hM,f=pD("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",gy).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",S).filter(l).on("touchstart.zoom",E).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new gu(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new gu(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function v(e,t,n,r){e.on("start.zoom",function(){x(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,o=x(this,e).event(r),a=i.apply(this,e),l=null==n?b(a):"function"==typeof n?n.apply(this,e):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=this.__zoom,u="function"==typeof t?t.apply(this,e):t,f=d(c.invert(l).concat(s/c.k),u.invert(l).concat(s/u.k));return function(e){if(1===e)e=u;else{var t=f(e),n=s/t[2];e=new gu(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function x(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=i.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=x(this,t).event(e),i=this.__zoom,l=Math.max(s[0],Math.min(s[1],i.k*Math.pow(2,a.apply(this,arguments)))),u=hg(e);if(n.wheel)(n.mouse[0][0]!==u[0]||n.mouse[0][1]!==u[1])&&(n.mouse[1]=i.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(i.k===l)return;n.mouse=[u,i.invert(u)],mm(this),n.start()}gh(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",o(y(g(i,l),n.mouse[0],n.mouse[1]),n.extent,c))}}function _(e,...t){if(!n&&r.apply(this,arguments)){var i=e.currentTarget,a=x(this,t,!0).event(e),l=hm(e.view).on("mousemove.zoom",function(e){if(gh(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",o(y(a.that.__zoom,a.mouse[0]=hg(e,i),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){l.on("mousemove.zoom mouseup.zoom",null),hk(e.view,a.moved),gh(e),a.event(e).end()},!0),s=hg(e,i),u=e.clientX,d=e.clientY;hw(e.view),gp(e),a.mouse=[s,this.__zoom.invert(s)],mm(this),a.start()}}function S(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=hg(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=o(y(g(n,s),a,l),i.apply(this,t),c);gh(e),u>0?hm(this).transition().duration(u).call(v,d,a,e):hm(this).call(m.transform,d,a,e)}}function E(n,...i){if(r.apply(this,arguments)){var o,a,l,s,c=n.touches,u=c.length,d=x(this,i,n.changedTouches.length===u).event(n);for(gp(n),a=0;a<u;++a)s=[s=hg(l=c[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,o=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),o&&(d.taps<2&&(t=s[0],e=setTimeout(function(){e=null},500)),mm(this),d.start())}}function j(e,...t){if(this.__zooming){var n,r,i,a,l=x(this,t).event(e),s=e.changedTouches,u=s.length;for(gh(e),n=0;n<u;++n)i=hg(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=i:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=i);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],p=l.touch1[0],h=l.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,b=(b=h[0]-f[0])*b+(b=h[1]-f[1])*b;r=g(r,Math.sqrt(m/b)),i=[(d[0]+p[0])/2,(d[1]+p[1])/2],a=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!l.touch0)return;i=l.touch0[0],a=l.touch0[1]}l.zoom("touch",o(y(r,i,a),l.extent,c))}}function O(e,...r){if(this.__zooming){var i,o,a=x(this,r).event(e),l=e.changedTouches,s=l.length;for(gp(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<s;++i)o=l[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=hg(o,this),Math.hypot(t[0]-o[0],t[1]-o[1])<h)){var c=hm(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property("__zoom",gy),e!==i?v(e,t,n,r):i.interrupt().each(function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=i.apply(this,arguments),r=this.__zoom,a=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return o(y(g(r,s),a,l),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return o(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=i.apply(this,arguments),a=this.__zoom,l=null==r?b(e):"function"==typeof r?r.apply(this,arguments):r;return o(gd.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,a)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=hm(this.that).datum();f.call(e,this.that,new gc(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:gs(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:gs(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:gs(!!e),m):l},m.extent=function(e){return arguments.length?(i="function"==typeof e?e:gs([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):i},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(o=e,m):o},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e*=1)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}function gk(e,t){var n,r,i=typeof t;return null==t||"boolean"===i?m4(t):("number"===i?mg:"string"===i?(r=mF(t))?(t=r,m5):ge:t instanceof mF?m5:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=Array(i),a=Array(r);for(n=0;n<i;++n)o[n]=gk(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},i={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=gk(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}:mg:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}})(e,t)}gf.prototype=gu.prototype;let g_=[[-1/0,-1/0],[1/0,1/0]],gS=["Enter"," ","Escape"],gE={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};(h=M||(M={})).Strict="strict",h.Loose="loose",(m=P||(P={})).Free="free",m.Vertical="vertical",m.Horizontal="horizontal",(g=T||(T={})).Partial="partial",g.Full="full";let gj={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};(y=I||(I={})).Bezier="default",y.Straight="straight",y.Step="step",y.SmoothStep="smoothstep",y.SimpleBezier="simplebezier",(b=D||(D={})).Arrow="arrow",b.ArrowClosed="arrowclosed",(v=z||(z={})).Left="left",v.Top="top",v.Right="right",v.Bottom="bottom";let gO={[z.Left]:z.Right,[z.Right]:z.Left,[z.Top]:z.Bottom,[z.Bottom]:z.Top};function gN(e){return null===e?null:e?"valid":"invalid"}let gC=e=>!!e&&"object"==typeof e&&"id"in e&&"source"in e&&"target"in e,gA=e=>!!e&&"object"==typeof e&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gM=(e,t=[0,0])=>{let{width:n,height:r}=g5(e),i=e.origin??t,o=n*i[0],a=r*i[1];return{x:e.position.x-o,y:e.position.y-a}},gP=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=gU(n,gq(e)),r=!0)}),r?gK(n):{x:0,y:0,width:0,height:0}},gT=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1)=>{let l=(t.x-n)/i,s=(t.y-r)/i,c=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(a&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:h}=t.internals.positionAbsolute,m=gV(l,s,c,u,p,h,i,f),g=i*f,y=o&&m>0;(!t.internals.handleBounds||y||m>=g||t.dragging)&&d.push(t)}return d};async function gI({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},a){let l,s;if(0===e.size)return!0;let c=g3(gP((l=new Map,s=a?.nodes?new Set(a.nodes.map(e=>e.id)):null,e.forEach(e=>{let t;if(a?.includeHiddenNodes){let{width:n,height:r}=g5(e);t=n>0&&r>0}else t=!!(e.measured.width&&e.measured.height&&!e.hidden);t&&(!s||s.has(e.id))&&l.set(e.id,e)}),l)),t,n,a?.minZoom??i,a?.maxZoom??o,a?.padding??.1);return await r.setViewport(c,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}function gD({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:s,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=a.origin??r,d=a.extent||i;if("parent"!==a.extent||a.expandParent)l&&g9(a.extent)&&(d=[[a.extent[0][0]+s,a.extent[0][1]+c],[a.extent[1][0]+s,a.extent[1][1]+c]]);else if(l){let e=l.measured.width,t=l.measured.height;e&&t&&(d=[[s,c],[s+e,c+t]])}else o?.("005","Only child nodes can use a parent extent.");let f=g9(d)?gL(t,d,a.measured):t;return(void 0===a.measured.width||void 0===a.measured.height)&&o?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-s+(a.measured.width??0)*u[0],y:f.y-c+(a.measured.height??0)*u[1]},positionAbsolute:f}}async function gz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let o,a=new Set(e.map(e=>e.id)),l=[];for(let e of n){if(!1===e.deletable)continue;let t=a.has(e.id),n=!t&&e.parentId&&l.find(t=>t.id===e.parentId);(t||n)&&l.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>!1!==e.deletable),u=(o=new Set,l.forEach(e=>{o.add(e.id)}),c.filter(e=>o.has(e.source)||o.has(e.target)));for(let e of c)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!i)return{edges:u,nodes:l};let d=await i({nodes:l,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:l}:{edges:[],nodes:[]}:d}let gR=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),gL=(e={x:0,y:0},t,n)=>({x:gR(e.x,t[0][0],t[1][0]-(n?.width??0)),y:gR(e.y,t[0][1],t[1][1]-(n?.height??0))});function g$(e,t,n){let{width:r,height:i}=g5(n),{x:o,y:a}=n.internals.positionAbsolute;return gL(e,[[o,a],[o+r,a+i]],t)}let gB=(e,t,n)=>e<t?gR(Math.abs(e-t),1,t)/t:e>n?-gR(Math.abs(e-n),1,t)/t:0,gF=(e,t,n=15,r=40)=>[gB(e.x,r,t.width-r)*n,gB(e.y,r,t.height-r)*n],gU=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),gH=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),gK=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gW=(e,t=[0,0])=>{let{x:n,y:r}=gA(e)?e.internals.positionAbsolute:gM(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},gq=(e,t=[0,0])=>{let{x:n,y:r}=gA(e)?e.internals.positionAbsolute:gM(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},gZ=(e,t)=>gK(gU(gH(e),gH(t))),gV=(e,t,n,r,i,o,a,l)=>Math.ceil(Math.max(0,Math.min(e+n,i+a)-Math.max(e,i))*Math.max(0,Math.min(t+r,o+l)-Math.max(t,o))),gG=(e,t)=>gV(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),gX=e=>gY(e.width)&&gY(e.height)&&gY(e.x)&&gY(e.y),gY=e=>!isNaN(e)&&isFinite(e),gJ=(e,t)=>(e,t)=>{},gQ=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),g0=({x:e,y:t},[n,r,i],o=!1,a=[1,1])=>{let l={x:(e-n)/i,y:(t-r)/i};return o?gQ(l,a):l},g1=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function g2(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let g3=(e,t,n,r,i,o)=>{let a=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=g2(e,n),i=g2(e,t);return{top:r,right:i,bottom:r,left:i,x:2*i,y:2*r}}if("object"==typeof e){let r=g2(e.top??e.y??0,n),i=g2(e.bottom??e.y??0,n),o=g2(e.left??e.x??0,t),a=g2(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:o,x:o+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(o,t,n),l=gR(Math.min((t-a.x)/e.width,(n-a.y)/e.height),r,i),s=e.x+e.width/2,c=e.y+e.height/2,u=t/2-s*l,d=n/2-c*l,f=function(e,t,n,r,i,o){let{x:a,y:l}=g1(e,[t,n,r]),{x:s,y:c}=g1({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(i-s),bottom:Math.floor(o-c)}}(e,u,d,l,t,n),p={left:Math.min(f.left-a.left,0),top:Math.min(f.top-a.top,0),right:Math.min(f.right-a.right,0),bottom:Math.min(f.bottom-a.bottom,0)};return{x:u-p.left+p.right,y:d-p.top+p.bottom,zoom:l}},g4=()=>"u">typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function g9(e){return null!=e&&"parent"!==e}function g5(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function g6(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function g8(e,t={width:0,height:0},n,r,i){let o={...e},a=r.get(n);if(a){let e=a.origin||i;o.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],o.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return o}function g7(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ye(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:o,y:a}=yo(e),l=g0({x:o-(i?.left??0),y:a-(i?.top??0)},r),{x:s,y:c}=n?gQ(l,t):l;return{xSnapped:s,ySnapped:c,...l}}let yt=e=>({width:e.offsetWidth,height:e.offsetHeight}),yn=e=>e?.getRootNode?.()||window?.document,yr=["INPUT","SELECT","TEXTAREA"];function yi(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(yr.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let yo=(e,t)=>{let n="clientX"in e,r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},ya=(e,t,n,r,i)=>{let o=t.querySelectorAll(`.${e}`);return o&&o.length?Array.from(o).map(t=>{let o=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:i,position:t.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...yt(t)}}):null};function yl({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:l}){let s=.125*e+.375*i+.375*a+.125*n,c=.125*t+.375*o+.375*l+.125*r,u=Math.abs(s-e),d=Math.abs(c-t);return[s,c,u,d]}function ys(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function yc({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case z.Left:return[t-ys(t-r,o),n];case z.Right:return[t+ys(r-t,o),n];case z.Top:return[t,n-ys(n-i,o)];case z.Bottom:return[t,n+ys(i-n,o)]}}function yu({sourceX:e,sourceY:t,sourcePosition:n=z.Bottom,targetX:r,targetY:i,targetPosition:o=z.Top,curvature:a=.25}){let[l,s]=yc({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[c,u]=yc({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[d,f,p,h]=yl({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${s} ${c},${u} ${r},${i}`,d,f,p,h]}function yd({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,o=Math.abs(r-t)/2;return[n<e?n+i:n-i,r<t?r+o:r-o,i,o]}let yf=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`;function yp({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,o,a,l]=yd({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,l]}let yh={[z.Left]:{x:-1,y:0},[z.Right]:{x:1,y:0},[z.Top]:{x:0,y:-1},[z.Bottom]:{x:0,y:1}},ym=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function yg({sourceX:e,sourceY:t,sourcePosition:n=z.Bottom,targetX:r,targetY:i,targetPosition:o=z.Top,borderRadius:a=5,centerX:l,centerY:s,offset:c=20,stepPosition:u=.5}){let[d,f,p,h,m]=function({source:e,sourcePosition:t=z.Bottom,target:n,targetPosition:r=z.Top,center:i,offset:o,stepPosition:a}){let l,s,c=yh[t],u=yh[r],d={x:e.x+c.x*o,y:e.y+c.y*o},f={x:n.x+u.x*o,y:n.y+u.y*o},p=(({source:e,sourcePosition:t=z.Bottom,target:n})=>t===z.Left||t===z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:d,sourcePosition:t,target:f}),h=0!==p.x?"x":"y",m=p[h],g=[],y={x:0,y:0},b={x:0,y:0},[,,v,x]=yd({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[h]*u[h]==-1){"x"===h?(l=i.x??d.x+(f.x-d.x)*a,s=i.y??(d.y+f.y)/2):(l=i.x??(d.x+f.x)/2,s=i.y??d.y+(f.y-d.y)*a);let e=[{x:l,y:d.y},{x:l,y:f.y}],t=[{x:d.x,y:s},{x:f.x,y:s}];g=c[h]===m?"x"===h?e:t:"x"===h?t:e}else{let i=[{x:d.x,y:f.y}],a=[{x:f.x,y:d.y}];if(g="x"===h?c.x===m?a:i:c.y===m?i:a,t===r){let t=Math.abs(e[h]-n[h]);if(t<=o){let r=Math.min(o-1,o-t);c[h]===m?y[h]=(d[h]>e[h]?-1:1)*r:b[h]=(f[h]>n[h]?-1:1)*r}}if(t!==r){let e="x"===h?"y":"x",t=c[h]===u[e],n=d[e]>f[e],r=d[e]<f[e];(1===c[h]&&(!t&&n||t&&r)||1!==c[h]&&(!t&&r||t&&n))&&(g="x"===h?i:a)}let p={x:d.x+y.x,y:d.y+y.y},v={x:f.x+b.x,y:f.y+b.y};Math.max(Math.abs(p.x-g[0].x),Math.abs(v.x-g[0].x))>=Math.max(Math.abs(p.y-g[0].y),Math.abs(v.y-g[0].y))?(l=(p.x+v.x)/2,s=g[0].y):(l=g[0].x,s=(p.y+v.y)/2)}let w={x:d.x+y.x,y:d.y+y.y},k={x:f.x+b.x,y:f.y+b.y};return[[e,...w.x!==g[0].x||w.y!==g[0].y?[w]:[],...g,...k.x!==g[g.length-1].x||k.y!==g[g.length-1].y?[k]:[],n],l,s,v,x]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:l,y:s},offset:c,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=function(e,t,n,r){let i=Math.min(ym(e,t)/2,ym(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${o+i*t},${a}Q ${o},${a} ${o},${a+i*r}`}let l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${o},${a+i*s}Q ${o},${a} ${o+i*l},${a}`}(d[e-1],d[e],d[e+1],a);return[g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,f,p,h,m]}function yy(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function yb(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function yv(e,t,n=z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,o=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??g5(e);if(r)return{x:i+a/2,y:o+l/2};switch(t?.position??n){case z.Top:return{x:i+a/2,y:o};case z.Right:return{x:i+a,y:o+l/2};case z.Bottom:return{x:i+a/2,y:o+l};case z.Left:return{x:i,y:o+l/2}}}function yx(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function yw(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}let yk={nodeOrigin:[0,0],nodeExtent:g_,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},y_={...yk,checkEquality:!0};function yS(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function yE(e){return"manual"===e}function yj(e,t,n,r={}){let i=yS(y_,r),o={i:0},a=new Map(t),l=i?.elevateNodesOnSelect&&!yE(i.zIndexMode)?1e3:0,s=e.length>0,c=!1;for(let u of(t.clear(),n.clear(),e)){let e=a.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=gL(gM(u,i.nodeOrigin),g9(u.extent)?u.extent:i.nodeExtent,g5(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(i):"target"===t.type&&r.push(i)}return{source:n,target:r}}(u,e),z:yN(u,l,i.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(s=!1),u.parentId&&yO(e,t,n,r,o),c||=u.selected??!1}return{nodesInitialized:s,hasSelectedNodes:c}}function yO(e,t,n,r,i){let{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:l,zIndexMode:s}=yS(yk,r),c=e.parentId,u=t.get(c);if(!u)return void console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),i&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===s&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+10*i.i),i&&void 0!==u.internals.rootParentIndex&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=function(e,t,n,r,i,o){let{x:a,y:l}=t.internals.positionAbsolute,s=g5(e),c=gM(e,n),u=g9(e.extent)?gL(c,e.extent,s):c,d=gL({x:a+u.x,y:l+u.y},r,s);"parent"===e.extent&&(d=g$(d,s,t));let f=yN(e,i,o),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}(e,u,a,l,o&&!yE(s)?1e3:0,s),{positionAbsolute:h}=e.internals,m=d!==h.x||f!==h.y;(m||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:m?{x:d,y:f}:h,z:p}})}function yN(e,t,n){let r=gY(e.zIndex)?e.zIndex:0;return yE(n)?r:r+(e.selected?t:0)}function yC(e,t,n,r=[0,0]){let i=[],o=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=gZ(o.get(n.parentId)?.expandedRect??gW(e),n.rect);o.set(n.parentId,{expandedRect:r,parent:e})}return o.size>0&&o.forEach(({expandedRect:t,parent:o},a)=>{let l=o.internals.positionAbsolute,s=g5(o),c=o.origin??r,u=t.x<l.x?Math.round(Math.abs(l.x-t.x)):0,d=t.y<l.y?Math.round(Math.abs(l.y-t.y)):0,f=Math.max(s.width,Math.round(t.width)),p=Math.max(s.height,Math.round(t.height)),h=(f-s.width)*c[0],m=(p-s.height)*c[1];(u>0||d>0||h||m)&&(i.push({id:a,type:"position",position:{x:o.position.x-u+h,y:o.position.y-d+m}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(s.width<t.width||s.height<t.height||u||d)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-h:0),height:p+(d?c[1]*d-m:0)}})}),i}async function yA({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function yM(e,t,n,r,i,o){let a=i,l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${i}-${e}`;let s=r.get(a)||new Map;if(r.set(a,s.set(n,t)),o){a=`${i}-${e}-${o}`;let l=r.get(a)||new Map;r.set(a,l.set(n,t))}}function yP(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:i,sourceHandle:o=null,targetHandle:a=null}=r,l={edgeId:r.id,source:n,target:i,sourceHandle:o,targetHandle:a},s=`${n}-${o}--${i}-${a}`;yM("source",l,`${i}-${a}--${n}-${o}`,e,n,o),yM("target",l,s,e,i,a),t.set(r.id,r)}}function yT(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r)return!1}function yI({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,o]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:o.position,dragging:r})}if(!e)return[i[0],i];let o=n.get(e)?.internals.userNode;return[o?{...o,position:t.get(e)?.position||o.position,dragging:r}:i[0],i]}function yD(e,t,n,r,i,o=!1){let a=r.get(e);if(!a)return null;let l="strict"===i?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],s=(n?l?.find(e=>e.id===n):l?.[0])??null;return s&&o?{...s,...yv(a,s,s.position,!0)}:s}function yz(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let yR=()=>!0;function yL(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:a,lib:l,flowId:s,isValidConnection:c=yR,nodeLookup:u}){let d="target"===o,f=t?a.querySelector(`.${l}-flow__handle[data-id="${s}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:h}=yo(e),m=a.elementFromPoint(p,h),g=m?.classList.contains(`${l}-flow__handle`)?m:f,y={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=yz(void 0,g),t=g.getAttribute("data-nodeid"),o=g.getAttribute("data-handleid"),a=g.classList.contains("connectable"),l=g.classList.contains("connectableend");if(!t||!e)return y;let s={source:d?t:r,sourceHandle:d?o:i,target:d?r:t,targetHandle:d?i:o};y.connection=s,y.isValid=a&&l&&(n===M.Strict?d&&"source"===e||!d&&"target"===e:t!==r||o!==i)&&c(s),y.toHandle=yD(t,e,o,u,n,!0)}return y}let y$=function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:a,domNode:l,nodeLookup:s,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:h,onConnect:m,onConnectEnd:g,isValidConnection:y=yR,onReconnectEnd:b,updateConnection:v,getTransform:x,getFromHandle:w,autoPanSpeed:k,dragThreshold:_=1,handleDomNode:S}){let E,j=yn(e.target),O=0,{x:N,y:C}=yo(e),A=yz(o,S),M=l?.getBoundingClientRect(),P=!1;if(!M||!A)return;let T=yD(i,A,r,s,t);if(!T)return;let I=yo(e,M),D=!1,R=null,L=!1,$=null,B={...T,nodeId:i,type:A,position:T.position},F=s.get(i),U={inProgress:!0,isValid:null,from:yv(F,B,z.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:F,to:I,toHandle:null,toPosition:gO[B.position],toNode:null,pointer:I};function H(){P=!0,v(U),h?.(e,{nodeId:i,handleId:r,handleType:A})}function K(e){var o,l;let p;if(!P){let{x:t,y:n}=yo(e),r=t-N,i=n-C;if(!(r*r+i*i>_*_))return;H()}if(!w()||!B)return void W(e);let h=x();E=function(e,t,n,r){let i=[],o=1/0;for(let a of function(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())gG(i,gW(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:l,y:s}=yv(a,n,n.position,!0),c=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(s-e.y,2));c>t||(c<o?(i=[{...n,x:l,y:s}],o=c):c===o&&i.push({...n,x:l,y:s}))}if(!i.length)return null;if(i.length>1){let e="source"===r.type?"target":"source";return i.find(t=>t.type===e)??i[0]}return i[0]}(g0(I=yo(e,M),h,!1,[1,1]),n,s,B),D||(!function e(){if(!u||!M)return;let[t,n]=gF(I,M,k);f({x:t,y:n}),O=requestAnimationFrame(e)}(),D=!0);let m=yL(e,{handle:E,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:j,lib:c,flowId:d,nodeLookup:s});$=m.handleDomNode,R=m.connection,o=!!E,l=m.isValid,p=null,l?p=!0:o&&!l&&(p=!1),L=p;let g=s.get(i),b=g?yv(g,B,z.Left,!0):U.from,S={...U,from:b,isValid:L,to:m.toHandle&&L?g1({x:m.toHandle.x,y:m.toHandle.y},h):I,toHandle:m.toHandle,toPosition:L&&m.toHandle?m.toHandle.position:gO[B.position],toNode:m.toHandle?s.get(m.toHandle.nodeId):null,pointer:I};v(S),U=S}function W(e){if(!("touches"in e)||!(e.touches.length>0)){if(P){(E||$)&&R&&L&&m?.(R);let{inProgress:t,...n}=U,r={...n,toPosition:U.toHandle?U.toPosition:null};g?.(e,r),o&&b?.(e,r)}p(),cancelAnimationFrame(O),D=!1,L=!1,R=null,$=null,j.removeEventListener("mousemove",K),j.removeEventListener("mouseup",W),j.removeEventListener("touchmove",K),j.removeEventListener("touchend",W)}}0===_&&H(),j.addEventListener("mousemove",K),j.addEventListener("mouseup",W),j.addEventListener("touchmove",K),j.addEventListener("touchend",W)},yB=e=>({x:e.x,y:e.y,zoom:e.k}),yF=({x:e,y:t,zoom:n})=>gd.translate(e,t).scale(n),yU=(e,t)=>e.target.closest(`.${t}`),yH=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),yK=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yW=(e,t=0,n=yK,r=()=>{})=>{let i="number"==typeof t&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},yq=e=>{let t=e.ctrlKey&&g4()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function yZ(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:e.includes("left"),affectsY:e.includes("top")}}function yV(e,t){return Math.max(0,t-e)}function yG(e,t){return Math.max(0,e-t)}function yX(e,t,n){return Math.max(0,t-e,e-n)}(x=R||(R={})).Line="line",x.Handle="handle";let yY={width:0,height:0,x:0,y:0},yJ={...yY,pointerX:0,pointerY:0,aspectRatio:1};var yQ=e.i(30224);let y0=e=>{let t,n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,i,o);return o},{useDebugValue:y1}=G.default,{useSyncExternalStoreWithSelector:y2}=yQ.default,y3=e=>e;function y4(e,t=y3,n){let r=y2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return y1(r),r}let y9=(e,t)=>{let n=e?y0(e):y0,r=(e,r=t)=>y4(n,e,r);return Object.assign(r,n),r};function y5(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}let y6=(0,G.createContext)(null),y8=y6.Provider,y7=((e="react")=>`Seems like you have not used ${"svelte"===e?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`)("react");function be(e,t){let n=(0,G.useContext)(y6);if(null===n)throw Error(y7);return y4(n,e,t)}function bt(){let e=(0,G.useContext)(y6);if(null===e)throw Error(y7);return(0,G.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let bn={display:"none"},br={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bi="react-flow__node-desc",bo="react-flow__edge-desc",ba=e=>e.ariaLiveMessage,bl=e=>e.ariaLabelConfig;function bs({rfId:e}){let t=be(ba);return(0,V.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:br,children:t})}function bc({rfId:e,disableKeyboardA11y:t}){let n=be(bl);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("div",{id:`${bi}-${e}`,style:bn,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,V.jsx)("div",{id:`${bo}-${e}`,style:bn,children:n["edge.a11yDescription.default"]}),!t&&(0,V.jsx)(bs,{rfId:e})]})}let bu=(0,G.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{let a=`${e}`.split("-");return(0,V.jsx)("div",{className:pT(["react-flow__panel",n,...a]),style:r,ref:o,...i,children:t})});bu.displayName="Panel";let bd="https://reactflow.dev?utm_source=attribution";function bf({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,V.jsx)(bu,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${bd}`,children:(0,V.jsx)("a",{href:bd,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}let bp=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},bh=e=>e.id;function bm(e,t){return y5(e.selectedNodes.map(bh),t.selectedNodes.map(bh))&&y5(e.selectedEdges.map(bh),t.selectedEdges.map(bh))}function bg({onSelectionChange:e}){let t=bt(),{selectedNodes:n,selectedEdges:r}=be(bp,bm);return(0,G.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}let by=e=>!!e.onSelectionChangeHandlers;function bb({onSelectionChange:e}){let t=be(by);return e||t?(0,V.jsx)(bg,{onSelectionChange:e}):null}let bv=[0,0],bx={x:0,y:0,zoom:1},bw=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],bk=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),b_={translateExtent:g_,nodeOrigin:bv,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function bS(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:s}=be(bk,y5),c=bt();(0,G.useEffect)(()=>(s(e.defaultNodes,e.defaultEdges),()=>{u.current=b_,l()}),[]);let u=(0,G.useRef)(b_);return(0,G.useEffect)(()=>{for(let l of bw){let s=e[l];if(s!==u.current[l]&&void 0!==e[l])if("nodes"===l)t(s);else if("edges"===l)n(s);else if("minZoom"===l)r(s);else if("maxZoom"===l)i(s);else if("translateExtent"===l)o(s);else if("nodeExtent"===l)a(s);else if("ariaLabelConfig"===l)c.setState({ariaLabelConfig:{...gE,...s||{}}});else"fitView"===l?c.setState({fitViewQueued:s}):"fitViewOptions"===l?c.setState({fitViewOptions:s}):c.setState({[l]:s})}u.current=e},bw.map(t=>e[t])),null}function bE(){return"u"<typeof window||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}let bj="u">typeof document?document:null;function bO(e=null,t={target:bj,actInsideInputWithModifier:!0}){let[n,r]=(0,G.useState)(!1),i=(0,G.useRef)(!1),o=(0,G.useRef)(new Set([])),[a,l]=(0,G.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,G.useEffect)(()=>{let n=t?.target??bj,s=t?.actInsideInputWithModifier??!0;if(null!==e){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!s)&&yi(e))return!1;let n=bC(e.code,l);if(o.current.add(e[n]),bN(a,o.current,!1)){let n=e.composedPath?.()?.[0]||e.target,o=n?.nodeName==="BUTTON"||n?.nodeName==="A";!1!==t.preventDefault&&(i.current||!o)&&e.preventDefault(),r(!0)}},c=e=>{let t=bC(e.code,l);bN(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(e[t]),"Meta"===e.key&&o.current.clear(),i.current=!1},u=()=>{o.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function bN(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function bC(e,t){return t.includes(e)?"code":"key"}function bA(e,t){let n=[],r=new Map,i=[];for(let t of e)if("add"===t.type){i.push(t);continue}else if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let i={...e};for(let e of t){var o=e,a=i;switch(o.type){case"select":a.selected=o.selected;break;case"position":void 0!==o.position&&(a.position=o.position),void 0!==o.dragging&&(a.dragging=o.dragging);break;case"dimensions":void 0!==o.dimensions&&(a.measured={...o.dimensions},o.setAttributes&&((!0===o.setAttributes||"width"===o.setAttributes)&&(a.width=o.dimensions.width),(!0===o.setAttributes||"height"===o.setAttributes)&&(a.height=o.dimensions.height))),"boolean"==typeof o.resizing&&(a.resizing=o.resizing)}}n.push(i)}return i.length&&i.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function bM(e,t){return{id:e,type:"select",selected:t}}function bP(e,t=new Set,n=!1){let r=[];for(let[i,o]of e){let e=t.has(i);(void 0!==o.selected||e)&&o.selected!==e&&(n&&(o.selected=e),r.push(bM(o.id,e)))}return r}function bT({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),o=e?.internals?.userNode??e;void 0!==o&&o!==i&&n.push({id:i.id,item:i,type:"replace"}),void 0===o&&n.push({item:i,type:"add",index:r})}for(let[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function bI(e){return{id:e.id,type:"remove"}}let bD=gJ("React Flow","https://reactflow.dev/"),bz=e=>!!e&&"object"==typeof e&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e);function bR(e){return(0,G.forwardRef)(e)}let bL="u">typeof window?G.useLayoutEffect:G.useEffect;function b$(e){let[t,n]=(0,G.useState)(BigInt(0)),[r]=(0,G.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return bL(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}let bB=(0,G.createContext)(null);function bF({children:e}){let t=bt(),n=b$((0,G.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:o,nodeLookup:a,fitViewQueued:l,onNodesChangeMiddlewareMap:s}=t.getState(),c=n;for(let t of e)c="function"==typeof t?t(c):t;let u=bT({items:c,lookup:a});for(let e of s.values())u=e(u);i&&r(c),u.length>0?o?.(u):l&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=b$((0,G.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:o,edgeLookup:a}=t.getState(),l=n;for(let t of e)l="function"==typeof t?t(l):t;i?r(l):o&&o(bT({items:l,lookup:a}))},[])),i=(0,G.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,V.jsx)(bB.Provider,{value:i,children:e})}let bU=e=>!!e.panZoom;function bH(){let e,t=(e=bt(),(0,G.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1.2,t)},zoomOut:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1/1.2,t)},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return!!r&&r.scaleTo(t,n)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,o],panZoom:a}=e.getState();return!!a&&(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),!0)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:o,maxZoom:a,panZoom:l}=e.getState(),s=g3(t,r,i,o,a,n?.padding??.1);return!!l&&(await l.setViewport(s,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;let{x:l,y:s}=a.getBoundingClientRect(),c={x:t.x-l,y:t.y-s},u=n.snapGrid??i;return g0(c,r,n.snapToGrid??o,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:o}=r.getBoundingClientRect(),a=g1(t,n);return{x:a.x+i,y:a.y+o}}}),[])),n=bt(),r=function(){let e=(0,G.useContext)(bB);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),i=be(bU),o=(0,G.useMemo)(()=>{let e=e=>n.getState().nodeLookup.get(e),t=e=>{r.nodeQueue.push(e)},i=e=>{r.edgeQueue.push(e)},o=e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState(),i=bz(e)?e:t.get(e.id),o=i.parentId?g8(i.position,i.measured,i.parentId,t,r):i.position;return gW({...i,position:o,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},a=(e,n,r={replace:!1})=>{t(t=>t.map(t=>{if(t.id===e){let e="function"==typeof n?n(t):n;return r.replace&&bz(e)?e:{...t,...e}}return t}))},l=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e="function"==typeof t?t(r):t;return n.replace&&gC(e)?e:{...r,...e}}return r}))};return{getNodes:()=>n.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=n.getState();return e.map(e=>({...e}))},getEdge:e=>n.getState().edgeLookup.get(e),setNodes:t,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];r.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];r.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:t=[],transform:r}=n.getState(),[i,o,a]=r;return{nodes:e.map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:i,y:o,zoom:a}}},deleteElements:async({nodes:e=[],edges:t=[]})=>{let{nodes:r,edges:i,onNodesDelete:o,onEdgesDelete:a,triggerNodeChanges:l,triggerEdgeChanges:s,onDelete:c,onBeforeDelete:u}=n.getState(),{nodes:d,edges:f}=await gz({nodesToRemove:e,edgesToRemove:t,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,h=d.length>0;if(p){let e=f.map(bI);a?.(f),s(e)}if(h){let e=d.map(bI);o?.(d),l(e)}return(h||p)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,t=!0,r)=>{let i=gX(e),a=i?e:o(e),l=void 0!==r;return a?(r||n.getState().nodes).filter(r=>{let o=n.getState().nodeLookup.get(r.id);if(o&&!i&&(r.id===e.id||!o.internals.positionAbsolute))return!1;let s=gW(l?r:o),c=gG(s,a);return t&&c>0||c>=s.width*s.height||c>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=gX(e)?e:o(e);if(!r)return!1;let i=gG(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:l,updateEdgeData:(e,t,n={replace:!1})=>{l(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState();return((e,t={nodeOrigin:[0,0]})=>0===e.length?{x:0,y:0,width:0,height:0}:gK(e.reduce((e,n)=>{let r="string"==typeof n,i=t.nodeLookup||r?void 0:n;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):gA(n)?n:t.nodeLookup.get(n.id)),gU(e,i?gq(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})))(e,{nodeLookup:t,nodeOrigin:r})},getHandleConnections:({type:e,id:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}-${e}${t?`-${t}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}${e?t?`-${e}-${t}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{let t,i,o=n.getState().fitViewResolver??{promise:new Promise((e,n)=>{t=e,i=n}),resolve:t,reject:i};return n.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:o}),r.nodeQueue.push(e=>[...e]),o.promise}}},[]);return(0,G.useMemo)(()=>({...o,...t,viewportInitialized:i}),[i])}let bK=e=>e.selected,bW="u">typeof window?window:void 0,bq={position:"absolute",width:"100%",height:"100%",top:0,left:0},bZ=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bV({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=P.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:s,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:h,noWheelClassName:m,noPanClassName:g,onViewportChange:y,isControlledViewport:b,paneClickDistance:v,selectionOnDrag:x}){let w,k=bt(),_=(0,G.useRef)(null),{userSelectionActive:S,lib:E,connectionInProgress:j}=be(bZ,y5),O=bO(f),N=(0,G.useRef)();w=bt(),(0,G.useEffect)(()=>{let e=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let e=yt(_.current);(0===e.height||0===e.width)&&w.getState().onError?.("004","The parent container needs a width and a height to render the graph."),w.setState({width:e.width||500,height:e.height||500})};if(_.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(_.current),()=>{window.removeEventListener("resize",e),t&&_.current&&t.unobserve(_.current)}}},[]);let C=(0,G.useCallback)(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||k.setState({transform:e})},[y,b]);return(0,G.useEffect)(()=>{if(_.current){N.current=function({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:s}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f="u">typeof ResizeObserver?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let p=gw().extent(()=>d).scaleExtent([t,n]).translateExtent(r),h=hm(e).call(p);v({x:i.x,y:i.y,zoom:gR(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");async function y(e,t){return!!h&&new Promise(n=>{p?.interpolate(t?.interpolate==="linear"?gk:hM).transform(yW(h,t?.duration,t?.ease,()=>n(!0)),e)})}function b(){p.on("zoom",null)}async function v(e,t,n){let r=yF(e),i=p?.constrain()(r,t,n);return i&&await y(i),i}return p.wheelDelta(yq),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:y,zoomOnPinch:v,zoomOnScroll:x,zoomOnDoubleClick:w,zoomActivationKeyPressed:k,lib:_,onTransformChange:S,connectionInProgress:E,paneClickDistance:j,selectionOnDrag:O}){r&&!c.isZoomingOrPanning&&b();let N=i&&!k&&!r;p.clickDistance(O?1/0:!gY(j)||j<0?0:j);let C=N?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}){return u=>{if(yU(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property("__zoom").k||1;if(u.ctrlKey&&a){let e=hg(u),t=d*Math.pow(2,yq(u));r.scaleTo(n,t,e,u);return}let f=1===u.deltaMode?20:1,p=i===P.Vertical?0:u.deltaX*f,h=i===P.Horizontal?0:u.deltaY*f;!g4()&&u.shiftKey&&i!==P.Vertical&&(p=u.deltaY*f,h=0),r.translateBy(n,-(p/d)*o,-(h/d)*o,{internal:!0});let m=yB(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?s?.(u,m):(e.isPanScrolling=!0,l?.(u,m)),e.panScrollTimeout=setTimeout(()=>{c?.(u,m),e.isPanScrolling=!1},150)}}({zoomPanValues:c,noWheelClassName:e,d3Selection:h,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:l}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let o="wheel"===r.type,a=!t&&o&&!r.ctrlKey,l=yU(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,i)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:m});h.on("wheel.zoom",C,{passive:!1});let A=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=yB(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}({zoomPanValues:c,onDraggingChange:s,onPanZoomStart:a});p.on("start",A);let M=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{e.usedRightMouseButton=!!(n&&yH(t,e.mouseButton??0)),o.sourceEvent?.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!o.sourceEvent?.internal&&i?.(o.sourceEvent,yB(o.transform))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:o,onTransformChange:S});p.on("zoom",M);let T=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,o&&yH(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=yB(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,t)},150*!!n)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:s});p.on("end",T);let I=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:l,noPanClassName:s,lib:c,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,h="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(yU(d,`${c}-flow__node`)||yU(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!i&&!o&&!n||a||u&&!h||yU(d,l)&&h||yU(d,s)&&(!h||i&&h&&!e)||!n&&d.ctrlKey&&h)return!1;if(!n&&"touchstart"===d.type&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&h||!r&&("mousedown"===d.type||"touchstart"===d.type)||Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;let m=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||h)&&m}}({zoomActivationKeyPressed:k,panOnDrag:u,zoomOnScroll:x,panOnScroll:i,zoomOnDoubleClick:w,zoomOnPinch:v,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:_,connectionInProgress:E});p.filter(I),w?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)},destroy:b,setViewport:async function e(e,t){let n=yF(e);return await y(n,t),n},setViewportConstrained:v,getViewport:function(){let e=h?gf(h.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:async function e(e,t){return!!h&&new Promise(n=>{p?.interpolate(t?.interpolate==="linear"?gk:hM).scaleTo(yW(h,t?.duration,t?.ease,()=>n(!0)),e)})},scaleBy:async function e(e,t){return!!h&&new Promise(n=>{p?.interpolate(t?.interpolate==="linear"?gk:hM).scaleBy(yW(h,t?.duration,t?.ease,()=>n(!0)),e)})},setScaleExtent:function(e){p?.scaleExtent(e)},setTranslateExtent:function(e){p?.translateExtent(e)},syncViewport:function(e){if(h){let t=yF(e),n=h.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&p?.transform(h,t,null,{sync:!0})}},setClickDistance:function(e){let t=!gY(e)||e<0?0:e;p?.clickDistance(t)}}}({domNode:_.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:s,onDraggingChange:e=>k.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=k.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=k.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=k.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=N.current.getViewport();return k.setState({panZoom:N.current,transform:[e,t,n],domNode:_.current.closest(".react-flow")}),()=>{N.current?.destroy()}}},[]),(0,G.useEffect)(()=>{N.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:O,preventScrolling:p,noPanClassName:g,userSelectionActive:S,noWheelClassName:m,lib:E,onTransformChange:C,connectionInProgress:j,selectionOnDrag:x,paneClickDistance:v})},[e,t,n,r,i,o,a,l,O,p,g,S,m,E,C,j,x,v]),(0,V.jsx)("div",{className:"react-flow__renderer",ref:_,style:bq,children:h})}let bG=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function bX(){let{userSelectionActive:e,userSelectionRect:t}=be(bG,y5);return e&&t?(0,V.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}let bY=(e,t)=>n=>{n.target===t.current&&e?.(n)},bJ=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function bQ({isSelecting:e,selectionKeyPressed:t,selectionMode:n=T.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:h,children:m}){let g=(0,G.useRef)(0),y=bt(),{userSelectionActive:b,elementsSelectable:v,dragging:x,panBy:w,autoPanSpeed:k}=be(bJ,y5),_=v&&(e||b),S=(0,G.useRef)(null),E=(0,G.useRef)(),j=(0,G.useRef)(new Set),O=(0,G.useRef)(new Set),N=(0,G.useRef)(!1),C=(0,G.useRef)(!1),A=(0,G.useRef)({x:0,y:0}),M=(0,G.useRef)(!1),P=e=>{if(C.current||N.current||y.getState().connection.inProgress){C.current=!1,N.current=!1;return}c?.(e),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})};function I(e,t){let{userSelectionRect:r}=y.getState();if(!r)return;let{transform:i,nodeLookup:o,edgeLookup:a,connectionLookup:l,triggerNodeChanges:s,triggerEdgeChanges:c,defaultEdgeOptions:u}=y.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=g1(d,i),h={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},m=j.current,g=O.current;j.current=new Set(gT(o,h,i,n===T.Partial,!0).map(e=>e.id)),O.current=new Set;let b=u?.selectable??!0;for(let e of j.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=a.get(e);t&&(t.selectable??b)&&O.current.add(e)}}g7(m,j.current)||s(bP(o,j.current,!0)),g7(g,O.current)||c(bP(a,O.current)),y.setState({userSelectionRect:h,userSelectionActive:!0,nodesSelectionActive:!1})}let D=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};(0,G.useEffect)(()=>()=>D(),[]);let z=!0===r||Array.isArray(r)&&r.includes(0);return(0,V.jsxs)("div",{className:pT(["react-flow__pane",{draggable:z,dragging:x,selection:e}]),onClick:_?void 0:bY(P,S),onContextMenu:bY(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},S),onWheel:bY(d?e=>d(e):void 0,S),onPointerEnter:_?void 0:f,onPointerMove:_?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:a}=y.getState();if(!E.current||!n)return;let{x:s,y:c}=yo(e.nativeEvent,E.current);A.current={x:s,y:c};let u=g1({x:n.startX,y:n.startY},r);if(!C.current){if(Math.hypot(s-u.x,c-u.y)<=(t?0:o))return;a(),l?.(e)}C.current=!0,M.current||(!function e(){if(!i||!E.current)return;let[t,n]=gF(A.current,E.current,k);w({x:t,y:n}).then(t=>{if(!C.current||!t){g.current=requestAnimationFrame(e);return}let{x:n,y:r}=A.current;I(n,r),g.current=requestAnimationFrame(e)})}(),M.current=!0),I(s,c)}:p,onPointerUp:e=>{if(!_){e.target===S.current&&y.getState().connection.inProgress&&(N.current=!0);return}0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!b&&e.target===S.current&&y.getState().userSelectionRect&&P?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null}),C.current&&(s?.(e),y.setState({nodesSelectionActive:j.current.size>0})),D())},onPointerCancel:_?e=>{e.target?.releasePointerCapture?.(e.pointerId),D()}:void 0,onPointerDownCapture:_?n=>{let{domNode:r,transform:i}=y.getState();if(E.current=r?.getBoundingClientRect(),!E.current)return;let o=n.target===S.current;if(!o&&n.target.closest(".nokey")||!e||!(a&&o||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),C.current=!1;let{x:l,y:s}=yo(n.nativeEvent,E.current),c=g0({x:l,y:s},i);y.setState({userSelectionRect:{width:0,height:0,startX:c.x,startY:c.y,x:l,y:s}}),o||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:_?e=>{C.current&&(e.stopPropagation(),C.current=!1)}:void 0,onPointerLeave:h,ref:S,style:bq,children:[m,(0,V.jsx)(bX,{})]})}function b0({id:e,store:t,unselect:n=!1,nodeRef:r}){let i,{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:s,onError:c}=t.getState(),u=s.get(e);u?(t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(a({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):c?.("012",(i=e,`Node with id "${i}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`))}function b1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:a}){let l=bt(),[s,c]=(0,G.useState)(!1),u=(0,G.useRef)();return(0,G.useEffect)(()=>{if(!t)return u.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},a=0,l=new Map,s=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,h=!1,m=null;return{update:function({noDragClassName:g,handleSelector:y,domNode:b,isSelectable:v,nodeId:x,nodeClickDistance:w=0}){function k({x:e,y:n}){let{nodeLookup:i,nodeExtent:a,snapGrid:s,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();o={x:e,y:n};let y=!1,b=l.size>1,v=b&&a?gH(gP(l)):null,w=b&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let o={x:n-i.distance.x,y:r-i.distance.y},a=gQ(o,t);return{x:a.x-o.x,y:a.y-o.y}}({dragItems:l,snapGrid:s,x:e,y:n}):null;for(let[t,r]of l){if(!i.has(t))continue;let o={x:e-r.distance.x,y:n-r.distance.y};c&&(o=w?{x:Math.round(o.x+w.x),y:Math.round(o.y+w.y)}:gQ(o,s));let l=null;if(b&&a&&!r.extent&&v){let{positionAbsolute:e}=r.internals,t=e.x-v.x+a[0][0],n=e.x+r.measured.width-v.x2+a[1][0];l=[[t,e.y-v.y+a[0][1]],[n,e.y+r.measured.height-v.y2+a[1][1]]]}let{position:d,positionAbsolute:f}=gD({nodeId:t,nextPosition:o,nodeLookup:i,nodeExtent:l||a,nodeOrigin:u,onError:p});y=y||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(h=h||y,y&&(g(l,!0),m&&(r||d||!x&&f))){let[e,t]=yI({nodeId:x,dragItems:l,nodeLookup:i});r?.(m,l,e,t),d?.(m,e,t),x||f?.(m,t)}}async function _(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){s=!1,cancelAnimationFrame(a);return}let[l,d]=gF(c,u,r);(0!==l||0!==d)&&(o.x=(o.x??0)-l/e[2],o.y=(o.y??0)-d/e[2],await n({x:l,y:d})&&k(o)),a=requestAnimationFrame(_)}function S(r){let{nodeLookup:i,multiSelectionActive:a,nodesDraggable:s,transform:c,snapGrid:f,snapToGrid:p,selectNodesOnDrag:h,onNodeDragStart:m,onSelectionDragStart:g,unselectNodesAndEdges:y}=t();d=!0,h&&v||a||!x||i.get(x)?.selected||y(),v&&h&&x&&e?.(x);let b=ye(r.sourceEvent,{transform:c,snapGrid:f,snapToGrid:p,containerBounds:u});if(o=b,(l=function(e,t,n,r){let i=new Map;for(let[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(a,e))&&(a.draggable||t&&void 0===a.draggable)){let t=e.get(o);t&&i.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}(i,s,b,x)).size>0&&(n||m||!x&&g)){let[e,t]=yI({nodeId:x,dragItems:l,nodeLookup:i});n?.(r.sourceEvent,l,e,t),m?.(r.sourceEvent,e,t),x||g?.(r.sourceEvent,t)}}f=hm(b);let E=hC().clickDistance(w).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:a,snapToGrid:l}=t();u=n?.getBoundingClientRect()||null,p=!1,h=!1,m=e.sourceEvent,0===r&&S(e),o=ye(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:l,containerBounds:u}),c=yo(e.sourceEvent,u)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:a,nodeDragThreshold:f,nodeLookup:h}=t(),g=ye(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:u});if(m=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||x&&!h.has(x))&&(p=!0),!p){if(!s&&n&&d&&(s=!0,_()),!d){let t=yo(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&S(e)}(o.x!==g.xSnapped||o.y!==g.ySnapped)&&l&&d&&(c=yo(e.sourceEvent,u),k(g))}}).on("end",e=>{if(!d||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(s=!1,d=!1,cancelAnimationFrame(a),l.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:o,onSelectionDragStop:a}=t();if(h&&(r(l,!1),h=!1),i||o||!x&&a){let[t,r]=yI({nodeId:x,dragItems:l,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,l,t,r),o?.(e.sourceEvent,t,r),x||a?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!yT(t,`.${g}`,b))&&(!y||yT(t,y,b))});f.call(E)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{b0({id:t,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,l,e]),(0,G.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:a})},[n,r,t,o,e,i,a]),s}function b2(){let e=bt();return(0,G.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:o,onError:a,updateNodePositions:l,nodeLookup:s,nodeOrigin:c}=e.getState(),u=new Map,d=e=>e.selected&&(e.draggable||o&&void 0===e.draggable),f=r?i[0]:5,p=r?i[1]:5,h=t.direction.x*f*t.factor,m=t.direction.y*p*t.factor;for(let[,e]of s){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+h,y:e.internals.positionAbsolute.y+m};r&&(t=gQ(t,i));let{position:o,positionAbsolute:l}=gD({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:n,nodeOrigin:c,onError:a});e.position=o,e.internals.positionAbsolute=l,u.set(e.id,e)}l(u)},[])}let b3=(0,G.createContext)(null),b4=b3.Provider;b3.Consumer;let b9=()=>(0,G.useContext)(b3),b5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),b6=(0,G.createContext)(null);function b8({children:e}){let t=be(b5,y5);return(0,V.jsx)(b6.Provider,{value:t,children:e})}let b7={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},ve=(0,G.memo)(bR(function({type:e="source",position:t=z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:l,children:s,className:c,onMouseDown:u,onTouchStart:d,...f},p){let h=a||null,m="target"===e,g=bt(),y=b9(),{connectOnClick:b,noPanClassName:v,rfId:x}=function(){let e=(0,G.useContext)(b6);if(!e)throw Error("useHandleConfig must be used within a HandleConfigProvider");return e}(),{connectingFrom:w,connectingTo:k,clickConnecting:_,isPossibleEndHandle:S,connectionInProcess:E,clickConnectionInProcess:j,valid:O}=be(t=>{let{connectionClickStartHandle:n,connectionMode:r,connection:i}=t,{fromHandle:o,toHandle:a,isValid:l}=i;if(!o&&!n)return b7;let s=a?.nodeId===y&&a?.id===h&&a?.type===e;return{connectingFrom:o?.nodeId===y&&o?.id===h&&o?.type===e,connectingTo:s,clickConnecting:n?.nodeId===y&&n?.id===h&&n?.type===e,isPossibleEndHandle:r===M.Strict?o?.type!==e:y!==o?.nodeId||h!==o?.id,connectionInProcess:!!o,clickConnectionInProcess:!!n,valid:s&&l}},y5);y||g.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");let N=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(function(e,t,n={}){return((e,t,n={})=>{let r,i;if(!e.source||!e.target)return n.onError?.("006","Can't create edge. An edge needs a source and a target."),t;let o=n.getEdgeId||yf;return(i=r=gC(e)?{...e}:{...e,id:o(e)},t.some(e=>e.source===i.source&&e.target===i.target&&(e.sourceHandle===i.sourceHandle||!e.sourceHandle&&!i.sourceHandle)&&(e.targetHandle===i.targetHandle||!e.targetHandle&&!i.targetHandle)))?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))})(e,t,{...n,onError:n.onError??bD})}(i,e,{onError:n}))}n?.(i),l?.(i)},C=e=>{if(!y)return;let t="clientX"in e.nativeEvent;if(i&&(t&&0===e.button||!t)){let t=g.getState();y$(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:m,handleId:h,nodeId:y,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:N,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,V.jsx)("div",{"data-handleid":h,"data-nodeid":y,"data-handlepos":t,"data-id":`${x}-${y}-${h}-${e}`,className:pT(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",v,c,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,clickconnecting:_,connectingfrom:w,connectingto:k,valid:O,connectionindicator:r&&(!E||S)&&(E||j?o:i)}]),onMouseDown:C,onTouchStart:C,onClick:b?t=>{let{onClickConnectStart:r,onClickConnectEnd:o,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s,lib:c,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!y||!a&&!i)return;if(!a){r?.(t.nativeEvent,{nodeId:y,handleId:h,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:y,type:e,id:h}});return}let p=yn(t.target),m=n||s,{connection:b,isValid:v}=yL(t.nativeEvent,{handle:{nodeId:y,id:h,type:e},connectionMode:l,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:m,flowId:u,doc:p,lib:c,nodeLookup:d});v&&b&&N(b);let x=structuredClone(f);delete x.inProgress,x.toPosition=x.toHandle?x.toHandle.position:null,o?.(t,x),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:s})})),vt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vn={input:function({data:e,isConnectable:t,sourcePosition:n=z.Bottom}){return(0,V.jsxs)(V.Fragment,{children:[e?.label,(0,V.jsx)(ve,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=z.Top,sourcePosition:r=z.Bottom}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ve,{type:"target",position:n,isConnectable:t}),e?.label,(0,V.jsx)(ve,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=z.Top}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ve,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},vr=e=>{let{width:t,height:n,x:r,y:i}=gP(e.nodeLookup,{filter:e=>!!e.selected});return{width:gY(t)?t:null,height:gY(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function vi({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=bt(),{width:i,height:o,transformString:a,userSelectionActive:l}=be(vr,y5),s=b2(),c=(0,G.useRef)(null);(0,G.useEffect)(()=>{n||c.current?.focus({preventScroll:!0})},[n]);let u=!l&&null!==i&&null!==o;if(b1({nodeRef:c,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,V.jsx)("div",{className:pT(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:(0,V.jsx)("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(vt,e.key)&&(e.preventDefault(),s({direction:vt[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:o}})})}let vo="u">typeof window?window:void 0,va=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function vl({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:h,panActivationKeyCode:m,zoomActivationKeyCode:g,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:x,panOnScrollSpeed:w,panOnScrollMode:k,zoomOnDoubleClick:_,panOnDrag:S,autoPanOnSelection:E,defaultViewport:j,translateExtent:O,minZoom:N,maxZoom:C,preventScrolling:A,onSelectionContextMenu:M,noWheelClassName:P,noPanClassName:T,disableKeyboardA11y:I,onViewportChange:D,isControlledViewport:z}){let{nodesSelectionActive:R,userSelectionActive:L}=be(va,y5),$=bO(c,{target:vo}),B=bO(m,{target:vo}),F=B||S,U=B||x,H=u&&!0!==F,K=$||L||H;return!function({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=bt(),{deleteElements:r}=bH(),i=bO(e,{actInsideInputWithModifier:!1}),o=bO(t,{target:bW});(0,G.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(bK),edges:e.filter(bK)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,G.useEffect)(()=>{n.setState({multiSelectionActive:o})},[o])}({deleteKeyCode:s,multiSelectionKeyCode:h}),(0,V.jsx)(bV,{onPaneContextMenu:o,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:U,panOnScrollSpeed:w,panOnScrollMode:k,zoomOnDoubleClick:_,panOnDrag:!$&&F,defaultViewport:j,translateExtent:O,minZoom:N,maxZoom:C,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:P,noPanClassName:T,onViewportChange:D,isControlledViewport:z,paneClickDistance:l,selectionOnDrag:H,children:(0,V.jsxs)(bQ,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:F,autoPanOnSelection:E,isSelecting:!!K,selectionMode:d,selectionKeyPressed:$,paneClickDistance:l,selectionOnDrag:H,children:[e,R&&(0,V.jsx)(vi,{onSelectionContextMenu:M,noPanClassName:T,disableKeyboardA11y:I})]})})}vl.displayName="FlowRenderer";let vs=(0,G.memo)(vl),vc=e=>e.updateNodeInternals;var vu=(0,G.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:a,nodesDraggable:l,elementsSelectable:s,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:h,rfId:m,nodeTypes:g,nodeClickDistance:y,onError:b}){let v,{node:x,internals:w,isParent:k}=be(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},y5),_=x.type||"default",S=g?.[_]||vn[_];void 0===S&&(b?.("003",(v=_,`Node type "${v}" not found. Using fallback type "default".`)),_="default",S=g?.default||vn.default);let E=!!(x.draggable||l&&void 0===x.draggable),j=!!(x.selectable||s&&void 0===x.selectable),O=!!(x.connectable||c&&void 0===x.connectable),N=!!(x.focusable||u&&void 0===x.focusable),C=bt(),A=g6(x),M=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=bt(),o=(0,G.useRef)(null),a=(0,G.useRef)(null),l=(0,G.useRef)(e.sourcePosition),s=(0,G.useRef)(e.targetPosition),c=(0,G.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,G.useEffect)(()=>{!o.current||e.hidden||u&&a.current===o.current||(a.current&&r?.unobserve(a.current),r?.observe(o.current),a.current=o.current)},[u,e.hidden]),(0,G.useEffect)(()=>()=>{a.current&&(r?.unobserve(a.current),a.current=null)},[]),(0,G.useEffect)(()=>{if(o.current){let n=c.current!==t,r=l.current!==e.sourcePosition,a=s.current!==e.targetPosition;(n||r||a)&&(c.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}({node:x,nodeType:_,hasDimensions:A,resizeObserver:d}),P=b1({nodeRef:M,disabled:x.hidden||!E,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),T=b2();if(x.hidden)return null;let I=g5(x),D=void 0===x.internals.handleBounds?{width:x.width??x.initialWidth??x.style?.width,height:x.height??x.initialHeight??x.style?.height}:{width:x.width??x.style?.width,height:x.height??x.style?.height},z=j||E||t||n||r||i,R=n?e=>n(e,{...w.userNode}):void 0,L=r?e=>r(e,{...w.userNode}):void 0,$=i?e=>i(e,{...w.userNode}):void 0,B=o?e=>o(e,{...w.userNode}):void 0,F=a?e=>a(e,{...w.userNode}):void 0;return(0,V.jsx)("div",{className:pT(["react-flow__node",`react-flow__node-${_}`,{[p]:E},x.className,{selected:x.selected,selectable:j,parent:k,draggable:E,dragging:P}]),ref:M,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:A?"visible":"hidden",...x.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:L,onMouseLeave:$,onContextMenu:B,onClick:n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=C.getState();j&&(!r||!E||i>0)&&b0({id:e,store:C,nodeRef:M}),t&&t(n,{...w.userNode})},onDoubleClick:F,onKeyDown:N?t=>{if(!yi(t.nativeEvent)&&!h){if(gS.includes(t.key)&&j)b0({id:e,store:C,unselect:"Escape"===t.key,nodeRef:M});else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(vt,t.key)){t.preventDefault();let{ariaLabelConfig:e}=C.getState();C.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),T({direction:vt[t.key],factor:t.shiftKey?4:1})}}}:void 0,tabIndex:N?0:void 0,onFocus:N?()=>{if(h||!M.current?.matches(":focus-visible"))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:o}=C.getState();!i||gT(new Map([[e,x]]),{x:0,y:0,width:n,height:r},t,!0).length>0||o(x.position.x+I.width/2,x.position.y+I.height/2,{zoom:t[2]})}:void 0,role:x.ariaRole??(N?"group":void 0),"aria-roledescription":"node","aria-describedby":h?void 0:`${bi}-${m}`,"aria-label":x.ariaLabel,...x.domAttributes,children:(0,V.jsx)(b4,{value:e,children:(0,V.jsx)(S,{id:e,data:x.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:O,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:P,dragHandle:x.dragHandle,zIndex:w.z,parentId:x.parentId,...I})})})});let vd=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function vf(e){var t;let{nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=be(vd,y5),a=(t=e.onlyRenderVisibleElements,be((0,G.useCallback)(e=>t?gT(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(e=>e.id):Array.from(e.nodeLookup.keys()),[t]),y5)),l=function(){let e=be(vc),[t]=(0,G.useState)(()=>"u"<typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,G.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,V.jsx)("div",{className:"react-flow__nodes",style:bq,children:a.map(t=>(0,V.jsx)(vu,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},t))})}vf.displayName="NodeRenderer";let vp=(0,G.memo)(vf),vh={[D.Arrow]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,V.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[D.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,V.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},vm=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{let s,c=(s=bt(),(0,G.useMemo)(()=>{let e;return Object.prototype.hasOwnProperty.call(vh,t)?vh[t]:(s.getState().onError?.("009",(e=t,`Marker type "${e}" doesn't exist.`)),null)},[t]));return c?(0,V.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:(0,V.jsx)(c,{color:n,strokeWidth:a})}):null},vg=({defaultColor:e,rfId:t})=>{let n=be(e=>e.edges),r=be(e=>e.defaultEdgeOptions),i=(0,G.useMemo)(()=>(function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let o=new Set;return e.reduce((e,a)=>([a.markerStart||r,a.markerEnd||i].forEach(r=>{if(r&&"object"==typeof r){let i=yw(r,t);o.has(i)||(e.push({id:i,color:r.color||n,...r}),o.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))})(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,V.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,V.jsx)("defs",{children:i.map(e=>(0,V.jsx)(vm,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};vg.displayName="MarkerDefinitions";var vy=(0,G.memo)(vg);function vb({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:s,className:c,...u}){let[d,f]=(0,G.useState)({x:1,y:0,width:0,height:0}),p=pT(["react-flow__edge-textwrapper",c]),h=(0,G.useRef)(null);return((0,G.useEffect)(()=>{if(h.current){let e=h.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n)?(0,V.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[i&&(0,V.jsx)("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),(0,V.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:h,style:r,children:n}),s]}):null}vb.displayName="EdgeText";let vv=(0,G.memo)(vb);function vx({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:c=20,...u}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("path",{...u,d:e,fill:"none",className:pT(["react-flow__edge-path",u.className])}),c?(0,V.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&gY(t)&&gY(n)?(0,V.jsx)(vv,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function vw({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===z.Left||e===z.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function vk({sourceX:e,sourceY:t,sourcePosition:n=z.Bottom,targetX:r,targetY:i,targetPosition:o=z.Top}){let[a,l]=vw({pos:n,x1:e,y1:t,x2:r,y2:i}),[s,c]=vw({pos:o,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=yl({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${e},${t} C${a},${l} ${s},${c} ${r},${i}`,u,d,f,p]}function v_(e){return(0,G.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:a,targetPosition:l,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,interactionWidth:y})=>{let[b,v,x]=vk({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:o,targetPosition:l}),w=e.isInternal?void 0:t;return(0,V.jsx)(vx,{id:w,path:b,labelX:v,labelY:x,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,interactionWidth:y})})}let vS=v_({isInternal:!1}),vE=v_({isInternal:!0});function vj(e){return(0,G.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=z.Bottom,targetPosition:h=z.Top,markerEnd:m,markerStart:g,pathOptions:y,interactionWidth:b})=>{let[v,x,w]=yg({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:o,targetPosition:h,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),k=e.isInternal?void 0:t;return(0,V.jsx)(vx,{id:k,path:v,labelX:x,labelY:w,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:g,interactionWidth:b})})}vS.displayName="SimpleBezierEdge",vE.displayName="SimpleBezierEdgeInternal";let vO=vj({isInternal:!1}),vN=vj({isInternal:!0});function vC(e){return(0,G.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,V.jsx)(vO,{...n,id:r,pathOptions:(0,G.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}vO.displayName="SmoothStepEdge",vN.displayName="SmoothStepEdgeInternal";let vA=vC({isInternal:!1}),vM=vC({isInternal:!0});function vP(e){return(0,G.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:m})=>{let[g,y,b]=yp({sourceX:n,sourceY:r,targetX:i,targetY:o}),v=e.isInternal?void 0:t;return(0,V.jsx)(vx,{id:v,path:g,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:m})})}vA.displayName="StepEdge",vM.displayName="StepEdgeInternal";let vT=vP({isInternal:!1}),vI=vP({isInternal:!0});function vD(e){return(0,G.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:a=z.Bottom,targetPosition:l=z.Top,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,pathOptions:y,interactionWidth:b})=>{let[v,x,w]=yu({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:o,targetPosition:l,curvature:y?.curvature}),k=e.isInternal?void 0:t;return(0,V.jsx)(vx,{id:k,path:v,labelX:x,labelY:w,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}vT.displayName="StraightEdge",vI.displayName="StraightEdgeInternal";let vz=vD({isInternal:!1}),vR=vD({isInternal:!0});vz.displayName="BezierEdge",vR.displayName="BezierEdgeInternal";let vL={default:vR,straight:vI,step:vM,smoothstep:vN,simplebezier:vE},v$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},vB="react-flow__edgeupdater";function vF({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:l}){return(0,V.jsx)("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:pT([vB,`${vB}-${l}`]),cx:e===z.Left?t-r:e===z.Right?t+r:t,cy:e===z.Top?n-r:e===z.Bottom?n+r:n,r:r,stroke:"transparent",fill:"transparent"})}function vU({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:a,sourcePosition:l,targetPosition:s,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let h=bt(),m=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:r,domNode:i,connectionMode:o,connectionRadius:a,lib:l,onConnectStart:s,cancelConnection:p,nodeLookup:m,rfId:g,panBy:y,updateConnection:b}=h.getState(),v="target"===t.type;y$(e.nativeEvent,{autoPanOnConnect:r,connectionMode:o,connectionRadius:a,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:v,edgeUpdaterType:t.type,lib:l,flowId:g,cancelConnection:p,panBy:y,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>c?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),s?.(r,i)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:b,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>p(!0),y=()=>p(!1);return(0,V.jsxs)(V.Fragment,{children:[(!0===e||"source"===e)&&(0,V.jsx)(vF,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:e=>m(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:y,type:"source"}),(!0===e||"target"===e)&&(0,V.jsx)(vF,{position:s,centerX:o,centerY:a,radius:t,onMouseDown:e=>m(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:y,type:"target"})]})}var vH=(0,G.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:h,edgeTypes:m,noPanClassName:g,onError:y,disableKeyboardA11y:b}){let v,x=be(t=>t.edgeLookup.get(e)),w=be(e=>e.defaultEdgeOptions),k=(x=w?{...w,...x}:x).type||"default",_=m?.[k]||vL[k];void 0===_&&(y?.("011",(v=k,`Edge type "${v}" not found. Using fallback type "default".`)),k="default",_=m?.default||vL.default);let S=!!(x.focusable||t&&void 0===x.focusable),E=void 0!==d&&(x.reconnectable||n&&void 0===x.reconnectable),j=!!(x.selectable||r&&void 0===x.selectable),O=(0,G.useRef)(null),[N,C]=(0,G.useState)(!1),[A,P]=(0,G.useState)(!1),T=bt(),{zIndex:I=x.zIndex,sourceX:D,sourceY:R,targetX:L,targetY:$,sourcePosition:B,targetPosition:F}=be((0,G.useCallback)(t=>{let n=t.nodeLookup.get(x.source),r=t.nodeLookup.get(x.target);if(!n||!r)return v$;let i=function(e){let{sourceNode:t,targetNode:n}=e;if(!yy(t)||!yy(n))return null;let r=t.internals.handleBounds||yb(t.handles),i=n.internals.handleBounds||yb(n.handles),o=yx(r?.source??[],e.sourceHandle),a=yx(e.connectionMode===M.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!o||!a)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`)(!o?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=o?.position||z.Bottom,s=a?.position||z.Top,c=yv(t,o,l),u=yv(n,a,s);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:s}}({id:e,sourceNode:n,targetNode:r,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:t.connectionMode,onError:y}),o=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if("manual"===o)return r;let a=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return(i&&n?r+1e3:r)+a}({selected:x.selected,zIndex:x.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||v$,zIndex:o}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),y5),U=(0,G.useMemo)(()=>x.markerStart?`url('#${yw(x.markerStart,h)}')`:void 0,[x.markerStart,h]),H=(0,G.useMemo)(()=>x.markerEnd?`url('#${yw(x.markerEnd,h)}')`:void 0,[x.markerEnd,h]);if(x.hidden||null===D||null===R||null===L||null===$)return null;let K=o?e=>{o(e,{...x})}:void 0,W=a?e=>{a(e,{...x})}:void 0,q=l?e=>{l(e,{...x})}:void 0,Z=s?e=>{s(e,{...x})}:void 0,X=c?e=>{c(e,{...x})}:void 0;return(0,V.jsx)("svg",{style:{zIndex:I},children:(0,V.jsxs)("g",{className:pT(["react-flow__edge",`react-flow__edge-${k}`,x.className,g,{selected:x.selected,animated:x.animated,inactive:!j&&!i,updating:N,selectable:j}]),onClick:t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:o}=T.getState();j&&(T.setState({nodesSelectionActive:!1}),x.selected&&o?(r({nodes:[],edges:[x]}),O.current?.blur()):n([e])),i&&i(t,x)},onDoubleClick:K,onContextMenu:W,onMouseEnter:q,onMouseMove:Z,onMouseLeave:X,onKeyDown:S?t=>{if(!b&&gS.includes(t.key)&&j){let{unselectNodesAndEdges:n,addSelectedEdges:r}=T.getState();"Escape"===t.key?(O.current?.blur(),n({edges:[x]})):r([e])}}:void 0,tabIndex:S?0:void 0,role:x.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===x.ariaLabel?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":S?`${bo}-${h}`:void 0,ref:O,...x.domAttributes,children:[!A&&(0,V.jsx)(_,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:D,sourceY:R,targetX:L,targetY:$,sourcePosition:B,targetPosition:F,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:H,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&(0,V.jsx)(vU,{edge:x,isReconnectable:E,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:D,sourceY:R,targetX:L,targetY:$,sourcePosition:B,targetPosition:F,setUpdateHover:C,setReconnecting:P})]})})});let vK=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vW({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,disableKeyboardA11y:m}){let{edgesFocusable:g,edgesReconnectable:y,elementsSelectable:b,onError:v}=be(vK,y5),x=be((0,G.useCallback)(e=>{if(!t)return e.edges.map(e=>e.id);let n=[];if(e.width&&e.height)for(let t of e.edges){let r=e.nodeLookup.get(t.source),i=e.nodeLookup.get(t.target);r&&i&&function({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let o=gU(gq(e),gq(t));return o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1),gG({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},gK(o))>0}({sourceNode:r,targetNode:i,width:e.width,height:e.height,transform:e.transform})&&n.push(t.id)}return n},[t]),y5);return(0,V.jsxs)("div",{className:"react-flow__edges",children:[(0,V.jsx)(vy,{defaultColor:e,rfId:n}),x.map(e=>(0,V.jsx)(vH,{id:e,edgesFocusable:g,edgesReconnectable:y,elementsSelectable:b,noPanClassName:i,onReconnect:o,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,rfId:n,onError:v,edgeTypes:r,disableKeyboardA11y:m},e))]})}vW.displayName="EdgeRenderer";let vq=(0,G.memo)(vW),vZ=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function vV({children:e}){let t=bt(),n=(0,G.useRef)(null),[r]=(0,G.useState)(()=>t.getState().transform);return bL(()=>{let e=null,r=()=>{let r=t.getState().transform;(!e||r[0]!==e[0]||r[1]!==e[1]||r[2]!==e[2])&&(e=r,n.current&&(n.current.style.transform=vZ(r)))};return r(),t.subscribe(r)},[t]),(0,V.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:vZ(r)},children:e})}let vG=e=>e.panZoom?.syncViewport;function vX(e){return e.connection.inProgress?{...e.connection,to:g0(e.connection.to,e.transform)}:{...e.connection}}let vY=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function vJ({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:o,height:a,isValid:l,inProgress:s}=be(vY,y5);return o&&i&&s?(0,V.jsx)("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:(0,V.jsx)("g",{className:pT(["react-flow__connection",gN(l)]),children:(0,V.jsx)(vQ,{style:t,type:n,CustomComponent:r,isValid:l})})}):null}let vQ=({style:e,type:t=I.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:o,fromNode:a,fromHandle:l,fromPosition:s,to:c,toNode:u,toHandle:d,toPosition:f,pointer:p}=be(vX,y5);if(!i)return;if(n)return(0,V.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:s,toPosition:f,connectionStatus:gN(r),toNode:u,toHandle:d,pointer:p});let h="",m={sourceX:o.x,sourceY:o.y,sourcePosition:s,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case I.Bezier:[h]=yu(m);break;case I.SimpleBezier:[h]=vk(m);break;case I.Step:[h]=yg({...m,borderRadius:0});break;case I.SmoothStep:[h]=yg(m);break;default:[h]=yp(m)}return(0,V.jsx)("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};vQ.displayName="ConnectionLine";let v0={};function v1(e=v0){(0,G.useRef)(e),bt(),(0,G.useEffect)(()=>{},[e])}function v2({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:h,connectionLineStyle:m,connectionLineComponent:g,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:_,deleteKeyCode:S,onlyRenderVisibleElements:E,elementsSelectable:j,defaultViewport:O,translateExtent:N,minZoom:C,maxZoom:A,preventScrolling:M,defaultMarkerColor:P,zoomOnScroll:T,zoomOnPinch:I,panOnScroll:D,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:L,panOnDrag:$,autoPanOnSelection:B,onPaneClick:F,onPaneMouseEnter:U,onPaneMouseMove:H,onPaneMouseLeave:K,onPaneScroll:W,onPaneContextMenu:q,paneClickDistance:Z,nodeClickDistance:X,onEdgeContextMenu:Y,onEdgeMouseEnter:J,onEdgeMouseMove:Q,onEdgeMouseLeave:ee,reconnectRadius:et,onReconnect:en,onReconnectStart:er,onReconnectEnd:ei,noDragClassName:eo,noWheelClassName:ea,noPanClassName:el,disableKeyboardA11y:es,nodeExtent:ec,rfId:eu,viewport:ed,onViewportChange:ef,nodesDraggable:ep}){let eh,em,eg,ey;return v1(e),v1(t),bt(),(0,G.useRef)(!1),(0,G.useEffect)(()=>{},[]),eh=bH(),em=(0,G.useRef)(!1),(0,G.useEffect)(()=>{!em.current&&eh.viewportInitialized&&n&&(setTimeout(()=>n(eh),1),em.current=!0)},[n,eh.viewportInitialized]),eg=be(vG),ey=bt(),(0,G.useEffect)(()=>{ed&&(eg?.(ed),ey.setState({transform:[ed.x,ed.y,ed.zoom]}))},[ed,eg]),(0,V.jsx)(vs,{onPaneClick:F,onPaneMouseEnter:U,onPaneMouseMove:H,onPaneMouseLeave:K,onPaneContextMenu:q,onPaneScroll:W,paneClickDistance:Z,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:_,elementsSelectable:j,zoomOnScroll:T,zoomOnPinch:I,zoomOnDoubleClick:L,panOnScroll:D,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:$,autoPanOnSelection:B,defaultViewport:O,translateExtent:N,minZoom:C,maxZoom:A,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:eo,noWheelClassName:ea,noPanClassName:el,disableKeyboardA11y:es,onViewportChange:ef,isControlledViewport:!!ed,children:(0,V.jsxs)(vV,{children:[(0,V.jsx)(vq,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:en,onReconnectStart:er,onReconnectEnd:ei,onlyRenderVisibleElements:E,onEdgeContextMenu:Y,onEdgeMouseEnter:J,onEdgeMouseMove:Q,onEdgeMouseLeave:ee,reconnectRadius:et,defaultMarkerColor:P,noPanClassName:el,disableKeyboardA11y:es,rfId:eu}),(0,V.jsx)(vJ,{style:m,type:h,component:g,containerStyle:y}),(0,V.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,V.jsx)(vp,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:X,onlyRenderVisibleElements:E,noPanClassName:el,noDragClassName:eo,disableKeyboardA11y:es,nodeExtent:ec,rfId:eu,nodesDraggable:ep}),(0,V.jsx)("div",{className:"react-flow__viewport-portal"})]})})}v2.displayName="GraphView";let v3=(0,G.memo)(v2),v4=gJ("React Flow","https://reactflow.dev/"),v9=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:a,fitViewOptions:l,minZoom:s=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{let p=new Map,h=new Map,m=new Map,g=new Map,y=r??t??[],b=n??e??[],v=u??[0,0],x=d??g_;yP(m,g,y);let{nodesInitialized:w}=yj(b,p,h,{nodeOrigin:v,nodeExtent:x,zIndexMode:f}),k=[0,0,1];if(a&&i&&o){let{x:e,y:t,zoom:n}=g3(gP(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,o,s,c,l?.padding??.1);k=[e,t,n]}return{rfId:"1",width:i??0,height:o??0,transform:k,nodes:b,nodesInitialized:w,nodeLookup:p,parentLookup:h,edges:y,edgeLookup:g,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:s,maxZoom:c,translateExtent:g_,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:M.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...gj},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:v4,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:gE,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}};function v5({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:s,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[h]=(0,G.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:a,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>{let p,h;return p=(p,h)=>{async function m(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:o,minZoom:a,maxZoom:l}=h();t&&(await gI({nodes:e,width:i,height:o,panZoom:t,minZoom:a,maxZoom:l},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...v9({nodes:e,edges:t,width:i,height:o,fitView:a,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:o,zIndexMode:a,nodesSelectionActive:l}=h(),{nodesInitialized:s,hasSelectedNodes:c}=yj(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:a}),u=l&&c;o&&s?(m(),p({nodes:e,nodesInitialized:s,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:s,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=h();yP(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=h();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=h();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:o,nodeExtent:a,debug:l,fitViewQueued:s,zIndexMode:c}=h(),{changes:u,updatedInternals:d}=function(e,t,n,r,i,o,a){let l=r?.querySelector(".xyflow__viewport"),s=!1;if(!l)return{changes:[],updatedInternals:s};let c=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}let l=yt(r.nodeElement),u=e.measured.width!==l.width||e.measured.height!==l.height;if(l.width&&l.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),h=g9(e.extent)?e.extent:o,{positionAbsolute:m}=e.internals;if(e.parentId&&"parent"===e.extent){let n=t.get(e.parentId);n&&(m=g$(m,l,n))}else h&&(m=gL(m,h,l));let g={...e,measured:l,internals:{...e.internals,positionAbsolute:m,handleBounds:{source:ya("source",r.nodeElement,p,d,e.id),target:ya("target",r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&yO(g,t,n,{nodeOrigin:i,zIndexMode:a}),s=!0,u&&(c.push({id:e.id,type:"dimensions",dimensions:l}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:gW(g,i)}))}}if(f.length>0){let e=yC(f,t,n,i);c.push(...e)}return{changes:c,updatedInternals:s}}(e,n,r,i,o,a,c);d&&(!function(e,t,n){let r=yS(yk,n);for(let n of e.values())if(n.parentId)yO(n,e,t,r);else{let e=gL(gM(n,r.nodeOrigin),g9(n.extent)?n.extent:r.nodeExtent,g5(n));n.internals.positionAbsolute=e}}(n,r,{nodeOrigin:o,nodeExtent:a,zIndexMode:c}),s?(m(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(l&&console.log("React Flow: trigger node changes",u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:o,connection:a,updateConnection:l,onNodesChangeMiddlewareMap:s}=h();for(let[o,s]of e){let e=i.get(o),c=!!(e?.expandParent&&e?.parentId&&s?.position),u={id:o,type:"position",position:c?{x:Math.max(0,s.position.x),y:Math.max(0,s.position.y)}:s.position,dragging:t};if(e&&a.inProgress&&a.fromNode.id===e.id){let t=yv(e,a.fromHandle,z.Left,!0);l({...a,from:t})}c&&e.parentId&&n.push({id:o,parentId:e.parentId,rect:{...s.internals.positionAbsolute,width:s.measured.width??0,height:s.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=h(),o=yC(n,i,e,t);r.push(...o)}for(let e of s.values())r=e(r);o(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:o}=h();e?.length&&(i&&n(bA(e,r)),o&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:o}=h();e?.length&&(i&&n(bA(e,r)),o&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:o}=h();t?i(e.map(e=>bM(e,!0))):(i(bP(r,new Set([...e]),!0)),o(bP(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:o}=h();t?o(e.map(e=>bM(e,!0))):(o(bP(n,new Set([...e]))),i(bP(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:o,triggerEdgeChanges:a}=h(),l=[];for(let t of e||r){if(!t.selected)continue;let e=i.get(t.id);e&&(e.selected=!1),l.push(bM(t.id,!1))}let s=[];for(let e of t||n)e.selected&&s.push(bM(e.id,!1));o(l),a(s)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=h();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=h();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{h().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=h();if(!i)return;let o=t.reduce((e,t)=>t.selected?[...e,bM(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,bM(t.id,!1)]:e,[]);n(o),r(a)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:o,nodeExtent:a,zIndexMode:l}=h();(e[0][0]!==a[0][0]||e[0][1]!==a[0][1]||e[1][0]!==a[1][0]||e[1][1]!==a[1][1])&&(yj(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:o,checkEquality:!1,zIndexMode:l}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:o}=h();return yA({delta:e,panZoom:i,transform:t,translateExtent:o,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:o,panZoom:a}=h();if(!a)return!1;let l=void 0!==n?.zoom?n.zoom:o;return await a.setViewport({x:r/2-e*l,y:i/2-t*l,zoom:l},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...gj}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...v9()})}},h=Object.is,p?y9(p,h):y9})({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:c,minZoom:a,maxZoom:l,fitViewOptions:s,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,V.jsx)(y8,{value:h,children:(0,V.jsx)(bF,{children:(0,V.jsx)(b8,{children:p})})})}function v6({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,G.useContext)(y6)?(0,V.jsx)(V.Fragment,{children:e}):(0,V.jsx)(v5,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:a,fitView:l,initialFitViewOptions:s,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}let v8={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var v7=bR(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:a,onNodeClick:l,onEdgeClick:s,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:h,onConnectEnd:m,onClickConnectStart:g,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:w,onNodeDoubleClick:k,onNodeDragStart:_,onNodeDrag:S,onNodeDragStop:E,onNodesDelete:j,onEdgesDelete:O,onDelete:N,onSelectionChange:C,onSelectionDragStart:A,onSelectionDrag:M,onSelectionDragStop:D,onSelectionContextMenu:z,onSelectionStart:R,onSelectionEnd:L,onBeforeDelete:$,connectionMode:B,connectionLineType:F=I.Bezier,connectionLineStyle:U,connectionLineComponent:H,connectionLineContainerStyle:K,deleteKeyCode:W="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:Z=!1,selectionMode:X=T.Full,panActivationKeyCode:Y="Space",multiSelectionKeyCode:J=g4()?"Meta":"Control",zoomActivationKeyCode:Q=g4()?"Meta":"Control",snapToGrid:ee,snapGrid:et,onlyRenderVisibleElements:en=!1,selectNodesOnDrag:er,nodesDraggable:ei,autoPanOnNodeFocus:eo,nodesConnectable:ea,nodesFocusable:el,nodeOrigin:es=bv,edgesFocusable:ec,edgesReconnectable:eu,elementsSelectable:ed=!0,defaultViewport:ef=bx,minZoom:ep=.5,maxZoom:eh=2,translateExtent:em=g_,preventScrolling:eg=!0,nodeExtent:ey,defaultMarkerColor:eb="#b1b1b7",zoomOnScroll:ev=!0,zoomOnPinch:ex=!0,panOnScroll:ew=!1,panOnScrollSpeed:ek=.5,panOnScrollMode:e_=P.Free,zoomOnDoubleClick:eS=!0,panOnDrag:eE=!0,onPaneClick:ej,onPaneMouseEnter:eO,onPaneMouseMove:eN,onPaneMouseLeave:eC,onPaneScroll:eA,onPaneContextMenu:eM,paneClickDistance:eP=1,nodeClickDistance:eT=0,children:eI,onReconnect:eD,onReconnectStart:ez,onReconnectEnd:eR,onEdgeContextMenu:eL,onEdgeDoubleClick:e$,onEdgeMouseEnter:eB,onEdgeMouseMove:eF,onEdgeMouseLeave:eU,reconnectRadius:eH=10,onNodesChange:eK,onEdgesChange:eW,noDragClassName:eq="nodrag",noWheelClassName:eZ="nowheel",noPanClassName:eV="nopan",fitView:eG,fitViewOptions:eX,connectOnClick:eY,attributionPosition:eJ,proOptions:eQ,defaultEdgeOptions:e0,elevateNodesOnSelect:e1=!0,elevateEdgesOnSelect:e2=!1,disableKeyboardA11y:e3=!1,autoPanOnConnect:e4,autoPanOnNodeDrag:e9,autoPanOnSelection:e5=!0,autoPanSpeed:e6,connectionRadius:e8,isValidConnection:e7,onError:te,style:tt,id:tn,nodeDragThreshold:tr,connectionDragThreshold:ti,viewport:to,onViewportChange:ta,width:tl,height:ts,colorMode:tc="light",debug:tu,onScroll:td,ariaLabelConfig:tf,zIndexMode:tp="basic",...th},tm){let tg=tn||"1",ty=function(e){let[t,n]=(0,G.useState)("system"===e?null:e);return(0,G.useEffect)(()=>{if("system"!==e)return void n(e);let t=bE(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:bE()?.matches?"dark":"light"}(tc),tb=(0,G.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),td?.(e)},[td]);return(0,V.jsx)("div",{"data-testid":"rf__wrapper",...th,onScroll:tb,style:{...tt,...v8},ref:tm,className:pT(["react-flow",i,ty]),id:tn,role:"application",children:(0,V.jsxs)(v6,{nodes:e,edges:t,width:tl,height:ts,fitView:eG,fitViewOptions:eX,minZoom:ep,maxZoom:eh,nodeOrigin:es,nodeExtent:ey,zIndexMode:tp,children:[(0,V.jsx)(bS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:h,onConnectEnd:m,onClickConnectStart:g,onClickConnectEnd:y,nodesDraggable:ei,autoPanOnNodeFocus:eo,nodesConnectable:ea,nodesFocusable:el,edgesFocusable:ec,edgesReconnectable:eu,elementsSelectable:ed,elevateNodesOnSelect:e1,elevateEdgesOnSelect:e2,minZoom:ep,maxZoom:eh,nodeExtent:ey,onNodesChange:eK,onEdgesChange:eW,snapToGrid:ee,snapGrid:et,connectionMode:B,translateExtent:em,connectOnClick:eY,defaultEdgeOptions:e0,fitView:eG,fitViewOptions:eX,onNodesDelete:j,onEdgesDelete:O,onDelete:N,onNodeDragStart:_,onNodeDrag:S,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:A,onSelectionDragStop:D,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:eV,nodeOrigin:es,rfId:tg,autoPanOnConnect:e4,autoPanOnNodeDrag:e9,autoPanSpeed:e6,onError:te,connectionRadius:e8,isValidConnection:e7,selectNodesOnDrag:er,nodeDragThreshold:tr,connectionDragThreshold:ti,onBeforeDelete:$,debug:tu,ariaLabelConfig:tf,zIndexMode:tp}),(0,V.jsx)(v3,{onInit:c,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:w,onNodeDoubleClick:k,nodeTypes:o,edgeTypes:a,connectionLineType:F,connectionLineStyle:U,connectionLineComponent:H,connectionLineContainerStyle:K,selectionKeyCode:q,selectionOnDrag:Z,selectionMode:X,deleteKeyCode:W,multiSelectionKeyCode:J,panActivationKeyCode:Y,zoomActivationKeyCode:Q,onlyRenderVisibleElements:en,defaultViewport:ef,translateExtent:em,minZoom:ep,maxZoom:eh,preventScrolling:eg,zoomOnScroll:ev,zoomOnPinch:ex,zoomOnDoubleClick:eS,panOnScroll:ew,panOnScrollSpeed:ek,panOnScrollMode:e_,panOnDrag:eE,autoPanOnSelection:e5,onPaneClick:ej,onPaneMouseEnter:eO,onPaneMouseMove:eN,onPaneMouseLeave:eC,onPaneScroll:eA,onPaneContextMenu:eM,paneClickDistance:eP,nodeClickDistance:eT,onSelectionContextMenu:z,onSelectionStart:R,onSelectionEnd:L,onReconnect:eD,onReconnectStart:ez,onReconnectEnd:eR,onEdgeContextMenu:eL,onEdgeDoubleClick:e$,onEdgeMouseEnter:eB,onEdgeMouseMove:eF,onEdgeMouseLeave:eU,reconnectRadius:eH,defaultMarkerColor:eb,noDragClassName:eq,noWheelClassName:eZ,noPanClassName:eV,rfId:tg,disableKeyboardA11y:e3,nodeExtent:ey,viewport:to,onViewportChange:ta,nodesDraggable:ei}),(0,V.jsx)(bb,{onSelectionChange:C}),eI,(0,V.jsx)(bf,{proOptions:eQ,position:eJ}),(0,V.jsx)(bc,{rfId:tg,disableKeyboardA11y:e3})]})})});function xe({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,V.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:pT(["react-flow__background-pattern",n,r])})}function xt({radius:e,className:t}){return(0,V.jsx)("circle",{cx:e,cy:e,r:e,className:pT(["react-flow__background-pattern","dots",t])})}(w=L||(L={})).Lines="lines",w.Dots="dots",w.Cross="cross";let xn={[L.Dots]:1,[L.Lines]:1,[L.Cross]:6},xr=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function xi({id:e,variant:t=L.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:a,bgColor:l,style:s,className:c,patternClassName:u}){let d=(0,G.useRef)(null),{transform:f,patternId:p}=be(xr,y5),h=r||xn[t],m=t===L.Dots,g=t===L.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*f[2]||1,y[1]*f[2]||1],v=h*f[2],x=Array.isArray(o)?o:[o,o],w=g?[v,v]:b,k=[x[0]*f[2]||1+w[0]/2,x[1]*f[2]||1+w[1]/2],_=`${p}${e||""}`;return(0,V.jsxs)("svg",{className:pT(["react-flow__background",c]),style:{...s,...bq,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[(0,V.jsx)("pattern",{id:_,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:m?(0,V.jsx)(xt,{radius:v/2,className:u}):(0,V.jsx)(xe,{dimensions:w,lineWidth:i,variant:t,className:u})}),(0,V.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}xi.displayName="Background";let xo=(0,G.memo)(xi);function xa(){return(0,V.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,V.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xl(){return(0,V.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,V.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function xs(){return(0,V.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,V.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function xc(){return(0,V.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,V.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function xu(){return(0,V.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,V.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function xd({children:e,className:t,...n}){return(0,V.jsx)("button",{type:"button",className:pT(["react-flow__controls-button",t]),...n,children:e})}let xf=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function xp({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:a,onFitView:l,onInteractiveChange:s,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p}){let h=bt(),{isInteractive:m,minZoomReached:g,maxZoomReached:y,ariaLabelConfig:b}=be(xf,y5),{zoomIn:v,zoomOut:x,fitView:w}=bH();return(0,V.jsxs)(bu,{className:pT(["react-flow__controls","horizontal"===f?"horizontal":"vertical",c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xd,{onClick:()=>{v(),o?.()},className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:(0,V.jsx)(xa,{})}),(0,V.jsx)(xd,{onClick:()=>{x(),a?.()},className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:g,children:(0,V.jsx)(xl,{})})]}),n&&(0,V.jsx)(xd,{className:"react-flow__controls-fitview",onClick:()=>{w(i),l?.()},title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:(0,V.jsx)(xs,{})}),r&&(0,V.jsx)(xd,{className:"react-flow__controls-interactive",onClick:()=>{h.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),s?.(!m)},title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:m?(0,V.jsx)(xu,{}):(0,V.jsx)(xc,{})}),u]})}xp.displayName="Controls";let xh=(0,G.memo)(xp),xm=(0,G.memo)(function({id:e,x:t,y:n,width:r,height:i,style:o,color:a,strokeColor:l,strokeWidth:s,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:h,backgroundColor:m}=o||{};return(0,V.jsx)("rect",{className:pT(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:a||h||m,stroke:l,strokeWidth:s},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}),xg=e=>e.nodes.map(e=>e.id),xy=e=>e instanceof Function?e:()=>e,xb=(0,G.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:l,onClick:s}){let{node:c,x:u,y:d,width:f,height:p}=be(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:o}=n.internals.positionAbsolute,{width:a,height:l}=g5(r);return{node:r,x:i,y:o,width:a,height:l}},y5);return c&&!c.hidden&&g6(c)?(0,V.jsx)(l,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:i,strokeColor:n(c),strokeWidth:o,shapeRendering:a,onClick:s,id:c.id}):null});var xv=(0,G.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=xm,onClick:a}){let l=be(xg,y5),s=xy(t),c=xy(e),u=xy(n),d="u"<typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,V.jsx)(V.Fragment,{children:l.map(e=>(0,V.jsx)(xb,{id:e,nodeColorFunc:s,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:a,shapeRendering:d},e))})});let xx=e=>!e.hidden,xw=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?gZ(gP(e.nodeLookup,{filter:xx}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},xk=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,x_=(e,t)=>xk(e.viewBB,t.viewBB)&&xk(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig;function xS({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:s,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:h,pannable:m=!1,zoomable:g=!1,ariaLabel:y,inversePan:b,zoomStep:v=1,offsetScale:x=5}){let w=bt(),k=(0,G.useRef)(null),{boundingRect:_,viewBB:S,rfId:E,panZoom:j,translateExtent:O,flowWidth:N,flowHeight:C,ariaLabelConfig:A}=be(xw,x_),M=e?.width??200,P=e?.height??150,T=Math.max(_.width/M,_.height/P),I=T*M,D=T*P,z=x*T,R=_.x-(I-_.width)/2-z,L=_.y-(D-_.height)/2-z,$=I+2*z,B=D+2*z,F=`react-flow__minimap-desc-${E}`,U=(0,G.useRef)(0),H=(0,G.useRef)();U.current=T,(0,G.useEffect)(()=>{if(k.current&&j)return H.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=hm(e);return{update:function({translateExtent:e,width:o,height:a,zoomStep:l=1,pannable:s=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0],f=gw().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",s?i=>{let l=n();if("mousemove"!==i.sourceEvent.type&&"touchmove"!==i.sourceEvent.type||!t)return;let s=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],c=[s[0]-d[0],s[1]-d[1]];d=s;let f=r()*Math.max(l[2],Math.log(l[2]))*(u?-1:1),p={x:l[0]-c[0]*f,y:l[1]-c[1]*f};t.setViewportConstrained({x:p.x,y:p.y,zoom:l[2]},[[0,0],[o,a]],e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&g4()?10:1,o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*l,a=r[2]*Math.pow(2,o*i);t.scaleTo(a)}:null);i.call(f,{})},destroy:function(){i.on("zoom",null)},pointer:hg}}({domNode:k.current,panZoom:j,getTransform:()=>w.getState().transform,getViewScale:()=>U.current}),()=>{H.current?.destroy()}},[j]),(0,G.useEffect)(()=>{H.current?.update({translateExtent:O,width:N,height:C,inversePan:b,pannable:m,zoomStep:v,zoomable:g})},[m,g,b,v,O,N,C]);let K=p?e=>{let[t,n]=H.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,W=h?(0,G.useCallback)((e,t)=>{h(e,w.getState().nodeLookup.get(t).internals.userNode)},[]):void 0,q=y??A["minimap.ariaLabel"];return(0,V.jsx)(bu,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof s?s:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*T:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof a?a:void 0},className:pT(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,V.jsxs)("svg",{width:M,height:P,viewBox:`${R} ${L} ${$} ${B}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":F,ref:k,onClick:K,children:[q&&(0,V.jsx)("title",{id:F,children:q}),(0,V.jsx)(xv,{onClick:W,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:l}),(0,V.jsx)("path",{className:"react-flow__minimap-mask",d:`M${R-z},${L-z}h${$+2*z}v${B+2*z}h${-$-2*z}z
|
|
56
|
+
M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}xS.displayName="MiniMap",(0,G.memo)(xS);let xE={[R.Line]:"right",[R.Handle]:"bottom-right"};(0,G.memo)(function({nodeId:e,position:t,variant:n=R.Handle,className:r,style:i,children:o,color:a,minWidth:l=10,minHeight:s=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:h,onResizeStart:m,onResize:g,onResizeEnd:y}){let b,v=b9(),x="string"==typeof e?e:v,w=bt(),k=(0,G.useRef)(null),_=n===R.Handle,S=be((0,G.useCallback)((b=_&&p,e=>b?`${Math.max(1/e.transform[2],1)}`:void 0),[_,p]),y5),E=(0,G.useRef)(null),j=t??xE[n];(0,G.useEffect)(()=>{if(k.current&&x)return E.current||(E.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let o=hm(e),a={controlDirection:yZ("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:l,keepAspectRatio:s,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let h,m,g,y,b={...yY},v={...yJ};a={boundaries:l,resizeDirection:c,keepAspectRatio:s,controlDirection:yZ(e)};let x=null,w=[],k=!1,_=hC().on("start",e=>{let{nodeLookup:r,transform:i,snapGrid:o,snapToGrid:a,nodeOrigin:l,paneDomNode:s}=n();if(!(h=r.get(t)))return;x=s?.getBoundingClientRect()??null;let{xSnapped:c,ySnapped:d}=ye(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:a,containerBounds:x});for(let[e,n]of(v={...b={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},pointerX:c,pointerY:d,aspectRatio:b.width/b.height},m=void 0,g=g9(h.extent)?h.extent:void 0,h.parentId&&("parent"===h.extent||h.expandParent)&&(m=r.get(h.parentId)),m&&"parent"===h.extent&&(g=[[0,0],[m.measured.width,m.measured.height]]),w=[],y=void 0,r))if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){let e=function(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,a=e.measured.height??0,l=n[0]*o,s=n[1]*a;return[[r-l,i-s],[r+o-l,i+a-s]]}(n,h,n.origin??l);y=y?[[Math.min(e[0][0],y[0][0]),Math.min(e[0][1],y[0][1])],[Math.max(e[1][0],y[1][0]),Math.max(e[1][1],y[1][1])]]:e}u?.(e,{...b})}).on("drag",e=>{let{transform:t,snapGrid:i,snapToGrid:o,nodeOrigin:l}=n(),s=ye(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:o,containerBounds:x}),c=[];if(!h)return;let{x:u,y:f,width:_,height:S}=b,E={},j=h.origin??l,{width:O,height:N,x:C,y:A}=function(e,t,n,r,i,o,a,l){var s,c,u,d;let{affectsX:f,affectsY:p}=t,{isHorizontal:h,isVertical:m}=t,g=h&&m,{xSnapped:y,ySnapped:b}=n,{minWidth:v,maxWidth:x,minHeight:w,maxHeight:k}=r,{x:_,y:S,width:E,height:j,aspectRatio:O}=e,N=Math.floor(h?y-e.pointerX:0),C=Math.floor(m?b-e.pointerY:0),A=E+(f?-N:N),M=j+(p?-C:C),P=-o[0]*E,T=-o[1]*j,I=yX(A,v,x),D=yX(M,w,k);if(a){let e=0,t=0;f&&N<0?e=yV(_+N+P,a[0][0]):!f&&N>0&&(e=yG(_+A+P,a[1][0])),p&&C<0?t=yV(S+C+T,a[0][1]):!p&&C>0&&(t=yG(S+M+T,a[1][1])),I=Math.max(I,e),D=Math.max(D,t)}if(l){let e=0,t=0;f&&N>0?e=yG(_+N,l[0][0]):!f&&N<0&&(e=yV(_+A,l[1][0])),p&&C>0?t=yG(S+C,l[0][1]):!p&&C<0&&(t=yV(S+M,l[1][1])),I=Math.max(I,e),D=Math.max(D,t)}if(i){if(h){(I=Math.max(I,yX(A/O,w,k)*O),a)&&(I=Math.max(I,(f||p)&&(!f||p||!g)?yV(S+T+(f?N:-N)/O,a[0][1])*O:yG(S+T+A/O,a[1][1])*O));l&&(I=Math.max(I,(f||p)&&(!f||p||!g)?yG(S+(f?N:-N)/O,l[0][1])*O:yV(S+A/O,l[1][1])*O))}if(m){(D=Math.max(D,yX(M*O,v,x)/O),a)&&(D=Math.max(D,(f||p)&&(!p||f||!g)?yV(_+(p?C:-C)*O+P,a[0][0])/O:yG(_+M*O+P,a[1][0])/O));l&&(D=Math.max(D,(f||p)&&(!p||f||!g)?yG(_+(p?C:-C)*O,l[0][0])/O:yV(_+M*O,l[1][0])/O))}}C+=C<0?D:-D,N+=N<0?I:-I,i&&(g?A>M*O?C=((s=f,c=p,s?!c:c)?-N:N)/O:N=((u=f,d=p,u?!d:d)?-C:C)*O:h?(C=N/O,p=f):(N=C*O,f=p));let z=f?_+N:_,R=p?S+C:S;return{width:E+(f?-N:N),height:j+(p?-C:C),x:o[0]*N*(f?-1:1)+z,y:o[1]*C*(p?-1:1)+R}}(v,a.controlDirection,s,a.boundaries,a.keepAspectRatio,j,g,y),M=O!==_,P=N!==S,T=C!==u&&M,I=A!==f&&P;if(!T&&!I&&!M&&!P)return;if((T||I||1===j[0]||1===j[1])&&(E.x=T?C:b.x,E.y=I?A:b.y,b.x=E.x,b.y=E.y,w.length>0)){let e=C-u,t=A-f;for(let n of w)n.position={x:n.position.x-e+j[0]*(O-_),y:n.position.y-t+j[1]*(N-S)},c.push(n)}if((M||P)&&(E.width=M&&(!a.resizeDirection||"horizontal"===a.resizeDirection)?O:b.width,E.height=P&&(!a.resizeDirection||"vertical"===a.resizeDirection)?N:b.height,b.width=E.width,b.height=E.height),m&&h.expandParent){let e=j[0]*(E.width??0);E.x&&E.x<e&&(b.x=e,v.x=v.x-(E.x-e));let t=j[1]*(E.height??0);E.y&&E.y<t&&(b.y=t,v.y=v.y-(E.y-t))}let D=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){let a=e-t,l=n-r,s=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(s[0]=-1*s[0]),l&&o&&(s[1]=-1*s[1]),s}({width:b.width,prevWidth:_,height:b.height,prevHeight:S,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),z={...b,direction:D};!1!==p?.(e,z)&&(k=!0,d?.(e,z),r(E,c))}).on("end",e=>{k&&(f?.(e,{...b}),i?.({...b}),k=!1)});o.call(_)},destroy:function(){o.on(".drag",null)}}}({domNode:k.current,nodeId:x,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:o}=w.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:o}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:o}=w.getState(),a=[],l={x:e.x,y:e.y},s=r.get(x);if(s&&s.expandParent&&s.parentId){let t=s.origin??o,n=e.width??s.measured.width??0,c=e.height??s.measured.height??0,u=yC([{id:s.id,parentId:s.parentId,rect:{width:n,height:c,...g8({x:e.x??s.position.x,y:e.y??s.position.y},{width:n,height:c},s.parentId,r,t)}}],r,i,o);a.push(...u),l.x=e.x?Math.max(t[0]*n,e.x):void 0,l.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==l.x&&void 0!==l.y){let e={id:x,type:"position",position:{...l}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){let t={id:x,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(let e of t){let t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{w.getState().triggerNodeChanges([{id:x,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}}])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:s,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:g,onResizeEnd:y,shouldResize:h}),()=>{E.current?.destroy()}},[j,l,s,c,u,d,m,g,y,h]);let O=j.split("-");return(0,V.jsx)("div",{className:pT(["react-flow__resize-control","nodrag",...O,n,r]),ref:k,style:{...i,scale:S,...a&&{[_?"backgroundColor":"borderColor"]:a}},children:o})});let xj=G.createContext({selected:null,active:null}),xO={bead:function({data:e}){let{bead:t,onOpen:n,horizontal:r,outsideEpic:i}=e,{selectedBeadId:o,selectBead:a}=eu(),l=G.useContext(xj);return(0,V.jsxs)("div",{style:{opacity:!l.active||l.active.has(t.id)?1:.2,outline:l.active&&l.selected===t.id?"2.5px solid var(--brand)":void 0,outlineOffset:3},role:"button",tabIndex:0,"data-keyboard-bead-id":t.id,"data-epic-scope":i?"outside":"inside","aria-current":o===t.id?"true":void 0,onFocus:()=>a(t.id),onClick:()=>{a(t.id),n(t.id)},className:`w-[170px] cursor-pointer rounded-[11px] border bg-[var(--surface)] p-[9px_11px] shadow-[var(--shadow)] hover:border-[var(--border-strong)] hover:shadow-[var(--shadow-lg)] focus-visible:outline-none ${o===t.id?"border-[var(--brand)] ring-2 ring-[var(--brand)]/30":"border-border"}`,children:[(0,V.jsx)(ve,{type:"target",position:r?z.Left:z.Top,style:{background:"var(--text-3)"}}),(0,V.jsxs)("div",{className:"mb-[5px] flex items-center gap-[6px]",children:[(0,V.jsx)("span",{className:"h-2 w-2 rounded-full",style:{background:lL(t.status)}}),(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:t.id}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)(en.W,{name:(0,en.F)(t.issue_type),size:12,style:{color:lK(t.issue_type)}})]}),i&&(0,V.jsx)("div",{className:"mb-[5px] w-fit rounded-full bg-[var(--surface-3)] px-[6px] py-[2px] text-meta font-semibold uppercase tracking-[.04em] text-[var(--text-3)]",children:"Outside epic"}),(0,V.jsx)("div",{className:"break-words text-label font-medium leading-[1.3] text-[var(--text)] [overflow-wrap:anywhere] [text-wrap:pretty]",children:t.title.replace(/\s*\([^)]*\)\s*/,"")}),(0,V.jsx)(ve,{type:"source",position:r?z.Right:z.Bottom,style:{background:"var(--text-3)"}})]})}},xN=new Set(["blocks","conditional-blocks","waits-for"]);function xC(e,t=!1){return 82+18*Math.max(1,Math.ceil(e.title.replace(/\s*\([^)]*\)\s*/,"").length/16))+24*!!t}function xA(e,t){let n=new Set(e.map(e=>e.id)),r=new Set,i=[];for(let o of e)for(let e of o.dependencies??[]){if(!n.has(e.depends_on_id))continue;let a=`${o.id}->${e.depends_on_id}:${e.type}`;if(r.has(a))continue;r.add(a);let l=xN.has(e.type),s="related"===e.type||"relates-to"===e.type;i.push({id:a,source:t?e.depends_on_id:o.id,target:t?o.id:e.depends_on_id,animated:l,style:{stroke:l?"#ef4444":s?"var(--brand)":"var(--text-3)",strokeWidth:l?2:1.6,strokeDasharray:s?"5 4":void 0}})}return i}function xM(e,t=new Set){let n=e.filter(e=>"closed"!==e.status||t.has(e.id)),r=new Set(n.map(e=>e.id)),i=new Set;for(let e of n)for(let t of e.dependencies??[])"parent-child"!==t.type&&r.has(t.depends_on_id)&&(i.add(e.id),i.add(t.depends_on_id));return n.filter(e=>t.has(e.id)||"epic"===e.issue_type||i.has(e.id)||(e.dependencies??[]).some(e=>"parent-child"===e.type&&r.has(e.depends_on_id)))}function xP(){let{beads:e,openDetail:t,readOnly:n}=eu(),[r,i]=G.useState(""),[o,a]=G.useState(!1),[l,s]=G.useState(!1),[c,u]=G.useState(null),d=G.useCallback(e=>{l?u(e):t(e)},[l,t]),f=eb(),p=G.useRef(null),h=G.useCallback(()=>p.current?.fitView({padding:.2,minZoom:.02,duration:400}),[]),m=G.useMemo(()=>e.filter(e=>"epic"===e.issue_type&&!(e.labels??[]).includes("archived")).sort((e,t)=>e.priority-t.priority||e.id.localeCompare(t.id)),[e]),g=m.some(e=>e.id===r)?r:"",{nodes:y,edges:b,considered:v}=G.useMemo(()=>{var t;let n,r,i,a,l,s,c,u,f=e.filter(e=>!(e.labels??[]).includes("archived"));if(g){let e=function(e,t){let n=new Map;for(let t of e)n.has(t.id)||n.set(t.id,t);let r=new Map;for(let e of n.values())for(let t of e.dependencies??[]){if("parent-child"!==t.type||!n.has(t.depends_on_id))continue;let i=r.get(t.depends_on_id);i?i.push(e.id):r.set(t.depends_on_id,[e.id])}let i=new Set,o=[];n.has(t)&&(i.add(t),o.push(t));for(let e=0;e<o.length;e+=1)for(let t of r.get(o[e])??[])i.has(t)||(i.add(t),o.push(t));let a=new Set;for(let e of n.values())for(let t of e.dependencies??[])n.has(t.depends_on_id)&&(i.has(e.id)&&!i.has(t.depends_on_id)&&a.add(t.depends_on_id),!i.has(e.id)&&i.has(t.depends_on_id)&&a.add(e.id));let l=new Set([...i,...a]);return{beads:[...n.values()].filter(e=>l.has(e.id)),insideIds:i,outsideIds:a}}(f,g);return{...function(e,t,n){let r=function(e){let t=[...new Set(e.map(e=>e.id))].sort(),n=new Set(t),r=new Set(lS),i=new Map(t.map(e=>[e,new Set])),o=new Map(t.map(e=>[e,new Set]));for(let t of e)if(n.has(t.id))for(let e of t.dependencies??[])r.has(e.type)&&n.has(e.depends_on_id)&&(i.get(e.depends_on_id).add(t.id),o.get(t.id).add(e.depends_on_id));let a=new Set,l=[];for(let e of t){if(a.has(e))continue;a.add(e);let t=[{id:e,next:0,neighbors:[...i.get(e)].sort()}];for(;t.length;){let e=t[t.length-1];if(e.next<e.neighbors.length){let n=e.neighbors[e.next++];if(a.has(n))continue;a.add(n),t.push({id:n,next:0,neighbors:[...i.get(n)].sort()})}else l.push(e.id),t.pop()}}let s=new Map,c=[];for(let e=l.length-1;e>=0;e-=1){let t=l[e];if(s.has(t))continue;let n=c.length,r=[],i=[t];for(s.set(t,n);i.length;){let e=i.pop();for(let t of(r.push(e),[...o.get(e)].sort().reverse()))s.has(t)||(s.set(t,n),i.push(t))}r.sort(),c.push(r)}let u=new Map,d=Array(c.length).fill(0),f=Array(c.length).fill(0);for(let e=0;e<c.length;e+=1)u.set(e,new Set);for(let[e,t]of i){let n=s.get(e);for(let e of t){let t=s.get(e);n===t||u.get(n).has(t)||(u.get(n).add(t),d[t]+=1)}}let p=e=>c[e][0]??"",h=d.map((e,t)=>({degree:e,id:t})).filter(({degree:e})=>0===e).map(({id:e})=>e).sort((e,t)=>p(e).localeCompare(p(t)));for(;h.length;){let e=h.shift();for(let t of[...u.get(e)].sort((e,t)=>p(e).localeCompare(p(t))))f[t]=Math.max(f[t],f[e]+1),d[t]-=1,0===d[t]&&(h.push(t),h.sort((e,t)=>p(e).localeCompare(p(t))))}return new Map(t.map(e=>[e,f[s.get(e)]]))}(e),i=new Map;for(let t of e){let e=r.get(t.id)??0,n=i.get(e);n?n.push(t):i.set(e,[t])}let o=[];for(let e of[...i.keys()].sort((e,t)=>e-t)){let r=0,a=i.get(e);for(let i of(a.sort((e,t)=>e.priority-t.priority||e.id.localeCompare(t.id)),a)){let a=n.has(i.id);o.push({id:i.id,type:"bead",position:{x:270*e,y:r},data:{bead:i,onOpen:t,horizontal:!0,outsideEpic:a}}),r+=xC(i,a)}}return{nodes:o,edges:xA(e,!0)}}(o?xM(e.beads,new Set([g])):e.beads,d,e.outsideIds),considered:e.beads.length}}return{...(t=o?xM(f):f,n=t.filter(e=>"epic"===e.issue_type),r=[],i=new Set,a=(e,t,n)=>{i.has(e.id)||(i.add(e.id),r.push({id:e.id,type:"bead",position:{x:t,y:n},data:{bead:e,onOpen:d}}))},n.forEach((e,n)=>{let r=0;a(e,250*n,0),r+=xC(e),lQ(e.id,t).forEach(e=>{a(e,250*n,r),r+=xC(e)})}),l=t.filter(e=>"epic"!==e.issue_type&&!i.has(e.id)),s=n.length,c=Math.max(6,Math.ceil(Math.sqrt(2*l.length))),u=[],l.forEach((e,t)=>{let n=Math.floor(t/c);a(e,(s+n)*250,u[n]??0),u[n]=(u[n]??0)+xC(e)}),{nodes:r,edges:xA(t,!1)}),considered:f.length}},[e,d,g,o]),x=Math.max(0,v-y.length),w=G.useMemo(()=>l&&c&&y.some(e=>e.id===c)?function(e,t,n){let r=new Map(e.filter(e=>t.has(e.id)).map(e=>[e.id,e])),i=new Map,o=new Map,a=new Set;function l(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}for(let e of r.values())if("closed"!==e.status)for(let t of e.dependencies??[]){if(!["blocks","waits-for","conditional-blocks"].includes(t.type))continue;let n=r.get(t.depends_on_id);n&&"closed"!==n.status&&(l(i,e.id,n.id),l(o,n.id,e.id),a.add(`${e.id}->${n.id}:${t.type}`))}function s(e){let t=new Set([n]),r=[n];for(;r.length;)for(let n of e.get(r.pop())??[])t.has(n)||(t.add(n),r.push(n));return t}let c=s(i),u=s(o);return{all:new Set([...c,...u]),up:c.size-1,down:u.size-1,edgeIds:a}}(e,new Set(y.map(e=>e.id)),c):null,[e,y,l,c]),k=G.useMemo(()=>({selected:c,active:w?.all??null}),[c,w]),_=G.useMemo(()=>w?b.map(e=>{let t=w.edgeIds.has(e.id)&&w.all.has(e.source)&&w.all.has(e.target);return{...e,style:{...e.style,opacity:t?1:.12},animated:t&&e.animated}}):b,[b,w]),S=G.useCallback(e=>{if(!n&&e.source&&e.target&&e.source!==e.target){let[t,n]=g?[e.target,e.source]:[e.source,e.target];f.mutate({id:t,dependsOnId:n,type:"blocks"})}},[f,g,n]);return(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"Dependency graph",subtitle:(0,V.jsxs)(V.Fragment,{children:[g?l?"Left → right: prerequisite → dependent · select to spotlight active blocking chains; double-click for details":n?"Left → right: prerequisite → dependent · select a bead to view its details":"Left → right: prerequisite → dependent · drag a prerequisite onto its dependent":l?"Select a bead to highlight active blocking chains; double-click for details":n?"Select a bead to view its details":"Drag from a dependent to its prerequisite to add a dependency"," · ",y.length," beads shown",x>0&&(0,V.jsxs)(V.Fragment,{children:[" · ",(0,V.jsxs)("span",{title:"Turn off Live dependencies only to include closed and unlinked beads.",children:[x," hidden by filter"]})]})]}),controls:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsxs)(er.$,{"aria-label":"Graph scope",value:g,onChange:e=>{i(e.target.value),u(null)},title:"Scope the graph to an epic and its descendants",className:"max-w-[280px] flex-shrink-0 text-label font-medium text-[var(--text-2)]",children:[(0,V.jsx)("option",{value:"",children:"All beads"}),m.map(e=>(0,V.jsxs)("option",{value:e.id,children:[e.id," · ",e.title]},e.id))]}),(0,V.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-label text-[var(--text-2)]",children:[(0,V.jsx)(er.h,{checked:l,onChange:e=>{s(e.target.checked),u(null)}}),"Spotlight dependencies"]}),(0,V.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-label text-[var(--text-2)]",children:[(0,V.jsx)(er.h,{checked:o,onChange:e=>{a(e.target.checked),u(null)}}),"Live dependencies only"]}),(0,V.jsx)(er.K,{icon:"target",onClick:h,title:"Center the graph on all issues",children:"Center"}),l&&(0,V.jsx)("div",{className:"flex h-9 basis-full items-center",children:w&&c?(0,V.jsxs)("button",{onClick:()=>u(null),title:"Clear the dependency spotlight",className:"flex h-9 items-center gap-2 rounded-[9px] bg-[var(--brand-weak)] px-3 text-label text-[var(--brand)]",children:[(0,V.jsx)("span",{className:"font-mono",children:c}),(0,V.jsxs)("span",{children:[w.up," upstream · ",w.down," downstream"]}),(0,V.jsx)(en.W,{name:"x",size:13})]}):(0,V.jsx)("span",{className:"text-label text-[var(--text-3)]",children:"Choose a bead to highlight its blocking chains."})})]})}),(0,V.jsxs)("div",{className:"relative min-h-0 flex-1",children:[(0,V.jsx)(xj.Provider,{value:k,children:(0,V.jsxs)(v7,{nodes:y,edges:_,zoomOnDoubleClick:!l,onPaneClick:()=>u(null),onNodeDoubleClick:(e,n)=>{l&&t(n.id)},nodeTypes:xO,nodesConnectable:!n,onConnect:S,onInit:e=>{p.current=e},minZoom:.02,fitView:!0,fitViewOptions:{padding:.2,minZoom:.02},proOptions:{hideAttribution:!0},children:[(0,V.jsx)(xo,{gap:22,color:"var(--border)"}),(0,V.jsx)(xh,{fitViewOptions:{padding:.2,minZoom:.02}})]},`${g||"all"}:${o?"live":"complete"}`)}),0===y.length&&(0,V.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center p-6",children:(0,V.jsxs)("div",{className:"pointer-events-auto max-w-[360px] rounded-[12px] border border-border bg-[var(--surface)] p-[16px_18px] text-center shadow-[var(--shadow)]",children:[(0,V.jsx)("div",{className:"text-body font-semibold text-[var(--text)]",children:o&&v>0?"No live dependencies":"No beads to show"}),(0,V.jsx)("p",{className:"m-0 mt-[6px] text-label leading-[1.5] text-[var(--text-2)]",children:0===v?"There are no non-archived beads in this project.":"The current filter hides all beads. Show all beads to inspect completed work or create new dependencies."}),o&&v>0&&(0,V.jsx)(er.K,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>a(!1),children:"Show all beads"})]})}),(0,V.jsxs)("div",{className:"pointer-events-none absolute bottom-[18px] left-1/2 flex -translate-x-1/2 gap-[18px] rounded-[11px] border border-border bg-[var(--surface)] p-[9px_16px] text-meta text-[var(--text-2)] shadow-[var(--shadow)]",children:[(0,V.jsxs)("span",{className:"flex items-center gap-[6px]",children:[(0,V.jsx)("span",{className:"h-[2px] w-[18px] bg-[#ef4444]"}),"blocks"]}),(0,V.jsxs)("span",{className:"flex items-center gap-[6px]",children:[(0,V.jsx)("span",{className:"h-[2px] w-[18px] bg-[var(--text-3)]"}),"parent-child"]}),(0,V.jsxs)("span",{className:"flex items-center gap-[6px]",children:[(0,V.jsx)("span",{className:"h-0 w-[18px] border-t-2 border-dashed border-[var(--brand)]"}),"related"]})]})]})]})}var xT=e.i(7670),xI=e.i(24283),xD=e.i(85845),xz=e.i(78948),xR=e.i(82820),xL=e.i(94241),x$=e.i(3945),xB=function(e){return 0===e?0:e>0?1:-1},xF=function(e){return(0,xD.default)(e)&&e.indexOf("%")===e.length-1},xU=function(e){return(0,xL.default)(e)&&!(0,xz.default)(e)},xH=function(e){return xU(e)||(0,xD.default)(e)},xK=0,xW=function(e){var t=++xK;return"".concat(e||"").concat(t)},xq=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!xU(e)&&!(0,xD.default)(e))return r;if(xF(e)){var o=e.indexOf("%");n=t*parseFloat(e.slice(0,o))/100}else n=+e;return(0,xz.default)(n)&&(n=r),i&&n>t&&(n=t),n},xZ=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},xV=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(n[e[r]])return!0;else n[e[r]]=!0;return!1},xG=function(e,t){return xU(e)&&xU(t)?function(n){return e+n*(t-e)}:function(){return t}};function xX(e,t,n){return e&&e.length?e.find(function(e){return e&&("function"==typeof t?t(e):(0,xR.default)(e,t))===n}):null}var xY=function(e,t){return xU(e)&&xU(t)?e-t:(0,xD.default)(e)&&(0,xD.default)(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))},xJ=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i]},xQ=e.i(71223),x0=e.i(12447),x1=e.i(79367);function x2(e,t){for(var n in e)if(({}).hasOwnProperty.call(e,n)&&(!({}).hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if(({}).hasOwnProperty.call(t,r)&&!({}).hasOwnProperty.call(e,r))return!1;return!0}function x3(e){return(x3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var x4=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","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","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","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","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],x9=["points","pathLength"],x5={svg:["viewBox","children"],polygon:x9,polyline:x9},x6=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],x8=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,G.isValidElement)(e)&&(n=e.props),!(0,x0.default)(n))return null;var r={};return Object.keys(n).forEach(function(e){x6.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},x7=function(e,t,n){if(!(0,x0.default)(e)||"object"!==x3(e))return null;var r=null;return Object.keys(e).forEach(function(i){var o=e[i];x6.includes(i)&&"function"==typeof o&&(r||(r={}),r[i]=function(e){return o(t,n,e),null})}),r},we=["children"],wt=["children"];function wn(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wr(e){return(wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var wi={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},wo=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},wa=null,wl=null,ws=function e(t){if(t===wa&&Array.isArray(wl))return wl;var n=[];return G.Children.forEach(t,function(t){(0,x$.default)(t)||((0,x1.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),wl=n,wa=t,n};function wc(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return wo(e)}):[wo(t)],ws(e).forEach(function(e){var t=(0,xR.default)(e,"type.displayName")||(0,xR.default)(e,"type.name");-1!==r.indexOf(t)&&n.push(e)}),n}function wu(e,t){var n=wc(e,t);return n&&n[0]}var wd=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!!xU(n)&&!(n<=0)&&!!xU(r)&&!(r<=0)},wf=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],wp=function(e,t,n,r){var i,o=null!=(i=null==x5?void 0:x5[r])?i:[];return t.startsWith("data-")||!(0,xQ.default)(e)&&(r&&o.includes(t)||x4.includes(t))||n&&x6.includes(t)},wh=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,G.isValidElement)(e)&&(r=e.props),!(0,x0.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){var o;wp(null==(o=r)?void 0:o[e],e,t,n)&&(i[e]=r[e])}),i},wm=function e(t,n){if(t===n)return!0;var r=G.Children.count(t);if(r!==G.Children.count(n))return!1;if(0===r)return!0;if(1===r)return wg(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],a=n[i];if(Array.isArray(o)||Array.isArray(a)){if(!e(o,a))return!1}else if(!wg(o,a))return!1}return!0},wg=function(e,t){if((0,x$.default)(e)&&(0,x$.default)(t))return!0;if(!(0,x$.default)(e)&&!(0,x$.default)(t)){var n=e.props||{},r=n.children,i=wn(n,we),o=t.props||{},a=o.children,l=wn(o,wt);if(r&&a)return x2(i,l)&&wm(r,a);if(!r&&!a)return x2(i,l)}return!1},wy=function(e,t){var n=[],r={};return ws(e).forEach(function(e,i){if(e&&e.type&&(0,xD.default)(e.type)&&wf.indexOf(e.type)>=0)n.push(e);else if(e){var o=wo(e.type),a=t[o]||{},l=a.handler,s=a.once;if(l&&(!s||!r[o])){var c=l(e,o,i);n.push(c),r[o]=!0}}}),n},wb=function(e){var t=e&&e.type;return t&&wi[t]?wi[t]:null};function wv(e){return(wv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ww(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wx(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=wv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wv(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wv(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var w_=(0,G.forwardRef)(function(e,t){var n,r=e.aspect,i=e.initialDimension,o=void 0===i?{width:-1,height:-1}:i,a=e.width,l=void 0===a?"100%":a,s=e.height,c=void 0===s?"100%":s,u=e.minWidth,d=void 0===u?0:u,f=e.minHeight,p=e.maxHeight,h=e.children,m=e.debounce,g=void 0===m?0:m,y=e.id,b=e.className,v=e.onResize,x=e.style,w=(0,G.useRef)(null),k=(0,G.useRef)();k.current=v,(0,G.useImperativeHandle)(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var _=function(e){if(Array.isArray(e))return e}(n=(0,G.useState)({containerWidth:o.width,containerHeight:o.height}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(n)||function(e){if(e){if("string"==typeof e)return wk(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wk(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),S=_[0],E=_[1],j=(0,G.useCallback)(function(e,t){E(function(n){var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,G.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,i=n.height;j(r,i),null==(t=k.current)||t.call(k,r,i)};g>0&&(e=(0,xI.default)(e,g,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=w.current.getBoundingClientRect();return j(n.width,n.height),t.observe(w.current),function(){t.disconnect()}},[j,g]);var O=(0,G.useMemo)(function(){var e=S.containerWidth,t=S.containerHeight;if(e<0||t<0)return null;xJ(xF(l)||xF(c),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",l,c),xJ(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=xF(l)?e:l,i=xF(c)?t:c;r&&r>0&&(n?i=n/r:i&&(n=i*r),p&&i>p&&(i=p)),xJ(n>0||i>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,i,l,c,d,f,r);var o=!Array.isArray(h)&&wo(h.type).endsWith("Chart");return G.default.Children.map(h,function(e){return G.default.isValidElement(e)?(0,G.cloneElement)(e,ww({width:n,height:i},o?{style:ww({height:"100%",width:"100%",maxHeight:i,maxWidth:n},e.props.style)}:{})):e})},[r,h,c,p,f,d,S,l]);return G.default.createElement("div",{id:y?"".concat(y):void 0,className:(0,xT.U)("recharts-responsive-container",b),style:ww(ww({},void 0===x?{}:x),{},{width:l,height:c,minWidth:d,minHeight:f,maxHeight:p}),ref:w},O)}),wS=e.i(44950),wE=e.i(31195);function wj(e,t){if(!e)throw Error("Invariant failed")}var wO=["children","width","height","viewBox","className","style","title","desc"];function wN(){return(wN=Object.assign.bind()).apply(this,arguments)}function wC(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,a=e.style,l=e.title,s=e.desc,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,wO),u=i||{width:n,height:r,x:0,y:0},d=(0,xT.U)("recharts-surface",o);return G.default.createElement("svg",wN({},wh(c,!0,"svg"),{className:d,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),G.default.createElement("title",null,l),G.default.createElement("desc",null,s),t)}var wA=["children","className"];function wM(){return(wM=Object.assign.bind()).apply(this,arguments)}var wP=G.default.forwardRef(function(e,t){var n=e.children,r=e.className,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,wA),o=(0,xT.U)("recharts-layer",r);return G.default.createElement("g",wM({className:o},wh(i,!0),{ref:t}),n)});function wT(e){return(wT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wI(){return(wI=Object.assign.bind()).apply(this,arguments)}function wD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wz(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=wT(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wT(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wT(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wL(e){return Array.isArray(e)&&xH(e[0])&&xH(e[1])?e.join(" ~ "):e}var w$=function(e){var t=e.separator,n=void 0===t?" : ":t,r=e.contentStyle,i=e.itemStyle,o=void 0===i?{}:i,a=e.labelStyle,l=e.payload,s=e.formatter,c=e.itemSorter,u=e.wrapperClassName,d=e.labelClassName,f=e.label,p=e.labelFormatter,h=e.accessibilityLayer,m=wR({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},void 0===r?{}:r),g=wR({margin:0},void 0===a?{}:a),y=!(0,x$.default)(f),b=y?f:"",v=(0,xT.U)("recharts-default-tooltip",u),x=(0,xT.U)("recharts-tooltip-label",d);return y&&p&&null!=l&&(b=p(f,l)),G.default.createElement("div",wI({className:v,style:m},void 0!==h&&h?{role:"status","aria-live":"assertive"}:{}),G.default.createElement("p",{className:x,style:g},G.default.isValidElement(b)?b:"".concat(b)),function(){if(l&&l.length){var e=(c?(0,wE.default)(l,c):l).map(function(e,t){if("none"===e.type)return null;var r=wR({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},o),i=e.formatter||s||wL,a=e.value,c=e.name,u=a,d=c;if(i&&null!=u&&null!=d){var f=i(a,c,e,t,l);if(Array.isArray(f)){var p=function(e){if(Array.isArray(e))return e}(f)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(f)||function(e){if(e){if("string"==typeof e)return wD(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wD(e,2)}}(f)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();u=p[0],d=p[1]}else u=f}return G.default.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:r},xH(d)?G.default.createElement("span",{className:"recharts-tooltip-item-name"},d):null,xH(d)?G.default.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,G.default.createElement("span",{className:"recharts-tooltip-item-value"},u),G.default.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return G.default.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function wB(e){return(wB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wF(e,t,n){var r;return(r=function(e,t){if("object"!=wB(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wB(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==wB(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wU="recharts-tooltip-wrapper",wH={visibility:"hidden"};function wK(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,o=e.position,a=e.reverseDirection,l=e.tooltipDimension,s=e.viewBox,c=e.viewBoxDimension;if(o&&xU(o[r]))return o[r];var u=n[r]-l-i,d=n[r]+i;return t[r]?a[r]?u:d:a[r]?u<s[r]?Math.max(d,s[r]):Math.max(u,s[r]):d+l>s[r]+c?Math.max(u,s[r]):Math.max(d,s[r])}function wW(e){return(wW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wq(Object(n),!0).forEach(function(t){wY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(wV=function(){return!!e})()}function wG(e){return(wG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wX(e,t){return(wX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function wY(e,t,n){return(t=wJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wJ(e){var t=function(e,t){if("object"!=wW(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wW(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wW(t)?t:t+""}var wQ=function(e){var t;function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n,r=[].concat(o),t=wG(t),wY(e=function(e,t){if(t&&("object"===wW(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,wV()?Reflect.construct(t,r||[],wG(this).constructor):t.apply(this,r)),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),wY(e,"handleKeyDown",function(t){if("Escape"===t.key){var n,r,i,o;e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!=(n=null==(r=e.props.coordinate)?void 0:r.x)?n:0,y:null!=(i=null==(o=e.props.coordinate)?void 0:o.y)?i:0}})}}),e}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&wX(n,e),t=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>1||Math.abs(e.height-this.state.lastBoundingBox.height)>1)&&this.setState({lastBoundingBox:{width:e.width,height:e.height}})}else(-1!==this.state.lastBoundingBox.width||-1!==this.state.lastBoundingBox.height)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null==(e=this.props.coordinate)?void 0:e.x)!==this.state.dismissedAtCoordinate.x||(null==(t=this.props.coordinate)?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var e,t,n,r,i,o,a,l,s,c,u,d,f,p,h,m,g,y,b,v=this,x=this.props,w=x.active,k=x.allowEscapeViewBox,_=x.animationDuration,S=x.animationEasing,E=x.children,j=x.coordinate,O=x.hasPayload,N=x.isAnimationActive,C=x.offset,A=x.position,M=x.reverseDirection,P=x.useTranslate3d,T=x.viewBox,I=x.wrapperStyle,D=(d=(e={allowEscapeViewBox:k,coordinate:j,offsetTopLeft:C,position:A,reverseDirection:M,tooltipBox:this.state.lastBoundingBox,useTranslate3d:P,viewBox:T}).allowEscapeViewBox,f=e.coordinate,p=e.offsetTopLeft,h=e.position,m=e.reverseDirection,g=e.tooltipBox,y=e.useTranslate3d,b=e.viewBox,g.height>0&&g.width>0&&f?(n=(t={translateX:c=wK({allowEscapeViewBox:d,coordinate:f,key:"x",offsetTopLeft:p,position:h,reverseDirection:m,tooltipDimension:g.width,viewBox:b,viewBoxDimension:b.width}),translateY:u=wK({allowEscapeViewBox:d,coordinate:f,key:"y",offsetTopLeft:p,position:h,reverseDirection:m,tooltipDimension:g.height,viewBox:b,viewBoxDimension:b.height}),useTranslate3d:y}).translateX,r=t.translateY,s={transform:t.useTranslate3d?"translate3d(".concat(n,"px, ").concat(r,"px, 0)"):"translate(".concat(n,"px, ").concat(r,"px)")}):s=wH,{cssProperties:s,cssClasses:(o=(i={translateX:c,translateY:u,coordinate:f}).coordinate,a=i.translateX,l=i.translateY,(0,xT.U)(wU,wF(wF(wF(wF({},"".concat(wU,"-right"),xU(a)&&o&&xU(o.x)&&a>=o.x),"".concat(wU,"-left"),xU(a)&&o&&xU(o.x)&&a<o.x),"".concat(wU,"-bottom"),xU(l)&&o&&xU(o.y)&&l>=o.y),"".concat(wU,"-top"),xU(l)&&o&&xU(o.y)&&l<o.y)))}),z=D.cssClasses,R=D.cssProperties,L=wZ(wZ({transition:N&&w?"transform ".concat(_,"ms ").concat(S):void 0},R),{},{pointerEvents:"none",visibility:!this.state.dismissed&&w&&O?"visible":"hidden",position:"absolute",top:0,left:0},I);return G.default.createElement("div",{tabIndex:-1,className:z,style:L,ref:function(e){v.wrapperNode=e}},E)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wJ(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.PureComponent),w0={isSsr:!("u">typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return w0[e]},set:function(e,t){if("string"==typeof e)w0[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){w0[t]=e[t]})}}},w1=e.i(74010);function w2(e,t,n){return!0===t?(0,w1.default)(e,n):(0,xQ.default)(t)?(0,w1.default)(e,t):e}function w3(e){return(w3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w4(Object(n),!0).forEach(function(t){w7(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w5=function(){return!!e})()}function w6(e){return(w6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w8(e,t){return(w8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function w7(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e){var t=function(e,t){if("object"!=w3(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=w3(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==w3(t)?t:t+""}function kt(e){return e.dataKey}var kn=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=w6(e),function(e,t){if(t&&("object"===w3(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,w5()?Reflect.construct(e,t||[],w6(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&w8(n,e),t=[{key:"render",value:function(){var e,t=this,n=this.props,r=n.active,i=n.allowEscapeViewBox,o=n.animationDuration,a=n.animationEasing,l=n.content,s=n.coordinate,c=n.filterNull,u=n.isAnimationActive,d=n.offset,f=n.payload,p=n.payloadUniqBy,h=n.position,m=n.reverseDirection,g=n.useTranslate3d,y=n.viewBox,b=n.wrapperStyle,v=null!=f?f:[];c&&v.length&&(v=w2(f.filter(function(e){return null!=e.value&&(!0!==e.hide||t.props.includeHidden)}),p,kt));var x=v.length>0;return G.default.createElement(wQ,{allowEscapeViewBox:i,animationDuration:o,animationEasing:a,isAnimationActive:u,active:r,coordinate:s,hasPayload:x,offset:d,position:h,reverseDirection:m,useTranslate3d:g,viewBox:y,wrapperStyle:b},(e=w9(w9({},this.props),{},{payload:v}),G.default.isValidElement(l)?G.default.cloneElement(l,e):"function"==typeof l?G.default.createElement(l,e):G.default.createElement(w$,e)))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ke(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.PureComponent);w7(kn,"displayName","Tooltip"),w7(kn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!w0.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var kr=e.i(32241);function ki(e){return function(){return e}}let ko=Math.PI,ka=2*ko,kl=ka-1e-6;function ks(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class kc{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?ks:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return ks;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e*=1,t*=1,n*=1,r*=1,(i*=1)<0)throw Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,l=n-e,s=r-t,c=o-e,u=a-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>1e-6)if(Math.abs(u*l-s*c)>1e-6&&i){let f=n-o,p=r-a,h=l*l+s*s,m=Math.sqrt(h),g=Math.sqrt(d),y=i*Math.tan((ko-Math.acos((h+d-(f*f+p*p))/(2*m*g)))/2),b=y/g,v=y/m;Math.abs(b-1)>1e-6&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*f>c*p)},${this._x1=e+v*l},${this._y1=t+v*s}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,o){if(e*=1,t*=1,n*=1,o=!!o,n<0)throw Error(`negative radius: ${n}`);let a=n*Math.cos(r),l=n*Math.sin(r),s=e+a,c=t+l,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${s},${c}`:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-c)>1e-6)&&this._append`L${s},${c}`,n&&(d<0&&(d=d%ka+ka),d>kl?this._append`A${n},${n},0,1,${u},${e-a},${t-l}A${n},${n},0,1,${u},${this._x1=s},${this._y1=c}`:d>1e-6&&this._append`A${n},${n},0,${+(d>=ko)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n*=1}v${+r}h${-n}Z`}toString(){return this._}}function ku(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new kc(t)}kc.prototype;let kd=Math.cos,kf=Math.sin,kp=Math.sqrt,kh=Math.PI,km=2*kh;kp(3);let kg={draw(e,t){let n=kp(t/kh);e.moveTo(n,0),e.arc(0,0,n,0,km)}},ky=kp(1/3),kb=2*ky,kv=kf(kh/10)/kf(7*kh/10),kx=kf(km/10)*kv,kw=-kd(km/10)*kv,kk=kp(3);kp(3);let k_=kp(3)/2,kS=1/kp(12),kE=(kS/2+1)*3;function kj(e){return(kj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var kO=["type","size","sizeType"];function kN(){return(kN=Object.assign.bind()).apply(this,arguments)}function kC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kC(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=kj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=kj(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kj(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var kM={symbolCircle:kg,symbolCross:{draw(e,t){let n=kp(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},symbolDiamond:{draw(e,t){let n=kp(t/kb),r=n*ky;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},symbolSquare:{draw(e,t){let n=kp(t),r=-n/2;e.rect(r,r,n,n)}},symbolStar:{draw(e,t){let n=kp(.8908130915292852*t),r=kx*n,i=kw*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let o=km*t/5,a=kd(o),l=kf(o);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*i,l*r+a*i)}e.closePath()}},symbolTriangle:{draw(e,t){let n=-kp(t/(3*kk));e.moveTo(0,2*n),e.lineTo(-kk*n,-n),e.lineTo(kk*n,-n),e.closePath()}},symbolWye:{draw(e,t){let n=kp(t/kE),r=n/2,i=n*kS,o=n*kS+n,a=-r;e.moveTo(r,i),e.lineTo(r,o),e.lineTo(a,o),e.lineTo(-.5*r-k_*i,k_*r+-.5*i),e.lineTo(-.5*r-k_*o,k_*r+-.5*o),e.lineTo(-.5*a-k_*o,k_*a+-.5*o),e.lineTo(-.5*r+k_*i,-.5*i-k_*r),e.lineTo(-.5*r+k_*o,-.5*o-k_*r),e.lineTo(-.5*a+k_*o,-.5*o-k_*a),e.closePath()}}},kP=Math.PI/180,kT=function(e,t,n){if("area"===t)return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var r=18*kP;return 1.25*e*e*(Math.tan(r)-Math.tan(2*r)*Math.pow(Math.tan(r),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},kI=function(e){var t,n=e.type,r=void 0===n?"circle":n,i=e.size,o=void 0===i?64:i,a=e.sizeType,l=void 0===a?"area":a,s=kA(kA({},function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,kO)),{},{type:r,size:o,sizeType:l}),c=s.className,u=s.cx,d=s.cy,f=wh(s,!0);return u===+u&&d===+d&&o===+o?G.default.createElement("path",kN({},f,{className:(0,xT.U)("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:(t=kM["symbol".concat((0,kr.default)(r))]||kg,(function(e,t){let n=null,r=ku(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:ki(e||kg),t="function"==typeof t?t:ki(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:ki(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:ki(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i})().type(t).size(kT(o,l,r))())})):null};function kD(e){return(kD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kz(){return(kz=Object.assign.bind()).apply(this,arguments)}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}kI.registerSymbol=function(e,t){kM["symbol".concat((0,kr.default)(e))]=t};function kL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kL=function(){return!!e})()}function k$(e){return(k$=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kB(e,t){return(kB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function kF(e,t,n){return(t=kU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kU(e){var t=function(e,t){if("object"!=kD(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=kD(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kD(t)?t:t+""}var kH=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=k$(e),function(e,t){if(t&&("object"===kD(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,kL()?Reflect.construct(e,t||[],k$(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&kB(n,e),t=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,n=32/6,r=32/3,i=e.inactive?t:e.color;if("plainline"===e.type)return G.default.createElement("line",{strokeWidth:4,fill:"none",stroke:i,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:16,x2:32,y2:16,className:"recharts-legend-icon"});if("line"===e.type)return G.default.createElement("path",{strokeWidth:4,fill:"none",stroke:i,d:"M0,".concat(16,"h").concat(r,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*r,",").concat(16,"\n H").concat(32,"M").concat(2*r,",").concat(16,"\n A").concat(n,",").concat(n,",0,1,1,").concat(r,",").concat(16),className:"recharts-legend-icon"});if("rect"===e.type)return G.default.createElement("path",{stroke:"none",fill:i,d:"M0,".concat(4,"h").concat(32,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(G.default.isValidElement(e.legendIcon)){var o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(t){kF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return delete o.legendIcon,G.default.cloneElement(e.legendIcon,o)}return G.default.createElement(kI,{fill:i,cx:16,cy:16,size:32,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,i=t.layout,o=t.formatter,a=t.inactiveColor,l={x:0,y:0,width:32,height:32},s={display:"horizontal"===i?"inline-block":"block",marginRight:10},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return n.map(function(t,n){var i=t.formatter||o,u=(0,xT.U)(kF(kF({"recharts-legend-item":!0},"legend-item-".concat(n),!0),"inactive",t.inactive));if("none"===t.type)return null;var d=(0,xQ.default)(t.value)?null:t.value;xJ(!(0,xQ.default)(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var f=t.inactive?a:t.color;return G.default.createElement("li",kz({className:u,style:s,key:"legend-item-".concat(n)},x7(e.props,t,n)),G.default.createElement(wC,{width:r,height:r,viewBox:l,style:c},e.renderIcon(t)),G.default.createElement("span",{className:"recharts-legend-item-text",style:{color:f}},i?i(d,t,n):d))})}},{key:"render",value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;return t&&t.length?G.default.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?r:"left"}},this.renderItems()):null}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kU(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.PureComponent);function kK(e){return(kK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}kF(kH,"displayName","Legend"),kF(kH,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var kW=["ref"];function kq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kq(Object(n),!0).forEach(function(t){kJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kQ(r.key),r)}}function kG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kG=function(){return!!e})()}function kX(e){return(kX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kY(e,t){return(kY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function kJ(e,t,n){return(t=kQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kQ(e){var t=function(e,t){if("object"!=kK(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=kK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kK(t)?t:t+""}function k0(e){return e.value}var k1=function(e){var t,n;function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r,n=[].concat(o),t=kX(t),kJ(e=function(e,t){if(t&&("object"===kK(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,kG()?Reflect.construct(t,n||[],kX(this).constructor):t.apply(this,n)),"lastBoundingBox",{width:-1,height:-1}),e}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&kY(r,e),t=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?kZ({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,i=r.layout,o=r.align,a=r.verticalAlign,l=r.margin,s=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===i?{left:((s||0)-this.getBBoxSnapshot().width)/2}:"right"===o?{right:l&&l.right||0}:{left:l&&l.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===a?{top:((c||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:l&&l.bottom||0}:{top:l&&l.top||0}),kZ(kZ({},t),n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,r=t.width,i=t.height,o=t.wrapperStyle,a=t.payloadUniqBy,l=t.payload,s=kZ(kZ({position:"absolute",width:r||"auto",height:i||"auto"},this.getDefaultPosition(o)),o);return G.default.createElement("div",{className:"recharts-legend-wrapper",style:s,ref:function(t){e.wrapperNode=t}},function(e,t){if(G.default.isValidElement(e))return G.default.cloneElement(e,t);if("function"==typeof e)return G.default.createElement(e,t);t.ref;var n=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,kW);return G.default.createElement(kH,n)}(n,kZ(kZ({},this.props),{},{payload:w2(l,a,k0)})))}}],n=[{key:"getWithHeight",value:function(e,t){var n=kZ(kZ({},this.defaultProps),e.props).layout;return"vertical"===n&&xU(e.props.height)?{height:e.props.height}:"horizontal"===n?{width:e.props.width||t}:null}}],t&&kV(r.prototype,t),n&&kV(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(G.PureComponent);function k2(){return(k2=Object.assign.bind()).apply(this,arguments)}kJ(k1,"displayName","Legend"),kJ(k1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var k3=function(e){var t=e.cx,n=e.cy,r=e.r,i=e.className,o=(0,xT.U)("recharts-dot",i);return t===+t&&n===+n&&r===+r?G.createElement("circle",k2({},wh(e,!1),x8(e),{className:o,cx:t,cy:n,r:r})):null},k4=e.i(45009);let{getOwnPropertyNames:k9,getOwnPropertySymbols:k5}=Object,{hasOwnProperty:k6}=Object.prototype;function k8(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function k7(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,o=i.get(t),a=i.get(n);if(o&&a)return o===n&&a===t;i.set(t,n),i.set(n,t);let l=e(t,n,r);return i.delete(t),i.delete(n),l}}function _e(e){return k9(e).concat(k5(e))}let _t=Object.hasOwn||((e,t)=>k6.call(e,t));function _n(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let{getOwnPropertyDescriptor:_r,keys:_i}=Object;function _o(e,t){return e.byteLength===t.byteLength&&_y(new Uint8Array(e),new Uint8Array(t))}function _a(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function _l(e,t){return e.byteLength===t.byteLength&&_y(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function _s(e,t){return _n(e.getTime(),t.getTime())}function _c(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function _u(e,t){return e===t}function _d(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let a=Array(o),l=e.entries(),s=0;for(;(r=l.next())&&!r.done;){let o=t.entries(),l=!1,c=0;for(;(i=o.next())&&!i.done;){if(a[c]){c++;continue}let o=r.value,u=i.value;if(n.equals(o[0],u[0],s,c,e,t,n)&&n.equals(o[1],u[1],o[0],u[0],e,t,n)){l=a[c]=!0;break}c++}if(!l)return!1;s++}return!0}function _f(e,t,n){let r=_i(e),i=r.length;if(_i(t).length!==i)return!1;for(;i-- >0;)if(!_v(e,t,n,r[i]))return!1;return!0}function _p(e,t,n){let r,i,o,a=_e(e),l=a.length;if(_e(t).length!==l)return!1;for(;l-- >0;)if(!_v(e,t,n,r=a[l])||(i=_r(e,r),o=_r(t,r),(i||o)&&(!i||!o||i.configurable!==o.configurable||i.enumerable!==o.enumerable||i.writable!==o.writable)))return!1;return!0}function _h(e,t){return _n(e.valueOf(),t.valueOf())}function _m(e,t){return e.source===t.source&&e.flags===t.flags}function _g(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let a=Array(o),l=e.values();for(;(r=l.next())&&!r.done;){let o=t.values(),l=!1,s=0;for(;(i=o.next())&&!i.done;){if(!a[s]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){l=a[s]=!0;break}s++}if(!l)return!1}return!0}function _y(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function _b(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function _v(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||_t(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let _x={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},_w=Object.prototype.toString,_k=__();function __(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:l,areObjectsEqual:s,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:h}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?l(m,g,y):"function"===b&&o(m,g,y);let v=m.constructor;if(v!==g.constructor)return!1;if(v===Object)return s(m,g,y);if(Array.isArray(m))return t(m,g,y);if(v===Date)return r(m,g,y);if(v===RegExp)return u(m,g,y);if(v===Map)return a(m,g,y);if(v===Set)return d(m,g,y);let x=_w.call(m);if("[object Date]"===x)return r(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return a(m,g,y);if("[object Set]"===x)return d(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&s(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return i(m,g,y);if("[object Arguments]"===x)return s(m,g,y);if(_x[x])return f(m,g,y);if("[object ArrayBuffer]"===x)return e(m,g,y);if("[object DataView]"===x)return n(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return c(m,g,y);if(h){let e=h[x];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=h[t])}if(e)return e(m,g,y)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:_o,areArraysEqual:n?_p:_a,areDataViewsEqual:_l,areDatesEqual:_s,areErrorsEqual:_c,areFunctionsEqual:_u,areMapsEqual:n?k8(_d,_p):_d,areNumbersEqual:_n,areObjectsEqual:n?_p:_f,arePrimitiveWrappersEqual:_h,areRegExpsEqual:_m,areSetsEqual:n?k8(_g,_p):_g,areTypedArraysEqual:n?k8(_y,_p):_y,areUrlsEqual:_b,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=k7(r.areArraysEqual),t=k7(r.areMapsEqual),n=k7(r.areObjectsEqual),i=k7(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e)),a=n?n(o):function(e,t,n,r,i,a,l){return o(e,t,l)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,a){let{cache:l=e?new WeakMap:void 0,meta:s}=n();return t(o,a,{cache:l,equals:r,meta:s,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:o,createState:r,equals:a,strict:i})}function _S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(i){if(n<0&&(n=i),i-n>t)e(i),n=-1;else{var o;o=r,"u">typeof requestAnimationFrame&&requestAnimationFrame(o)}})}function _E(e){return(_E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _O(e){return(_O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_N(Object(n),!0).forEach(function(t){_A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _A(e,t,n){var r;return(r=function(e,t){if("object"!==_O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_O(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===_O(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}__({strict:!0}),__({circular:!0}),__({circular:!0,strict:!0}),__({createInternalComparator:()=>_n}),__({strict:!0,createInternalComparator:()=>_n}),__({circular:!0,createInternalComparator:()=>_n}),__({circular:!0,createInternalComparator:()=>_n,strict:!0});var _M=function(e){return e},_P=function(e,t){return Object.keys(t).reduce(function(n,r){return _C(_C({},n),{},_A({},r,e(r,t[r])))},{})},_T=function(e,t,n){return e.map(function(e){return"".concat(e.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())})," ").concat(t,"ms ").concat(n)}).join(",")},_I=function(e,t,n,r,i,o,a,l){};function _D(e,t){if(e){if("string"==typeof e)return _z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _z(e,t)}}function _z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _R=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},_L=function(e,t){return e.map(function(e,n){return e*Math.pow(t,n)}).reduce(function(e,t){return e+t})},_$=function(e,t){return function(n){return _L(_R(e,t),n)}},_B=function(){for(var e,t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r[0],a=r[1],l=r[2],s=r[3];if(1===r.length)switch(r[0]){case"linear":o=0,a=0,l=1,s=1;break;case"ease":o=.25,a=.1,l=.25,s=1;break;case"ease-in":o=.42,a=0,l=1,s=1;break;case"ease-out":o=.42,a=0,l=.58,s=1;break;case"ease-in-out":o=0,a=0,l=.58,s=1;break;default:var c=r[0].split("(");if("cubic-bezier"===c[0]&&4===c[1].split(")")[0].split(",").length){var u,d=function(e){if(Array.isArray(e))return e}(u=c[1].split(")")[0].split(",").map(function(e){return parseFloat(e)}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),4!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(u)||_D(u,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=d[0],a=d[1],l=d[2],s=d[3]}else _I(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",r)}_I([o,l,a,s].every(function(e){return"number"==typeof e&&e>=0&&e<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var f=_$(o,l),p=_$(a,s),h=(e=o,t=l,function(n){var r;return _L([].concat(function(e){if(Array.isArray(e))return _z(e)}(r=_R(e,t).map(function(e,t){return e*t}).slice(1))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||_D(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),m=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i,o=f(n)-t,a=h(n);if(1e-4>Math.abs(o-t)||a<1e-4)break;n=(i=n-o/a)>1?1:i<0?0:i}return p(n)};return m.isStepper=!1,m},_F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,i=void 0===r?8:r,o=e.dt,a=void 0===o?17:o,l=function(e,t,r){var o=r+(-(e-t)*n-r*i)*a/1e3,l=r*a/1e3+e;return 1e-4>Math.abs(l-t)&&1e-4>Math.abs(o)?[t,0]:[l,o]};return l.isStepper=!0,l.dt=a,l},_U=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0];if("string"==typeof r)switch(r){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return _B(r);case"spring":return _F();default:if("cubic-bezier"===r.split("(")[0])return _B(r);_I(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",t)}return"function"==typeof r?r:(_I(!1,"[configEasing]: first argument type should be function or string, instead received %s",t),null)};function _H(e){return(_H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _K(e){return function(e){if(Array.isArray(e))return _G(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_V(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_W(Object(n),!0).forEach(function(t){_Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_W(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _Z(e,t,n){var r;return(r=function(e,t){if("object"!==_H(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_H(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===_H(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _V(e,t){if(e){if("string"==typeof e)return _G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _G(e,t)}}function _G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _X=function(e,t,n){return e+(t-e)*n},_Y=function(e){return e.from!==e.to},_J=function e(t,n,r){var i=_P(function(e,n){if(_Y(n)){var r,i=function(e){if(Array.isArray(e))return e}(r=t(n.from,n.to,n.velocity))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(r)||_V(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i[1];return _q(_q({},n),{},{from:o,velocity:a})}return n},n);return r<1?_P(function(e,t){return _Y(t)?_q(_q({},t),{},{velocity:_X(t.velocity,i[e].velocity,r),from:_X(t.from,i[e].from,r)}):t},n):e(t,i,r-1)};let _Q=function(e,t,n,r,i){var o,a,l=[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})}),s=l.reduce(function(n,r){return _q(_q({},n),{},_Z({},r,[e[r],t[r]]))},{}),c=l.reduce(function(n,r){return _q(_q({},n),{},_Z({},r,{from:e[r],velocity:0,to:t[r]}))},{}),u=-1,d=function(){return null};return d=n.isStepper?function(r){o||(o=r);var a=(r-o)/n.dt;c=_J(n,c,a),i(_q(_q(_q({},e),t),_P(function(e,t){return t.from},c))),o=r,Object.values(c).filter(_Y).length&&(u=requestAnimationFrame(d))}:function(o){a||(a=o);var l=(o-a)/r,c=_P(function(e,t){return _X.apply(void 0,_K(t).concat([n(l)]))},s);if(i(_q(_q(_q({},e),t),c)),l<1)u=requestAnimationFrame(d);else{var f=_P(function(e,t){return _X.apply(void 0,_K(t).concat([n(1)]))},s);i(_q(_q(_q({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(u)}}};function _0(e){return(_0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var _1=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function _2(e){return function(e){if(Array.isArray(e))return _3(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return _3(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _3(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_4(Object(n),!0).forEach(function(t){_5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _5(e,t,n){return(t=_6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _6(e){var t=function(e,t){if("object"!==_0(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_0(t)?t:String(t)}function _8(e,t){return(_8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _7(e,t){if(t&&("object"===_0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return Se(e)}function Se(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function St(e){return(St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sn=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&_8(i,e);var t,n,r=(t=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=St(i);return e=t?Reflect.construct(n,arguments,St(this).constructor):n.apply(this,arguments),_7(this,e)});function i(e,t){if(!(this instanceof i))throw TypeError("Cannot call a class as a function");var n=r.call(this,e,t),o=n.props,a=o.isActive,l=o.attributeName,s=o.from,c=o.to,u=o.steps,d=o.children,f=o.duration;if(n.handleStyleChange=n.handleStyleChange.bind(Se(n)),n.changeStyle=n.changeStyle.bind(Se(n)),!a||f<=0)return n.state={style:{}},"function"==typeof d&&(n.state={style:c}),_7(n);if(u&&u.length)n.state={style:u[0].style};else if(s){if("function"==typeof d)return n.state={style:s},_7(n);n.state={style:l?_5({},l,s):s}}else n.state={style:{}};return n}return n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,i=t.attributeName,o=t.shouldReAnimate,a=t.to,l=t.from,s=this.state.style;if(r){if(!n){var c={style:i?_5({},i,a):a};this.state&&s&&(i&&s[i]!==a||!i&&s!==a)&&this.setState(c);return}if(!_k(e.to,a)||!e.canBegin||!e.isActive){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||o?l:e.to;if(this.state&&s){var f={style:i?_5({},i,d):d};(i&&s[i]!==d||!i&&s!==d)&&this.setState(f)}this.runAnimation(_9(_9({},this.props),{},{from:d,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,n=e.from,r=e.to,i=e.duration,o=e.easing,a=e.begin,l=e.onAnimationEnd,s=e.onAnimationStart,c=_Q(n,r,_U(o),i,this.changeStyle);this.manager.start([s,a,function(){t.stopJSAnimation=c()},i,l])}},{key:"runStepAnimation",value:function(e){var t=this,n=e.steps,r=e.begin,i=e.onAnimationStart,o=n[0],a=o.style,l=o.duration;return this.manager.start([i].concat(_2(n.reduce(function(e,r,i){if(0===i)return e;var o=r.duration,a=r.easing,l=void 0===a?"ease":a,s=r.style,c=r.properties,u=r.onAnimationEnd,d=i>0?n[i-1]:r,f=c||Object.keys(s);if("function"==typeof l||"spring"===l)return[].concat(_2(e),[t.runJSAnimation.bind(t,{from:d.style,to:s,duration:o,easing:l}),o]);var p=_T(f,o,l),h=_9(_9(_9({},d.style),s),{},{transition:p});return[].concat(_2(e),[h,o,u]).filter(_M)},[a,Math.max(void 0===l?0:l,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){this.manager||(this.manager=(t=function(){return null},n=!1,r=function e(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var i=function(e){if(Array.isArray(e))return e}(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e){if(e){if("string"==typeof e)return _j(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _j(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i.slice(1);return"number"==typeof o?void _S(e.bind(null,a),o):(e(o),void _S(e.bind(null,a)))}"object"===_E(r)&&t(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}));var t,n,r,i=e.begin,o=e.duration,a=e.attributeName,l=e.to,s=e.easing,c=e.onAnimationStart,u=e.onAnimationEnd,d=e.steps,f=e.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),"function"==typeof s||"function"==typeof f||"spring"===s)return void this.runJSAnimation(e);if(d.length>1)return void this.runStepAnimation(e);var h=a?_5({},a,l):l,m=_T(Object.keys(h),o,s);p.start([c,i,_9(_9({},h),{},{transition:m}),o,u])}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),r=(e.attributeName,e.easing,e.isActive),i=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,_1)),o=G.Children.count(t),a=this.state.style;if("function"==typeof t)return t(a);if(!r||0===o||n<=0)return t;var l=function(e){var t=e.props,n=t.style,r=t.className;return(0,G.cloneElement)(e,_9(_9({},i),{},{style:_9(_9({},void 0===n?{}:n),a),className:r}))};return 1===o?l(G.Children.only(t)):G.default.createElement("div",null,G.Children.map(t,function(e){return l(e)}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_6(r.key),r)}}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(G.PureComponent);function Sr(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function Si(){return(Si=Object.assign.bind()).apply(null,arguments)}function So(e,t){return(So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Sa(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,So(e,t)}Sn.displayName="Animate",Sn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},Sn.propTypes={from:k4.default.oneOfType([k4.default.object,k4.default.string]),to:k4.default.oneOfType([k4.default.object,k4.default.string]),attributeName:k4.default.string,duration:k4.default.number,begin:k4.default.number,easing:k4.default.oneOfType([k4.default.string,k4.default.func]),steps:k4.default.arrayOf(k4.default.shape({duration:k4.default.number.isRequired,style:k4.default.object.isRequired,easing:k4.default.oneOfType([k4.default.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),k4.default.func]),properties:k4.default.arrayOf("string"),onAnimationEnd:k4.default.func})),children:k4.default.oneOfType([k4.default.node,k4.default.func]),isActive:k4.default.bool,canBegin:k4.default.bool,onAnimationEnd:k4.default.func,shouldReAnimate:k4.default.bool,onAnimationStart:k4.default.func,onAnimationReStart:k4.default.func};let Sl=G.default.createContext(null);function Ss(e,t){var n=Object.create(null);return e&&G.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,G.isValidElement)(e)?t(e):e}),n}function Sc(e,t,n){return null!=n[t]?n[t]:e.props[t]}var Su=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Sd=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.handleExited.bind(function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}Sa(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?Ss(e.children,function(t){return(0,G.cloneElement)(t,{onExited:o.bind(null,t),in:!0,appear:Sc(t,"appear",e),enter:Sc(t,"enter",e),exit:Sc(t,"exit",e)})}):(Object.keys(r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var l={};for(var s in t){if(i[s])for(r=0;r<i[s].length;r++){var c=i[s][r];l[i[s][r]]=n(c)}l[s]=n(s)}for(r=0;r<o.length;r++)l[o[r]]=n(o[r]);return l}(i,n=Ss(e.children))).forEach(function(t){var a=r[t];if((0,G.isValidElement)(a)){var l=t in i,s=t in n,c=i[t],u=(0,G.isValidElement)(c)&&!c.props.in;s&&(!l||u)?r[t]=(0,G.cloneElement)(a,{onExited:o.bind(null,a),in:!0,exit:Sc(a,"exit",e),enter:Sc(a,"enter",e)}):s||!l||u?s&&l&&(0,G.isValidElement)(c)&&(r[t]=(0,G.cloneElement)(a,{onExited:o.bind(null,a),in:c.props.in,exit:Sc(a,"exit",e),enter:Sc(a,"enter",e)})):r[t]=(0,G.cloneElement)(a,{in:!1})}}),r),firstRender:!1}},n.handleExited=function(e,t){var n=Ss(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Si({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Sr(e,["component","childFactory"]),i=this.state.contextValue,o=Su(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?G.default.createElement(Sl.Provider,{value:i},o):G.default.createElement(Sl.Provider,{value:i},G.default.createElement(t,r,o))},t}(G.default.Component);Sd.propTypes={},Sd.defaultProps={component:"div",childFactory:function(e){return e}};var Sf="unmounted",Sp="exited",Sh="entering",Sm="entered",Sg="exiting",Sy=function(e){function t(t,n){var r,i=e.call(this,t,n)||this,o=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?o?(r=Sp,i.appearStatus=Sh):r=Sm:r=t.unmountOnExit||t.mountOnEnter?Sf:Sp,i.state={status:r},i.nextCallback=null,i}Sa(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Sf?{status:Sp}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Sh&&n!==Sm&&(t=Sh):(n===Sh||n===Sm)&&(t=Sg)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Sh){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:cQ.default.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Sp&&this.setState({status:Sf})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[cQ.default.findDOMNode(this),r],o=i[0],a=i[1],l=this.getTimeouts(),s=r?l.appear:l.enter;(e||n)&&1?(this.props.onEnter(o,a),this.safeSetState({status:Sh},function(){t.props.onEntering(o,a),t.onTransitionEnd(s,function(){t.safeSetState({status:Sm},function(){t.props.onEntered(o,a)})})})):this.safeSetState({status:Sm},function(){t.props.onEntered(o)})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:cQ.default.findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:Sg},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Sp},function(){e.props.onExited(r)})})})):this.safeSetState({status:Sp},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:cQ.default.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===Sf)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Sr(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return G.default.createElement(Sl.Provider,{value:null},"function"==typeof n?n(e,r):G.default.cloneElement(G.default.Children.only(n),r))},t}(G.default.Component);function Sb(){}Sy.contextType=Sl,Sy.propTypes={},Sy.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Sb,onEntering:Sb,onEntered:Sb,onExit:Sb,onExiting:Sb,onExited:Sb},Sy.UNMOUNTED=Sf,Sy.EXITED=Sp,Sy.ENTERING=Sh,Sy.ENTERED=Sm,Sy.EXITING=Sg;var Sv=["children","appearOptions","enterOptions","leaveOptions"];function Sx(e){return(Sx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sw(){return(Sw=Object.assign.bind()).apply(this,arguments)}function Sk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sk(Object(n),!0).forEach(function(t){SO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SS(e,t){return(SS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function SE(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sj(e){return(Sj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function SO(e,t,n){return(t=SN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SN(e){var t=function(e,t){if("object"!==Sx(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Sx(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Sx(t)?t:String(t)}var SC=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce(function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)},0):Number.isFinite(n)?n:0},SA=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&SS(i,e);var t,n,r=(t=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=Sj(i);return e=t?Reflect.construct(n,arguments,Sj(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===Sx(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return SE(e)}(this,e)});function i(){var e;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return SO(SE(e=r.call(this)),"handleEnter",function(t,n){var r=e.props,i=r.appearOptions,o=r.enterOptions;e.handleStyleActive(n?i:o)}),SO(SE(e),"handleExit",function(){var t=e.props.leaveOptions;e.handleStyleActive(t)}),e.state={isActive:!1},e}return n=[{key:"handleStyleActive",value:function(e){if(e){var t=e.onAnimationEnd?function(){e.onAnimationEnd()}:null;this.setState(S_(S_({},e),{},{onAnimationEnd:t,isActive:!0}))}}},{key:"parseTimeout",value:function(){var e=this.props,t=e.appearOptions,n=e.enterOptions,r=e.leaveOptions;return SC(t)+SC(n)+SC(r)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=(t.appearOptions,t.enterOptions,t.leaveOptions,function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Sv));return G.default.createElement(Sy,Sw({},r,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return G.default.createElement(Sn,e.state,G.Children.only(n))})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,SN(r.key),r)}}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(G.Component);function SM(e){var t=e.component,n=e.children,r=e.appear,i=e.enter,o=e.leave;return G.default.createElement(Sd,{component:t},G.Children.map(n,function(e,t){return G.default.createElement(SA,{appearOptions:r,enterOptions:i,leaveOptions:o,key:"child-".concat(t)},e)}))}function SP(e){return(SP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ST(){return(ST=Object.assign.bind()).apply(this,arguments)}function SI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SD(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=SP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=SP(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==SP(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}SA.propTypes={appearOptions:k4.default.object,enterOptions:k4.default.object,leaveOptions:k4.default.object,children:k4.default.element},SM.propTypes={appear:k4.default.object,enter:k4.default.object,leave:k4.default.object,children:k4.default.oneOfType([k4.default.array,k4.default.element]),component:k4.default.any},SM.defaultProps={component:"span"};var SR=function(e,t,n,r,i){var o,a=Math.min(Math.abs(n)/2,Math.abs(r)/2),l=r>=0?1:-1,s=n>=0?1:-1,c=+(r>=0&&n>=0||r<0&&n<0);if(a>0&&i instanceof Array){for(var u=[0,0,0,0],d=0;d<4;d++)u[d]=i[d]>a?a:i[d];o="M".concat(e,",").concat(t+l*u[0]),u[0]>0&&(o+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+s*u[0],",").concat(t)),o+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(o+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+l*u[1])),o+="L ".concat(e+n,",").concat(t+r-l*u[2]),u[2]>0&&(o+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-s*u[2],",").concat(t+r)),o+="L ".concat(e+s*u[3],",").concat(t+r),u[3]>0&&(o+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-l*u[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var f=Math.min(a,i);o="M ".concat(e,",").concat(t+l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+s*f,",").concat(t,"\n L ").concat(e+n-s*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n,",").concat(t+l*f,"\n L ").concat(e+n,",").concat(t+r-l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n-s*f,",").concat(t+r,"\n L ").concat(e+s*f,",").concat(t+r,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e,",").concat(t+r-l*f," Z")}else o="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return o},SL=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,o=t.y,a=t.width,l=t.height;if(Math.abs(a)>0&&Math.abs(l)>0){var s=Math.min(i,i+a),c=Math.max(i,i+a),u=Math.min(o,o+l),d=Math.max(o,o+l);return n>=s&&n<=c&&r>=u&&r<=d}return!1},S$={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},SB=function(e){var t,n=Sz(Sz({},S$),e),r=(0,G.useRef)(),i=function(e){if(Array.isArray(e))return e}(t=(0,G.useState)(-1))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return SI(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return SI(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i[1];(0,G.useEffect)(function(){if(r.current&&r.current.getTotalLength)try{var e=r.current.getTotalLength();e&&a(e)}catch(e){}},[]);var l=n.x,s=n.y,c=n.width,u=n.height,d=n.radius,f=n.className,p=n.animationEasing,h=n.animationDuration,m=n.animationBegin,g=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||s!==+s||c!==+c||u!==+u||0===c||0===u)return null;var b=(0,xT.U)("recharts-rectangle",f);return y?G.default.createElement(Sn,{canBegin:o>0,from:{width:c,height:u,x:l,y:s},to:{width:c,height:u,x:l,y:s},duration:h,animationEasing:p,isActive:y},function(e){var t=e.width,i=e.height,a=e.x,l=e.y;return G.default.createElement(Sn,{canBegin:o>0,from:"0px ".concat(-1===o?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:h,isActive:g,easing:p},G.default.createElement("path",ST({},wh(n,!0),{className:b,d:SR(a,l,t,i,d),ref:r})))}):G.default.createElement("path",ST({},wh(n,!0),{className:b,d:SR(l,s,c,u,d)}))};function SF(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function SU(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}class SH extends Map{constructor(e,t=SW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(SK(this,e))}has(e){return super.has(SK(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}(this,e))}}function SK({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function SW(e){return null!==e&&"object"==typeof e?e.valueOf():e}let Sq=Symbol("implicit");function SZ(){var e=new SH,t=[],n=[],r=Sq;function i(i){let o=e.get(i);if(void 0===o){if(r!==Sq)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();for(let r of(t=[],e=new SH,n))e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return SZ(t,n).unknown(r)},SF.apply(i,arguments),i}function SV(){var e,t,n=SZ().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,l=!1,s=0,c=0,u=.5;function d(){var n=r().length,d=a<o,f=d?a:o,p=d?o:a;e=(p-f)/Math.max(1,n-s+2*c),l&&(e=Math.floor(e)),f+=(p-f-e*(n-s))*u,t=e*(1-s),l&&(f=Math.round(f),t=Math.round(t));var h=(function(e,t,n){e*=1,t*=1,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=Array(i);++r<i;)o[r]=e+r*n;return o})(n).map(function(t){return f+e*t});return i(d?h.reverse():h)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o*=1,a*=1,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o*=1,a*=1,l=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(l=!!e,d()):l},n.padding=function(e){return arguments.length?(s=Math.min(1,c=+e),d()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),d()):s},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return SV(r(),[o,a]).round(l).paddingInner(s).paddingOuter(c).align(u)},SF.apply(d(),arguments)}function SG(){return function e(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return e(n())},t}(SV.apply(null,arguments).paddingInner(1))}function SX(e){return(SX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function SY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SY(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=SX(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=SX(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==SX(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var SQ={widthCache:{},cacheCount:0},S0={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},S1="recharts_measurement_span",S2=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||w0.isSsr)return{width:0,height:0};var r=(Object.keys(t=SJ({},n)).forEach(function(e){t[e]||delete t[e]}),t),i=JSON.stringify({text:e,copyStyle:r});if(SQ.widthCache[i])return SQ.widthCache[i];try{var o=document.getElementById(S1);o||((o=document.createElement("span")).setAttribute("id",S1),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=SJ(SJ({},S0),r);Object.assign(o.style,a),o.textContent="".concat(e);var l=o.getBoundingClientRect(),s={width:l.width,height:l.height};return SQ.widthCache[i]=s,++SQ.cacheCount>2e3&&(SQ.cacheCount=0,SQ.widthCache={}),s}catch(e){return{width:0,height:0}}};function S3(e){return(S3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S4(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S9(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=S3(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=S3(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==S3(t)?t:t+""}(r.key),r)}}var S6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,S8=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,S7=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Ee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Et={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},En=Object.keys(Et),Er=function(){var e,t;function n(e,t){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");this.num=e,this.unit=t,this.num=e,this.unit=t,Number.isNaN(e)&&(this.unit=""),""===t||S7.test(t)||(this.num=0/0,this.unit=""),En.includes(t)&&(this.num=e*Et[t],this.unit="px")}return e=[{key:"add",value:function(e){return this.unit!==e.unit?new n(0/0,""):new n(this.num+e.num,this.unit)}},{key:"subtract",value:function(e){return this.unit!==e.unit?new n(0/0,""):new n(this.num-e.num,this.unit)}},{key:"multiply",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(0/0,""):new n(this.num*e.num,this.unit||e.unit)}},{key:"divide",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(0/0,""):new n(this.num/e.num,this.unit||e.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],t=[{key:"parse",value:function(e){var t,r=S4(null!=(t=Ee.exec(e))?t:[],3),i=r[1],o=r[2];return new n(parseFloat(i),null!=o?o:"")}}],e&&S5(n.prototype,e),t&&S5(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function Ei(e){if(e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var n,r=S4(null!=(n=S6.exec(t))?n:[],4),i=r[1],o=r[2],a=r[3],l=Er.parse(null!=i?i:""),s=Er.parse(null!=a?a:""),c="*"===o?l.multiply(s):l.divide(s);if(c.isNaN())return"NaN";t=t.replace(S6,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,d=S4(null!=(u=S8.exec(t))?u:[],4),f=d[1],p=d[2],h=d[3],m=Er.parse(null!=f?f:""),g=Er.parse(null!=h?h:""),y="+"===p?m.add(g):m.subtract(g);if(y.isNaN())return"NaN";t=t.replace(S8,y.toString())}return t}var Eo=/\(([^()]*)\)/;function Ea(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t=e;t.includes("(");){var n=S4(Eo.exec(t),2)[1];t=t.replace(Eo,Ei(n))}return t}(t),t=Ei(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var El=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Es=["dx","dy","angle","className","breakAll"];function Ec(){return(Ec=Object.assign.bind()).apply(this,arguments)}function Eu(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ef(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ef(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ep=/[ \f\n\r\t\v\u2028\u2029]+/,Eh=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];(0,x$.default)(t)||(i=n?t.toString().split(""):t.toString().split(Ep));var o=i.map(function(e){return{word:e,width:S2(e,r).width}}),a=n?0:S2(" ",r).width;return{wordsWithComputedWidth:o,spaceWidth:a}}catch(e){return null}},Em=function(e,t,n,r,i){var o,a=e.maxLines,l=e.children,s=e.style,c=e.breakAll,u=xU(a),d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){var o=t.word,a=t.width,l=e[e.length-1];return l&&(null==r||i||l.width+a+n<Number(r))?(l.words.push(o),l.width+=a+n):e.push({words:[o],width:a}),e},[])},f=d(t);if(!u)return f;for(var p=function(e){var t=d(Eh({breakAll:c,style:s,children:l.slice(0,e)+"…"}).wordsWithComputedWidth);return[t.length>a||t.reduce(function(e,t){return e.width>t.width?e:t}).width>Number(r),t]},h=0,m=l.length-1,g=0;h<=m&&g<=l.length-1;){var y=Math.floor((h+m)/2),b=Ed(p(y-1),2),v=b[0],x=b[1],w=Ed(p(y),1)[0];if(v||w||(h=y+1),v&&w&&(m=y-1),!v&&w){o=x;break}g++}return o||f},Eg=function(e){return[{words:(0,x$.default)(e)?[]:e.toString().split(Ep)}]},Ey=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,o=e.breakAll,a=e.maxLines;if((t||n)&&!w0.isSsr){var l=Eh({breakAll:o,children:r,style:i});if(!l)return Eg(r);var s=l.wordsWithComputedWidth,c=l.spaceWidth;return Em({breakAll:o,children:r,maxLines:a,style:i},s,c,t,n)}return Eg(r)},Eb="#808080",Ev=function(e){var t,n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.lineHeight,l=void 0===a?"1em":a,s=e.capHeight,c=void 0===s?"0.71em":s,u=e.scaleToFit,d=void 0!==u&&u,f=e.textAnchor,p=e.verticalAnchor,h=e.fill,m=void 0===h?Eb:h,g=Eu(e,El),y=(0,G.useMemo)(function(){return Ey({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:d,style:g.style,width:g.width})},[g.breakAll,g.children,g.maxLines,d,g.style,g.width]),b=g.dx,v=g.dy,x=g.angle,w=g.className,k=g.breakAll,_=Eu(g,Es);if(!xH(r)||!xH(o))return null;var S=r+(xU(b)?b:0),E=o+(xU(v)?v:0);switch(void 0===p?"end":p){case"start":t=Ea("calc(".concat(c,")"));break;case"middle":t=Ea("calc(".concat((y.length-1)/2," * -").concat(l," + (").concat(c," / 2))"));break;default:t=Ea("calc(".concat(y.length-1," * -").concat(l,")"))}var j=[];if(d){var O=y[0].width,N=g.width;j.push("scale(".concat((xU(N)?N/O:1)/O,")"))}return x&&j.push("rotate(".concat(x,", ").concat(S,", ").concat(E,")")),j.length&&(_.transform=j.join(" ")),G.default.createElement("text",Ec({},wh(_,!0),{x:S,y:E,className:(0,xT.U)("recharts-text",w),textAnchor:void 0===f?"start":f,fill:m.includes("url")?Eb:m}),y.map(function(e,n){var r=e.words.join(k?"":" ");return G.default.createElement("tspan",{x:S,dy:0===n?t:l,key:"".concat(r,"-").concat(n)},r)}))};let Ex=Math.sqrt(50),Ew=Math.sqrt(10),Ek=Math.sqrt(2);function E_(e,t,n){let r,i,o,a=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(a)),s=a/Math.pow(10,l),c=s>=Ex?10:s>=Ew?5:s>=Ek?2:1;return(l<0?(r=Math.round(e*(o=Math.pow(10,-l)/c)),i=Math.round(t*o),r/o<e&&++r,i/o>t&&--i,o=-o):(r=Math.round(e/(o=Math.pow(10,l)*c)),i=Math.round(t/o),r*o<e&&++r,i*o>t&&--i),i<r&&.5<=n&&n<2)?E_(e,t,2*n):[r,i,o]}function ES(e,t,n){if(t*=1,e*=1,!((n*=1)>0))return[];if(e===t)return[e];let r=t<e,[i,o,a]=r?E_(t,e,n):E_(e,t,n);if(!(o>=i))return[];let l=o-i+1,s=Array(l);if(r)if(a<0)for(let e=0;e<l;++e)s[e]=-((o-e)/a);else for(let e=0;e<l;++e)s[e]=(o-e)*a;else if(a<0)for(let e=0;e<l;++e)s[e]=-((i+e)/a);else for(let e=0;e<l;++e)s[e]=(i+e)*a;return s}function EE(e,t,n){return E_(e*=1,t*=1,n*=1)[2]}function Ej(e,t,n){t*=1,e*=1,n*=1;let r=t<e,i=r?EE(t,e,n):EE(e,t,n);return(r?-1:1)*(i<0?-(1/i):i)}function EO(e,t){return null==e||null==t?0/0:e<t?-1:e>t?1:e>=t?0:0/0}function EN(e,t){return null==e||null==t?0/0:t<e?-1:t>e?1:t>=e?0:0/0}function EC(e){let t,n,r;function i(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>n(e[t],r)?o=t+1:a=t}while(o<a)}return o}return 2!==e.length?(t=EO,n=(t,n)=>EO(e(t),n),r=(t,n)=>e(t)-n):(t=e===EO||e===EN?e:EA,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){let a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{let t=i+o>>>1;0>=n(e[t],r)?i=t+1:o=t}while(i<o)}return i}}}function EA(){return 0}function EM(e){return null===e?0/0:+e}let EP=EC(EO),ET=EP.right;function EI(e,t){return e*=1,t*=1,function(n){return Math.round(e*(1-n)+t*n)}}function ED(e){return+e}EP.left,EC(EM).center;var Ez=[0,1];function ER(e){return e}function EL(e,t){var n;return(t-=e*=1)?function(n){return(n-e)/t}:(n=isNaN(t)?0/0:.5,function(){return n})}function E$(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=EL(i,r),o=n(a,o)):(r=EL(r,i),o=n(o,a)),function(e){return o(r(e))}}function EB(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),o=Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=EL(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=ET(e,t,1,r)-1;return o[n](i[n](t))}}function EF(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function EU(){var e,t,n,r,i,o,a=Ez,l=Ez,s=gk,c=ER;function u(){var e,t,n,s=Math.min(a.length,l.length);return c!==ER&&(e=a[0],t=a[s-1],e>t&&(n=e,e=t,t=n),c=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?EB:E$,i=o=null,d}function d(t){return null==t||isNaN(t*=1)?n:(i||(i=r(a.map(e),l,s)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(l,a.map(e),mg)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,ED),u()):a.slice()},d.range=function(e){return arguments.length?(l=Array.from(e),u()):l.slice()},d.rangeRound=function(e){return l=Array.from(e),s=EI,u()},d.clamp=function(e){return arguments.length?(c=!!e||ER,u()):c!==ER},d.interpolate=function(e){return arguments.length?(s=e,u()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function EH(){return EU()(ER,ER)}function EK(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function EW(e){return(e=EK(Math.abs(e)))?e[1]:0/0}var Eq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function EZ(e){var t;if(!(t=Eq.exec(e)))throw Error("invalid format: "+e);return new EV({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function EV(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function EG(e,t){var n=EK(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+Array(i-r.length+2).join("0")}EZ.prototype=EV.prototype,EV.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let EX={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>EG(100*e,t),r:EG,s:function(e,t){var n=EK(e,t);if(!n)return $=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-($=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+Array(1-o).join("0")+EK(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function EY(e){return e}var EJ=Array.prototype.map,EQ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function E0(e,t,n,r){var i,o,a=Ej(e,t,n);switch((r=EZ(null==r?",f":r)).type){case"s":var l=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(EW(l)/3)))-EW(Math.abs(a))))||(r.precision=o),U(r,l);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=Math.max(0,EW(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(i=Math.abs(i=a)))-EW(i))+1)||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=Math.max(0,-EW(Math.abs(a))))||(r.precision=o-("%"===r.type)*2)}return F(r)}function E1(e){var t=e.domain;return e.ticks=function(e){var n=t();return ES(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return E0(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,l=o.length-1,s=o[a],c=o[l],u=10;for(c<s&&(i=s,s=c,c=i,i=a,a=l,l=i);u-- >0;){if((i=EE(s,c,n))===r)return o[a]=s,o[l]=c,t(o);if(i>0)s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i;else if(i<0)s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i;else break;r=i}return e},e}function E2(){var e=EH();return e.copy=function(){return EF(e,E2())},SF.apply(e,arguments),E1(e)}function E3(e){var t;function n(e){return null==e||isNaN(e*=1)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,ED),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return E3(e).unknown(t)},e=arguments.length?Array.from(e,ED):[0,1],E1(n)}function E4(e,t){e=e.slice();var n,r=0,i=e.length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function E9(e){return Math.log(e)}function E5(e){return Math.exp(e)}function E6(e){return-Math.log(-e)}function E8(e){return-Math.exp(-e)}function E7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function je(e){return(t,n)=>-e(-t,n)}function jt(e){let t,n,r=e(E9,E5),i=r.domain,o=10;function a(){var a,l;return t=(a=o)===Math.E?Math.log:10===a&&Math.log10||2===a&&Math.log2||(a=Math.log(a),e=>Math.log(e)/a),n=10===(l=o)?E7:l===Math.E?Math.exp:e=>Math.pow(l,e),i()[0]<0?(t=je(t),n=je(n),e(E6,E8)):e(E9,E5),r}return r.base=function(e){return arguments.length?(o=+e,a()):o},r.domain=function(e){return arguments.length?(i(e),a()):i()},r.ticks=e=>{let r,a,l=i(),s=l[0],c=l[l.length-1],u=c<s;u&&([s,c]=[c,s]);let d=t(s),f=t(c),p=null==e?10:+e,h=[];if(!(o%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),s>0){for(;d<=f;++d)for(r=1;r<o;++r)if(!((a=d<0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}}else for(;d<=f;++d)for(r=o-1;r>=1;--r)if(!((a=d>0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}2*h.length<p&&(h=ES(s,c,p))}else h=ES(d,f,Math.min(f-d,p)).map(n);return u?h.reverse():h},r.tickFormat=(e,i)=>{if(null==e&&(e=10),null==i&&(i=10===o?"s":","),"function"!=typeof i&&(o%1||null!=(i=EZ(i)).precision||(i.trim=!0),i=F(i)),1/0===e)return i;let a=Math.max(1,o*e/r.ticks().length);return e=>{let r=e/n(Math.round(t(e)));return r*o<o-.5&&(r*=o),r<=a?i(e):""}},r.nice=()=>i(E4(i(),{floor:e=>n(Math.floor(t(e))),ceil:e=>n(Math.ceil(t(e)))})),r}function jn(){let e=jt(EU()).domain([1,10]);return e.copy=()=>EF(e,jn()).base(e.base()),SF.apply(e,arguments),e}function jr(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ji(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jo(e){var t=1,n=e(jr(1),ji(t));return n.constant=function(n){return arguments.length?e(jr(t=+n),ji(t)):t},E1(n)}function ja(){var e=jo(EU());return e.copy=function(){return EF(e,ja()).constant(e.constant())},SF.apply(e,arguments)}function jl(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function js(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jc(e){return e<0?-e*e:e*e}function ju(e){var t=e(ER,ER),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(ER,ER):.5===n?e(js,jc):e(jl(n),jl(1/n)):n},E1(t)}function jd(){var e=ju(EU());return e.copy=function(){return EF(e,jd()).exponent(e.exponent())},SF.apply(e,arguments),e}function jf(){return jd.apply(null,arguments).exponent(.5)}function jp(e){return Math.sign(e)*e*e}function jh(){var e,t=EH(),n=[0,1],r=!1;function i(n){var i,o=Math.sign(i=t(n))*Math.sqrt(Math.abs(i));return isNaN(o)?e:r?Math.round(o):o}return i.invert=function(e){return t.invert(jp(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain()},i.range=function(e){return arguments.length?(t.range((n=Array.from(e,ED)).map(jp)),i):n.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(r=!!e,i):r},i.clamp=function(e){return arguments.length?(t.clamp(e),i):t.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return jh(t.domain(),n).round(r).clamp(t.clamp()).unknown(e)},SF.apply(i,arguments),E1(i)}function jm(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function jg(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function jy(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:+(e>t))}function jb(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function jv(){var e,t=[],n=[],r=[];function i(){var e=0,i=Math.max(1,n.length);for(r=Array(i-1);++e<i;)r[e-1]=function(e,t,n=EM){if(!(!(r=e.length)||isNaN(t*=1))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(n(e[o+1],o+1,e)-a)*(i-o)}}(t,e/i);return o}function o(t){return null==t||isNaN(t*=1)?e:n[ET(r,t)]}return o.invertExtent=function(e){var i=n.indexOf(e);return i<0?[0/0,0/0]:[i>0?r[i-1]:t[0],i<r.length?r[i]:t[t.length-1]]},o.domain=function(e){if(!arguments.length)return t.slice();for(let n of(t=[],e))null==n||isNaN(n*=1)||t.push(n);return t.sort(EO),i()},o.range=function(e){return arguments.length?(n=Array.from(e),i()):n.slice()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.quantiles=function(){return r.slice()},o.copy=function(){return jv().domain(t).range(n).unknown(e)},SF.apply(o,arguments)}function jx(){var e,t=0,n=1,r=1,i=[.5],o=[0,1];function a(t){return null!=t&&t<=t?o[ET(i,t,0,r)]:e}function l(){var e=-1;for(i=Array(r);++e<r;)i[e]=((e+1)*n-(e-r)*t)/(r+1);return a}return a.domain=function(e){return arguments.length?([t,n]=e,t*=1,n*=1,l()):[t,n]},a.range=function(e){return arguments.length?(r=(o=Array.from(e)).length-1,l()):o.slice()},a.invertExtent=function(e){var a=o.indexOf(e);return a<0?[0/0,0/0]:a<1?[t,i[0]]:a>=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(t){return arguments.length&&(e=t),a},a.thresholds=function(){return i.slice()},a.copy=function(){return jx().domain([t,n]).range(o).unknown(e)},SF.apply(E1(a),arguments)}function jw(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[ET(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(r=Math.min((t=Array.from(e)).length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return jw().domain(t).range(n).unknown(e)},SF.apply(i,arguments)}F=(B=function(e){var t,n,r,i=void 0===e.grouping||void 0===e.thousands?EY:(t=EJ.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,l=t[0],s=0;i>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),o.push(e.substring(i-=l,i+l)),!((s+=l+1)>r));)l=t[a=(a+1)%t.length];return o.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",l=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?EY:(r=EJ.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return r[+e]})}),c=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",d=void 0===e.nan?"NaN":e.nan+"";function f(e,t){var n=(e=EZ(e)).fill,r=e.align,f=e.sign,p=e.symbol,h=e.zero,m=e.width,g=e.comma,y=e.precision,b=e.trim,v=e.type;"n"===v?(g=!0,v="g"):EX[v]||(void 0===y&&(y=12),b=!0,v="g"),(h||"0"===n&&"="===r)&&(h=!0,n="0",r="=");var x=(t&&void 0!==t.prefix?t.prefix:"")+("$"===p?o:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():""),w=("$"===p?a:/[%p]/.test(v)?c:"")+(t&&void 0!==t.suffix?t.suffix:""),k=EX[v],_=/[defgprs%]/.test(v);function S(e){var t,o,a,c=x,p=w;if("c"===v)p=k(e)+p,e="";else{var S=(e*=1)<0||1/e<0;if(e=isNaN(e)?d:k(Math.abs(e),y),b&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==f&&(S=!1),c=(S?"("===f?f:u:"-"===f||"("===f?"":f)+c,p=("s"!==v||isNaN(e)||void 0===$?"":EQ[8+$/3])+p+(S&&"("===f?")":""),_){for(t=-1,o=e.length;++t<o;)if(48>(a=e.charCodeAt(t))||a>57){p=(46===a?l+e.slice(t+1):e.slice(t))+p,e=e.slice(0,t);break}}}g&&!h&&(e=i(e,1/0));var E=c.length+e.length+p.length,j=E<m?Array(m-E+1).join(n):"";switch(g&&h&&(e=i(j+e,j.length?m-p.length:1/0),j=""),r){case"<":e=c+e+p+j;break;case"=":e=c+j+e+p;break;case"^":e=j.slice(0,E=j.length>>1)+c+e+p+j.slice(E);break;default:e=j+c+e+p}return s(e)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),S.toString=function(){return e+""},S}return{format:f,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(EW(t)/3))),r=Math.pow(10,-n),i=f(((e=EZ(e)).type="f",e),{suffix:EQ[8+n/3]});return function(e){return i(r*e)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,U=B.formatPrefix;let jk=new Date,j_=new Date;function jS(e,t,n,r){function i(t){return e(t=0==arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{let a,l=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return l;do l.push(a=new Date(+n)),t(n,o),e(n);while(a<n&&n<r)return l},i.filter=n=>jS(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(jk.setTime(+t),j_.setTime(+r),e(jk),e(j_),Math.floor(n(jk,j_))),i.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null),i}let jE=jS(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());jE.every=e=>isFinite(e=Math.floor(e))&&e>0?jS(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,jE.range;let jj=jS(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());jj.every=e=>isFinite(e=Math.floor(e))&&e>0?jS(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,jj.range;let jO=jS(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());jO.range;let jN=jS(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jN.range;function jC(e){return jS(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}let jA=jC(0),jM=jC(1),jP=jC(2),jT=jC(3),jI=jC(4),jD=jC(5),jz=jC(6);function jR(e){return jS(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}jA.range,jM.range,jP.range,jT.range,jI.range,jD.range,jz.range;let jL=jR(0),j$=jR(1),jB=jR(2),jF=jR(3),jU=jR(4),jH=jR(5),jK=jR(6);jL.range,j$.range,jB.range,jF.range,jU.range,jH.range,jK.range;let jW=jS(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);jW.range;let jq=jS(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);jq.range;let jZ=jS(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));jZ.range;let jV=jS(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());jV.range;let jG=jS(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());jG.range;let jX=jS(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());jX.range;let jY=jS(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());jY.range;let jJ=jS(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());jJ.range;let jQ=jS(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);function j0(e,t,n,r,i,o){let a=[[jJ,1,1e3],[jJ,5,5e3],[jJ,15,15e3],[jJ,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function l(t,n,r){let i=Math.abs(n-t)/r,o=EC(([,,e])=>e).right(a,i);if(o===a.length)return e.every(Ej(t/31536e6,n/31536e6,r));if(0===o)return jQ.every(Math.max(Ej(t,n,r),1));let[l,s]=a[i/a[o-1][2]<a[o][2]/i?o-1:o];return l.every(s)}return[function(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&"function"==typeof n.range?n:l(e,t,n),o=i?i.range(e,+t+1):[];return r?o.reverse():o},l]}jQ.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?jS(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):jQ:null,jQ.range;let[j1,j2]=j0(jj,jN,jL,jZ,jG,jY),[j3,j4]=j0(jE,jO,jA,jW,jV,jX);function j9(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function j5(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function j6(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var j8={"-":"",_:" ",0:"0"},j7=/^\s*\d+/,Oe=/^%/,Ot=/[\\^$*+?|[\]().{}]/g;function On(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?Array(n-o+1).join(t)+i:i)}function Or(e){return e.replace(Ot,"\\$&")}function Oi(e){return RegExp("^(?:"+e.map(Or).join("|")+")","i")}function Oo(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Oa(e,t,n){var r=j7.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ol(e,t,n){var r=j7.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Os(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Oc(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ou(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Od(e,t,n){var r=j7.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Of(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Op(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Oh(e,t,n){var r=j7.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Om(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Og(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Oy(e,t,n){var r=j7.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ob(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ov(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ox(e,t,n){var r=j7.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ow(e,t,n){var r=j7.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ok(e,t,n){var r=j7.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function O_(e,t,n){var r=Oe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function OS(e,t,n){var r=j7.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function OE(e,t,n){var r=j7.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Oj(e,t){return On(e.getDate(),t,2)}function OO(e,t){return On(e.getHours(),t,2)}function ON(e,t){return On(e.getHours()%12||12,t,2)}function OC(e,t){return On(1+jW.count(jE(e),e),t,3)}function OA(e,t){return On(e.getMilliseconds(),t,3)}function OM(e,t){return OA(e,t)+"000"}function OP(e,t){return On(e.getMonth()+1,t,2)}function OT(e,t){return On(e.getMinutes(),t,2)}function OI(e,t){return On(e.getSeconds(),t,2)}function OD(e){var t=e.getDay();return 0===t?7:t}function Oz(e,t){return On(jA.count(jE(e)-1,e),t,2)}function OR(e){var t=e.getDay();return t>=4||0===t?jI(e):jI.ceil(e)}function OL(e,t){return e=OR(e),On(jI.count(jE(e),e)+(4===jE(e).getDay()),t,2)}function O$(e){return e.getDay()}function OB(e,t){return On(jM.count(jE(e)-1,e),t,2)}function OF(e,t){return On(e.getFullYear()%100,t,2)}function OU(e,t){return On((e=OR(e)).getFullYear()%100,t,2)}function OH(e,t){return On(e.getFullYear()%1e4,t,4)}function OK(e,t){var n=e.getDay();return On((e=n>=4||0===n?jI(e):jI.ceil(e)).getFullYear()%1e4,t,4)}function OW(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+On(t/60|0,"0",2)+On(t%60,"0",2)}function Oq(e,t){return On(e.getUTCDate(),t,2)}function OZ(e,t){return On(e.getUTCHours(),t,2)}function OV(e,t){return On(e.getUTCHours()%12||12,t,2)}function OG(e,t){return On(1+jq.count(jj(e),e),t,3)}function OX(e,t){return On(e.getUTCMilliseconds(),t,3)}function OY(e,t){return OX(e,t)+"000"}function OJ(e,t){return On(e.getUTCMonth()+1,t,2)}function OQ(e,t){return On(e.getUTCMinutes(),t,2)}function O0(e,t){return On(e.getUTCSeconds(),t,2)}function O1(e){var t=e.getUTCDay();return 0===t?7:t}function O2(e,t){return On(jL.count(jj(e)-1,e),t,2)}function O3(e){var t=e.getUTCDay();return t>=4||0===t?jU(e):jU.ceil(e)}function O4(e,t){return e=O3(e),On(jU.count(jj(e),e)+(4===jj(e).getUTCDay()),t,2)}function O9(e){return e.getUTCDay()}function O5(e,t){return On(j$.count(jj(e)-1,e),t,2)}function O6(e,t){return On(e.getUTCFullYear()%100,t,2)}function O8(e,t){return On((e=O3(e)).getUTCFullYear()%100,t,2)}function O7(e,t){return On(e.getUTCFullYear()%1e4,t,4)}function Ne(e,t){var n=e.getUTCDay();return On((e=n>=4||0===n?jU(e):jU.ceil(e)).getUTCFullYear()%1e4,t,4)}function Nt(){return"+0000"}function Nn(){return"%"}function Nr(e){return+e}function Ni(e){return Math.floor(e/1e3)}function No(e){return new Date(e)}function Na(e){return e instanceof Date?+e:+new Date(+e)}function Nl(e,t,n,r,i,o,a,l,s,c){var u=EH(),d=u.invert,f=u.domain,p=c(".%L"),h=c(":%S"),m=c("%I:%M"),g=c("%I %p"),y=c("%a %d"),b=c("%b %d"),v=c("%B"),x=c("%Y");function w(e){return(s(e)<e?p:l(e)<e?h:a(e)<e?m:o(e)<e?g:r(e)<e?i(e)<e?y:b:n(e)<e?v:x)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,Na)):f().map(No)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?w:c(t)},u.nice=function(e){var n=f();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(E4(n,e)):u},u.copy=function(){return EF(u,Nl(e,t,n,r,i,o,a,l,s,c))},u}function Ns(){return SF.apply(Nl(j3,j4,jE,jO,jA,jW,jV,jX,jJ,K).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Nc(){return SF.apply(Nl(j1,j2,jj,jN,jL,jq,jG,jY,jJ,W).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Nu(){var e,t,n,r,i,o=0,a=1,l=ER,s=!1;function c(t){return null==t||isNaN(t*=1)?i:l(0===n?.5:(t=(r(t)-e)*n,s?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,l=e(n,r),c):[l(0),l(1)]}}return c.domain=function(i){return arguments.length?([o,a]=i,e=r(o*=1),t=r(a*=1),n=e===t?0:1/(t-e),c):[o,a]},c.clamp=function(e){return arguments.length?(s=!!e,c):s},c.interpolator=function(e){return arguments.length?(l=e,c):l},c.range=u(gk),c.rangeRound=u(EI),c.unknown=function(e){return arguments.length?(i=e,c):i},function(i){return r=i,e=i(o),t=i(a),n=e===t?0:1/(t-e),c}}function Nd(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Nf(){var e=E1(Nu()(ER));return e.copy=function(){return Nd(e,Nf())},SU.apply(e,arguments)}function Np(){var e=jt(Nu()).domain([1,10]);return e.copy=function(){return Nd(e,Np()).base(e.base())},SU.apply(e,arguments)}function Nh(){var e=jo(Nu());return e.copy=function(){return Nd(e,Nh()).constant(e.constant())},SU.apply(e,arguments)}function Nm(){var e=ju(Nu());return e.copy=function(){return Nd(e,Nm()).exponent(e.exponent())},SU.apply(e,arguments)}function Ng(){return Nm.apply(null,arguments).exponent(.5)}function Ny(){var e=[],t=ER;function n(n){if(null!=n&&!isNaN(n*=1))return t((ET(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();for(let n of(e=[],t))null==n||isNaN(n*=1)||e.push(n);return e.sort(EO),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>(function(e,t){if(!(!(n=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r*=1)>=r&&(yield r)}}(e,void 0))).length)||isNaN(t*=1))){if(t<=0||n<2)return jg(e);if(t>=1)return jm(e);var n,r=(n-1)*t,i=Math.floor(r),o=jm((function e(t,n,r=0,i=1/0,o){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),i=Math.floor(Math.min(t.length-1,i)),!(r<=n&&n<=i))return t;for(o=void 0===o?jy:function(e=EO){if(e===EO)return jy;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(o);i>r;){if(i-r>600){let a=i-r+1,l=n-r+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(l-a/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/a+u)),f=Math.min(i,Math.floor(n+(a-l)*c/a+u));e(t,n,d,f,o)}let a=t[n],l=r,s=i;for(jb(t,r,n),o(t[i],a)>0&&jb(t,r,i);l<s;){for(jb(t,l,s),++l,--s;0>o(t[l],a);)++l;for(;o(t[s],a)>0;)--s}0===o(t[r],a)?jb(t,r,s):jb(t,++s,i),s<=n&&(r=s+1),n<=s&&(i=s-1)}return t})(e,i).subarray(0,i+1));return o+(jg(e.subarray(i+1))-o)*(r-i)}})(e,r/t))},n.copy=function(){return Ny(t).domain(e)},SU.apply(n,arguments)}function Nb(){var e,t,n,r,i,o,a,l=0,s=.5,c=1,u=1,d=ER,f=!1;function p(e){return isNaN(e*=1)?a:(e=.5+((e=+o(e))-t)*(u*e<u*t?r:i),d(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,d=function(e,t){void 0===t&&(t=e,e=gk);for(var n=0,r=t.length-1,i=t[0],o=Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return o[t](e-t)}}(e,[n,r,i]),p):[d(0),d(.5),d(1)]}}return p.domain=function(a){return arguments.length?([l,s,c]=a,e=o(l*=1),t=o(s*=1),n=o(c*=1),r=e===t?0:.5/(t-e),i=t===n?0:.5/(n-t),u=t<e?-1:1,p):[l,s,c]},p.clamp=function(e){return arguments.length?(f=!!e,p):f},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=h(gk),p.rangeRound=h(EI),p.unknown=function(e){return arguments.length?(a=e,p):a},function(a){return o=a,e=a(l),t=a(s),n=a(c),r=e===t?0:.5/(t-e),i=t===n?0:.5/(n-t),u=t<e?-1:1,p}}function Nv(){var e=E1(Nb()(ER));return e.copy=function(){return Nd(e,Nv())},SU.apply(e,arguments)}function Nx(){var e=jt(Nb()).domain([.1,1,10]);return e.copy=function(){return Nd(e,Nx()).base(e.base())},SU.apply(e,arguments)}function Nw(){var e=jo(Nb());return e.copy=function(){return Nd(e,Nw()).constant(e.constant())},SU.apply(e,arguments)}function Nk(){var e=ju(Nb());return e.copy=function(){return Nd(e,Nk()).exponent(e.exponent())},SU.apply(e,arguments)}function N_(){return Nk.apply(null,arguments).exponent(.5)}K=(H=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,l=e.months,s=e.shortMonths,c=Oi(i),u=Oo(i),d=Oi(o),f=Oo(o),p=Oi(a),h=Oo(a),m=Oi(l),g=Oo(l),y=Oi(s),b=Oo(s),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:Oj,e:Oj,f:OM,g:OU,G:OK,H:OO,I:ON,j:OC,L:OA,m:OP,M:OT,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Nr,s:Ni,S:OI,u:OD,U:Oz,V:OL,w:O$,W:OB,x:null,X:null,y:OF,Y:OH,Z:OW,"%":Nn},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:Oq,e:Oq,f:OY,g:O8,G:Ne,H:OZ,I:OV,j:OG,L:OX,m:OJ,M:OQ,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Nr,s:Ni,S:O0,u:O1,U:O2,V:O4,w:O9,W:O5,x:null,X:null,y:O6,Y:O7,Z:Nt,"%":Nn},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:Og,e:Og,f:Ok,g:Of,G:Od,H:Ob,I:Ob,j:Oy,L:Ow,m:Om,M:Ov,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:Oh,Q:OS,s:OE,S:Ox,u:Ol,U:Os,V:Oc,w:Oa,W:Ou,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:Of,Y:Od,Z:Op,"%":O_};function k(e,t){return function(n){var r,i,o,a=[],l=-1,s=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l<c;)37===e.charCodeAt(l)&&(a.push(e.slice(s,l)),null!=(i=j8[r=e.charAt(++l)])?r=e.charAt(++l):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),s=l+1);return a.push(e.slice(s,l)),a.join("")}}function _(e,t){return function(n){var r,i,o=j6(1900,void 0,1);if(S(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(!t||"Z"in o||(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=(r=j5(j6(o.y,0,1))).getUTCDay())>4||0===i?j$.ceil(r):j$(r),r=jq.offset(r,(o.V-1)*7),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(r=(i=(r=j9(j6(o.y,0,1))).getDay())>4||0===i?jM.ceil(r):jM(r),r=jW.offset(r,(o.V-1)*7),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:+("W"in o)),i="Z"in o?j5(j6(o.y,0,1)).getUTCDay():j9(j6(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,j5(o)):j9(o)}}function S(e,t,n,r){for(var i,o,a=0,l=t.length,s=n.length;a<l;){if(r>=s)return -1;if(37===(i=t.charCodeAt(a++))){if(!(o=w[(i=t.charAt(a++))in j8?t.charAt(a++):i])||(r=o(e,n,r))<0)return -1}else if(i!=n.charCodeAt(r++))return -1}return r}return v.x=k(n,v),v.X=k(r,v),v.c=k(t,v),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=_(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=_(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,H.parse,W=H.utcFormat,H.utcParse,e.s(["scaleBand",0,SV,"scaleDiverging",0,Nv,"scaleDivergingLog",0,Nx,"scaleDivergingPow",0,Nk,"scaleDivergingSqrt",0,N_,"scaleDivergingSymlog",0,Nw,"scaleIdentity",0,E3,"scaleImplicit",0,Sq,"scaleLinear",0,E2,"scaleLog",0,jn,"scaleOrdinal",0,SZ,"scalePoint",0,SG,"scalePow",0,jd,"scaleQuantile",0,jv,"scaleQuantize",0,jx,"scaleRadial",0,jh,"scaleSequential",0,Nf,"scaleSequentialLog",0,Np,"scaleSequentialPow",0,Nm,"scaleSequentialQuantile",0,Ny,"scaleSequentialSqrt",0,Ng,"scaleSequentialSymlog",0,Nh,"scaleSqrt",0,jf,"scaleSymlog",0,ja,"scaleThreshold",0,jw,"scaleTime",0,Ns,"scaleUtc",0,Nc,"tickFormat",0,E0],29061),e.i(29061),e.s(["scaleBand",0,SV,"scaleDiverging",0,Nv,"scaleDivergingLog",0,Nx,"scaleDivergingPow",0,Nk,"scaleDivergingSqrt",0,N_,"scaleDivergingSymlog",0,Nw,"scaleIdentity",0,E3,"scaleImplicit",0,Sq,"scaleLinear",0,E2,"scaleLog",0,jn,"scaleOrdinal",0,SZ,"scalePoint",0,SG,"scalePow",0,jd,"scaleQuantile",0,jv,"scaleQuantize",0,jx,"scaleRadial",0,jh,"scaleSequential",0,Nf,"scaleSequentialLog",0,Np,"scaleSequentialPow",0,Nm,"scaleSequentialQuantile",0,Ny,"scaleSequentialSqrt",0,Ng,"scaleSequentialSymlog",0,Nh,"scaleSqrt",0,jf,"scaleSymlog",0,ja,"scaleThreshold",0,jw,"scaleTime",0,Ns,"scaleUtc",0,Nc,"tickFormat",0,E0],79357);var NS=e.i(79357);function NE(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Nj(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],l=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function NO(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function NN(e,t){return e[t]}function NC(e){let t=[];return t.key=e,t}Array.prototype.slice;var NA=e.i(86966),NM=e.i(12393),NP=e.i(33303),NT=e.i(98892),NI=e.i(51655);function ND(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Nz=function(e){return e},NR={"@@functional/placeholder":!0},NL=function(e){return e===NR},N$=function(e){return function t(){return 0==arguments.length||1==arguments.length&&NL(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},NB=function(e){return function e(t,n){return 1===t?n:N$(function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i.filter(function(e){return e!==NR}).length;return a>=t?n.apply(void 0,i):e(t-a,N$(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=i.map(function(e){return NL(e)?t.shift():e});return n.apply(void 0,((function(e){if(Array.isArray(e))return ND(e)})(o)||function(e){if("u">typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(o)||function(e){if(e){if("string"==typeof e)return ND(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ND(e,void 0)}}(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(t))}))})}(e.length,e)},NF=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},NU=NB(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),NH=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.length)return Nz;var r=t.reverse(),i=r[0],o=r.slice(1);return function(){return o.reduce(function(e,t){return t(e)},i.apply(void 0,arguments))}},NK=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},NW=function(e){var t=null,n=null;return function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];return t&&i.every(function(e,n){return e===t[n]})?n:(t=i,n=e.apply(void 0,i))}};NB(function(e,t,n){var r=+e;return r+n*(t-r)}),NB(function(e,t,n){var r=t-e;return(n-e)/(r=r||1/0)}),NB(function(e,t,n){var r=t-e;return Math.max(0,Math.min(1,(n-e)/(r=r||1/0)))});let Nq=function(e,t,n){for(var r=new NI.default(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o},NZ=function(e){return 0===e?1:Math.floor(new NI.default(e).abs().log(10).toNumber())+1};function NV(e){return function(e){if(Array.isArray(e))return NY(e)}(e)||function(e){if("u">typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||NX(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("u">typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}}(e,t)||NX(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NX(e,t){if(e){if("string"==typeof e)return NY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NY(e,t)}}function NY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function NJ(e){var t=NG(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function NQ(e,t,n){if(e.lte(0))return new NI.default(0);var r=NZ(e.toNumber()),i=new NI.default(10).pow(r),o=e.div(i),a=1!==r?.05:.1,l=new NI.default(Math.ceil(o.div(a).toNumber())).add(n).mul(a).mul(i);return t?l:new NI.default(Math.ceil(l))}function N0(e,t,n){var r=1,i=new NI.default(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new NI.default(10).pow(NZ(e)-1),i=new NI.default(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new NI.default(Math.floor(e)))}else 0===e?i=new NI.default(Math.floor((t-1)/2)):n||(i=new NI.default(Math.floor(e)));var a=Math.floor((t-1)/2);return NH(NU(function(e){return i.add(new NI.default(e-a).mul(r)).toNumber()}),NF)(0,t)}var N1=NW(function(e){var t=NG(e,2),n=t[0],r=t[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(i,2),l=NG(NJ([n,r]),2),s=l[0],c=l[1];if(-1/0===s||1/0===c){var u=1/0===c?[s].concat(NV(NF(0,i-1).map(function(){return 1/0}))):[].concat(NV(NF(0,i-1).map(function(){return -1/0})),[c]);return n>r?NK(u):u}if(s===c)return N0(s,i,o);var d=function e(t,n,r,i){var o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new NI.default(0),tickMin:new NI.default(0),tickMax:new NI.default(0)};var l=NQ(new NI.default(n).sub(t).div(r-1),i,a),s=Math.ceil((o=t<=0&&n>=0?new NI.default(0):(o=new NI.default(t).add(n).div(2)).sub(new NI.default(o).mod(l))).sub(t).div(l).toNumber()),c=Math.ceil(new NI.default(n).sub(o).div(l).toNumber()),u=s+c+1;return u>r?e(t,n,r,i,a+1):(u<r&&(c=n>0?c+(r-u):c,s=n>0?s:s+(r-u)),{step:l,tickMin:o.sub(new NI.default(s).mul(l)),tickMax:o.add(new NI.default(c).mul(l))})}(s,c,a,o),f=d.step,p=Nq(d.tickMin,d.tickMax.add(new NI.default(.1).mul(f)),f);return n>r?NK(p):p});NW(function(e){var t=NG(e,2),n=t[0],r=t[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(i,2),l=NG(NJ([n,r]),2),s=l[0],c=l[1];if(-1/0===s||1/0===c)return[n,r];if(s===c)return N0(s,i,o);var u=NQ(new NI.default(c).sub(s).div(a-1),o,0),d=NH(NU(function(e){return new NI.default(s).add(new NI.default(e).mul(u)).toNumber()}),NF)(0,a).filter(function(e){return e>=s&&e<=c});return n>r?NK(d):d});var N2=NW(function(e,t){var n=NG(e,2),r=n[0],i=n[1],o=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=NG(NJ([r,i]),2),l=a[0],s=a[1];if(-1/0===l||1/0===s)return[r,i];if(l===s)return[l];var c=Math.max(t,2),u=NQ(new NI.default(s).sub(l).div(c-1),o,0),d=[].concat(NV(Nq(new NI.default(l),new NI.default(s).sub(new NI.default(.99).mul(u)),u)),[s]);return r>i?NK(d):d}),N3=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function N4(e){return(N4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N9(){return(N9=Object.assign.bind()).apply(this,arguments)}function N5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N6=function(){return!!e})()}function N8(e){return(N8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function N7(e,t){return(N7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e,t,n){return(t=Ct(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(e){var t=function(e,t){if("object"!=N4(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=N4(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==N4(t)?t:t+""}var Cn=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=N8(e),function(e,t){if(t&&("object"===N4(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,N6()?Reflect.construct(e,t||[],N8(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&N7(n,e),t=[{key:"render",value:function(){var e=this.props,t=e.offset,n=e.layout,r=e.width,i=e.dataKey,o=e.data,a=e.dataPointFormatter,l=e.xAxis,s=e.yAxis,c=wh(function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,N3),!1);"x"===this.props.direction&&"number"!==l.type&&wj(!1);var u=o.map(function(e){var o,u,d=a(e,i),f=d.x,p=d.y,h=d.value,m=d.errorVal;if(!m)return null;var g=[];if(Array.isArray(m)){var y=function(e){if(Array.isArray(e))return e}(m)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(m)||function(e){if(e){if("string"==typeof e)return N5(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N5(e,2)}}(m)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=y[0],u=y[1]}else o=u=m;if("vertical"===n){var b=l.scale,v=p+t,x=v+r,w=v-r,k=b(h-o),_=b(h+u);g.push({x1:_,y1:x,x2:_,y2:w}),g.push({x1:k,y1:v,x2:_,y2:v}),g.push({x1:k,y1:x,x2:k,y2:w})}else if("horizontal"===n){var S=s.scale,E=f+t,j=E-r,O=E+r,N=S(h-o),C=S(h+u);g.push({x1:j,y1:C,x2:O,y2:C}),g.push({x1:E,y1:N,x2:E,y2:C}),g.push({x1:j,y1:N,x2:O,y2:N})}return G.default.createElement(wP,N9({className:"recharts-errorBar",key:"bar-".concat(g.map(function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))},c),g.map(function(e){return G.default.createElement("line",N9({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))}))});return G.default.createElement(wP,{className:"recharts-errorBars"},u)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ct(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.default.Component);function Cr(e){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ci(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ci(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=Cr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Cr(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Cr(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ci(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Ce(Cn,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"}),Ce(Cn,"displayName","ErrorBar");var Ca=function(e){var t,n=e.children,r=e.formattedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=wu(n,k1);if(!a)return null;var l=k1.defaultProps,s=void 0!==l?Co(Co({},l),a.props):{};return t=a.props&&a.props.payload?a.props&&a.props.payload:"children"===o?(r||[]).reduce(function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map(function(e){return{type:a.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(r||[]).map(function(e){var t=e.item,n=t.type.defaultProps,r=void 0!==n?Co(Co({},n),t.props):{},i=r.dataKey,o=r.name,a=r.legendType;return{inactive:r.hide,dataKey:i,type:s.iconType||a||"square",color:Cg(t),value:o||i,payload:r}}),Co(Co(Co({},s),k1.getWithHeight(a,i)),{},{payload:t,item:a})};function Cl(e){return(Cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cs(e){return function(e){if(Array.isArray(e))return Cc(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return Cc(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cc(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cu(Object(n),!0).forEach(function(t){Cf(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cf(e,t,n){var r;return(r=function(e,t){if("object"!=Cl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Cl(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==Cl(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cp(e,t,n){return(0,x$.default)(e)||(0,x$.default)(t)?n:xH(t)?(0,xR.default)(e,t,n):(0,xQ.default)(t)?t(e):n}function Ch(e,t,n,r){var i=(0,NP.default)(e,function(e){return Cp(e,t)});if("number"===n){var o=i.filter(function(e){return xU(e)||parseFloat(e)});return o.length?[(0,NM.default)(o),(0,NA.default)(o)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,x$.default)(e)}):i).map(function(e){return xH(e)||e instanceof Date?e:""})}var Cm=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,a=null!=(t=null==n?void 0:n.length)?t:0;if(a<=1)return 0;if(i&&"angleAxis"===i.axisType&&1e-6>=Math.abs(Math.abs(i.range[1]-i.range[0])-360))for(var l=i.range,s=0;s<a;s++){var c=s>0?r[s-1].coordinate:r[a-1].coordinate,u=r[s].coordinate,d=s>=a-1?r[0].coordinate:r[s+1].coordinate,f=void 0;if(xB(u-c)!==xB(d-u)){var p=[];if(xB(d-u)===xB(l[1]-l[0])){f=d;var h=u+l[1]-l[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+l[1]-l[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>g[0]&&e<=g[1]||e>=p[0]&&e<=p[1]){o=r[s].index;break}}else{var y=Math.min(c,d),b=Math.max(c,d);if(e>(y+u)/2&&e<=(b+u)/2){o=r[s].index;break}}}else for(var v=0;v<a;v++)if(0===v&&e<=(n[v].coordinate+n[v+1].coordinate)/2||v>0&&v<a-1&&e>(n[v].coordinate+n[v-1].coordinate)/2&&e<=(n[v].coordinate+n[v+1].coordinate)/2||v===a-1&&e>(n[v].coordinate+n[v-1].coordinate)/2){o=n[v].index;break}return o},Cg=function(e){var t,n,r=e.type.displayName,i=null!=(t=e.type)&&t.defaultProps?Cd(Cd({},e.type.defaultProps),e.props):e.props,o=i.stroke,a=i.fill;switch(r){case"Line":n=o;break;case"Area":case"Radar":n=o&&"none"!==o?o:a;break;default:n=a}return n},Cy=function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,i=void 0===r?{}:r;if(!i)return{};for(var o={},a=Object.keys(i),l=0,s=a.length;l<s;l++)for(var c=i[a[l]].stackGroups,u=Object.keys(c),d=0,f=u.length;d<f;d++){var p=c[u[d]],h=p.items,m=p.cateAxisId,g=h.filter(function(e){return wo(e.type).indexOf("Bar")>=0});if(g&&g.length){var y=g[0].type.defaultProps,b=void 0!==y?Cd(Cd({},y),g[0].props):g[0].props,v=b.barSize,x=b[m];o[x]||(o[x]=[]);var w=(0,x$.default)(v)?t:v;o[x].push({item:g[0],stackList:g.slice(1),barSize:(0,x$.default)(w)?void 0:xq(w,n,0)})}}return o},Cb=function(e){var t,n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=void 0===o?[]:o,l=e.maxBarSize,s=a.length;if(s<1)return null;var c=xq(n,i,0,!0),u=[];if(a[0].barSize===+a[0].barSize){var d=!1,f=i/s,p=a.reduce(function(e,t){return e+t.barSize||0},0);(p+=(s-1)*c)>=i&&(p-=(s-1)*c,c=0),p>=i&&f>0&&(d=!0,f*=.9,p=s*f);var h={offset:((i-p)/2|0)-c,size:0};t=a.reduce(function(e,t){var n={item:t.item,position:{offset:h.offset+h.size+c,size:d?f:t.barSize}},r=[].concat(Cs(e),[n]);return h=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:h})}),r},u)}else{var m=xq(r,i,0,!0);i-2*m-(s-1)*c<=0&&(c=0);var g=(i-2*m-(s-1)*c)/s;g>1&&(g>>=0);var y=l===+l?Math.min(g,l):g;t=a.reduce(function(e,t,n){var r=[].concat(Cs(e),[{item:t.item,position:{offset:m+(g+c)*n+(g-y)/2,size:y}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return t},Cv=function(e,t,n,r){var i=n.children,o=n.width,a=n.margin,l=Ca({children:i,legendWidth:o-(a.left||0)-(a.right||0)});if(l){var s=r||{},c=s.width,u=s.height,d=l.align,f=l.verticalAlign,p=l.layout;if(("vertical"===p||"horizontal"===p&&"middle"===f)&&"center"!==d&&xU(e[d]))return Cd(Cd({},e),{},Cf({},d,e[d]+(c||0)));if(("horizontal"===p||"vertical"===p&&"center"===d)&&"middle"!==f&&xU(e[f]))return Cd(Cd({},e),{},Cf({},f,e[f]+(u||0)))}return e},Cx=function(e,t,n,r,i){var o=wc(t.props.children,Cn).filter(function(e){var t;return t=e.props.direction,!!(0,x$.default)(i)||("horizontal"===r?"yAxis"===i:"vertical"===r||"x"===t?"xAxis"===i:"y"!==t||"yAxis"===i)});if(o&&o.length){var a=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=Cp(t,n);if((0,x$.default)(r))return e;var i=Array.isArray(r)?[(0,NM.default)(r),(0,NA.default)(r)]:[r,r],o=a.reduce(function(e,n){var r=Cp(t,n,0),o=i[0]-Math.abs(Array.isArray(r)?r[0]:r),a=i[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(o,e[0]),Math.max(a,e[1])]},[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]},[1/0,-1/0])}return null},Cw=function(e,t,n,r,i){var o=t.map(function(t){return Cx(e,t,n,i,r)}).filter(function(e){return!(0,x$.default)(e)});return o&&o.length?o.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},Ck=function(e,t,n,r,i){var o=t.map(function(t){var o=t.props.dataKey;return"number"===n&&o&&Cx(e,t,o,r)||Ch(e,o,n,i)});if("number"===n)return o.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var a={};return o.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)a[t[n]]||(a[t[n]]=!0,e.push(t[n]));return e},[])},C_=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},CS=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var i,o,a=e.map(function(e){return e.coordinate===t&&(i=!0),e.coordinate===n&&(o=!0),e.coordinate});return i||a.push(t),o||a.push(n),a},CE=function(e,t,n){if(!e)return null;var r=e.scale,i=e.duplicateDomain,o=e.type,a=e.range,l="scaleBand"===e.realScaleType?r.bandwidth()/2:2,s=(t||n)&&"category"===o&&r.bandwidth?r.bandwidth()/l:0;return(s="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*xB(a[0]-a[1])*s:s,t&&(e.ticks||e.niceTicks))?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(i?i.indexOf(e):e)+s,value:e,offset:s}}).filter(function(e){return!(0,xz.default)(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+s,value:e,index:t,offset:s}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+s,value:e,offset:s}}):r.domain().map(function(e,t){return{coordinate:r(e)+s,value:i?i[e]:e,index:t,offset:s}})},Cj=new WeakMap,CO=function(e,t){if("function"!=typeof t)return e;Cj.has(e)||Cj.set(e,new WeakMap);var n=Cj.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},CN=function(e,t,n){var r=e.scale,i=e.type,o=e.layout,a=e.axisType;if("auto"===r)return"radial"===o&&"radiusAxis"===a?{scale:NS.scaleBand(),realScaleType:"band"}:"radial"===o&&"angleAxis"===a?{scale:NS.scaleLinear(),realScaleType:"linear"}:"category"===i&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!n)?{scale:NS.scalePoint(),realScaleType:"point"}:"category"===i?{scale:NS.scaleBand(),realScaleType:"band"}:{scale:NS.scaleLinear(),realScaleType:"linear"};if((0,xD.default)(r)){var l="scale".concat((0,kr.default)(r));return{scale:(NS[l]||NS.scalePoint)(),realScaleType:NS[l]?l:"point"}}return(0,xQ.default)(r)?{scale:r}:{scale:NS.scalePoint(),realScaleType:"point"}},CC=function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-1e-4,o=Math.max(r[0],r[1])+1e-4,a=e(t[0]),l=e(t[n-1]);(a<i||a>o||l<i||l>o)&&e.domain([t[0],t[n-1]])}},CA=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},CM=function(e,t){if(!t||2!==t.length||!xU(t[0])||!xU(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!xU(e[0])||e[0]<n)&&(i[0]=n),(!xU(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},CP={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,o=0,a=0;a<t;++a){var l=(0,xz.default)(e[a][n][1])?e[a][n][0]:e[a][n][1];l>=0?(e[a][n][0]=i,e[a][n][1]=i+l,i=e[a][n][1]):(e[a][n][0]=o,e[a][n][1]=o+l,o=e[a][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}Nj(e,t)}},none:Nj,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,l=0;a<n;++a)l+=e[a][r][1]||0;i[r][1]+=i[r][0]=-l/2}Nj(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var l=0,s=0,c=0;l<i;++l){for(var u=e[t[l]],d=u[a][1]||0,f=(d-(u[a-1][1]||0))/2,p=0;p<l;++p){var h=e[t[p]];f+=(h[a][1]||0)-(h[a-1][1]||0)}s+=d,c+=f*d}n[a-1][1]+=n[a-1][0]=o,s&&(o-=c/s)}n[a-1][1]+=n[a-1][0]=o,Nj(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,o=0;o<t;++o){var a=(0,xz.default)(e[o][n][1])?e[o][n][0]:e[o][n][1];a>=0?(e[o][n][0]=i,e[o][n][1]=i+a,i=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}}},CT=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=CP[n];return(function(){var e=ki([]),t=NO,n=Nj,r=NN;function i(i){var o,a,l=Array.from(e.apply(this,arguments),NC),s=l.length,c=-1;for(let e of i)for(o=0,++c;o<s;++o)(l[o][c]=[0,+r(e,l[o].key,c,i)]).data=e;for(o=0,a=NE(t(l));o<s;++o)l[a[o]].index=o;return n(l,a),l}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:ki(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:ki(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?NO:"function"==typeof e?e:ki(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?Nj:e,i):n},i})().keys(r).value(function(e,t){return+Cp(e,t,0)}).order(NO).offset(i)(e)},CI=function(e,t,n,r,i,o){if(!e)return null;var a=(o?t.reverse():t).reduce(function(e,t){var i,o=null!=(i=t.type)&&i.defaultProps?Cd(Cd({},t.type.defaultProps),t.props):t.props,a=o.stackId;if(o.hide)return e;var l=o[n],s=e[l]||{hasStack:!1,stackGroups:{}};if(xH(a)){var c=s.stackGroups[a]||{numericAxisId:n,cateAxisId:r,items:[]};c.items.push(t),s.hasStack=!0,s.stackGroups[a]=c}else s.stackGroups[xW("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return Cd(Cd({},e),{},Cf({},l,s))},{});return Object.keys(a).reduce(function(t,o){var l=a[o];return l.hasStack&&(l.stackGroups=Object.keys(l.stackGroups).reduce(function(t,o){var a=l.stackGroups[o];return Cd(Cd({},t),{},Cf({},o,{numericAxisId:n,cateAxisId:r,items:a.items,stackedData:CT(e,a.items,i)}))},{})),Cd(Cd({},t),{},Cf({},o,l))},{})},CD=function(e,t){var n=t.realScaleType,r=t.type,i=t.tickCount,o=t.originalDomain,a=t.allowDecimals,l=n||t.scale;if("auto"!==l&&"linear"!==l)return null;if(i&&"number"===r&&o&&("auto"===o[0]||"auto"===o[1])){var s=e.domain();if(!s.length)return null;var c=N1(s,i,a);return e.domain([(0,NM.default)(c),(0,NA.default)(c)]),{niceTicks:c}}return i&&"number"===r?{niceTicks:N2(e.domain(),i,a)}:null};function Cz(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!(0,x$.default)(i[t.dataKey])){var l=xX(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var s=Cp(i,(0,x$.default)(a)?t.dataKey:a);return(0,x$.default)(s)?null:t.scale(s)}var CR=function(e){var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,o=e.entry,a=e.index;if("category"===t.type)return n[a]?n[a].coordinate+r:null;var l=Cp(o,t.dataKey,t.domain[a]);return(0,x$.default)(l)?null:t.scale(l)-i/2+r},CL=function(e){var t=e.numericAxis,n=t.scale.domain();if("number"===t.type){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},C$=function(e,t){var n,r=(null!=(n=e.type)&&n.defaultProps?Cd(Cd({},e.type.defaultProps),e.props):e.props).stackId;if(xH(r)){var i=t[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},CB=function(e,t,n){return Object.keys(e).reduce(function(r,i){var o=e[i].stackedData.reduce(function(e,r){var i=r.slice(t,n+1).reduce(function(e,t){return[(0,NM.default)(t.concat([e[0]]).filter(xU)),(0,NA.default)(t.concat([e[1]]).filter(xU))]},[1/0,-1/0]);return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]).map(function(e){return 1/0===e||-1/0===e?0:e})},CF=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,CU=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,CH=function(e,t,n){if((0,xQ.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(xU(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(CF.test(e[0])){var i=+CF.exec(e[0])[1];r[0]=t[0]-i}else(0,xQ.default)(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if(xU(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(CU.test(e[1])){var o=+CU.exec(e[1])[1];r[1]=t[1]+o}else(0,xQ.default)(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},CK=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,wE.default)(t,function(e){return e.coordinate}),o=1/0,a=1,l=i.length;a<l;a++){var s=i[a],c=i[a-1];o=Math.min((s.coordinate||0)-(c.coordinate||0),o)}return 1/0===o?0:o}return n?void 0:0},CW=function(e,t,n){return!e||!e.length||(0,NT.default)(e,(0,xR.default)(n,"type.defaultProps.domain"))?t:e},Cq=function(e,t){var n=e.type.defaultProps?Cd(Cd({},e.type.defaultProps),e.props):e.props,r=n.dataKey,i=n.name,o=n.unit,a=n.formatter,l=n.tooltipType,s=n.chartType,c=n.hide;return Cd(Cd({},wh(e,!1)),{},{dataKey:r,unit:o,formatter:a,name:i||r,color:Cg(e),value:Cp(t,r),type:l,payload:t,chartType:s,hide:c})};function CZ(e){return(CZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function CV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CV(Object(n),!0).forEach(function(t){CX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CX(e,t,n){var r;return(r=function(e,t){if("object"!=CZ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=CZ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==CZ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CY=["Webkit","Moz","O","ms"],CJ=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=CY.reduce(function(e,r){return CG(CG({},e),{},CX({},r+n,t))},{});return r[e]=t,r};function CQ(e){return(CQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C0(){return(C0=Object.assign.bind()).apply(this,arguments)}function C1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C1(Object(n),!0).forEach(function(t){C6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C8(r.key),r)}}function C4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C4=function(){return!!e})()}function C9(e){return(C9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C5(e,t){return(C5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function C6(e,t,n){return(t=C8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C8(e){var t=function(e,t){if("object"!=CQ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=CQ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==CQ(t)?t:t+""}var C7=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,o=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var l=t.length,s=SG().domain((0,wS.default)(0,l)).range([i,i+o-a]),c=s.domain().map(function(e){return s(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:s(n),endX:s(r),scale:s,scaleValues:c}},Ae=function(e){return e.changedTouches&&!!e.changedTouches.length},At=function(e){var t,n;function r(e){var t,n,i;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return n=r,i=[e],n=C9(n),C6(t=function(e,t){if(t&&("object"===CQ(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,C4()?Reflect.construct(n,i||[],C9(this).constructor):n.apply(this,i)),"handleDrag",function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)}),C6(t,"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])}),C6(t,"handleDragEnd",function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=t.props,n=e.endIndex,r=e.onDragEnd,i=e.startIndex;null==r||r({endIndex:n,startIndex:i})}),t.detachDragEndListener()}),C6(t,"handleLeaveWrapper",function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))}),C6(t,"handleEnterSlideOrTraveller",function(){t.setState({isTextActive:!0})}),C6(t,"handleLeaveSlideOrTraveller",function(){t.setState({isTextActive:!1})}),C6(t,"handleSlideDragStart",function(e){var n=Ae(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),t.attachDragEndListener()}),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(t,"startX"),endX:t.handleTravellerDragStart.bind(t,"endX")},t.state={},t}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&C5(r,e),t=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,i=this.state.scaleValues,o=this.props,a=o.gap,l=o.data.length-1,s=Math.min(t,n),c=Math.max(t,n),u=r.getIndexInRange(i,s),d=r.getIndexInRange(i,c);return{startIndex:u-u%a,endIndex:d===l?l:d-d%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,i=t.dataKey,o=Cp(n[e],i,e);return(0,xQ.default)(r)?r(o,e):o}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,o=this.props,a=o.x,l=o.width,s=o.travellerWidth,c=o.startIndex,u=o.endIndex,d=o.onChange,f=e.pageX-n;f>0?f=Math.min(f,a+l-s-i,a+l-s-r):f<0&&(f=Math.max(f,a-r,a-i));var p=this.getIndex({startX:r+f,endX:i+f});(p.startIndex!==c||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=Ae(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,i=t.endX,o=t.startX,a=this.state[r],l=this.props,s=l.x,c=l.width,u=l.travellerWidth,d=l.onChange,f=l.gap,p=l.data,h={startX:this.state.startX,endX:this.state.endX},m=e.pageX-n;m>0?m=Math.min(m,s+c-u-a):m<0&&(m=Math.max(m,s-a)),h[r]=a+m;var g=this.getIndex(h),y=g.startIndex,b=g.endIndex,v=function(){var e=p.length-1;return"startX"===r&&(i>o?y%f==0:b%f==0)||!!(i<o)&&b===e||"endX"===r&&(i>o?b%f==0:y%f==0)||!!(i>o)&&b===e};this.setState(C6(C6({},r,a+m),"brushMoveStartX",e.pageX),function(){d&&v()&&d(g)})}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var n=this,r=this.state,i=r.scaleValues,o=r.startX,a=r.endX,l=this.state[t],s=i.indexOf(l);if(-1!==s){var c=s+e;if(-1!==c&&!(c>=i.length)){var u=i[c];"startX"===t&&u>=a||"endX"===t&&u<=o||this.setState(C6({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,o=e.fill,a=e.stroke;return G.default.createElement("rect",{stroke:a,fill:o,x:t,y:n,width:r,height:i})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,o=e.data,a=e.children,l=e.padding,s=G.Children.only(a);return s?G.default.cloneElement(s,{x:t,y:n,width:r,height:i,margin:l,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,t){var n,i,o=this,a=this.props,l=a.y,s=a.travellerWidth,c=a.height,u=a.traveller,d=a.ariaLabel,f=a.data,p=a.startIndex,h=a.endIndex,m=Math.max(e,this.props.x),g=C2(C2({},wh(this.props,!1)),{},{x:m,y:l,width:s,height:c}),y=d||"Min value: ".concat(null==(n=f[p])?void 0:n.name,", Max value: ").concat(null==(i=f[h])?void 0:i.name);return G.default.createElement(wP,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),o.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},r.renderTraveller(u,g))}},{key:"renderSlide",value:function(e,t){var n=this.props,r=n.y,i=n.height,o=n.stroke,a=n.travellerWidth,l=Math.min(e,t)+a,s=Math.max(Math.abs(t-e)-a,0);return G.default.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:l,y:r,width:s,height:i})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,o=e.travellerWidth,a=e.stroke,l=this.state,s=l.startX,c=l.endX,u={pointerEvents:"none",fill:a};return G.default.createElement(wP,{className:"recharts-brush-texts"},G.default.createElement(Ev,C0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(s,c)-5,y:r+i/2},u),this.getTextOfTick(t)),G.default.createElement(Ev,C0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(s,c)+o+5,y:r+i/2},u),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,o=e.y,a=e.width,l=e.height,s=e.alwaysShowText,c=this.state,u=c.startX,d=c.endX,f=c.isTextActive,p=c.isSlideMoving,h=c.isTravellerMoving,m=c.isTravellerFocused;if(!t||!t.length||!xU(i)||!xU(o)||!xU(a)||!xU(l)||a<=0||l<=0)return null;var g=(0,xT.U)("recharts-brush",n),y=1===G.default.Children.count(r),b=CJ("userSelect","none");return G.default.createElement(wP,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(u,d),this.renderTravellerLayer(u,"startX"),this.renderTravellerLayer(d,"endX"),(f||p||h||m||s)&&this.renderText())}}],n=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=e.stroke,a=Math.floor(n+i/2)-1;return G.default.createElement(G.default.Fragment,null,G.default.createElement("rect",{x:t,y:n,width:r,height:i,fill:o,stroke:"none"}),G.default.createElement("line",{x1:t+1,y1:a,x2:t+r-1,y2:a,fill:"none",stroke:"#fff"}),G.default.createElement("line",{x1:t+1,y1:a+2,x2:t+r-1,y2:a+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return G.default.isValidElement(e)?G.default.cloneElement(e,t):(0,xQ.default)(e)?e(t):r.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,i=e.x,o=e.travellerWidth,a=e.updateId,l=e.startIndex,s=e.endIndex;if(n!==t.prevData||a!==t.prevUpdateId)return C2({prevData:n,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:r},n&&n.length?C7({data:n,width:r,x:i,travellerWidth:o,startIndex:l,endIndex:s}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([i,i+r-o]);var c=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:o,prevUpdateId:a,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:c}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=e.length,r=0,i=n-1;i-r>1;){var o=Math.floor((r+i)/2);e[o]>t?i=o:r=o}return t>=e[i]?i:r}}],t&&C3(r.prototype,t),n&&C3(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(G.PureComponent);function An(e){return(An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=An(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=An(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==An(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}C6(At,"displayName","Brush"),C6(At,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Ao=Math.PI/180,Aa=function(e,t,n,r){return{x:e+Math.cos(-Ao*r)*n,y:t+Math.sin(-Ao*r)*n}},Al=function(e,t){var n=e.x,r=e.y;return Math.sqrt(Math.pow(n-t.x,2)+Math.pow(r-t.y,2))},As=function(e,t){var n=e.x,r=e.y,i=t.cx,o=t.cy,a=Al({x:n,y:r},{x:i,y:o});if(a<=0)return{radius:a};var l=Math.acos((n-i)/a);return r>o&&(l=2*Math.PI-l),{radius:a,angle:180*l/Math.PI,angleInRadian:l}},Ac=function(e){var t=e.startAngle,n=e.endAngle,r=Math.min(Math.floor(t/360),Math.floor(n/360));return{startAngle:t-360*r,endAngle:n-360*r}},Au=function(e,t){var n,r=As({x:e.x,y:e.y},t),i=r.radius,o=r.angle,a=t.innerRadius,l=t.outerRadius;if(i<a||i>l)return!1;if(0===i)return!0;var s=Ac(t),c=s.startAngle,u=s.endAngle,d=o;if(c<=u){for(;d>u;)d-=360;for(;d<c;)d+=360;n=d>=c&&d<=u}else{for(;d>c;)d-=360;for(;d<u;)d+=360;n=d>=u&&d<=c}return n?Ai(Ai({},t),{},{radius:i,angle:d+360*Math.min(Math.floor(t.startAngle/360),Math.floor(t.endAngle/360))}):null};function Ad(e){return(Ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Af=["offset"];function Ap(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ah(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Am(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ah(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=Ad(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ad(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ad(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ag(){return(Ag=Object.assign.bind()).apply(this,arguments)}var Ay=function(e){var t=e.value,n=e.formatter,r=(0,x$.default)(e.children)?t:e.children;return(0,xQ.default)(n)?n(r):r},Ab=function(e,t,n){var r,i,o=e.position,a=e.viewBox,l=e.offset,s=e.className,c=a.cx,u=a.cy,d=a.innerRadius,f=a.outerRadius,p=a.startAngle,h=a.endAngle,m=a.clockWise,g=(d+f)/2,y=xB(h-p)*Math.min(Math.abs(h-p),360),b=y>=0?1:-1;"insideStart"===o?(r=p+b*l,i=m):"insideEnd"===o?(r=h-b*l,i=!m):"end"===o&&(r=h+b*l,i=m),i=y<=0?i:!i;var v=Aa(c,u,g,r),x=Aa(c,u,g,r+(i?1:-1)*359),w="M".concat(v.x,",").concat(v.y,"\n A").concat(g,",").concat(g,",0,1,").concat(+!i,",\n ").concat(x.x,",").concat(x.y),k=(0,x$.default)(e.id)?xW("recharts-radial-line-"):e.id;return G.default.createElement("text",Ag({},n,{dominantBaseline:"central",className:(0,xT.U)("recharts-radial-bar-label",s)}),G.default.createElement("defs",null,G.default.createElement("path",{id:k,d:w})),G.default.createElement("textPath",{xlinkHref:"#".concat(k)},t))},Av=function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t.cx,o=t.cy,a=t.innerRadius,l=t.outerRadius,s=(t.startAngle+t.endAngle)/2;if("outside"===r){var c=Aa(i,o,l+n,s),u=c.x;return{x:u,y:c.y,textAnchor:u>=i?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:i,y:o,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:i,y:o,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:i,y:o,textAnchor:"middle",verticalAnchor:"end"};var d=Aa(i,o,(a+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},Ax=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,i=e.position,o=t.x,a=t.y,l=t.width,s=t.height,c=s>=0?1:-1,u=c*r,d=c>0?"end":"start",f=c>0?"start":"end",p=l>=0?1:-1,h=p*r,m=p>0?"end":"start",g=p>0?"start":"end";if("top"===i)return Am(Am({},{x:o+l/2,y:a-c*r,textAnchor:"middle",verticalAnchor:d}),n?{height:Math.max(a-n.y,0),width:l}:{});if("bottom"===i)return Am(Am({},{x:o+l/2,y:a+s+u,textAnchor:"middle",verticalAnchor:f}),n?{height:Math.max(n.y+n.height-(a+s),0),width:l}:{});if("left"===i){var y={x:o-h,y:a+s/2,textAnchor:m,verticalAnchor:"middle"};return Am(Am({},y),n?{width:Math.max(y.x-n.x,0),height:s}:{})}if("right"===i){var b={x:o+l+h,y:a+s/2,textAnchor:g,verticalAnchor:"middle"};return Am(Am({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:s}:{})}var v=n?{width:l,height:s}:{};return"insideLeft"===i?Am({x:o+h,y:a+s/2,textAnchor:g,verticalAnchor:"middle"},v):"insideRight"===i?Am({x:o+l-h,y:a+s/2,textAnchor:m,verticalAnchor:"middle"},v):"insideTop"===i?Am({x:o+l/2,y:a+u,textAnchor:"middle",verticalAnchor:f},v):"insideBottom"===i?Am({x:o+l/2,y:a+s-u,textAnchor:"middle",verticalAnchor:d},v):"insideTopLeft"===i?Am({x:o+h,y:a+u,textAnchor:g,verticalAnchor:f},v):"insideTopRight"===i?Am({x:o+l-h,y:a+u,textAnchor:m,verticalAnchor:f},v):"insideBottomLeft"===i?Am({x:o+h,y:a+s-u,textAnchor:g,verticalAnchor:d},v):"insideBottomRight"===i?Am({x:o+l-h,y:a+s-u,textAnchor:m,verticalAnchor:d},v):(0,x0.default)(i)&&(xU(i.x)||xF(i.x))&&(xU(i.y)||xF(i.y))?Am({x:o+xq(i.x,l),y:a+xq(i.y,s),textAnchor:"end",verticalAnchor:"end"},v):Am({x:o+l/2,y:a+s/2,textAnchor:"middle",verticalAnchor:"middle"},v)};function Aw(e){var t,n=e.offset,r=Am({offset:void 0===n?5:n},function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Af)),i=r.viewBox,o=r.position,a=r.value,l=r.children,s=r.content,c=r.className,u=r.textBreakAll;if(!i||(0,x$.default)(a)&&(0,x$.default)(l)&&!(0,G.isValidElement)(s)&&!(0,xQ.default)(s))return null;if((0,G.isValidElement)(s))return(0,G.cloneElement)(s,r);if((0,xQ.default)(s)){if(t=(0,G.createElement)(s,r),(0,G.isValidElement)(t))return t}else t=Ay(r);var d="cx"in i&&xU(i.cx),f=wh(r,!0);if(d&&("insideStart"===o||"insideEnd"===o||"end"===o))return Ab(r,t,f);var p=d?Av(r):Ax(r);return G.default.createElement(Ev,Ag({className:(0,xT.U)("recharts-label",void 0===c?"":c)},f,p,{breakAll:u}),t)}Aw.displayName="Label";var Ak=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,o=e.endAngle,a=e.r,l=e.radius,s=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,f=e.top,p=e.left,h=e.width,m=e.height,g=e.clockWise,y=e.labelViewBox;if(y)return y;if(xU(h)&&xU(m)){if(xU(u)&&xU(d))return{x:u,y:d,width:h,height:m};if(xU(f)&&xU(p))return{x:f,y:p,width:h,height:m}}return xU(u)&&xU(d)?{x:u,y:d,width:0,height:0}:xU(t)&&xU(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:o||r||0,innerRadius:s||0,outerRadius:c||l||a||0,clockWise:g}:e.viewBox?e.viewBox:{}};Aw.parseViewBox=Ak,Aw.renderCallByParent=function(e,t){var n,r,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&i&&!e.label)return null;var o=e.children,a=Ak(e),l=wc(o,Aw).map(function(e,n){return(0,G.cloneElement)(e,{viewBox:t||a,key:"label-".concat(n)})});if(!i)return l;return[(n=e.label,r=t||a,!n?null:!0===n?G.default.createElement(Aw,{key:"label-implicit",viewBox:r}):xH(n)?G.default.createElement(Aw,{key:"label-implicit",viewBox:r,value:n}):(0,G.isValidElement)(n)?n.type===Aw?(0,G.cloneElement)(n,{key:"label-implicit",viewBox:r}):G.default.createElement(Aw,{key:"label-implicit",content:n,viewBox:r}):(0,xQ.default)(n)?G.default.createElement(Aw,{key:"label-implicit",content:n,viewBox:r}):(0,x0.default)(n)?G.default.createElement(Aw,Ag({viewBox:r},n,{key:"label-implicit"})):null)].concat(function(e){if(Array.isArray(e))return Ap(e)}(l)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||function(e){if(e){if("string"==typeof e)return Ap(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ap(e,void 0)}}(l)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var A_=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},AS=e.i(60793),AE=e.i(26063),Aj=function(e){return null};Aj.displayName="Cell";var AO=e.i(4879);function AN(e){return(AN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var AC=["valueAccessor"],AA=["data","dataKey","clockWise","id","textBreakAll"];function AM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AP(){return(AP=Object.assign.bind()).apply(this,arguments)}function AT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AT(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=AN(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=AN(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==AN(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AD(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Az=function(e){return Array.isArray(e.value)?(0,AO.default)(e.value):e.value};function AR(e){var t=e.valueAccessor,n=void 0===t?Az:t,r=AD(e,AC),i=r.data,o=r.dataKey,a=r.clockWise,l=r.id,s=r.textBreakAll,c=AD(r,AA);return i&&i.length?G.default.createElement(wP,{className:"recharts-label-list"},i.map(function(e,t){var r=(0,x$.default)(o)?n(e,t):Cp(e&&e.payload,o),i=(0,x$.default)(l)?{}:{id:"".concat(l,"-").concat(t)};return G.default.createElement(Aw,AP({},wh(e,!0),c,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:s,viewBox:Aw.parseViewBox((0,x$.default)(a)?e:AI(AI({},e),{},{clockWise:a})),key:"label-".concat(t),index:t}))})):null}AR.displayName="LabelList",AR.renderCallByParent=function(e,t){var n,r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&r&&!e.label)return null;var i=wc(e.children,AR).map(function(e,n){return(0,G.cloneElement)(e,{data:t,key:"labelList-".concat(n)})});return r?[(n=e.label,!n?null:!0===n?G.default.createElement(AR,{key:"labelList-implicit",data:t}):G.default.isValidElement(n)||(0,xQ.default)(n)?G.default.createElement(AR,{key:"labelList-implicit",data:t,content:n}):(0,x0.default)(n)?G.default.createElement(AR,AP({data:t},n,{key:"labelList-implicit"})):null)].concat(function(e){if(Array.isArray(e))return AM(e)}(i)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e){if(e){if("string"==typeof e)return AM(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return AM(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i};var AL=e.i(1320),A$=e.i(20164);function AB(e){return(AB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function AF(){return(AF=Object.assign.bind()).apply(this,arguments)}function AU(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AK(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AH(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=AB(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=AB(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==AB(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var AW=function(e,t,n,r,i){var o=n-r;return"M ".concat(e,",").concat(t)+"L ".concat(e+n,",").concat(t)+"L ".concat(e+n-o/2,",").concat(t+i)+"L ".concat(e+n-o/2-r,",").concat(t+i)+"L ".concat(e,",").concat(t," Z")},Aq={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},AZ=function(e){var t,n=AK(AK({},Aq),e),r=(0,G.useRef)(),i=function(e){if(Array.isArray(e))return e}(t=(0,G.useState)(-1))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return AU(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return AU(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i[1];(0,G.useEffect)(function(){if(r.current&&r.current.getTotalLength)try{var e=r.current.getTotalLength();e&&a(e)}catch(e){}},[]);var l=n.x,s=n.y,c=n.upperWidth,u=n.lowerWidth,d=n.height,f=n.className,p=n.animationEasing,h=n.animationDuration,m=n.animationBegin,g=n.isUpdateAnimationActive;if(l!==+l||s!==+s||c!==+c||u!==+u||d!==+d||0===c&&0===u||0===d)return null;var y=(0,xT.U)("recharts-trapezoid",f);return g?G.default.createElement(Sn,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:s},to:{upperWidth:c,lowerWidth:u,height:d,x:l,y:s},duration:h,animationEasing:p,isActive:g},function(e){var t=e.upperWidth,i=e.lowerWidth,a=e.height,l=e.x,s=e.y;return G.default.createElement(Sn,{canBegin:o>0,from:"0px ".concat(-1===o?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:h,easing:p},G.default.createElement("path",AF({},wh(n,!0),{className:y,d:AW(l,s,t,i,a),ref:r})))}):G.default.createElement("g",null,G.default.createElement("path",AF({},wh(n,!0),{className:y,d:AW(l,s,c,u,d)})))};function AV(e){return(AV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function AG(){return(AG=Object.assign.bind()).apply(this,arguments)}function AX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AX(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=AV(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=AV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==AV(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var AJ=function(e){var t=e.cx,n=e.cy,r=e.radius,i=e.angle,o=e.sign,a=e.isExternal,l=e.cornerRadius,s=e.cornerIsExternal,c=l*(a?1:-1)+r,u=Math.asin(l/c)/Ao,d=s?i:i+o*u;return{center:Aa(t,n,c,d),circleTangency:Aa(t,n,r,d),lineTangency:Aa(t,n,c*Math.cos(u*Ao),s?i-o*u:i),theta:u}},AQ=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,o=e.startAngle,a=e.endAngle,l=xB(a-o)*Math.min(Math.abs(a-o),359.999),s=o+l,c=Aa(t,n,i,o),u=Aa(t,n,i,s),d="M ".concat(c.x,",").concat(c.y,"\n A ").concat(i,",").concat(i,",0,\n ").concat(+(Math.abs(l)>180),",").concat(+(o>s),",\n ").concat(u.x,",").concat(u.y,"\n ");if(r>0){var f=Aa(t,n,r,o),p=Aa(t,n,r,s);d+="L ".concat(p.x,",").concat(p.y,"\n A ").concat(r,",").concat(r,",0,\n ").concat(+(Math.abs(l)>180),",").concat(+(o<=s),",\n ").concat(f.x,",").concat(f.y," Z")}else d+="L ".concat(t,",").concat(n," Z");return d},A0=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,a=e.forceCornerRadius,l=e.cornerIsExternal,s=e.startAngle,c=e.endAngle,u=xB(c-s),d=AJ({cx:t,cy:n,radius:i,angle:s,sign:u,cornerRadius:o,cornerIsExternal:l}),f=d.circleTangency,p=d.lineTangency,h=d.theta,m=AJ({cx:t,cy:n,radius:i,angle:c,sign:-u,cornerRadius:o,cornerIsExternal:l}),g=m.circleTangency,y=m.lineTangency,b=m.theta,v=l?Math.abs(s-c):Math.abs(s-c)-h-b;if(v<0)return a?"M ".concat(p.x,",").concat(p.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(-(2*o),",0\n "):AQ({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:c});var x="M ".concat(p.x,",").concat(p.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(f.x,",").concat(f.y,"\n A").concat(i,",").concat(i,",0,").concat(+(v>180),",").concat(+(u<0),",").concat(g.x,",").concat(g.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(y.x,",").concat(y.y,"\n ");if(r>0){var w=AJ({cx:t,cy:n,radius:r,angle:s,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),k=w.circleTangency,_=w.lineTangency,S=w.theta,E=AJ({cx:t,cy:n,radius:r,angle:c,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),j=E.circleTangency,O=E.lineTangency,N=E.theta,C=l?Math.abs(s-c):Math.abs(s-c)-S-N;if(C<0&&0===o)return"".concat(x,"L").concat(t,",").concat(n,"Z");x+="L".concat(O.x,",").concat(O.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(j.x,",").concat(j.y,"\n A").concat(r,",").concat(r,",0,").concat(+(C>180),",").concat(+(u>0),",").concat(k.x,",").concat(k.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(_.x,",").concat(_.y,"Z")}else x+="L".concat(t,",").concat(n,"Z");return x},A1={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},A2=function(e){var t,n=AY(AY({},A1),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,l=n.cornerRadius,s=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a<o||u===d)return null;var p=(0,xT.U)("recharts-sector",f),h=a-o,m=xq(l,h,0,!0);return t=m>0&&360>Math.abs(u-d)?A0({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(m,h/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}):AQ({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d}),G.default.createElement("path",AG({},wh(n,!0),{className:p,d:t,role:"img"}))},A3=["option","shapeType","propTransformer","activeClassName","isActive"];function A4(e){return(A4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function A9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A9(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=A4(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=A4(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==A4(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A6(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return G.default.createElement(SB,n);case"trapezoid":return G.default.createElement(AZ,n);case"sector":return G.default.createElement(A2,n);case"symbols":if("symbols"===t)return G.default.createElement(kI,n);break;default:return null}}function A8(e){var t,n=e.option,r=e.shapeType,i=e.propTransformer,o=e.activeClassName,a=e.isActive,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,A3);if((0,G.isValidElement)(n))t=(0,G.cloneElement)(n,A5(A5({},l),(0,G.isValidElement)(n)?n.props:n));else if((0,xQ.default)(n))t=n(l);else if((0,AL.default)(n)&&!(0,A$.default)(n)){var s=(void 0===i?function(e,t){return A5(A5({},t),e)}:i)(n,l);t=G.default.createElement(A6,{shapeType:r,elementProps:s})}else t=G.default.createElement(A6,{shapeType:r,elementProps:l});return a?G.default.createElement(wP,{className:void 0===o?"recharts-active-shape":o},t):t}function A7(e,t){return null!=t&&"trapezoids"in e.props}function Me(e,t){return null!=t&&"sectors"in e.props}function Mt(e,t){return null!=t&&"points"in e.props}function Mn(e,t){var n,r,i=e.x===(null==t||null==(n=t.labelViewBox)?void 0:n.x)||e.x===t.x,o=e.y===(null==t||null==(r=t.labelViewBox)?void 0:r.y)||e.y===t.y;return i&&o}function Mr(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Mi(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}var Mo=["x","y"];function Ma(e){return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ml(){return(Ml=Object.assign.bind()).apply(this,arguments)}function Ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ms(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=Ma(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ma(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ma(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ms(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mu(e,t){var n=e.x,r=e.y,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Mo),o=parseInt("".concat(n),10),a=parseInt("".concat(r),10),l=parseInt("".concat(t.height||i.height),10),s=parseInt("".concat(t.width||i.width),10);return Mc(Mc(Mc(Mc(Mc({},t),i),o?{x:o}:{}),a?{y:a}:{}),{},{height:l,width:s,name:t.name,radius:t.radius})}function Md(e){return G.default.createElement(A8,Ml({shapeType:"rectangle",propTransformer:Mu,activeClassName:"recharts-active-bar"},e))}var Mf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(n,r){if("number"==typeof e)return e;var i=xU(n)||(0,x$.default)(n);return i?e(n,r):(i||wj(!1),t)}},Mp=["value","background"];function Mh(e){return(Mh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mm(){return(Mm=Object.assign.bind()).apply(this,arguments)}function Mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function My(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(n),!0).forEach(function(t){Mk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M_(r.key),r)}}function Mv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Mv=function(){return!!e})()}function Mx(e){return(Mx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mw(e,t){return(Mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Mk(e,t,n){return(t=M_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M_(e){var t=function(e,t){if("object"!=Mh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Mh(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mh(t)?t:t+""}var MS=function(e){var t,n;function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r,n=[].concat(o),t=Mx(t),Mk(e=function(e,t){if(t&&("object"===Mh(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,Mv()?Reflect.construct(t,n||[],Mx(this).constructor):t.apply(this,n)),"state",{isAnimationFinished:!1}),Mk(e,"id",xW("recharts-bar-")),Mk(e,"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),Mk(e,"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Mw(r,e),t=[{key:"renderRectanglesStatically",value:function(e){var t=this,n=this.props,r=n.shape,i=n.dataKey,o=n.activeIndex,a=n.activeBar,l=wh(this.props,!1);return e&&e.map(function(e,n){var s=n===o,c=My(My(My({},l),e),{},{isActive:s,option:s?a:r,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return G.default.createElement(wP,Mm({className:"recharts-bar-rectangle"},x7(t.props,e,n),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value,"-").concat(n)}),G.default.createElement(Md,c))})}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,n=t.data,r=t.layout,i=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,l=t.animationEasing,s=t.animationId,c=this.state.prevData;return G.default.createElement(Sn,{begin:o,duration:a,isActive:i,easing:l,from:{t:0},to:{t:1},key:"bar-".concat(s),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var i=t.t,o=n.map(function(e,t){var n=c&&c[t];if(n){var o=xG(n.x,e.x),a=xG(n.y,e.y),l=xG(n.width,e.width),s=xG(n.height,e.height);return My(My({},e),{},{x:o(i),y:a(i),width:l(i),height:s(i)})}if("horizontal"===r){var u=xG(0,e.height)(i);return My(My({},e),{},{y:e.y+e.height-u,height:u})}var d=xG(0,e.width)(i);return My(My({},e),{},{width:d})});return G.default.createElement(wP,null,e.renderRectanglesStatically(o))})}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!(0,NT.default)(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:"renderBackground",value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,i=t.activeIndex,o=wh(this.props.background,!1);return n.map(function(t,n){t.value;var a=t.background,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Mp);if(!a)return null;var s=My(My(My(My(My({},l),{},{fill:"#eee"},a),o),x7(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:"recharts-bar-background-rectangle"});return G.default.createElement(Md,Mm({key:"background-bar-".concat(n),option:e.props.background,isActive:n===i},s))})}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,i=n.xAxis,o=n.yAxis,a=n.layout,l=wc(n.children,Cn);if(!l)return null;var s="vertical"===a?r[0].height/2:r[0].width/2,c=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Cp(e,t)}};return G.default.createElement(wP,{clipPath:e?"url(#clipPath-".concat(t,")"):null},l.map(function(e){return G.default.cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:r,xAxis:i,yAxis:o,layout:a,offset:s,dataPointFormatter:c})}))}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,i=e.xAxis,o=e.yAxis,a=e.left,l=e.top,s=e.width,c=e.height,u=e.isAnimationActive,d=e.background,f=e.id;if(t||!n||!n.length)return null;var p=this.state.isAnimationFinished,h=(0,xT.U)("recharts-bar",r),m=i&&i.allowDataOverflow,g=o&&o.allowDataOverflow,y=m||g,b=(0,x$.default)(f)?this.id:f;return G.default.createElement(wP,{className:h},m||g?G.default.createElement("defs",null,G.default.createElement("clipPath",{id:"clipPath-".concat(b)},G.default.createElement("rect",{x:m?a:a-s/2,y:g?l:l-c/2,width:m?s:2*s,height:g?c:2*c}))):null,G.default.createElement(wP,{className:"recharts-bar-rectangles",clipPath:y?"url(#clipPath-".concat(b,")"):null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(y,b),(!u||p)&&AR.renderCallByParent(this.props,n))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],t&&Mb(r.prototype,t),n&&Mb(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(G.PureComponent);function ME(e){return(ME="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,MA(r.key),r)}}function MO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MO(Object(n),!0).forEach(function(t){MC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MC(e,t,n){return(t=MA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MA(e){var t=function(e,t){if("object"!=ME(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ME(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ME(t)?t:t+""}Mk(MS,"displayName","Bar"),Mk(MS,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!w0.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),Mk(MS,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,a=e.yAxis,l=e.xAxisTicks,s=e.yAxisTicks,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=CA(r,n);if(!p)return null;var h=t.layout,m=n.type.defaultProps,g=void 0!==m?My(My({},m),n.props):n.props,y=g.dataKey,b=g.children,v=g.minPointSize,x="horizontal"===h?a:o,w=c?x.scale.domain():null,k=CL({numericAxis:x}),_=wc(b,Aj),S=d.map(function(e,t){c?d=CM(c[u+t],w):Array.isArray(d=Cp(e,y))||(d=[k,d]);var r=Mf(v,MS.defaultProps.minPointSize)(d[1],t);if("horizontal"===h){var d,f,m,g,b,x,S,E=[a.scale(d[0]),a.scale(d[1])],j=E[0],O=E[1];f=CR({axis:o,ticks:l,bandSize:i,offset:p.offset,entry:e,index:t}),m=null!=(S=null!=O?O:j)?S:void 0,g=p.size;var N=j-O;if(b=Number.isNaN(N)?0:N,x={x:f,y:a.y,width:g,height:a.height},Math.abs(r)>0&&Math.abs(b)<Math.abs(r)){var C=xB(b||r)*(Math.abs(r)-Math.abs(b));m-=C,b+=C}}else{var A=[o.scale(d[0]),o.scale(d[1])],M=A[0],P=A[1];if(f=M,m=CR({axis:a,ticks:s,bandSize:i,offset:p.offset,entry:e,index:t}),g=P-M,b=p.size,x={x:o.x,y:m,width:o.width,height:b},Math.abs(r)>0&&Math.abs(g)<Math.abs(r)){var T=xB(g||r)*(Math.abs(r)-Math.abs(g));g+=T}}return My(My(My({},e),{},{x:f,y:m,width:g,height:b,value:c?d:d[1],payload:e,background:x},_&&_[t]&&_[t].props),{},{tooltipPayload:[Cq(n,e)],tooltipPosition:{x:f+g/2,y:m+b/2}})});return My({data:S,layout:h},f)});var MM=function(e,t,n,r,i){var o=e.width,a=e.height,l=e.layout,s=e.children,c=Object.keys(t),u={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:a-n.bottom,bottomMirror:a-n.bottom},d=!!wu(s,MS);return c.reduce(function(o,a){var s,c,f,p,h,m=t[a],g=m.orientation,y=m.domain,b=m.padding,v=void 0===b?{}:b,x=m.mirror,w=m.reversed,k="".concat(g).concat(x?"Mirror":"");if("number"===m.type&&("gap"===m.padding||"no-gap"===m.padding)){var _=y[1]-y[0],S=1/0,E=m.categoricalDomain.sort(xY);if(E.forEach(function(e,t){t>0&&(S=Math.min((e||0)-(E[t-1]||0),S))}),Number.isFinite(S)){var j=S/_,O="vertical"===m.layout?n.height:n.width;if("gap"===m.padding&&(s=j*O/2),"no-gap"===m.padding){var N=xq(e.barCategoryGap,j*O),C=j*O/2;s=C-N-(C-N)/O*N}}}c="xAxis"===r?[n.left+(v.left||0)+(s||0),n.left+n.width-(v.right||0)-(s||0)]:"yAxis"===r?"horizontal"===l?[n.top+n.height-(v.bottom||0),n.top+(v.top||0)]:[n.top+(v.top||0)+(s||0),n.top+n.height-(v.bottom||0)-(s||0)]:m.range,w&&(c=[c[1],c[0]]);var A=CN(m,i,d),M=A.scale,P=A.realScaleType;M.domain(y).range(c),CC(M);var T=CD(M,MN(MN({},m),{},{realScaleType:P}));"xAxis"===r?(h="top"===g&&!x||"bottom"===g&&x,f=n.left,p=u[k]-h*m.height):"yAxis"===r&&(h="left"===g&&!x||"right"===g&&x,f=u[k]-h*m.width,p=n.top);var I=MN(MN(MN({},m),T),{},{realScaleType:P,x:f,y:p,scale:M,width:"xAxis"===r?n.width:m.width,height:"yAxis"===r?n.height:m.height});return I.bandSize=CK(I,T),m.hide||"xAxis"!==r?m.hide||(u[k]+=(h?-1:1)*I.width):u[k]+=(h?-1:1)*I.height,MN(MN({},o),{},MC({},a,I))},{})},MP=function(e,t){var n=e.x,r=e.y,i=t.x,o=t.y;return{x:Math.min(n,i),y:Math.min(r,o),width:Math.abs(i-n),height:Math.abs(o-r)}},MT=function(){var e,t;function n(e){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");this.scale=e}return e=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o}if(n){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],t=[{key:"create",value:function(e){return new n(e)}}],e&&Mj(n.prototype,e),t&&Mj(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();MC(MT,"EPS",1e-4);var MI=function(e){var t=Object.keys(e).reduce(function(t,n){return MN(MN({},t),{},MC({},n,MT.create(e[n])))},{});return MN(MN({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,i=n.position;return(0,AS.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,AE.default)(e,function(e,n){return t[n].isInRange(e)})}})},MD=function(e){var t=e.width,n=e.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(r%180+180)%180*Math.PI/180,o=Math.atan(n/t);return Math.abs(i>o&&i<Math.PI-o?n/Math.sin(i):t/Math.cos(i))};function Mz(){return(Mz=Object.assign.bind()).apply(this,arguments)}function MR(e){return(MR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ML(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ML(Object(n),!0).forEach(function(t){MH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(MB=function(){return!!e})()}function MF(e){return(MF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function MU(e,t){return(MU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function MH(e,t,n){return(t=MK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MK(e){var t=function(e,t){if("object"!=MR(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=MR(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==MR(t)?t:t+""}var MW=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,o=MI({x:r.scale,y:i.scale}),a=o.apply({x:t,y:n},{bandAware:!0});return A_(e,"discard")&&!o.isInRange(a)?null:a},Mq=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=MF(e),function(e,t){if(t&&("object"===MR(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,MB()?Reflect.construct(e,t||[],MF(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&MU(n,e),t=[{key:"render",value:function(){var e=this.props,t=e.x,r=e.y,i=e.r,o=e.alwaysShow,a=e.clipPathId,l=xH(t),s=xH(r);if(xJ(void 0===o,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!s)return null;var c=MW(this.props);if(!c)return null;var u=c.x,d=c.y,f=this.props,p=f.shape,h=f.className,m=M$(M$({clipPath:A_(this.props,"hidden")?"url(#".concat(a,")"):void 0},wh(this.props,!0)),{},{cx:u,cy:d});return G.default.createElement(wP,{className:(0,xT.U)("recharts-reference-dot",h)},n.renderDot(p,m),Aw.renderCallByParent(this.props,{x:u-i,y:d-i,width:2*i,height:2*i}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,MK(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.default.Component);MH(Mq,"displayName","ReferenceDot"),MH(Mq,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),MH(Mq,"renderDot",function(e,t){return G.default.isValidElement(e)?G.default.cloneElement(e,t):(0,xQ.default)(e)?e(t):G.default.createElement(k3,Mz({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))});var MZ=e.i(88099),MV=e.i(60191),MG=(0,e.i(57588).default)(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),MX=(0,G.createContext)(void 0),MY=(0,G.createContext)(void 0),MJ=(0,G.createContext)(void 0),MQ=(0,G.createContext)({}),M0=(0,G.createContext)(void 0),M1=(0,G.createContext)(0),M2=(0,G.createContext)(0),M3=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,i=t.offset,o=e.clipPathId,a=e.children,l=e.width,s=e.height,c=MG(i);return G.default.createElement(MX.Provider,{value:n},G.default.createElement(MY.Provider,{value:r},G.default.createElement(MQ.Provider,{value:i},G.default.createElement(MJ.Provider,{value:c},G.default.createElement(M0.Provider,{value:o},G.default.createElement(M1.Provider,{value:s},G.default.createElement(M2.Provider,{value:l},a)))))))},M4=function(e){var t=(0,G.useContext)(MX);null==t&&wj(!1);var n=t[e];return null==n&&wj(!1),n},M9=function(){var e=(0,G.useContext)(MY);return(0,MV.default)(e,function(e){return(0,AE.default)(e.domain,Number.isFinite)})||xZ(e)},M5=function(e){var t=(0,G.useContext)(MY);null==t&&wj(!1);var n=t[e];return null==n&&wj(!1),n},M6=function(){return(0,G.useContext)(M2)},M8=function(){return(0,G.useContext)(M1)};function M7(e){return(M7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Pe=function(){return!!e})()}function Pt(e){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pn(e,t){return(Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pr(Object(n),!0).forEach(function(t){Po(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Po(e,t,n){return(t=Pa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pa(e){var t=function(e,t){if("object"!=M7(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=M7(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==M7(t)?t:t+""}function Pl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ps(){return(Ps=Object.assign.bind()).apply(this,arguments)}var Pc=function(e,t){return G.default.isValidElement(e)?G.default.cloneElement(e,t):(0,xQ.default)(e)?e(t):G.default.createElement("line",Ps({},t,{className:"recharts-reference-line-line"}))},Pu=function(e,t,n,r,i,o,a,l,s){var c=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=s.y,h=e.y.apply(p,{position:o});if(A_(s,"discard")&&!e.y.isInRange(h))return null;var m=[{x:c+d,y:h},{x:c,y:h}];return"left"===l?m.reverse():m}if(t){var g=s.x,y=e.x.apply(g,{position:o});if(A_(s,"discard")&&!e.x.isInRange(y))return null;var b=[{x:y,y:u+f},{x:y,y:u}];return"top"===a?b.reverse():b}if(r){var v=s.segment.map(function(t){return e.apply(t,{position:o})});return A_(s,"discard")&&(0,MZ.default)(v,function(t){return!e.isInRange(t)})?null:v}return null};function Pd(e){var t,n=e.x,r=e.y,i=e.segment,o=e.xAxisId,a=e.yAxisId,l=e.shape,s=e.className,c=e.alwaysShow,u=(0,G.useContext)(M0),d=M4(o),f=M5(a),p=(0,G.useContext)(MJ);if(!u||!p)return null;xJ(void 0===c,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Pu(MI({x:d.scale,y:f.scale}),xH(n),xH(r),i&&2===i.length,p,e.position,d.orientation,f.orientation,e);if(!h)return null;var m=function(e){if(Array.isArray(e))return e}(h)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],l=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return a}}(h)||function(e){if(e){if("string"==typeof e)return Pl(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Pl(e,2)}}(h)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=m[0],y=g.x,b=g.y,v=m[1],x=v.x,w=v.y,k=Pi(Pi({clipPath:A_(e,"hidden")?"url(#".concat(u,")"):void 0},wh(e,!0)),{},{x1:y,y1:b,x2:x,y2:w});return G.default.createElement(wP,{className:(0,xT.U)("recharts-reference-line",s)},Pc(l,k),Aw.renderCallByParent(e,MP({x:(t={x1:y,y1:b,x2:x,y2:w}).x1,y:t.y1},{x:t.x2,y:t.y2})))}var Pf=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=Pt(e),function(e,t){if(t&&("object"===M7(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,Pe()?Reflect.construct(e,t||[],Pt(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Pn(n,e),t=[{key:"render",value:function(){return G.default.createElement(Pd,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pa(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.default.Component);function Pp(){return(Pp=Object.assign.bind()).apply(this,arguments)}function Ph(e){return(Ph="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pm(Object(n),!0).forEach(function(t){Px(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Po(Pf,"displayName","ReferenceLine"),Po(Pf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Py(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Py=function(){return!!e})()}function Pb(e){return(Pb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pv(e,t){return(Pv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Px(e,t,n){return(t=Pw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pw(e){var t=function(e,t){if("object"!=Ph(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ph(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ph(t)?t:t+""}var Pk=function(e,t,n,r,i){var o=i.x1,a=i.x2,l=i.y1,s=i.y2,c=i.xAxis,u=i.yAxis;if(!c||!u)return null;var d=MI({x:c.scale,y:u.scale}),f={x:e?d.x.apply(o,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(l,{position:"start"}):d.y.rangeMin},p={x:t?d.x.apply(a,{position:"end"}):d.x.rangeMax,y:r?d.y.apply(s,{position:"end"}):d.y.rangeMax};return!A_(i,"discard")||d.isInRange(f)&&d.isInRange(p)?MP(f,p):null},P_=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=Pb(e),function(e,t){if(t&&("object"===Ph(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,Py()?Reflect.construct(e,t||[],Pb(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Pv(n,e),t=[{key:"render",value:function(){var e=this.props,t=e.x1,r=e.x2,i=e.y1,o=e.y2,a=e.className,l=e.alwaysShow,s=e.clipPathId;xJ(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=xH(t),u=xH(r),d=xH(i),f=xH(o),p=this.props.shape;if(!c&&!u&&!d&&!f&&!p)return null;var h=Pk(c,u,d,f,this.props);if(!h&&!p)return null;var m=A_(this.props,"hidden")?"url(#".concat(s,")"):void 0;return G.default.createElement(wP,{className:(0,xT.U)("recharts-reference-area",a)},n.renderRect(p,Pg(Pg({clipPath:m},wh(this.props,!0)),h)),Aw.renderCallByParent(this.props,h))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pw(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.default.Component);function PS(e){return function(e){if(Array.isArray(e))return PE(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return PE(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return PE(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Px(P_,"displayName","ReferenceArea"),Px(P_,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),Px(P_,"renderRect",function(e,t){return G.default.isValidElement(e)?G.default.cloneElement(e,t):(0,xQ.default)(e)?e(t):G.default.createElement(SB,Pp({},t,{className:"recharts-reference-area-rect"}))});var Pj=function(e,t,n,r,i){var o=wc(e,Pf),a=wc(e,Mq),l=[].concat(PS(o),PS(a)),s=wc(e,P_),c="".concat(r,"Id"),u=r[0],d=t;if(l.length&&(d=l.reduce(function(e,t){if(t.props[c]===n&&A_(t.props,"extendDomain")&&xU(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),s.length){var f="".concat(u,"1"),p="".concat(u,"2");d=s.reduce(function(e,t){if(t.props[c]===n&&A_(t.props,"extendDomain")&&xU(t.props[f])&&xU(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return xU(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},PO=new(e.i(78492)).default,PN="recharts.syncMouseEvents";function PC(e){return(PC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function PA(e,t,n){return(t=PM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PM(e){var t=function(e,t){if("object"!=PC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=PC(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==PC(t)?t:t+""}var PP=(k=function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");PA(this,"activeIndex",0),PA(this,"coordinateList",[]),PA(this,"layout","horizontal")},_=[{key:"setDetails",value:function(e){var t,n=e.coordinateList,r=void 0===n?null:n,i=e.container,o=void 0===i?null:i,a=e.layout,l=void 0===a?null:a,s=e.offset,c=void 0===s?null:s,u=e.mouseHandlerCallback,d=void 0===u?null:u;this.coordinateList=null!=(t=null!=r?r:this.coordinateList)?t:[],this.container=null!=o?o:this.container,this.layout=null!=l?l:this.layout,this.offset=null!=c?c:this.offset,this.mouseHandlerCallback=null!=d?d:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){if("horizontal"===this.layout&&0!==this.coordinateList.length){var e,t,n=this.container.getBoundingClientRect(),r=n.x,i=n.y,o=n.height,a=this.coordinateList[this.activeIndex].coordinate,l=(null==(e=window)?void 0:e.scrollX)||0,s=(null==(t=window)?void 0:t.scrollY)||0,c=i+this.offset.top+o/2+s;this.mouseHandlerCallback({pageX:r+a+l,pageY:c})}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PM(r.key),r)}}(k.prototype,_),Object.defineProperty(k,"prototype",{writable:!1}),k);function PT(e){this._context=e}function PI(e){return new PT(e)}function PD(e){return e[0]}function Pz(e){return e[1]}function PR(e,t){var n=ki(!0),r=null,i=PI,o=null,a=ku(l);function l(l){var s,c,u,d=(l=NE(l)).length,f=!1;for(null==r&&(o=i(u=a())),s=0;s<=d;++s)!(s<d&&n(c=l[s],s,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(c,s,l),+t(c,s,l));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?PD:ki(e),t="function"==typeof t?t:void 0===t?Pz:ki(t),l.x=function(t){return arguments.length?(e="function"==typeof t?t:ki(+t),l):e},l.y=function(e){return arguments.length?(t="function"==typeof e?e:ki(+e),l):t},l.defined=function(e){return arguments.length?(n="function"==typeof e?e:ki(!!e),l):n},l.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),l):i},l.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),l):r},l}function PL(e,t,n){var r=null,i=ki(!0),o=null,a=PI,l=null,s=ku(c);function c(c){var u,d,f,p,h,m=(c=NE(c)).length,g=!1,y=Array(m),b=Array(m);for(null==o&&(l=a(h=s())),u=0;u<=m;++u){if(!(u<m&&i(p=c[u],u,c))===g)if(g=!g)d=u,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=u-1;f>=d;--f)l.point(y[f],b[f]);l.lineEnd(),l.areaEnd()}g&&(y[u]=+e(p,u,c),b[u]=+t(p,u,c),l.point(r?+r(p,u,c):y[u],n?+n(p,u,c):b[u]))}if(h)return l=null,h+""||null}function u(){return PR().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?PD:ki(+e),t="function"==typeof t?t:void 0===t?ki(0):ki(+t),n="function"==typeof n?n:void 0===n?Pz:ki(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:ki(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:ki(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:ki(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:ki(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:ki(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:ki(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:ki(!!e),c):i},c.curve=function(e){return arguments.length?(a=e,null!=o&&(l=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=l=null:l=a(o=e),c):o},c}function P$(){}function PB(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function PF(e){this._context=e}function PU(e){this._context=e}function PH(e){this._context=e}PT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},PF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=0/0,this._point=0},lineEnd:function(){switch(this._point){case 3:PB(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:PB(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},PU.prototype={areaStart:P$,areaEnd:P$,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=0/0,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:PB(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},PH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=0/0,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:PB(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class PK{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=0/0}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function PW(e){this._context=e}PW.prototype={areaStart:P$,areaEnd:P$,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e*=1,t*=1,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Pq(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0);return((o<0?-1:1)+(a<0?-1:1))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs((o*i+a*r)/(r+i)))||0}function PZ(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function PV(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,l=(o-r)/3;e._context.bezierCurveTo(r+l,i+l*t,o-l,a-l*n,o,a)}function PG(e){this._context=e}function PX(e){this._context=new PY(e)}function PY(e){this._context=e}function PJ(e){this._context=e}function PQ(e){var t,n,r=e.length-1,i=Array(r),o=Array(r),a=Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function P0(e,t){this._context=e,this._t=t}function P1(e){return(P1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P2(){return(P2=Object.assign.bind()).apply(this,arguments)}function P3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P3(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=P1(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=P1(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==P1(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}PG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=0/0,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:PV(this,this._t0,PZ(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=0/0;if(t*=1,(e*=1)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,PV(this,PZ(this,n=Pq(this,e,t)),n);break;default:PV(this,this._t0,n=Pq(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(PX.prototype=Object.create(PG.prototype)).point=function(e,t){PG.prototype.point.call(this,t,e)},PY.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},PJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=PQ(e),i=PQ(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},P0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x=this._y=0/0,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var P9={curveBasisClosed:function(e){return new PU(e)},curveBasisOpen:function(e){return new PH(e)},curveBasis:function(e){return new PF(e)},curveBumpX:function(e){return new PK(e,!0)},curveBumpY:function(e){return new PK(e,!1)},curveLinearClosed:function(e){return new PW(e)},curveLinear:PI,curveMonotoneX:function(e){return new PG(e)},curveMonotoneY:function(e){return new PX(e)},curveNatural:function(e){return new PJ(e)},curveStep:function(e){return new P0(e,.5)},curveStepAfter:function(e){return new P0(e,1)},curveStepBefore:function(e){return new P0(e,0)}},P5=function(e){return e.x===+e.x&&e.y===+e.y},P6=function(e){return e.x},P8=function(e){return e.y},P7=function(e,t){if((0,xQ.default)(e))return e;var n="curve".concat((0,kr.default)(e));return("curveMonotone"===n||"curveBump"===n)&&t?P9["".concat(n).concat("vertical"===t?"Y":"X")]:P9[n]||PI},Te=function(e){var t,n=e.type,r=e.points,i=void 0===r?[]:r,o=e.baseLine,a=e.layout,l=e.connectNulls,s=void 0!==l&&l,c=P7(void 0===n?"linear":n,a),u=s?i.filter(function(e){return P5(e)}):i;if(Array.isArray(o)){var d=s?o.filter(function(e){return P5(e)}):o,f=u.map(function(e,t){return P4(P4({},e),{},{base:d[t]})});return(t="vertical"===a?PL().y(P8).x1(P6).x0(function(e){return e.base.x}):PL().x(P6).y1(P8).y0(function(e){return e.base.y})).defined(P5).curve(c),t(f)}return(t="vertical"===a&&xU(o)?PL().y(P8).x1(P6).x0(o):xU(o)?PL().x(P6).y1(P8).y0(o):PR().x(P6).y(P8)).defined(P5).curve(c),t(u)},Tt=function(e){var t=e.className,n=e.points,r=e.path,i=e.pathRef;if((!n||!n.length)&&!r)return null;var o=n&&n.length?Te(e):r;return G.createElement("path",P2({},wh(e,!1),x8(e),{className:(0,xT.U)("recharts-curve",t),d:o,ref:i}))};function Tn(e){return(Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Tr=["x","y","top","left","width","height","className"];function Ti(){return(Ti=Object.assign.bind()).apply(this,arguments)}function To(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Ta=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.top,a=void 0===o?0:o,l=e.left,s=void 0===l?0:l,c=e.width,u=void 0===c?0:c,d=e.height,f=void 0===d?0:d,p=e.className,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?To(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=Tn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Tn(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Tn(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):To(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({x:n,y:i,top:a,left:s,width:u,height:f},function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Tr));return xU(n)&&xU(i)&&xU(u)&&xU(f)&&xU(a)&&xU(s)?G.default.createElement("path",Ti({},wh(h,!0),{className:(0,xT.U)("recharts-cross",p),d:"M".concat(n,",").concat(a,"v").concat(f,"M").concat(s,",").concat(i,"h").concat(u)})):null};function Tl(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle;return{points:[Aa(t,n,r,i),Aa(t,n,r,o)],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function Ts(e){return(Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tc(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=Ts(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ts(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ts(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Td(e){var t,n,r,i,o=e.element,a=e.tooltipEventType,l=e.isActive,s=e.activeCoordinate,c=e.activePayload,u=e.offset,d=e.activeTooltipIndex,f=e.tooltipAxisBandSize,p=e.layout,h=e.chartName,m=null!=(n=o.props.cursor)?n:null==(r=o.type.defaultProps)?void 0:r.cursor;if(!o||!m||!l||!s||"ScatterChart"!==h&&"axis"!==a)return null;var g=Tt;if("ScatterChart"===h)i=s,g=Ta;else if("BarChart"===h)t=f/2,i={stroke:"none",fill:"#ccc",x:"horizontal"===p?s.x-t:u.left+.5,y:"horizontal"===p?u.top+.5:s.y-t,width:"horizontal"===p?f:u.width-1,height:"horizontal"===p?u.height-1:f},g=SB;else if("radial"===p){var y=Tl(s),b=y.cx,v=y.cy,x=y.radius;i={cx:b,cy:v,startAngle:y.startAngle,endAngle:y.endAngle,innerRadius:x,outerRadius:x},g=A2}else i={points:function(e,t,n){var r,i,o,a;if("horizontal"===e)o=r=t.x,i=n.top,a=n.top+n.height;else if("vertical"===e)a=i=t.y,r=n.left,o=n.left+n.width;else if(null!=t.cx&&null!=t.cy)if("centric"!==e)return Tl(t);else{var l=t.cx,s=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.angle,f=Aa(l,s,c,d),p=Aa(l,s,u,d);r=f.x,i=f.y,o=p.x,a=p.y}return[{x:r,y:i},{x:o,y:a}]}(p,s,u)},g=Tt;var w=Tu(Tu(Tu(Tu({stroke:"#ccc",pointerEvents:"none"},u),i),wh(m,!1)),{},{payload:c,payloadIndex:d,className:(0,xT.U)("recharts-tooltip-cursor",m.className)});return(0,G.isValidElement)(m)?(0,G.cloneElement)(m,w):(0,G.createElement)(g,w)}var Tf=["item"],Tp=["children","className","width","height","style","compact","title","desc"];function Th(e){return(Th="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tm(){return(Tm=Object.assign.bind()).apply(this,arguments)}function Tg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(e,t)||Tk(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ty(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Tb=function(){return!!e})()}function Tv(e){return(Tv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tx(e,t){return(Tx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Tw(e){return function(e){if(Array.isArray(e))return T_(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Tk(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tk(e,t){if(e){if("string"==typeof e)return T_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T_(e,t)}}function T_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TS(Object(n),!0).forEach(function(t){Tj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tj(e,t,n){return(t=TO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TO(e){var t=function(e,t){if("object"!=Th(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Th(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Th(t)?t:t+""}var TN={xAxis:["bottom","top"],yAxis:["left","right"]},TC={width:"100%",height:"100%"},TA={x:0,y:0};function TM(e){return e}var TP=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if("horizontal"===e)return{x:i.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:i.coordinate};if("centric"===e){var o=i.coordinate,a=r.radius;return TE(TE(TE({},r),Aa(r.cx,r.cy,a,o)),{},{angle:o,radius:a})}var l=i.coordinate,s=r.angle;return TE(TE(TE({},r),Aa(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}return TA},TT=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,o=(null!=n?n:[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(Tw(e),Tw(n)):e},[]);return o.length>0?o:e&&e.length&&xU(r)&&xU(i)?e.slice(r,i+1):[]};function TI(e){return"number"===e?[0,"auto"]:void 0}var TD=function(e,t,n,r){var i=e.graphicalItems,o=e.tooltipAxis,a=TT(t,e);return n<0||!i||!i.length||n>=a.length?null:i.reduce(function(i,l){var s,c,u=null!=(s=l.props.data)?s:t;return(u&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),c=o.dataKey&&!o.allowDuplicatedCategory?xX(void 0===u?a:u,o.dataKey,r):u&&u[n]||a[n])?[].concat(Tw(i),[Cq(l,c)]):i},[])},Tz=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},o="horizontal"===n?i.x:"vertical"===n?i.y:"centric"===n?i.angle:i.radius,a=e.orderedTooltipTicks,l=e.tooltipAxis,s=e.tooltipTicks,c=Cm(o,a,s,l);if(c>=0&&s){var u=s[c]&&s[c].value,d=TD(e,t,c,u),f=TP(n,a,c,i);return{activeTooltipIndex:c,activeLabel:u,activePayload:d,activeCoordinate:f}}return null},TR=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.layout,u=e.children,d=e.stackOffset,f=C_(c,i);return n.reduce(function(t,n){var p=void 0!==n.type.defaultProps?TE(TE({},n.type.defaultProps),n.props):n.props,h=p.type,m=p.dataKey,g=p.allowDataOverflow,y=p.allowDuplicatedCategory,b=p.scale,v=p.ticks,x=p.includeHidden,w=p[o];if(t[w])return t;var k=TT(e.data,{graphicalItems:r.filter(function(e){var t;return(o in e.props?e.props[o]:null==(t=e.type.defaultProps)?void 0:t[o])===w}),dataStartIndex:l,dataEndIndex:s}),_=k.length;(function(e,t,n){if("number"===n&&!0===t&&Array.isArray(e)){var r=null==e?void 0:e[0],i=null==e?void 0:e[1];if(r&&i&&xU(r)&&xU(i))return!0}return!1})(p.domain,g,h)&&(j=CH(p.domain,null,g),f&&("number"===h||"auto"!==b)&&(N=Ch(k,m,"category")));var S=TI(h);if(!j||0===j.length){var E,j,O,N,C,A=null!=(C=p.domain)?C:S;if(m){if(j=Ch(k,m,h),"category"===h&&f){var M=xV(j);y&&M?(O=j,j=(0,wS.default)(0,_)):y||(j=CW(A,j,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(Tw(e),[t])},[]))}else if("category"===h)j=y?j.filter(function(e){return""!==e&&!(0,x$.default)(e)}):CW(A,j,n).reduce(function(e,t){return e.indexOf(t)>=0||""===t||(0,x$.default)(t)?e:[].concat(Tw(e),[t])},[]);else if("number"===h){var P=Cw(k,r.filter(function(e){var t,n,r=o in e.props?e.props[o]:null==(t=e.type.defaultProps)?void 0:t[o],i="hide"in e.props?e.props.hide:null==(n=e.type.defaultProps)?void 0:n.hide;return r===w&&(x||!i)}),m,i,c);P&&(j=P)}f&&("number"===h||"auto"!==b)&&(N=Ch(k,m,"category"))}else j=f?(0,wS.default)(0,_):a&&a[w]&&a[w].hasStack&&"number"===h?"expand"===d?[0,1]:CB(a[w].stackGroups,l,s):Ck(k,r.filter(function(e){var t=o in e.props?e.props[o]:e.type.defaultProps[o],n="hide"in e.props?e.props.hide:e.type.defaultProps.hide;return t===w&&(x||!n)}),h,c,!0);"number"===h?(j=Pj(u,j,w,i,v),A&&(j=CH(A,j,g))):"category"===h&&A&&j.every(function(e){return A.indexOf(e)>=0})&&(j=A)}return TE(TE({},t),{},Tj({},w,TE(TE({},p),{},{axisType:i,domain:j,categoricalDomain:N,duplicateDomain:O,originalDomain:null!=(E=p.domain)?E:S,isCategorical:f,layout:c})))},{})},TL=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.layout,u=e.children,d=TT(e.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:s}),f=d.length,p=C_(c,i),h=-1;return n.reduce(function(e,t){var m,g=(void 0!==t.type.defaultProps?TE(TE({},t.type.defaultProps),t.props):t.props)[o],y=TI("number");return e[g]?e:(h++,m=p?(0,wS.default)(0,f):a&&a[g]&&a[g].hasStack?Pj(u,m=CB(a[g].stackGroups,l,s),g,i):Pj(u,m=CH(y,Ck(d,n.filter(function(e){var t,n,r=o in e.props?e.props[o]:null==(t=e.type.defaultProps)?void 0:t[o],i="hide"in e.props?e.props.hide:null==(n=e.type.defaultProps)?void 0:n.hide;return r===g&&!i}),"number",c),r.defaultProps.allowDataOverflow),g,i),TE(TE({},e),{},Tj({},g,TE(TE({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,xR.default)(TN,"".concat(i,".").concat(h%2),null),domain:m,originalDomain:y,isCategorical:p,layout:c}))))},{})},T$=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,i=t.AxisComp,o=t.graphicalItems,a=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=wc(c,i),f={};return d&&d.length?f=TR(e,{axes:d,graphicalItems:o,axisType:r,axisIdKey:u,stackGroups:a,dataStartIndex:l,dataEndIndex:s}):o&&o.length&&(f=TL(e,{Axis:i,graphicalItems:o,axisType:r,axisIdKey:u,stackGroups:a,dataStartIndex:l,dataEndIndex:s})),f},TB=function(e){var t=xZ(e),n=CE(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,wE.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:CK(t,n)}},TF=function(e){var t=e.children,n=e.defaultShowTooltip,r=wu(t,At),i=0,o=0;return e.data&&0!==e.data.length&&(o=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(o=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},TU=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},TH=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,o=void 0===i?{}:i,a=e.yAxisMap,l=void 0===a?{}:a,s=n.width,c=n.height,u=n.children,d=n.margin||{},f=wu(u,At),p=wu(u,k1),h=Object.keys(l).reduce(function(e,t){var n=l[t],r=n.orientation;return n.mirror||n.hide?e:TE(TE({},e),{},Tj({},r,e[r]+n.width))},{left:d.left||0,right:d.right||0}),m=Object.keys(o).reduce(function(e,t){var n=o[t],r=n.orientation;return n.mirror||n.hide?e:TE(TE({},e),{},Tj({},r,(0,xR.default)(e,"".concat(r))+n.height))},{top:d.top||0,bottom:d.bottom||0}),g=TE(TE({},m),h),y=g.bottom;f&&(g.bottom+=f.props.height||At.defaultProps.height),p&&t&&(g=Cv(g,r,n,t));var b=s-g.left-g.right,v=c-g.top-g.bottom;return TE(TE({brushBottom:y},g),{},{width:Math.max(b,0),height:Math.max(v,0)})},TK=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=void 0===r?"axis":r,o=e.validateTooltipEventTypes,a=void 0===o?["axis"]:o,l=e.axisComponents,s=e.legendContent,c=e.formatAxisMap,u=e.defaultProps,d=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,o=t.updateId,a=t.dataStartIndex,s=t.dataEndIndex,c=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,h=TU(u),m=h.numericAxisName,g=h.cateAxisName,y=!!n&&!!n.length&&n.some(function(e){var t=wo(e&&e.type);return t&&t.indexOf("Bar")>=0}),b=[];return n.forEach(function(n,h){var v=TT(e.data,{graphicalItems:[n],dataStartIndex:a,dataEndIndex:s}),x=void 0!==n.type.defaultProps?TE(TE({},n.type.defaultProps),n.props):n.props,w=x.dataKey,k=x.maxBarSize,_=x["".concat(m,"Id")],S=x["".concat(g,"Id")],E=l.reduce(function(e,n){var r=t["".concat(n.axisType,"Map")],i=x["".concat(n.axisType,"Id")];r&&r[i]||"zAxis"===n.axisType||wj(!1);var o=r[i];return TE(TE({},e),{},Tj(Tj({},n.axisType,o),"".concat(n.axisType,"Ticks"),CE(o)))},{}),j=E[g],O=E["".concat(g,"Ticks")],N=r&&r[_]&&r[_].hasStack&&C$(n,r[_].stackGroups),C=wo(n.type).indexOf("Bar")>=0,A=CK(j,O),M=[],P=y&&Cy({barSize:c,stackGroups:r,totalSize:"xAxis"===g?E[g].width:"yAxis"===g?E[g].height:void 0});if(C){var T,I,D=(0,x$.default)(k)?p:k,z=null!=(T=null!=(I=CK(j,O,!0))?I:D)?T:0;M=Cb({barGap:d,barCategoryGap:f,bandSize:z!==A?z:A,sizeList:P[S],maxBarSize:D}),z!==A&&(M=M.map(function(e){return TE(TE({},e),{},{position:TE(TE({},e.position),{},{offset:e.position.offset-z/2})})}))}var R=n&&n.type&&n.type.getComposedData;R&&b.push({props:TE(TE({},R(TE(TE({},E),{},{displayedData:v,props:e,dataKey:w,item:n,bandSize:A,barPosition:M,offset:i,stackedData:N,layout:u,dataStartIndex:a,dataEndIndex:s}))),{},Tj(Tj(Tj({key:n.key||"item-".concat(h)},m,E[m]),g,E[g]),"animationId",o)),childIndex:ws(e.children).indexOf(n),item:n})}),b},f=function(e,r){var i=e.props,o=e.dataStartIndex,a=e.dataEndIndex,s=e.updateId;if(!wd({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,h=i.data,m=i.reverseStackOrder,g=TU(f),y=g.numericAxisName,b=g.cateAxisName,v=wc(u,n),x=CI(h,v,"".concat(y,"Id"),"".concat(b,"Id"),p,m),w=l.reduce(function(e,t){var n="".concat(t.axisType,"Map");return TE(TE({},e),{},Tj({},n,T$(i,TE(TE({},t),{},{graphicalItems:v,stackGroups:t.axisType===y&&x,dataStartIndex:o,dataEndIndex:a}))))},{}),k=TH(TE(TE({},w),{},{props:i,graphicalItems:v}),null==r?void 0:r.legendBBox);Object.keys(w).forEach(function(e){w[e]=c(i,w[e],k,e.replace("Map",""),t)});var _=TB(w["".concat(b,"Map")]),S=d(i,TE(TE({},w),{},{dataStartIndex:o,dataEndIndex:a,updateId:s,graphicalItems:v,stackGroups:x,offset:k}));return TE(TE({formattedGraphicalItems:S,graphicalItems:v,offset:k,stackGroups:x},_),w)},p=function(e){var n;function r(e){var n,i,o,a,l;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return a=r,l=[e],a=Tv(a),Tj(o=function(e,t){if(t&&("object"===Th(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,Tb()?Reflect.construct(a,l||[],Tv(this).constructor):a.apply(this,l)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Tj(o,"accessibilityManager",new PP),Tj(o,"handleLegendBBoxUpdate",function(e){if(e){var t=o.state,n=t.dataStartIndex,r=t.dataEndIndex,i=t.updateId;o.setState(TE({legendBBox:e},f({props:o.props,dataStartIndex:n,dataEndIndex:r,updateId:i},TE(TE({},o.state),{},{legendBBox:e}))))}}),Tj(o,"handleReceiveSyncEvent",function(e,t,n){o.props.syncId===e&&(n!==o.eventEmitterSymbol||"function"==typeof o.props.syncMethod)&&o.applySyncEvent(t)}),Tj(o,"handleBrushChange",function(e){var t=e.startIndex,n=e.endIndex;if(t!==o.state.dataStartIndex||n!==o.state.dataEndIndex){var r=o.state.updateId;o.setState(function(){return TE({dataStartIndex:t,dataEndIndex:n},f({props:o.props,dataStartIndex:t,dataEndIndex:n,updateId:r},o.state))}),o.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),Tj(o,"handleMouseEnter",function(e){var t=o.getMouseInfo(e);if(t){var n=TE(TE({},t),{},{isTooltipActive:!0});o.setState(n),o.triggerSyncEvent(n);var r=o.props.onMouseEnter;(0,xQ.default)(r)&&r(n,e)}}),Tj(o,"triggeredAfterMouseMove",function(e){var t=o.getMouseInfo(e),n=t?TE(TE({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};o.setState(n),o.triggerSyncEvent(n);var r=o.props.onMouseMove;(0,xQ.default)(r)&&r(n,e)}),Tj(o,"handleItemMouseEnter",function(e){o.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),Tj(o,"handleItemMouseLeave",function(){o.setState(function(){return{isTooltipActive:!1}})}),Tj(o,"handleMouseMove",function(e){e.persist(),o.throttleTriggeredAfterMouseMove(e)}),Tj(o,"handleMouseLeave",function(e){o.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};o.setState(t),o.triggerSyncEvent(t);var n=o.props.onMouseLeave;(0,xQ.default)(n)&&n(t,e)}),Tj(o,"handleOuterEvent",function(e){var t,n=wb(e),r=(0,xR.default)(o.props,"".concat(n));n&&(0,xQ.default)(r)&&r(null!=(t=/.*touch.*/i.test(n)?o.getMouseInfo(e.changedTouches[0]):o.getMouseInfo(e))?t:{},e)}),Tj(o,"handleClick",function(e){var t=o.getMouseInfo(e);if(t){var n=TE(TE({},t),{},{isTooltipActive:!0});o.setState(n),o.triggerSyncEvent(n);var r=o.props.onClick;(0,xQ.default)(r)&&r(n,e)}}),Tj(o,"handleMouseDown",function(e){var t=o.props.onMouseDown;(0,xQ.default)(t)&&t(o.getMouseInfo(e),e)}),Tj(o,"handleMouseUp",function(e){var t=o.props.onMouseUp;(0,xQ.default)(t)&&t(o.getMouseInfo(e),e)}),Tj(o,"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&o.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),Tj(o,"handleTouchStart",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&o.handleMouseDown(e.changedTouches[0])}),Tj(o,"handleTouchEnd",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&o.handleMouseUp(e.changedTouches[0])}),Tj(o,"handleDoubleClick",function(e){var t=o.props.onDoubleClick;(0,xQ.default)(t)&&t(o.getMouseInfo(e),e)}),Tj(o,"handleContextMenu",function(e){var t=o.props.onContextMenu;(0,xQ.default)(t)&&t(o.getMouseInfo(e),e)}),Tj(o,"triggerSyncEvent",function(e){void 0!==o.props.syncId&&PO.emit(PN,o.props.syncId,e,o.eventEmitterSymbol)}),Tj(o,"applySyncEvent",function(e){var t=o.props,n=t.layout,r=t.syncMethod,i=o.state.updateId,a=e.dataStartIndex,l=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)o.setState(TE({dataStartIndex:a,dataEndIndex:l},f({props:o.props,dataStartIndex:a,dataEndIndex:l,updateId:i},o.state)));else if(void 0!==e.activeTooltipIndex){var s=e.chartX,c=e.chartY,u=e.activeTooltipIndex,d=o.state,p=d.offset,h=d.tooltipTicks;if(!p)return;if("function"==typeof r)u=r(h,e);else if("value"===r){u=-1;for(var m=0;m<h.length;m++)if(h[m].value===e.activeLabel){u=m;break}}var g=TE(TE({},p),{},{x:p.left,y:p.top}),y=Math.min(s,g.x+g.width),b=Math.min(c,g.y+g.height),v=h[u]&&h[u].value,x=TD(o.state,o.props.data,u),w=h[u]?{x:"horizontal"===n?h[u].coordinate:y,y:"horizontal"===n?b:h[u].coordinate}:TA;o.setState(TE(TE({},e),{},{activeLabel:v,activeCoordinate:w,activePayload:x,activeTooltipIndex:u}))}else o.setState(e)}),Tj(o,"renderCursor",function(e){var n,r=o.state,i=r.isTooltipActive,a=r.activeCoordinate,l=r.activePayload,s=r.offset,c=r.activeTooltipIndex,u=r.tooltipAxisBandSize,d=o.getTooltipEventType(),f=null!=(n=e.props.active)?n:i,p=o.props.layout,h=e.key||"_recharts-cursor";return G.default.createElement(Td,{key:h,activeCoordinate:a,activePayload:l,activeTooltipIndex:c,chartName:t,element:e,isActive:f,layout:p,offset:s,tooltipAxisBandSize:u,tooltipEventType:d})}),Tj(o,"renderPolarAxis",function(e,t,n){var r=(0,xR.default)(e,"type.axisType"),i=(0,xR.default)(o.state,"".concat(r,"Map")),a=e.type.defaultProps,l=void 0!==a?TE(TE({},a),e.props):e.props,s=i&&i[l["".concat(r,"Id")]];return(0,G.cloneElement)(e,TE(TE({},s),{},{className:(0,xT.U)(r,s.className),key:e.key||"".concat(t,"-").concat(n),ticks:CE(s,!0)}))}),Tj(o,"renderPolarGrid",function(e){var t=e.props,n=t.radialLines,r=t.polarAngles,i=t.polarRadius,a=o.state,l=a.radiusAxisMap,s=a.angleAxisMap,c=xZ(l),u=xZ(s),d=u.cx,f=u.cy,p=u.innerRadius,h=u.outerRadius;return(0,G.cloneElement)(e,{polarAngles:Array.isArray(r)?r:CE(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(i)?i:CE(c,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:h,key:e.key||"polar-grid",radialLines:n})}),Tj(o,"renderLegend",function(){var e=o.state.formattedGraphicalItems,t=o.props,n=t.children,r=t.width,i=t.height,a=o.props.margin||{},l=Ca({children:n,formattedGraphicalItems:e,legendWidth:r-(a.left||0)-(a.right||0),legendContent:s});if(!l)return null;var c=l.item,u=Ty(l,Tf);return(0,G.cloneElement)(c,TE(TE({},u),{},{chartWidth:r,chartHeight:i,margin:a,onBBoxUpdate:o.handleLegendBBoxUpdate}))}),Tj(o,"renderTooltip",function(){var e,t=o.props,n=t.children,r=t.accessibilityLayer,i=wu(n,kn);if(!i)return null;var a=o.state,l=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,u=a.activeLabel,d=a.offset,f=null!=(e=i.props.active)?e:l;return(0,G.cloneElement)(i,{viewBox:TE(TE({},d),{},{x:d.left,y:d.top}),active:f,label:u,payload:f?c:[],coordinate:s,accessibilityLayer:r})}),Tj(o,"renderBrush",function(e){var t=o.props,n=t.margin,r=t.data,i=o.state,a=i.offset,l=i.dataStartIndex,s=i.dataEndIndex,c=i.updateId;return(0,G.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:CO(o.handleBrushChange,e.props.onChange),data:r,x:xU(e.props.x)?e.props.x:a.left,y:xU(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(n.bottom||0),width:xU(e.props.width)?e.props.width:a.width,startIndex:l,endIndex:s,updateId:"brush-".concat(c)})}),Tj(o,"renderReferenceElement",function(e,t,n){if(!e)return null;var r=o.clipPathId,i=o.state,a=i.xAxisMap,l=i.yAxisMap,s=i.offset,c=e.type.defaultProps||{},u=e.props,d=u.xAxisId,f=void 0===d?c.xAxisId:d,p=u.yAxisId,h=void 0===p?c.yAxisId:p;return(0,G.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:a[f],yAxis:l[h],viewBox:{x:s.left,y:s.top,width:s.width,height:s.height},clipPathId:r})}),Tj(o,"renderActivePoints",function(e){var t=e.item,n=e.activePoint,i=e.basePoint,o=e.childIndex,a=e.isRange,l=[],s=t.props.key,c=void 0!==t.item.type.defaultProps?TE(TE({},t.item.type.defaultProps),t.item.props):t.item.props,u=c.activeDot,d=TE(TE({index:o,dataKey:c.dataKey,cx:n.x,cy:n.y,r:4,fill:Cg(t.item),strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value},wh(u,!1)),x8(u));return l.push(r.renderActiveDot(u,d,"".concat(s,"-activePoint-").concat(o))),i?l.push(r.renderActiveDot(u,TE(TE({},d),{},{cx:i.x,cy:i.y}),"".concat(s,"-basePoint-").concat(o))):a&&l.push(null),l}),Tj(o,"renderGraphicChild",function(e,t,n){var r=o.filterFormatItem(e,t,n);if(!r)return null;var i=o.getTooltipEventType(),a=o.state,l=a.isTooltipActive,s=a.tooltipAxis,c=a.activeTooltipIndex,u=a.activeLabel,d=wu(o.props.children,kn),f=r.props,p=f.points,h=f.isRange,m=f.baseLine,g=void 0!==r.item.type.defaultProps?TE(TE({},r.item.type.defaultProps),r.item.props):r.item.props,y=g.activeDot,b=g.hide,v=g.activeBar,x=g.activeShape,w=!!(!b&&l&&d&&(y||v||x)),k={};"axis"!==i&&d&&"click"===d.props.trigger?k={onClick:CO(o.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(k={onMouseLeave:CO(o.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:CO(o.handleItemMouseEnter,e.props.onMouseEnter)});var _=(0,G.cloneElement)(e,TE(TE({},r.props),k));if(w)if(c>=0){if(s.dataKey&&!s.allowDuplicatedCategory){var S="function"==typeof s.dataKey?function(e){return"function"==typeof s.dataKey?s.dataKey(e.payload):null}:"payload.".concat(s.dataKey.toString());j=xX(p,S,u),O=h&&m&&xX(m,S,u)}else j=null==p?void 0:p[c],O=h&&m&&m[c];if(x||v){var E=void 0!==e.props.activeIndex?e.props.activeIndex:c;return[(0,G.cloneElement)(e,TE(TE(TE({},r.props),k),{},{activeIndex:E})),null,null]}if(!(0,x$.default)(j))return[_].concat(Tw(o.renderActivePoints({item:r,activePoint:j,basePoint:O,childIndex:c,isRange:h})))}else{var j,O,N,C=(null!=(N=o.getItemByXY(o.state.activeCoordinate))?N:{graphicalItem:_}).graphicalItem,A=C.item,M=void 0===A?e:A,P=C.childIndex,T=TE(TE(TE({},r.props),k),{},{activeIndex:P});return[(0,G.cloneElement)(M,T),null,null]}return h?[_,null,null]:[_,null]}),Tj(o,"renderCustomized",function(e,t,n){return(0,G.cloneElement)(e,TE(TE({key:"recharts-customized-".concat(n)},o.props),o.state))}),Tj(o,"renderMap",{CartesianGrid:{handler:TM,once:!0},ReferenceArea:{handler:o.renderReferenceElement},ReferenceLine:{handler:TM},ReferenceDot:{handler:o.renderReferenceElement},XAxis:{handler:TM},YAxis:{handler:TM},Brush:{handler:o.renderBrush,once:!0},Bar:{handler:o.renderGraphicChild},Line:{handler:o.renderGraphicChild},Area:{handler:o.renderGraphicChild},Radar:{handler:o.renderGraphicChild},RadialBar:{handler:o.renderGraphicChild},Scatter:{handler:o.renderGraphicChild},Pie:{handler:o.renderGraphicChild},Funnel:{handler:o.renderGraphicChild},Tooltip:{handler:o.renderCursor,once:!0},PolarGrid:{handler:o.renderPolarGrid,once:!0},PolarAngleAxis:{handler:o.renderPolarAxis},PolarRadiusAxis:{handler:o.renderPolarAxis},Customized:{handler:o.renderCustomized}}),o.clipPathId="".concat(null!=(n=e.id)?n:xW("recharts"),"-clip"),o.throttleTriggeredAfterMouseMove=(0,xI.default)(o.triggeredAfterMouseMove,null!=(i=e.throttleDelay)?i:1e3/60),o.state={},o}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Tx(r,e),n=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!=(e=this.props.margin.left)?e:0,top:null!=(t=this.props.margin.top)?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,o=wu(t,kn);if(o){var a=o.props.defaultIndex;if("number"==typeof a&&!(a<0)&&!(a>this.state.tooltipTicks.length-1)){var l=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,s=TD(this.state,n,a,l),c=this.state.tooltipTicks[a].coordinate,u=(this.state.offset.top+r)/2,d="horizontal"===i?{x:c,y:u}:{y:c,x:u},f=this.state.formattedGraphicalItems.find(function(e){return"Scatter"===e.item.type.name});f&&(d=TE(TE({},d),f.props.points[a].tooltipPosition),s=f.props.points[a].tooltipPayload);var p={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:l,activePayload:s,activeCoordinate:d};this.setState(p),this.renderCursor(o),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!=(n=this.props.margin.left)?n:0,top:null!=(r=this.props.margin.top)?r:0}})}return null}},{key:"componentDidUpdate",value:function(e){wm([wu(e.children,kn)],[wu(this.props.children,kn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=wu(this.props.children,kn);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return a.indexOf(t)>=0?t:i}return i}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r={top:n.top+window.scrollY-document.documentElement.clientTop,left:n.left+window.scrollX-document.documentElement.clientLeft},i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},o=n.width/t.offsetWidth||1,a=this.inRange(i.chartX,i.chartY,o);if(!a)return null;var l=this.state,s=l.xAxisMap,c=l.yAxisMap,u=this.getTooltipEventType(),d=Tz(this.state,this.props.data,this.props.layout,a);if("axis"!==u&&s&&c){var f=xZ(s).scale,p=xZ(c).scale,h=f&&f.invert?f.invert(i.chartX):null,m=p&&p.invert?p.invert(i.chartY):null;return TE(TE({},i),{},{xValue:h,yValue:m},d)}return d?TE(TE({},i),d):null}},{key:"inRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,i=e/n,o=t/n;if("horizontal"===r||"vertical"===r){var a=this.state.offset;return i>=a.left&&i<=a.left+a.width&&o>=a.top&&o<=a.top+a.height?{x:i,y:o}:null}var l=this.state,s=l.angleAxisMap,c=l.radiusAxisMap;return s&&c?Au({x:i,y:o},xZ(s)):null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=wu(e,kn),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),TE(TE({},x8(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){PO.on(PN,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){PO.removeListener(PN,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,o=r.length;i<o;i++){var a=r[i];if(a.item===e||a.props.key===e.key||t===wo(a.item.type)&&n===a.childIndex)return a}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,o=t.width;return G.default.createElement("defs",null,G.default.createElement("clipPath",{id:e},G.default.createElement("rect",{x:n,y:r,height:i,width:o})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=Tg(t,2),r=n[0],i=n[1];return TE(TE({},e),{},Tj({},r,i.scale))},{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=Tg(t,2),r=n[0],i=n[1];return TE(TE({},e),{},Tj({},r,i.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null==(t=this.state.xAxisMap)||null==(t=t[e])?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null==(t=this.state.yAxisMap)||null==(t=t[e])?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,o=n.length;i<o;i++){var a=n[i],l=a.props,s=a.item,c=void 0!==s.type.defaultProps?TE(TE({},s.type.defaultProps),s.props):s.props,u=wo(s.type);if("Bar"===u){var d=(l.data||[]).find(function(t){return SL(e,t)});if(d)return{graphicalItem:a,payload:d}}else if("RadialBar"===u){var f=(l.data||[]).find(function(t){return Au(e,t)});if(f)return{graphicalItem:a,payload:f}}else if(A7(a,r)||Me(a,r)||Mt(a,r)){var p=function(e){var t,n,r,i=e.activeTooltipItem,o=e.graphicalItem,a=e.itemData,l=(A7(o,i)?t="trapezoids":Me(o,i)?t="sectors":Mt(o,i)&&(t="points"),t),s=A7(o,i)?null==(n=i.tooltipPayload)||null==(n=n[0])||null==(n=n.payload)?void 0:n.payload:Me(o,i)?null==(r=i.tooltipPayload)||null==(r=r[0])||null==(r=r.payload)?void 0:r.payload:Mt(o,i)?i.payload:{},c=a.filter(function(e,t){var n=(0,NT.default)(s,e),r=o.props[l].filter(function(e){var t;return(A7(o,i)?t=Mn:Me(o,i)?t=Mr:Mt(o,i)&&(t=Mi),t)(e,i)}),a=o.props[l].indexOf(r[r.length-1]);return n&&t===a});return a.indexOf(c[c.length-1])}({graphicalItem:a,activeTooltipItem:r,itemData:c.data}),h=void 0===c.activeIndex?p:c.activeIndex;return{graphicalItem:TE(TE({},a),{},{childIndex:h}),payload:Mt(a,r)?c.data[p]:a.props.data[p]}}}return null}},{key:"render",value:function(){var e,t,n=this;if(!wd(this))return null;var r=this.props,i=r.children,o=r.className,a=r.width,l=r.height,s=r.style,c=r.compact,u=r.title,d=r.desc,f=wh(Ty(r,Tp),!1);if(c)return G.default.createElement(M3,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},G.default.createElement(wC,Tm({},f,{width:a,height:l,title:u,desc:d}),this.renderClipPath(),wy(i,this.renderMap)));this.props.accessibilityLayer&&(f.tabIndex=null!=(e=this.props.tabIndex)?e:0,f.role=null!=(t=this.props.role)?t:"application",f.onKeyDown=function(e){n.accessibilityManager.keyboardEvent(e)},f.onFocus=function(){n.accessibilityManager.focus()});var p=this.parseEventsOfWrapper();return G.default.createElement(M3,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},G.default.createElement("div",Tm({className:(0,xT.U)("recharts-wrapper",o),style:TE({position:"relative",cursor:"default",width:a,height:l},s)},p,{ref:function(e){n.container=e}}),G.default.createElement(wC,Tm({},f,{width:a,height:l,title:u,desc:d,style:TC}),this.renderClipPath(),wy(i,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,TO(r.key),r)}}(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(G.Component);Tj(p,"displayName",t),Tj(p,"defaultProps",TE({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},u)),Tj(p,"getDerivedStateFromProps",function(e,t){var n=e.dataKey,r=e.data,i=e.children,o=e.width,a=e.height,l=e.layout,s=e.stackOffset,c=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(void 0===t.updateId){var p=TF(e);return TE(TE(TE({},p),{},{updateId:0},f(TE(TE({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:o,prevHeight:a,prevLayout:l,prevStackOffset:s,prevMargin:c,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||o!==t.prevWidth||a!==t.prevHeight||l!==t.prevLayout||s!==t.prevStackOffset||!x2(c,t.prevMargin)){var h=TF(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=TE(TE({},Tz(t,r,l)),{},{updateId:t.updateId+1}),y=TE(TE(TE({},h),m),g);return TE(TE(TE({},y),f(TE({props:e},y),t)),{},{prevDataKey:n,prevData:r,prevWidth:o,prevHeight:a,prevLayout:l,prevStackOffset:s,prevMargin:c,prevChildren:i})}if(!wm(i,t.prevChildren)){var b,v,x,w,k=wu(i,At),_=k&&null!=(b=null==(v=k.props)?void 0:v.startIndex)?b:u,S=k&&null!=(x=null==(w=k.props)?void 0:w.endIndex)?x:d,E=(0,x$.default)(r)||_!==u||S!==d?t.updateId+1:t.updateId;return TE(TE({updateId:E},f(TE(TE({props:e},t),{},{updateId:E,dataStartIndex:_,dataEndIndex:S}),t)),{},{prevChildren:i,dataStartIndex:_,dataEndIndex:S})}return null}),Tj(p,"renderActiveDot",function(e,t,n){var r;return r=(0,G.isValidElement)(e)?(0,G.cloneElement)(e,t):(0,xQ.default)(e)?e(t):G.default.createElement(k3,t),G.default.createElement(wP,{className:"recharts-active-dot",key:n},r)});var h=(0,G.forwardRef)(function(e,t){return G.default.createElement(p,Tm({},e,{ref:t}))});return h.displayName=p.displayName,h};function TW(e,t,n){if(t<1)return[];if(1===t&&void 0===n)return e;for(var r=[],i=0;i<e.length;i+=t)if(void 0!==n&&!0!==n(e[i]))return;else r.push(e[i]);return r}function Tq(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function TZ(e){return(TZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function TV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TV(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=TZ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=TZ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==TZ(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TX(e,t,n){var r,i,o,a,l,s=e.tick,c=e.ticks,u=e.viewBox,d=e.minTickGap,f=e.orientation,p=e.interval,h=e.tickFormatter,m=e.unit,g=e.angle;if(!c||!c.length||!s)return[];if(xU(p)||w0.isSsr)return TW(c,("number"==typeof p&&xU(p)?p:0)+1);var y="top"===f||"bottom"===f?"width":"height",b=m&&"width"===y?S2(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},v=function(e,r){var i,o=(0,xQ.default)(h)?h(e.value,r):e.value;return"width"===y?(i=S2(o,{fontSize:t,letterSpacing:n}),MD({width:i.width+b.width,height:i.height+b.height},g)):S2(o,{fontSize:t,letterSpacing:n})[y]},x=c.length>=2?xB(c[1].coordinate-c[0].coordinate):1,w=(r="width"===y,i=u.x,o=u.y,a=u.width,l=u.height,1===x?{start:r?i:o,end:r?i+a:o+l}:{start:r?i+a:o+l,end:r?i:o});return"equidistantPreserveStart"===p?function(e,t,n,r,i){for(var o,a=(r||[]).slice(),l=t.start,s=t.end,c=0,u=1,d=l;u<=a.length;)if(o=function(){var t,o=null==r?void 0:r[c];if(void 0===o)return{v:TW(r,u)};var a=c,f=function(){return void 0===t&&(t=n(o,a)),t},p=o.coordinate,h=0===c||Tq(e,p,f,d,s);h||(c=0,d=l,u+=1),h&&(d=p+e*(f()/2+i),c+=u)}())return o.v;return[]}(x,w,v,c,d):("preserveStart"===p||"preserveStartEnd"===p?function(e,t,n,r,i,o){var a=(r||[]).slice(),l=a.length,s=t.start,c=t.end;if(o){var u=r[l-1],d=n(u,l-1),f=e*(u.coordinate+e*d/2-c);a[l-1]=u=TG(TG({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),Tq(e,u.tickCoord,function(){return d},s,c)&&(c=u.tickCoord-e*(d/2+i),a[l-1]=TG(TG({},u),{},{isShow:!0}))}for(var p=o?l-1:l,h=function(t){var r,o=a[t],l=function(){return void 0===r&&(r=n(o,t)),r};if(0===t){var u=e*(o.coordinate-e*l()/2-s);a[t]=o=TG(TG({},o),{},{tickCoord:u<0?o.coordinate-u*e:o.coordinate})}else a[t]=o=TG(TG({},o),{},{tickCoord:o.coordinate});Tq(e,o.tickCoord,l,s,c)&&(s=o.tickCoord+e*(l()/2+i),a[t]=TG(TG({},o),{},{isShow:!0}))},m=0;m<p;m++)h(m);return a}(x,w,v,c,d,"preserveStartEnd"===p):function(e,t,n,r,i){for(var o=(r||[]).slice(),a=o.length,l=t.start,s=t.end,c=function(t){var r,c=o[t],u=function(){return void 0===r&&(r=n(c,t)),r};if(t===a-1){var d=e*(c.coordinate+e*u()/2-s);o[t]=c=TG(TG({},c),{},{tickCoord:d>0?c.coordinate-d*e:c.coordinate})}else o[t]=c=TG(TG({},c),{},{tickCoord:c.coordinate});Tq(e,c.tickCoord,u,l,s)&&(s=c.tickCoord-e*(u()/2+i),o[t]=TG(TG({},c),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}(x,w,v,c,d)).filter(function(e){return e.isShow})}var TY=["viewBox"],TJ=["viewBox"],TQ=["ticks"];function T0(e){return(T0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T1(){return(T1=Object.assign.bind()).apply(this,arguments)}function T2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T2(Object(n),!0).forEach(function(t){T7(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T4(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function T9(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ie(r.key),r)}}function T5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T5=function(){return!!e})()}function T6(e){return(T6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T8(e,t){return(T8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function T7(e,t,n){return(t=Ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ie(e){var t=function(e,t){if("object"!=T0(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=T0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==T0(t)?t:t+""}var It=function(e){var t,n;function r(e){var t,n,i;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return n=r,i=[e],n=T6(n),(t=function(e,t){if(t&&("object"===T0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,T5()?Reflect.construct(n,i||[],T6(this).constructor):n.apply(this,i))).state={fontSize:"",letterSpacing:""},t}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&T8(r,e),t=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=T4(e,TY),i=this.props,o=i.viewBox,a=T4(i,TJ);return!x2(n,o)||!x2(r,a)||!x2(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,n,r,i,o,a,l=this.props,s=l.x,c=l.y,u=l.width,d=l.height,f=l.orientation,p=l.tickSize,h=l.mirror,m=l.tickMargin,g=h?-1:1,y=e.tickSize||p,b=xU(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=n=e.coordinate,a=(r=(i=c+!h*d)-g*y)-g*m,o=b;break;case"left":r=i=e.coordinate,o=(t=(n=s+!h*u)-g*y)-g*m,a=b;break;case"right":r=i=e.coordinate,o=(t=(n=s+h*u)+g*y)+g*m,a=b;break;default:t=n=e.coordinate,a=(r=(i=c+h*d)+g*y)+g*m,o=b}return{line:{x1:t,y1:r,x2:n,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,o=e.orientation,a=e.mirror,l=e.axisLine,s=T3(T3(T3({},wh(this.props,!1)),wh(l,!1)),{},{fill:"none"});if("top"===o||"bottom"===o){var c=+("top"===o&&!a||"bottom"===o&&a);s=T3(T3({},s),{},{x1:t,y1:n+c*i,x2:t+r,y2:n+c*i})}else{var u=+("left"===o&&!a||"right"===o&&a);s=T3(T3({},s),{},{x1:t+u*r,y1:n,x2:t+u*r,y2:n+i})}return G.default.createElement("line",T1({},s,{className:(0,xT.U)("recharts-cartesian-axis-line",(0,xR.default)(l,"className"))}))}},{key:"renderTicks",value:function(e,t,n){var i=this,o=this.props,a=o.tickLine,l=o.stroke,s=o.tick,c=o.tickFormatter,u=o.unit,d=TX(T3(T3({},this.props),{},{ticks:e}),t,n),f=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),h=wh(this.props,!1),m=wh(s,!1),g=T3(T3({},h),{},{fill:"none"},wh(a,!1)),y=d.map(function(e,t){var n=i.getTickLineCoord(e),o=n.line,y=n.tick,b=T3(T3(T3(T3({textAnchor:f,verticalAnchor:p},h),{},{stroke:"none",fill:l},m),y),{},{index:t,payload:e,visibleTicksCount:d.length,tickFormatter:c});return G.default.createElement(wP,T1({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},x7(i.props,e,t)),a&&G.default.createElement("line",T1({},g,o,{className:(0,xT.U)("recharts-cartesian-axis-tick-line",(0,xR.default)(a,"className"))})),s&&r.renderTickItem(s,b,"".concat((0,xQ.default)(c)?c(e.value,t):e.value).concat(u||"")))});return G.default.createElement("g",{className:"recharts-cartesian-axis-ticks"},y)}},{key:"render",value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,i=t.height,o=t.ticksGenerator,a=t.className;if(t.hide)return null;var l=this.props,s=l.ticks,c=T4(l,TQ),u=s;return((0,xQ.default)(o)&&(u=o(s&&s.length>0?this.props:c)),r<=0||i<=0||!u||!u.length)?null:G.default.createElement(wP,{className:(0,xT.U)("recharts-cartesian-axis",a),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),Aw.renderCallByParent(this.props))}}],n=[{key:"renderTickItem",value:function(e,t,n){var r=(0,xT.U)(t.className,"recharts-cartesian-axis-tick-value");return G.default.isValidElement(e)?G.default.cloneElement(e,T3(T3({},t),{},{className:r})):(0,xQ.default)(e)?e(T3(T3({},t),{},{className:r})):G.default.createElement(Ev,T1({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],t&&T9(r.prototype,t),n&&T9(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(G.Component);function In(e){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}T7(It,"displayName","CartesianAxis"),T7(It,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function Ir(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ir=function(){return!!e})()}function Ii(e){return(Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Io(e,t){return(Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ia(e,t,n){return(t=Il(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Il(e){var t=function(e,t){if("object"!=In(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=In(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==In(t)?t:t+""}function Is(){return(Is=Object.assign.bind()).apply(this,arguments)}function Ic(e){var t=e.xAxisId,n=M6(),r=M8(),i=M4(t);return null==i?null:G.createElement(It,Is({},i,{className:(0,xT.U)("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return CE(e,!0)}}))}var Iu=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=Ii(e),function(e,t){if(t&&("object"===In(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,Ir()?Reflect.construct(e,t||[],Ii(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Io(n,e),t=[{key:"render",value:function(){return G.createElement(Ic,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Il(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.Component);function Id(e){return(Id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Ia(Iu,"displayName","XAxis"),Ia(Iu,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function If(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(If=function(){return!!e})()}function Ip(e){return(Ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ih(e,t){return(Ih=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Im(e,t,n){return(t=Ig(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ig(e){var t=function(e,t){if("object"!=Id(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Id(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Id(t)?t:t+""}function Iy(){return(Iy=Object.assign.bind()).apply(this,arguments)}var Ib=function(e){var t=e.yAxisId,n=M6(),r=M8(),i=M5(t);return null==i?null:G.createElement(It,Iy({},i,{className:(0,xT.U)("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return CE(e,!0)}}))},Iv=function(e){var t;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=Ip(e),function(e,t){if(t&&("object"===Id(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,If()?Reflect.construct(e,t||[],Ip(this).constructor):e.apply(this,t))}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ih(n,e),t=[{key:"render",value:function(){return G.createElement(Ib,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ig(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(G.Component);Im(Iv,"displayName","YAxis"),Im(Iv,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});var Ix=TK({chartName:"BarChart",GraphicalChild:MS,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Iu},{axisType:"yAxis",AxisComp:Iv}],formatAxisMap:MM}),Iw=["type","layout","connectNulls","ref"],Ik=["key"];function I_(e){return(I_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function IS(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function IE(){return(IE=Object.assign.bind()).apply(this,arguments)}function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ij(Object(n),!0).forEach(function(t){II(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IN(e){return function(e){if(Array.isArray(e))return IC(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return IC(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return IC(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function IA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ID(r.key),r)}}function IM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(IM=function(){return!!e})()}function IP(e){return(IP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function IT(e,t){return(IT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function II(e,t,n){return(t=ID(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ID(e){var t=function(e,t){if("object"!=I_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=I_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==I_(t)?t:t+""}var Iz=function(e){var t,n;function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r,n=[].concat(o),t=IP(t),II(e=function(e,t){if(t&&("object"===I_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var n=e;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,IM()?Reflect.construct(t,n||[],IP(this).constructor):t.apply(this,n)),"state",{isAnimationFinished:!0,totalLength:0}),II(e,"generateSimpleStrokeDasharray",function(e,t){return"".concat(t,"px ").concat(e-t,"px")}),II(e,"getStrokeDasharray",function(t,n,i){var o=i.reduce(function(e,t){return e+t});if(!o)return e.generateSimpleStrokeDasharray(n,t);for(var a=Math.floor(t/o),l=t%o,s=n-t,c=[],u=0,d=0;u<i.length;d+=i[u],++u)if(d+i[u]>l){c=[].concat(IN(i.slice(0,u)),[l-d]);break}var f=c.length%2==0?[0,s]:[s];return[].concat(IN(r.repeat(i,a)),IN(c),f).map(function(e){return"".concat(e,"px")}).join(", ")}),II(e,"id",xW("recharts-line-")),II(e,"pathRef",function(t){e.mainCurve=t}),II(e,"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),II(e,"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&IT(r,e),t=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.points,i=n.xAxis,o=n.yAxis,a=n.layout,l=wc(n.children,Cn);if(!l)return null;var s=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:Cp(e.payload,t)}};return G.default.createElement(wP,{clipPath:e?"url(#clipPath-".concat(t,")"):null},l.map(function(e){return G.default.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:r,xAxis:i,yAxis:o,layout:a,dataPointFormatter:s})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.dot,a=i.points,l=i.dataKey,s=wh(this.props,!1),c=wh(o,!0),u=a.map(function(e,t){var n=IO(IO(IO({key:"dot-".concat(t),r:3},s),c),{},{index:t,cx:e.x,cy:e.y,value:e.value,dataKey:l,payload:e.payload,points:a});return r.renderDotItem(o,n)}),d={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return G.default.createElement(wP,IE({className:"recharts-line-dots",key:"dots"},d),u)}},{key:"renderCurveStatically",value:function(e,t,n,r){var i=this.props,o=i.type,a=i.layout,l=i.connectNulls,s=IO(IO(IO({},wh((i.ref,IS(i,Iw)),!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},r),{},{type:o,layout:a,connectNulls:l});return G.default.createElement(Tt,IE({},s,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,r=this.props,i=r.points,o=r.strokeDasharray,a=r.isAnimationActive,l=r.animationBegin,s=r.animationDuration,c=r.animationEasing,u=r.animationId,d=r.animateNewValues,f=r.width,p=r.height,h=this.state,m=h.prevPoints,g=h.totalLength;return G.default.createElement(Sn,{begin:l,duration:s,isActive:a,easing:c,from:{t:0},to:{t:1},key:"line-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var a,l=r.t;if(m){var s=m.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(m[n]){var r=m[n],i=xG(r.x,e.x),o=xG(r.y,e.y);return IO(IO({},e),{},{x:i(l),y:o(l)})}if(d){var a=xG(2*f,e.x),c=xG(p/2,e.y);return IO(IO({},e),{},{x:a(l),y:c(l)})}return IO(IO({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=xG(0,g)(l);if(o){var h="".concat(o).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});a=n.getStrokeDasharray(u,g,h)}else a=n.generateSimpleStrokeDasharray(g,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:a})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,i=n.isAnimationActive,o=this.state,a=o.prevPoints,l=o.totalLength;return i&&r&&r.length&&(!a&&l>0||!(0,NT.default)(a,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,i=t.points,o=t.className,a=t.xAxis,l=t.yAxis,s=t.top,c=t.left,u=t.width,d=t.height,f=t.isAnimationActive,p=t.id;if(n||!i||!i.length)return null;var h=this.state.isAnimationFinished,m=1===i.length,g=(0,xT.U)("recharts-line",o),y=a&&a.allowDataOverflow,b=l&&l.allowDataOverflow,v=y||b,x=(0,x$.default)(p)?this.id:p,w=null!=(e=wh(r,!1))?e:{r:3,strokeWidth:2},k=w.r,_=w.strokeWidth,S=(r&&"object"===wr(r)&&"clipDot"in r?r:{}).clipDot,E=void 0===S||S,j=2*(void 0===k?3:k)+(void 0===_?2:_);return G.default.createElement(wP,{className:g},y||b?G.default.createElement("defs",null,G.default.createElement("clipPath",{id:"clipPath-".concat(x)},G.default.createElement("rect",{x:y?c:c-u/2,y:b?s:s-d/2,width:y?u:2*u,height:b?d:2*d})),!E&&G.default.createElement("clipPath",{id:"clipPath-dots-".concat(x)},G.default.createElement("rect",{x:c-j/2,y:s-j/2,width:u+j,height:d+j}))):null,!m&&this.renderCurve(v,x),this.renderErrorBar(v,x),(m||r)&&this.renderDots(v,E,x),(!f||h)&&AR.renderCallByParent(this.props,i))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(IN(e),[0]):e,r=[],i=0;i<t;++i)r=[].concat(IN(r),IN(n));return r}},{key:"renderDotItem",value:function(e,t){var n;if(G.default.isValidElement(e))n=G.default.cloneElement(e,t);else if((0,xQ.default)(e))n=e(t);else{var r=t.key,i=IS(t,Ik),o=(0,xT.U)("recharts-line-dot","boolean"!=typeof e?e.className:"");n=G.default.createElement(k3,IE({key:r},i,{className:o}))}return n}}],t&&IA(r.prototype,t),n&&IA(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(G.PureComponent);II(Iz,"displayName","Line"),II(Iz,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!w0.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),II(Iz,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,a=e.dataKey,l=e.bandSize,s=e.displayedData,c=e.offset,u=t.layout;return IO({points:s.map(function(e,t){var s=Cp(e,a);return"horizontal"===u?{x:Cz({axis:n,ticks:i,bandSize:l,entry:e,index:t}),y:(0,x$.default)(s)?null:r.scale(s),value:s,payload:e}:{x:(0,x$.default)(s)?null:n.scale(s),y:Cz({axis:r,ticks:o,bandSize:l,entry:e,index:t}),value:s,payload:e}}),layout:u},c)});var IR=TK({chartName:"LineChart",GraphicalChild:Iz,axisComponents:[{axisType:"xAxis",AxisComp:Iu},{axisType:"yAxis",AxisComp:Iv}],formatAxisMap:MM}),IL=["x1","y1","x2","y2","key"],I$=["offset"];function IB(e){return(IB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function IF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?IF(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=IB(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=IB(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==IB(t)?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IH(){return(IH=Object.assign.bind()).apply(this,arguments)}function IK(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var IW=function(e){var t=e.fill;if(!t||"none"===t)return null;var n=e.fillOpacity,r=e.x,i=e.y,o=e.width,a=e.height,l=e.ry;return G.default.createElement("rect",{x:r,y:i,ry:l,width:o,height:a,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Iq(e,t){var n;if(G.default.isValidElement(e))n=G.default.cloneElement(e,t);else if((0,xQ.default)(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,a=t.y2,l=t.key,s=wh(IK(t,IL),!1),c=(s.offset,IK(s,I$));n=G.default.createElement("line",IH({},c,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:l}))}return n}function IZ(e){var t=e.x,n=e.width,r=e.horizontal,i=void 0===r||r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(r,o){return Iq(i,IU(IU({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:"line-".concat(o),index:o}))});return G.default.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function IV(e){var t=e.y,n=e.height,r=e.vertical,i=void 0===r||r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(r,o){return Iq(i,IU(IU({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:"line-".concat(o),index:o}))});return G.default.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function IG(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,a=e.height,l=e.horizontalPoints,s=e.horizontal;if(!(void 0===s||s)||!t||!t.length)return null;var c=l.map(function(e){return Math.round(e+i-i)}).sort(function(e,t){return e-t});i!==c[0]&&c.unshift(0);var u=c.map(function(e,l){var s=c[l+1]?c[l+1]-e:i+a-e;if(s<=0)return null;var u=l%t.length;return G.default.createElement("rect",{key:"react-".concat(l),y:e,x:r,height:s,width:o,stroke:"none",fill:t[u],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return G.default.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function IX(e){var t=e.vertical,n=e.verticalFill,r=e.fillOpacity,i=e.x,o=e.y,a=e.width,l=e.height,s=e.verticalPoints;if(!(void 0===t||t)||!n||!n.length)return null;var c=s.map(function(e){return Math.round(e+i-i)}).sort(function(e,t){return e-t});i!==c[0]&&c.unshift(0);var u=c.map(function(e,t){var s=c[t+1]?c[t+1]-e:i+a-e;if(s<=0)return null;var u=t%n.length;return G.default.createElement("rect",{key:"react-".concat(t),x:e,y:o,width:s,height:l,stroke:"none",fill:n[u],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return G.default.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var IY=function(e,t){var n=e.xAxis,r=e.width,i=e.height,o=e.offset;return CS(TX(IU(IU(IU({},It.defaultProps),n),{},{ticks:CE(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),o.left,o.left+o.width,t)},IJ=function(e,t){var n=e.yAxis,r=e.width,i=e.height,o=e.offset;return CS(TX(IU(IU(IU({},It.defaultProps),n),{},{ticks:CE(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),o.top,o.top+o.height,t)},IQ=[],I0=[];function I1(e){var t,n,r,i,o,a,l=M6(),s=M8(),c=(0,G.useContext)(MQ),u=IU(IU({},e),{},{stroke:null!=(t=e.stroke)?t:"#ccc",fill:null!=(n=e.fill)?n:"none",horizontal:null==(r=e.horizontal)||r,horizontalFill:null!=(i=e.horizontalFill)?i:I0,vertical:null==(o=e.vertical)||o,verticalFill:null!=(a=e.verticalFill)?a:IQ,x:xU(e.x)?e.x:c.left,y:xU(e.y)?e.y:c.top,width:xU(e.width)?e.width:c.width,height:xU(e.height)?e.height:c.height}),d=u.x,f=u.y,p=u.width,h=u.height,m=u.syncWithTicks,g=u.horizontalValues,y=u.verticalValues,b=xZ((0,G.useContext)(MX)),v=M9();if(!xU(p)||p<=0||!xU(h)||h<=0||!xU(d)||d!==+d||!xU(f)||f!==+f)return null;var x=u.verticalCoordinatesGenerator||IY,w=u.horizontalCoordinatesGenerator||IJ,k=u.horizontalPoints,_=u.verticalPoints;if((!k||!k.length)&&(0,xQ.default)(w)){var S=g&&g.length,E=w({yAxis:v?IU(IU({},v),{},{ticks:S?g:v.ticks}):void 0,width:l,height:s,offset:c},!!S||m);xJ(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(IB(E),"]")),Array.isArray(E)&&(k=E)}if((!_||!_.length)&&(0,xQ.default)(x)){var j=y&&y.length,O=x({xAxis:b?IU(IU({},b),{},{ticks:j?y:b.ticks}):void 0,width:l,height:s,offset:c},!!j||m);xJ(Array.isArray(O),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(IB(O),"]")),Array.isArray(O)&&(_=O)}return G.default.createElement("g",{className:"recharts-cartesian-grid"},G.default.createElement(IW,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),G.default.createElement(IZ,IH({},u,{offset:c,horizontalPoints:k,xAxis:b,yAxis:v})),G.default.createElement(IV,IH({},u,{offset:c,verticalPoints:_,xAxis:b,yAxis:v})),G.default.createElement(IG,IH({},u,{horizontalPoints:k})),G.default.createElement(IX,IH({},u,{verticalPoints:_})))}I1.displayName="CartesianGrid";let I2=[7,30,90],I3="beadscope.wipLimits",I4=["ready","in_progress","blocked"],I9=e=>e.slice(5),I5=e=>e>=48?`${(e/24).toFixed(1)}d`:`${e.toFixed(1)}h`;function I6(){let{projectId:e}=eu(),[t,n]=G.useState(30),[r,i]=G.useState(!0),{data:o,isLoading:a}=(0,ee.f)({queryKey:["insights",e,t],queryFn:()=>ei.k.insights(e,t),refetchInterval:3e4});return(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)(f3,{title:"Insights",subtitle:"flow metrics, human vs agent",controls:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:"flex-1 max-md:hidden"}),(0,V.jsxs)("label",{className:"flex items-center gap-[6px] text-label text-[var(--text-2)] max-md:min-h-11",children:[(0,V.jsx)(er.h,{checked:r,onChange:e=>i(e.target.checked)}),"Split by human/agent"]}),(0,V.jsx)(er.L,{label:"Range",options:I2.map(e=>({value:e,label:`${e}d`})),value:t,onChange:n})]})}),(0,V.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 max-md:p-4",children:a&&!o?(0,V.jsx)("div",{className:"p-8 text-center text-body text-[var(--text-3)]",children:"Loading insights…"}):o?(0,V.jsx)(I8,{data:o,split:r}):(0,V.jsx)("div",{className:"p-8 text-center text-body text-[var(--text-3)]",children:"No data."})})]})}function I8({data:e,split:t}){let[n,r]=G.useState(()=>(function(){try{return JSON.parse(localStorage.getItem(I3)||"{}")}catch{return{}}})()),i=e.throughput.reduce((e,t)=>e+t.total,0),o=e.columns.find(e=>"in_progress"===e.id)?.count??0;return(0,V.jsxs)("div",{className:"mx-auto flex max-w-5xl flex-col gap-5",children:[(0,V.jsxs)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[(0,V.jsx)(I7,{label:`Closed (last ${e.days}d)`,value:String(i)}),(0,V.jsx)(I7,{label:"Cycle p50",value:e.cycle.overall.count?I5(e.cycle.overall.p50):"—"}),(0,V.jsx)(I7,{label:"Cycle p90",value:e.cycle.overall.count?I5(e.cycle.overall.p90):"—"}),(0,V.jsx)(I7,{label:"In progress",value:String(o)})]}),!e.hasEvents&&(0,V.jsx)("div",{className:"rounded-[8px] border border-border bg-[var(--surface-2)] px-3 py-2 text-label text-[var(--text-3)]",children:"No interaction log found for this project — metrics are derived from bead created/closed timestamps (best effort)."}),(0,V.jsx)(De,{title:`Throughput \xb7 closed per day${t?" (human vs agent)":""}`,children:(0,V.jsx)(w_,{width:"100%",height:220,children:(0,V.jsxs)(Ix,{data:e.throughput,margin:{top:6,right:8,bottom:0,left:-18},children:[(0,V.jsx)(I1,{strokeDasharray:"3 3",stroke:"var(--border)"}),(0,V.jsx)(Iu,{dataKey:"date",tickFormatter:I9,stroke:"var(--text-3)",minTickGap:28}),(0,V.jsx)(Iv,{allowDecimals:!1,stroke:"var(--text-3)"}),(0,V.jsx)(kn,{contentStyle:{fontSize:"var(--fs-label)",background:"var(--surface)",border:"1px solid var(--border)"},labelFormatter:I9}),t&&(0,V.jsx)(k1,{wrapperStyle:{fontSize:"var(--fs-label)"},formatter:Dn}),t&&(0,V.jsx)(MS,{dataKey:"human",stackId:"a",fill:"#3b82f6",name:"Human",radius:[0,0,0,0]}),t&&(0,V.jsx)(MS,{dataKey:"agent",stackId:"a",fill:"#8b5cf6",name:"Agent",radius:[3,3,0,0]}),!t&&(0,V.jsx)(MS,{dataKey:"total",fill:"var(--brand)",name:"Closed",radius:[3,3,0,0]})]})})}),(0,V.jsx)(De,{title:"Created vs closed",children:(0,V.jsx)(w_,{width:"100%",height:220,children:(0,V.jsxs)(IR,{data:e.createdClosed,margin:{top:6,right:8,bottom:0,left:-18},children:[(0,V.jsx)(I1,{strokeDasharray:"3 3",stroke:"var(--border)"}),(0,V.jsx)(Iu,{dataKey:"date",tickFormatter:I9,stroke:"var(--text-3)",minTickGap:28}),(0,V.jsx)(Iv,{allowDecimals:!1,stroke:"var(--text-3)"}),(0,V.jsx)(kn,{contentStyle:{fontSize:"var(--fs-label)",background:"var(--surface)",border:"1px solid var(--border)"},labelFormatter:I9}),(0,V.jsx)(k1,{wrapperStyle:{fontSize:"var(--fs-label)"},formatter:Dn}),(0,V.jsx)(Iz,{type:"monotone",dataKey:"created",stroke:"#64748b",strokeWidth:2,dot:!1,name:"Created"}),(0,V.jsx)(Iz,{type:"monotone",dataKey:"closed",stroke:"#16a34a",strokeWidth:2,dot:!1,name:"Closed"})]})})}),(0,V.jsxs)("div",{className:"grid gap-5 md:grid-cols-2",children:[(0,V.jsx)(De,{title:"Cycle time (in progress → closed)",children:(0,V.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,V.jsx)(Dt,{label:"Overall",stat:e.cycle.overall}),(0,V.jsx)(Dt,{label:"👤 Human",stat:e.cycle.human}),(0,V.jsx)(Dt,{label:"🤖 Agent",stat:e.cycle.agent})]})}),(0,V.jsx)(De,{title:"Aging work in progress",children:0===e.aging.length?(0,V.jsx)("div",{className:"py-6 text-center text-label text-[var(--text-3)]",children:"Nothing in progress."}):(0,V.jsx)("div",{className:"flex flex-col gap-[6px]",children:e.aging.map(e=>(0,V.jsxs)("div",{className:"flex items-center gap-2 text-label",children:[(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:e.id}),(0,V.jsx)("span",{className:"flex-1 truncate text-[var(--text-2)]",children:e.title}),(0,V.jsxs)(pn,{color:e.days>=7?"#ef4444":void 0,tone:"strong",className:"font-semibold",children:[e.days,"d"]})]},e.id))})})]}),(0,V.jsxs)(De,{title:"Work-in-progress limits",children:[(0,V.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:e.columns.filter(e=>I4.includes(e.id)).map(e=>{let t=n[e.id]??0,i=t>0&&e.count>t;return(0,V.jsxs)("div",{className:"flex items-center justify-between rounded-[10px] border bg-[var(--surface-2)] p-3",style:{borderColor:i?"#ef4444":"var(--border)"},children:[(0,V.jsxs)("div",{children:[(0,V.jsxs)("div",{className:"flex items-center gap-[6px] text-label font-medium",children:[(0,V.jsx)("span",{className:"h-[8px] w-[8px] rounded-full",style:{background:e.color}}),e.name]}),(0,V.jsxs)("div",{className:"text-page-title font-semibold",style:{color:i?pe("#ef4444"):"var(--text)"},children:[e.count,i&&(0,V.jsx)("span",{className:"ml-1 text-meta font-medium",children:"over limit"})]})]}),(0,V.jsxs)("label",{className:"flex flex-col items-end gap-[3px] text-meta text-[var(--text-3)] max-md:min-h-11",children:["limit",(0,V.jsx)(er.C,{size:"sm",type:"number",min:0,value:t||"",placeholder:"0",onChange:t=>{var i,o;let a;return i=e.id,o=Math.max(0,Number(t.target.value)||0),void(r(a={...n,[i]:o}),localStorage.setItem(I3,JSON.stringify(a)))},className:"w-14 text-right"})]})]},e.id)})}),(0,V.jsx)("div",{className:"text-meta text-[var(--text-3)]",children:"Limits are per-device (stored in this browser). 0 = no limit."})]})]})}function I7({label:e,value:t}){return(0,V.jsxs)("div",{className:"rounded-[12px] border border-border bg-[var(--surface)] p-4",children:[(0,V.jsx)("div",{className:"text-meta uppercase tracking-[.03em] text-[var(--text-3)]",children:e}),(0,V.jsx)("div",{className:"mt-1 text-page-title font-semibold tracking-[-.02em]",children:t})]})}function De({title:e,children:t}){return(0,V.jsxs)("section",{className:"flex min-w-0 flex-col gap-3 rounded-[13px] border border-border bg-[var(--surface)] p-[16px_18px]",children:[(0,V.jsx)("div",{className:"text-body font-semibold",children:e}),t]})}function Dt({label:e,stat:t}){return(0,V.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 rounded-[9px] bg-[var(--surface-2)] px-3 py-2 text-label",children:[(0,V.jsx)("span",{className:"font-medium text-[var(--text-2)]",children:e}),0===t.count?(0,V.jsx)("span",{className:"text-[var(--text-3)]",children:"no closed beads"}):(0,V.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 font-mono text-label",children:[(0,V.jsxs)("span",{title:"median",children:["p50 ",I5(t.p50)]}),(0,V.jsxs)("span",{title:"90th percentile",className:"text-[var(--text-3)]",children:["p90 ",I5(t.p90)]}),(0,V.jsxs)("span",{className:"text-[var(--text-3)]",children:["· ",t.count]})]})]})}function Dn(e){return(0,V.jsx)("span",{style:{color:"var(--text-2)"},children:e})}function Dr(){let{projectId:e,openDetail:t,selectedBeadId:n,selectBead:r}=eu(),{data:i,isLoading:o}=ep(e),a=i?.items??[];return(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)(f3,{title:"Activity",subtitle:"what humans and agents did, newest first"}),(0,V.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:o&&0===a.length?(0,V.jsx)("div",{className:"p-8 text-center text-body text-[var(--text-3)]",children:"Loading activity…"}):0===a.length?(0,V.jsx)("div",{className:"p-8 text-center text-body text-[var(--text-3)]",children:"No activity yet."}):(0,V.jsx)("ol",{className:"mx-auto flex max-w-3xl flex-col",children:a.map(e=>(0,V.jsx)("li",{children:(0,V.jsxs)("button",{"data-keyboard-bead-id":e.issueId,"aria-current":n===e.issueId?"true":void 0,onFocus:()=>r(e.issueId),onClick:()=>{r(e.issueId),t(e.issueId)},className:`flex w-full items-start gap-3 rounded-[10px] px-3 py-[10px] text-left hover:bg-[var(--surface-2)] focus-visible:outline-none ${n===e.issueId?"ring-2 ring-inset ring-[var(--brand)]":""}`,children:[(0,V.jsx)("span",{className:"mt-[1px] flex h-[26px] w-[26px] flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.actor)},children:lV(e.actor)}),(0,V.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,V.jsxs)("div",{className:"flex flex-wrap items-center gap-x-[6px] gap-y-1 text-body",children:[(0,V.jsx)("span",{className:"font-semibold",children:e.actor}),(0,V.jsx)(ps,{origin:e.origin,title:"human"===e.origin?"Human":"Agent"}),(0,V.jsx)("span",{className:"text-[var(--text-2)]",children:e.action}),(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:e.issueId})]}),(0,V.jsx)("div",{className:"truncate text-label text-[var(--text-2)]",children:e.title}),e.detail&&(0,V.jsx)("div",{className:"truncate text-label text-[var(--text-3)]",children:e.detail})]}),(0,V.jsx)("span",{title:l3(e.at),className:"flex-shrink-0 whitespace-nowrap text-meta text-[var(--text-3)]",children:l1(e.at)})]})},e.id))})})]})}function Di(e){return"Enter"===e.key&&(e.metaKey||e.ctrlKey)}let Do={f:"focus",b:"board",l:"list",e:"epics",g:"graph",i:"insights",a:"activity",y:"needsyou",h:"achievements",p:"publish",s:"settings"},Da=[{topic:"Global",shortcuts:[{keys:["?"],label:"Show keyboard shortcuts"},{keys:["⌘/Ctrl","K"],label:"Open the command palette"},{keys:["/"],label:"Focus search"},{keys:["⌘/Ctrl","Enter"],label:"Submit the focused text field"},{keys:["N"],label:"Create an issue"},{keys:["T"],label:"Cycle theme: System / Light / Dark"},{keys:["Esc"],label:"Close the active drawer or dialog"}]},{topic:"Issues",shortcuts:[{keys:["J"],label:"Select next visible issue"},{keys:["K"],label:"Select previous visible issue"},{keys:["H"],label:"Select issue to the left"},{keys:["L"],label:"Select issue to the right"},{keys:["Enter"],label:"Open selected issue"},{keys:["O"],label:"Open selected issue"},{keys:["E"],label:"Edit selected issue"},{keys:["C"],label:"Close selected issue with optional reason"},{keys:["S"],label:"Set selected issue status"},{keys:["P"],label:"Set selected issue priority"},{keys:["Y"],label:"Copy selected issue ID"}]},{topic:"Views",shortcuts:[{keys:["G","F"],label:"Focus",sequence:!0},{keys:["G","B"],label:"Board",sequence:!0},{keys:["G","L"],label:"List",sequence:!0},{keys:["G","E"],label:"Epics",sequence:!0},{keys:["G","G"],label:"Graph",sequence:!0},{keys:["G","I"],label:"Insights",sequence:!0},{keys:["G","A"],label:"Activity",sequence:!0},{keys:["G","Y"],label:"Needs You",sequence:!0},{keys:["G","H"],label:"Achievements",sequence:!0},{keys:["G","P"],label:"Publish",sequence:!0},{keys:["G","S"],label:"Settings",sequence:!0}]},{topic:"Repositories",shortcuts:[{keys:["G","R"],label:"Choose a repository",sequence:!0},{keys:["G","["],label:"Previous repository",sequence:!0},{keys:["G","]"],label:"Next repository",sequence:!0}]}];function Dl(e,t,n){return Da.find(t=>t.topic===e)?.shortcuts.find(e=>e.label===t&&(void 0===n||e.keys[0]===n))}function Ds({id:e}){let{projectId:t,meta:n,readOnly:r}=eu(),i=(0,et.d)(),[o,a]=G.useState(!1),[l,s]=G.useState(""),c=G.useRef(!1),u=G.useId(),d=(0,Q.f)({mutationFn:n=>ei.k.setStatus(t,e,"closed",n),onSuccess:async()=>{s(""),await Promise.all([i.invalidateQueries({queryKey:ed(t)}),i.invalidateQueries({queryKey:ef(t)})])},onError:el,onSettled:()=>{c.current=!1}}),f=()=>{if(r||c.current)return;c.current=!0;let e=n?.humanActor?.trim()||"human reviewer",t=`Approved by ${e} via Beadscope at ${new Date().toISOString()}`;d.mutate(l.trim()?`${t}
|
|
57
|
+
|
|
58
|
+
${l.trim()}`:t)};return(0,V.jsxs)("div",{className:"flex min-w-0 flex-col items-end gap-2",children:[(0,V.jsxs)("div",{className:"flex items-center gap-2",children:[(0,V.jsx)(er.W,{className:"text-meta",disabled:r||d.isPending,"aria-expanded":o,"aria-controls":u,onClick:()=>a(!o),children:o?"Hide approval note":"Add approval note"}),(0,V.jsx)(ub.f,{size:"sm",icon:"check",disabled:r||d.isPending,onClick:f,children:"Approve"})]}),o&&(0,V.jsx)(er.p,{size:"sm",id:u,"aria-label":"Approval note",placeholder:"Optional approval note",value:l,onChange:e=>s(e.target.value),onKeyDown:e=>{Di(e)&&(e.preventDefault(),f())},disabled:r||d.isPending,maxLength:8e3,rows:2,className:"min-w-[180px]"})]})}function Dc(e){let t=[e.description,e.notes,e.design,...(e.comments??[]).map(e=>e.text)].filter(Boolean).join("\n").match(/(?:https?:\/\/|attachment:\/\/|\/api\/p\/)[^\s<>"']+/gi)??[],n=new Set;for(let e of t){let t=e.replace(/[.,;!?]+$/,"");for(let[e,n]of[["(",")"],["[","]"]])for(;t.endsWith(n)&&t.split(n).length>t.split(e).length;)t=t.slice(0,-1);if((t=t.replace(/[.,;!?]+$/,"")).startsWith("attachment://")){let e=t.slice(13).split("/");e.length>=2&&e.every(e=>e&&"."!==e&&".."!==e)&&n.add(t);continue}try{let e=new URL(t,"https://beadscope.invalid");t.startsWith("/")?/^\/api\/p\/[^/]+\/attachments\/[^/]+\/[^/]+$/.test(e.pathname)&&n.add(t):["http:","https:"].includes(e.protocol)&&e.hostname&&n.add(t)}catch{}}return[...n]}function Du(){}function Dd(){}let Df=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dh={};function Dm(e,t){return((t||Dh).jsx?Dp:Df).test(e)}let Dg=/[ \t\n\f\r]/g;function Dy(e){return""===e.replace(Dg,"")}class Db{constructor(e,t){this.attribute=t,this.property=e}}Db.prototype.attribute="",Db.prototype.booleanish=!1,Db.prototype.boolean=!1,Db.prototype.commaOrSpaceSeparated=!1,Db.prototype.commaSeparated=!1,Db.prototype.defined=!1,Db.prototype.mustUseProperty=!1,Db.prototype.number=!1,Db.prototype.overloadedBoolean=!1,Db.prototype.property="",Db.prototype.spaceSeparated=!1,Db.prototype.space=void 0;let Dv=0,Dx=DO(),Dw=DO(),Dk=DO(),D_=DO(),DS=DO(),DE=DO(),Dj=DO();function DO(){return 2**++Dv}e.s(["boolean",0,Dx,"booleanish",0,Dw,"commaOrSpaceSeparated",0,Dj,"commaSeparated",0,DE,"number",0,D_,"overloadedBoolean",0,Dk,"spaceSeparated",0,DS],744);var DN=e.i(744);let DC=Object.keys(DN);class DA extends Db{constructor(e,t,n,r){var i,o,a,l,s;let c=-1;if(super(e,t),i=this,(o=r)&&(i.space=o),"number"==typeof n)for(;++c<DC.length;){let e=DC[c];a=this,l=DC[c],(s=(n&DN[e])===DN[e])&&(a[l]=s)}}}function DM(e){return e.toLowerCase()}DA.prototype.defined=!0;let DP=/[A-Z]/g,DT=/-[a-z]/g,DI=/^data[-\w.:]+$/i;function DD(e){return"-"+e.toLowerCase()}function Dz(e){return e.charAt(1).toUpperCase()}let DR={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class DL{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function D$(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new DL(n,r,t)}function DB(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let o=new DA(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[DM(r)]=r,n[DM(o.attribute)]=r}return new DL(t,n,e.space)}DL.prototype.normal={},DL.prototype.property={},DL.prototype.space=void 0;let DF=DB({properties:{ariaActiveDescendant:null,ariaAtomic:Dw,ariaAutoComplete:null,ariaBusy:Dw,ariaChecked:Dw,ariaColCount:D_,ariaColIndex:D_,ariaColSpan:D_,ariaControls:DS,ariaCurrent:null,ariaDescribedBy:DS,ariaDetails:null,ariaDisabled:Dw,ariaDropEffect:DS,ariaErrorMessage:null,ariaExpanded:Dw,ariaFlowTo:DS,ariaGrabbed:Dw,ariaHasPopup:null,ariaHidden:Dw,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:DS,ariaLevel:D_,ariaLive:null,ariaModal:Dw,ariaMultiLine:Dw,ariaMultiSelectable:Dw,ariaOrientation:null,ariaOwns:DS,ariaPlaceholder:null,ariaPosInSet:D_,ariaPressed:Dw,ariaReadOnly:Dw,ariaRelevant:null,ariaRequired:Dw,ariaRoleDescription:DS,ariaRowCount:D_,ariaRowIndex:D_,ariaRowSpan:D_,ariaSelected:Dw,ariaSetSize:D_,ariaSort:null,ariaValueMax:D_,ariaValueMin:D_,ariaValueNow:D_,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function DU(e,t){return t in e?e[t]:t}function DH(e,t){return DU(e,t.toLowerCase())}let DK=DB({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:DE,acceptCharset:DS,accessKey:DS,action:null,allow:null,allowFullScreen:Dx,allowPaymentRequest:Dx,allowUserMedia:Dx,alpha:Dx,alt:null,as:null,async:Dx,autoCapitalize:null,autoComplete:DS,autoFocus:Dx,autoPlay:Dx,blocking:DS,capture:null,charSet:null,checked:Dx,cite:null,className:DS,closedBy:null,colorSpace:null,cols:D_,colSpan:D_,command:null,commandFor:null,content:null,contentEditable:Dw,controls:Dx,controlsList:DS,coords:D_|DE,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Dx,defer:Dx,dir:null,dirName:null,disabled:Dx,download:Dk,draggable:Dw,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Dx,formTarget:null,headers:DS,height:D_,hidden:Dk,high:D_,href:null,hrefLang:null,htmlFor:DS,httpEquiv:DS,id:null,imageSizes:null,imageSrcSet:null,inert:Dx,inputMode:null,integrity:null,is:null,isMap:Dx,itemId:null,itemProp:DS,itemRef:DS,itemScope:Dx,itemType:DS,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Dx,low:D_,manifest:null,max:null,maxLength:D_,media:null,method:null,min:null,minLength:D_,multiple:Dx,muted:Dx,name:null,nonce:null,noModule:Dx,noValidate:Dx,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Dx,optimum:D_,pattern:null,ping:DS,placeholder:null,playsInline:Dx,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Dx,referrerPolicy:null,rel:DS,required:Dx,reversed:Dx,rows:D_,rowSpan:D_,sandbox:DS,scope:null,scoped:Dx,seamless:Dx,selected:Dx,shadowRootClonable:Dx,shadowRootCustomElementRegistry:Dx,shadowRootDelegatesFocus:Dx,shadowRootMode:null,shadowRootSerializable:Dx,shape:null,size:D_,sizes:null,slot:null,span:D_,spellCheck:Dw,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D_,step:null,style:null,tabIndex:D_,target:null,title:null,translate:null,type:null,typeMustMatch:Dx,useMap:null,value:Dw,width:D_,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:DS,axis:null,background:null,bgColor:null,border:D_,borderColor:null,bottomMargin:D_,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Dx,declare:Dx,event:null,face:null,frame:null,frameBorder:null,hSpace:D_,leftMargin:D_,link:null,longDesc:null,lowSrc:null,marginHeight:D_,marginWidth:D_,noResize:Dx,noHref:Dx,noShade:Dx,noWrap:Dx,object:null,profile:null,prompt:null,rev:null,rightMargin:D_,rules:null,scheme:null,scrolling:Dw,standby:null,summary:null,text:null,topMargin:D_,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D_,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Dx,disablePictureInPicture:Dx,disableRemotePlayback:Dx,exportParts:DE,part:DS,prefix:null,property:null,results:D_,security:null,unselectable:null},space:"html",transform:DH}),DW=DB({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Dj,accentHeight:D_,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D_,amplitude:D_,arabicForm:null,ascent:D_,attributeName:null,attributeType:null,azimuth:D_,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D_,by:null,calcMode:null,capHeight:D_,className:DS,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:D_,diffuseConstant:D_,direction:null,display:null,dur:null,divisor:D_,dominantBaseline:null,download:Dx,dx:null,dy:null,edgeMode:null,editable:null,elevation:D_,enableBackground:null,end:null,event:null,exponent:D_,externalResourcesRequired:null,fill:null,fillOpacity:D_,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:DE,g2:DE,glyphName:DE,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D_,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D_,horizOriginX:D_,horizOriginY:D_,id:null,ideographic:D_,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D_,k:D_,k1:D_,k2:D_,k3:D_,k4:D_,kernelMatrix:Dj,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D_,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:D_,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:D_,overlineThickness:D_,paintOrder:null,panose1:null,path:null,pathLength:D_,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:DS,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D_,pointsAtY:D_,pointsAtZ:D_,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Dj,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Dj,rev:Dj,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Dj,requiredFeatures:Dj,requiredFonts:Dj,requiredFormats:Dj,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:D_,specularExponent:D_,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D_,strikethroughThickness:D_,string:null,stroke:null,strokeDashArray:Dj,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D_,strokeOpacity:D_,strokeWidth:null,style:null,surfaceScale:D_,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Dj,tabIndex:D_,tableValues:null,target:null,targetX:D_,targetY:D_,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Dj,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D_,underlineThickness:D_,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D_,values:null,vAlphabetic:D_,vMathematical:D_,vectorEffect:null,vHanging:D_,vIdeographic:D_,version:null,vertAdvY:D_,vertOriginX:D_,vertOriginY:D_,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D_,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DU}),Dq=DB({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),DZ=DB({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:DH}),DV=DB({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),DG=D$([DF,DK,Dq,DZ,DV],"html"),DX=D$([DF,DW,Dq,DZ,DV],"svg");var DY=e.i(15511);let DJ=D0("end"),DQ=D0("start");function D0(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function D1(e){return e&&"object"==typeof e?"position"in e||"type"in e?D3(e.position):"start"in e||"end"in e?D3(e):"line"in e||"column"in e?D2(e):"":""}function D2(e){return D4(e&&e.line)+":"+D4(e&&e.column)}function D3(e){return D2(e&&e.start)+"-"+D2(e&&e.end)}function D4(e){return e&&"number"==typeof e?e:1}class D9 extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){let e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=D1(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}D9.prototype.file="",D9.prototype.name="",D9.prototype.reason="",D9.prototype.message="",D9.prototype.stack="",D9.prototype.column=void 0,D9.prototype.line=void 0,D9.prototype.ancestors=void 0,D9.prototype.cause=void 0,D9.prototype.fatal=void 0,D9.prototype.place=void 0,D9.prototype.ruleId=void 0,D9.prototype.source=void 0;let D5={}.hasOwnProperty,D6=new Map,D8=/[A-Z]/g,D7=new Set(["table","tbody","thead","tfoot","tr"]),ze=new Set(["td","th"]),zt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zn(e,t,n){var r,i,o,a,l,s,c,u,d;let f,p,h,m,g,y,b,v,x,w,k;return"element"===t.type?(r=e,i=t,o=n,p=f=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===f.space&&(r.schema=DX),r.ancestors.push(i),h=za(r,i.tagName,!1),m=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&D5.call(t.properties,r)){let o=function(e,t,n){let r=function(e,t){let n=DM(t),r=t,i=Db;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&DI.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(DT,Dz);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!DT.test(e)){let n=e.replace(DP,DD);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=DA}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,DY.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new D9("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=zt+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)D5.call(e,t)&&(n[function(e){let t=e.replace(D8,zs);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?DR[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(o){let[r,a]=o;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&ze.has(t.tagName)?n=a:i[r]=a}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),g=zo(r,i),D7.has(i.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&Dy(e.value):Dy(e))})),zr(r,m,h,i),zi(m,g),r.ancestors.pop(),r.schema=f,r.create(i,h,m,o)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return Du(n.type),e.evaluater.evaluateExpression(n.expression)}zl(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,l=t,s=n,b=y=a.schema,"svg"===l.name&&"html"===y.space&&(a.schema=DX),a.ancestors.push(l),v=null===l.name?a.Fragment:za(a,l.name,!0),x=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];Du(t.type);let i=t.expression;Du(i.type);let o=i.properties[0];Du(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else zl(e,t.position);else{let i,o=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];Du(t.type),i=e.evaluater.evaluateExpression(t.expression)}else zl(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(a,l),w=zo(a,l),zr(a,x,v,l),zi(x,w),a.ancestors.pop(),a.schema=y,a.create(l,v,x,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zl(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,zi(k={},zo(c,u)),c.create(u,c.Fragment,k,d)):"text"===t.type?t.value:void 0}function zr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zi(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function zo(e,t){let n=[],r=-1,i=e.passKeys?new Map:D6;for(;++r<t.children.length;){let o,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=i.get(e)||0;o=e+"-"+t,i.set(e,t+1)}}let l=zn(e,a,o);void 0!==l&&n.push(l)}return n}function za(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=Dm(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}Du(),r=e}else r=Dm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return D5.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);zl(e)}function zl(e,t){let n=new D9("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=zt+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zs(e){return"-"+e.toLowerCase()}let zc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},zu={};function zd(e,t){let n=t||zu;return zf(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function zf(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zp(e.children,t,n)}return Array.isArray(e)?zp(e,t,n):""}function zp(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=zf(e[i],t,n);return r.join("")}function zh(e,t,n,r){let i,o=e.length,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)(i=r.slice(a,a+1e4)).unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function zm(e,t){return e.length>0?(zh(e,e.length,0,t),e):t}let zg={}.hasOwnProperty;function zy(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(zg.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];if(o)for(r in o){zg.call(i,r)||(i[r]=[]);let e=o[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);zh(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let zb=zA(/[A-Za-z]/),zv=zA(/[\dA-Za-z]/),zx=zA(/[#-'*+\--9=?A-Z^-~]/);function zw(e){return null!==e&&(e<32||127===e)}let zk=zA(/\d/),z_=zA(/[\dA-Fa-f]/),zS=zA(/[!-/:-@[-`{-~]/);function zE(e){return null!==e&&e<-2}function zj(e){return null!==e&&(e<0||32===e)}function zO(e){return -2===e||-1===e||32===e}let zN=zA(/\p{P}|\p{S}/u),zC=zA(/\s/);function zA(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function zM(e,t,n,r){let i=r?r-1:1/0,o=0;return function(r){return zO(r)?(e.enter(n),function r(a){return zO(a)&&o++<i?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let zP={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),zM(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return zE(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},zT={tokenize:function(e){let t,n,r,i=this,o=[],a=0;return l;function l(t){if(a<o.length){let n=o[a];return i.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&y();let r=i.events.length,o=r;for(;o--;)if("exit"===i.events[o][0]&&"chunkFlow"===i.events[o][1].type){n=i.events[o][1].end;break}g(a);let l=r;for(;l<i.events.length;)i.events[l][1].end={...n},l++;return zh(i.events,o+1,0,i.events.slice(r)),i.events.length=l,c(e)}return l(e)}function c(n){if(a===o.length){if(!t)return f(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(zI,u,d)(n)}function u(e){return t&&y(),g(a),f(e)}function d(e){return i.parser.lazy[i.now().line]=a!==o.length,r=i.now().offset,h(e)}function f(t){return i.containerState={},e.attempt(zI,p,h)(t)}function p(e){return a++,o.push([i.currentConstruct,i.containerState]),f(e)}function h(r){if(null===r){t&&y(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return zE(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,i.interrupt=void 0,l):(e.consume(n),t)}(r)}function m(e,o){let l=i.sliceStream(e);if(o&&l.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(l),i.parser.lazy[e.start.line]){let e,n,o=t.events.length;for(;o--;)if(t.events[o][1].start.offset<r&&(!t.events[o][1].end||t.events[o][1].end.offset>r))return;let l=i.events.length,s=l;for(;s--;)if("exit"===i.events[s][0]&&"chunkFlow"===i.events[s][1].type){if(e){n=i.events[s][1].end;break}e=!0}for(g(a),o=l;o<i.events.length;)i.events[o][1].end={...n},o++;zh(i.events,s+1,0,i.events.slice(l)),i.events.length=o}}function g(t){let n=o.length;for(;n-- >t;){let t=o[n];i.containerState=t[1],t[0].exit.call(i,e)}o.length=t}function y(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},zI={tokenize:function(e,t,n){return zM(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},zD={partial:!0,tokenize:function(e,t,n){return function(t){return zO(t)?zM(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||zE(e)?t(e):n(e)}}};class zz{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&zR(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),zR(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),zR(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);zR(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);zR(this.left,t.reverse())}}}function zR(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function zL(e){let t,n,r,i,o,a,l,s={},c=-1,u=new zz(e);for(;++c<u.length;){for(;c in s;)c=s[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,i=e.get(t)[1],o=e.get(t)[2],a=t-1,l=[],s=i._tokenizer;!s&&(s=o.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,u=[],d={},f=-1,p=i,h=0,m=0,g=[0];for(;p;){for(;e.get(++a)[1]!==p;);l.push(a),!p._tokenizer&&(n=o.sliceStream(p),p.next||n.push(null),r&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++f<c.length;)"exit"===c[f][0]&&"enter"===c[f-1][0]&&c[f][1].type===c[f-1][1].type&&c[f][1].start.line!==c[f][1].end.line&&(m=f+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=c.slice(g[f],g[f+1]),n=l.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),f=-1;++f<u.length;)d[h+u[f][0]]=h+u[f][1],h+=u[f][1]-u[f][0]-1;return d}(u,c)),c=s[c],l=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(i=u.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(o=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,o))}}return zh(e,0,1/0,u.slice(0)),!l}let z$={resolve:function(e){return zL(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):zE(t)?e.check(zB,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},zB={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),zM(e,i,"linePrefix")};function i(i){if(null===i||zE(i))return n(i);let o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},zF={tokenize:function(e){let t=this,n=e.attempt(zD,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,zM(e,e.attempt(this.parser.constructs.flow,r,e.attempt(z$,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},zU={resolveAll:zq()},zH=zW("string"),zK=zW("text");function zW(e){return{resolveAll:zq("text"===e?zZ:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,o,a);return o;function o(e){return s(e)?i(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),l)}function l(e){return s(e)?(t.exit("data"),i(e)):(t.consume(e),l)}function s(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function zq(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function zZ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],o=t.sliceStream(i),a=o.length,l=-1,s=0;for(;a--;){let e=o[a];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)s++,l--;if(l)break;l=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let o={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-s,offset:i.end.offset-s},end:{...i.end}};i.end={...o.start},i.start.offset===i.end.offset?Object.assign(i,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}function zV(e){return null===e||zj(e)||zC(e)?1:zN(e)?2:void 0}function zG(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}let zX={name:"attention",resolveAll:function(e,t){let n,r,i,o,a,l,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[u][1].start};zY(d,-l),zY(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},i={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[n][1].end={...o.start},e[u][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=zm(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=zm(s,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),s=zm(s,zG(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=zm(s,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=zm(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,zh(e,n-1,u-n+3,s),u=n+s.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,o=zV(i);return function(a){return n=a,e.enter("attentionSequence"),function a(l){if(l===n)return e.consume(l),a;let s=e.exit("attentionSequence"),c=zV(l),u=!c||2===c&&o||r.includes(l),d=!o||2===o&&c||r.includes(i);return s._open=!!(42===n?u:u&&(o||!d)),s._close=!!(42===n?d:d&&(c||!u)),t(l)}(a)}}};function zY(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let zJ={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return zO(t)?zM(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(zJ,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return zO(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},zQ={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return zS(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},z0=document.createElement("i");function z1(e){let t="&"+e+";";z0.innerHTML=t;let n=z0.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let z2={name:"characterReference",tokenize:function(e,t,n){let r,i,o=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,i=zv,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=z_,c):(e.enter("characterReferenceValue"),r=7,i=zk,c(t))}function c(l){if(59===l&&a){let r=e.exit("characterReferenceValue");return i!==zv||z1(o.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(l)}return i(l)&&a++<r?(e.consume(l),c):n(l)}}},z3={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},z4={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),zO(t)?zM(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o>=l?(e.exit("codeFencedFenceSequence"),zO(i)?zM(e,c,"whitespace")(i):c(i)):n(i)}(t)):n(t)}function c(r){return null===r||zE(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,l=0;return function(t){var o;let c;return o=t,a=(c=i.events[i.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(l++,e.consume(i),t):l<3?n(i):(e.exit("codeFencedFenceSequence"),zO(i)?zM(e,s,"whitespace")(i):s(i))}(o)};function s(o){return null===o||zE(o)?(e.exit("codeFencedFence"),i.interrupt?t(o):e.check(z3,u,h)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||zE(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(i)):zO(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),zM(e,c,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(o))}function c(t){return null===t||zE(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||zE(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function u(t){return e.attempt(o,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f}function f(t){return a>0&&zO(t)?zM(e,p,"linePrefix",a+1)(t):p(t)}function p(t){return null===t||zE(t)?e.check(z3,u,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||zE(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},z9={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),zM(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?o(n):zE(n)?e.attempt(z5,t,o)(n):(e.enter("codeFlowValue"),function n(r){return null===r||zE(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function o(n){return e.exit("codeIndented"),t(n)}}},z5={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):zE(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):zM(e,o,"linePrefix",5)(t)}function o(e){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):zE(e)?i(e):n(e)}}};function z6(e,t,n,r,i,o,a,l,s){let c=s||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||zw(t)?n(t):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(l),d(t)):null===t||60===t||zE(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function h(i){return!u&&(null===i||41===i||zj(i))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(i)):u<c&&40===i?(e.consume(i),u++,h):41===i?(e.consume(i),u--,h):null===i||32===i||40===i||zw(i)?n(i):(e.consume(i),92===i?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function z8(e,t,n,r,i,o){let a,l=this,s=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),c};function c(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(d):93===d?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):zE(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||zE(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!zO(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function z7(e,t,n,r,i,o){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,l):n(t)};function l(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),s(n))}function s(t){return t===a?(e.exit(o),l(a)):null===t?n(t):zE(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),zM(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||zE(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function Re(e,t){let n;return function r(i){return zE(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):zO(i)?zM(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Rt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let Rn={partial:!0,tokenize:function(e,t,n){return function(t){return zj(t)?Re(e,r)(t):n(t)};function r(t){return z7(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return zO(t)?zM(e,o,"whitespace")(t):o(t)}function o(e){return null===e||zE(e)?t(e):n(e)}}},Rr=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ri=["pre","script","style","textarea"],Ro={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zD,t,n)}}},Ra={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return zE(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},Rl={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&zh(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,o,a=e.length,l=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){l=2;break}}else"labelEnd"===n.type&&(i=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+l+2][1].end},end:{...e[i-2][1].start}};return o=zm(o=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+l+3)),o=zm(o,[["enter",u,t]]),o=zm(o,zG(t.parser.constructs.insideSpan.null,e.slice(r+l+4,i-3),t)),o=zm(o,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),o=zm(o,e.slice(i+1)),o=zm(o,[["exit",s,t]]),zh(e,r,e.length,o),e},tokenize:function(e,t,n){let r,i,o=this,a=o.events.length;for(;a--;)if(("labelImage"===o.events[a][1].type||"labelLink"===o.events[a][1].type)&&!o.events[a][1]._balanced){r=o.events[a][1];break}return function(t){return r?r._inactive?u(t):(i=o.parser.defined.includes(Rt(o.sliceSerialize({start:r.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),l):n(t)};function l(t){return 40===t?e.attempt(Rs,c,i?c:u)(t):91===t?e.attempt(Rc,c,i?s:u)(t):i?c(t):u(t)}function s(t){return e.attempt(Ru,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},Rs={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return zj(t)?Re(e,i)(t):i(t)}function i(t){return 41===t?c(t):z6(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return zj(t)?Re(e,l)(t):c(t)}function a(e){return n(e)}function l(t){return 34===t||39===t||40===t?z7(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return zj(t)?Re(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},Rc={tokenize:function(e,t,n){let r=this;return function(t){return z8.call(r,e,i,o,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(Rt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},Ru={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},Rd={name:"labelStartImage",resolveAll:Rl.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},Rf={name:"labelStartLink",resolveAll:Rl.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},Rp={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),zM(e,t,"linePrefix")}}},Rh={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(o){var a;return e.enter("thematicBreak"),r=a=o,function o(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),zO(n)?zM(e,o,"whitespace")(n):o(n))}(a)):i>=3&&(null===a||zE(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},Rm={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(zD,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zM(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!zO(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ry,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,zM(e,e.attempt(Rm,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:zk(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(Rh,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return zk(i)&&++a<10?(e.consume(i),t):(!r.interrupt||a<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),l(i)):n(i)}(t)}return n(t)};function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(zD,r.interrupt?n:s,e.attempt(Rg,u,c))}function s(e){return r.containerState.initialBlankLine=!0,o++,u(e)}function c(t){return zO(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},Rg={partial:!0,tokenize:function(e,t,n){let r=this;return zM(e,function(e){let i=r.events[r.events.length-1];return!zO(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},Ry={partial:!0,tokenize:function(e,t,n){let r=this;return zM(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},Rb={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var a;let l,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){l="paragraph"===i.events[s][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||l)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),zO(n)?zM(e,o,"lineSuffix")(n):o(n))}(a)):n(t)};function o(r){return null===r||zE(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,z8.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function o(t){return(r=Rt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return zj(t)?Re(e,l)(t):l(t)}function l(t){return z6(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(Rn,c,c)(t)}function c(t){return zO(t)?zM(e,u,"whitespace")(t):u(t)}function u(o){return null===o||zE(o)?(e.exit("definition"),i.parser.defined.push(r),t(o)):n(o)}}}},"disable",0,{null:[]},"document",0,{42:Rm,43:Rm,45:Rm,48:Rm,49:Rm,50:Rm,51:Rm,52:Rm,53:Rm,54:Rm,55:Rm,56:Rm,57:Rm,62:zJ},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),i-2>o&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},zh(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var o;return e.enter("atxHeading"),o=i,e.enter("atxHeadingSequence"),function i(o){return 35===o&&r++<6?(e.consume(o),i):null===o||zj(o)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||zE(r)?(e.exit("atxHeading"),t(r)):zO(r)?zM(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||zj(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(o)):n(o)}(o)}}},42:Rh,45:[Rb,Rh],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,o,a,l,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),i=!0,p):63===a?(e.consume(a),r=3,s.interrupt?t:P):zb(a)?(e.consume(a),o=String.fromCharCode(a),h):n(a)}function u(i){return 45===i?(e.consume(i),r=2,d):91===i?(e.consume(i),r=5,a=0,f):zb(i)?(e.consume(i),r=4,s.interrupt?t:P):n(i)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:P):n(r)}function f(r){let i="CDATA[";return r===i.charCodeAt(a++)?(e.consume(r),a===i.length)?s.interrupt?t:S:f:n(r)}function p(t){return zb(t)?(e.consume(t),o=String.fromCharCode(t),h):n(t)}function h(a){if(null===a||47===a||62===a||zj(a)){let l=47===a,c=o.toLowerCase();return!l&&!i&&Ri.includes(c)?(r=1,s.interrupt?t(a):S(a)):Rr.includes(o.toLowerCase())?(r=6,l)?(e.consume(a),m):s.interrupt?t(a):S(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):i?function t(n){return zO(n)?(e.consume(n),t):k(n)}(a):g(a))}return 45===a||zv(a)?(e.consume(a),o+=String.fromCharCode(a),h):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:S):n(r)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||zb(t)?(e.consume(t),y):zO(t)?(e.consume(t),g):k(t)}function y(t){return 45===t||46===t||58===t||95===t||zv(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),v):zO(t)?(e.consume(t),b):g(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):zO(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||zj(n)?b(n):(e.consume(n),t)}(t)}function x(t){return t===l?(e.consume(t),l=null,w):null===t||zE(t)?n(t):(e.consume(t),x)}function w(e){return 47===e||62===e||zO(e)?g(e):n(e)}function k(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||zE(t)?S(t):zO(t)?(e.consume(t),_):n(t)}function S(t){return 45===t&&2===r?(e.consume(t),N):60===t&&1===r?(e.consume(t),C):62===t&&4===r?(e.consume(t),T):63===t&&3===r?(e.consume(t),P):93===t&&5===r?(e.consume(t),M):zE(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(Ro,I,E)(t)):null===t||zE(t)?(e.exit("htmlFlowData"),E(t)):(e.consume(t),S)}function E(t){return e.check(Ra,j,I)(t)}function j(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),O}function O(t){return null===t||zE(t)?E(t):(e.enter("htmlFlowData"),S(t))}function N(t){return 45===t?(e.consume(t),P):S(t)}function C(t){return 47===t?(e.consume(t),o="",A):S(t)}function A(t){if(62===t){let n=o.toLowerCase();return Ri.includes(n)?(e.consume(t),T):S(t)}return zb(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),A):S(t)}function M(t){return 93===t?(e.consume(t),P):S(t)}function P(t){return 62===t?(e.consume(t),T):45===t&&2===r?(e.consume(t),P):S(t)}function T(t){return null===t||zE(t)?(e.exit("htmlFlowData"),I(t)):(e.consume(t),T)}function I(n){return e.exit("htmlFlow"),t(n)}}},61:Rb,95:Rh,96:z4,126:z4},"flowInitial",0,{[-2]:z9,[-1]:z9,32:z9},"insideSpan",0,{null:[zX,zU]},"string",0,{38:z2,92:zQ},"text",0,{[-5]:Rp,[-4]:Rp,[-3]:Rp,33:Rd,38:z2,42:zX,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return zb(t)?(e.consume(t),o):64===t?n(t):l(t)}function o(t){return 43===t||45===t||46===t||zv(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||zv(n))&&r++<32?(e.consume(n),t):(r=0,l(n))}(t)):l(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||zw(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),s):zx(t)?(e.consume(t),l):n(t)}function s(i){return zv(i)?function i(o){return 46===o?(e.consume(o),r=0,s):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(o){if((45===o||zv(o))&&r++<63){let n=45===o?t:i;return e.consume(o),n}return n(o)}(o)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,o,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),x):63===t?(e.consume(t),b):zb(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,p):zb(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),f):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):zE(t)?(o=u,A(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),f):u(t)}function f(e){return 62===e?C(e):45===e?d(e):u(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?h:p):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):zE(t)?(o=h,A(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?C(t):93===t?(e.consume(t),g):h(t)}function y(t){return null===t||62===t?C(t):zE(t)?(o=y,A(t)):(e.consume(t),y)}function b(t){return null===t?n(t):63===t?(e.consume(t),v):zE(t)?(o=b,A(t)):(e.consume(t),b)}function v(e){return 62===e?C(e):b(e)}function x(t){return zb(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||zv(t)?(e.consume(t),w):function t(n){return zE(n)?(o=t,A(n)):zO(n)?(e.consume(n),t):C(n)}(t)}function k(t){return 45===t||zv(t)?(e.consume(t),k):47===t||62===t||zj(t)?_(t):n(t)}function _(t){return 47===t?(e.consume(t),C):58===t||95===t||zb(t)?(e.consume(t),S):zE(t)?(o=_,A(t)):zO(t)?(e.consume(t),_):C(t)}function S(t){return 45===t||46===t||58===t||95===t||zv(t)?(e.consume(t),S):function t(n){return 61===n?(e.consume(n),E):zE(n)?(o=t,A(n)):zO(n)?(e.consume(n),t):_(n)}(t)}function E(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,j):zE(t)?(o=E,A(t)):zO(t)?(e.consume(t),E):(e.consume(t),O)}function j(t){return t===r?(e.consume(t),r=void 0,N):null===t?n(t):zE(t)?(o=j,A(t)):(e.consume(t),j)}function O(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||zj(t)?_(t):(e.consume(t),O)}function N(e){return 47===e||62===e||zj(e)?_(e):n(e)}function C(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function A(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return zO(t)?zM(e,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),o(t)}}}],91:Rf,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return zE(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},zQ],93:Rl,95:zX,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),o++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(i=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(i.type="codeTextData",l(a))}(s)):zE(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(s))}function l(t){return null===t||32===t||96===t||zE(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}}}}],4127);var Rv=e.i(4127);let Rx=/[\0\t\n\r]/g;function Rw(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let Rk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function R_(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return Rw(n.slice(t?2:1),t?16:10)}return z1(n)||e}let RS={}.hasOwnProperty;function RE(e){return{line:e.line,column:e.column,offset:e.offset}}function Rj(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+D1({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+D1({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+D1({start:t.start,end:t.end})+") is still open")}function RO(e){let t=this;t.parser=function(n){var r,i;let o,a,l,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(y),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,i),htmlFlowData:c,htmlText:r(g,i),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(y),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(b,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(b),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=Rw(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=z1(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=RE(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Rt(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(Rk,R_),n.identifier=Rt(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=RE(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Rt(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(RS.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:o,exit:l,buffer:i,resume:s,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,i,o,a,l=t-1,s=-1,c=!1;for(;++l<=n;){let t=e[l];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||o||(o=l),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=l;for(i=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||l,0,["exit",r,t[2]]),l++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(l,0,["enter",i,t[2]]),l++,n++,o=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];RS.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Rj).call(a,void 0,e[0])}for(r.position={start:RE(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:RE(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){o.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function o(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:RE(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Rj).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+D1({start:e.start,end:e.end})+"): it’s not open");n.position.end=RE(e.end)}function s(){return zd(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:RE(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=RE(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!zL(e););return e}((function(e){let t={constructs:zy([Rv,...(e||{}).extensions||[]]),content:n(zP),defined:[],document:n(zT),flow:n(zF),lazy:{},string:n(zH),text:n(zK)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],a=[],l=[],s={attempt:h(function(e,t){m(e,t.from)}),check:h(p),consume:function(e){zE(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=f(),c.events.push(["enter",n,c]),l.push(n),n},exit:function(e){let t=l.pop();return t.end=f(),c.events.push(["exit",t,c]),t},interrupt:h(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let o,a=e[r];if("string"==typeof a)o=a;else switch(a){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=t?" ":" ";break;case -1:if(!t&&n)continue;o=" ";break;default:o=String.fromCharCode(a)}n=-2===a,i.push(o)}return i.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=zm(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==a[a.length-1])?[]:(m(t,0),c.events=zG(o,c.events,c),c.events)}},u=t.tokenize.call(c,s);return t.resolveAll&&o.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;if(r===o)n=[e[r].slice(i,a)];else{if(n=e.slice(r,o),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}a>0&&n.push(e[o].slice(0,a))}return n}(a,e)}function f(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:o}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:o}}function p(e,t){t.restore()}function h(e,t){return function(n,i,o){var a;let u,d,p,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?o:y(e[d])}function y(e){return function(n){let i,o,a,u,d;return(i=f(),o=c.previous,a=c.currentConstruct,u=c.events.length,d=Array.from(l),h={from:u,restore:function(){r=i,c.previous=o,c.currentConstruct=a,c.events.length=u,l=d,g()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,b,v)(n)}}function b(t){return e(p,h),i}function v(e){return(h.restore(),++d<u.length)?y(u[d]):o}}}function m(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&zh(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((a=1,l="",s=!0,function(e,t,n){let r,i,c,u,d,f=[];for(e=l+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,l="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(Rx.lastIndex=c,u=(r=Rx.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){l=e.slice(c);break}if(10===d&&c===u&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),c<u&&(f.push(e.slice(c,u)),a+=u-c),d){case 0:f.push(65533),a++;break;case 9:for(i=4*Math.ceil(a/4),f.push(-2);a++<i;)f.push(-1);break;case 10:f.push(-4),a=1;break;default:o=!0,a=1}c=u+1}return n&&(o&&f.push(-5),l&&f.push(l),f.push(null)),f})(n,r,!0))))}}let RN="object"==typeof self?self:globalThis,RC=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+e)}return new RN[e](t)},RA=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[o,a]=e[i];switch(o){case 0:case -1:return n(a,i);case 1:{let e=n([],i);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(RC(e,t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(RC(o,a),i)})(0)},{toString:RM}={},{keys:RP}=Object,RT=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=RM.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},RI=([e,t])=>0===e&&("function"===t||"symbol"===t),RD=(e,{json:t,lossy:n}={})=>{var r,i,o;let a,l,s=[];return(r=!(t||n),i=!!t,o=new Map,a=(e,t)=>{let n=s.push(e)-1;return o.set(t,n),n},l=e=>{if(o.has(e))return o.get(e);let[t,n]=RT(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return a([-1],e)}return a([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],i=a([t,r],e);for(let t of e)r.push(l(t));return i}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(i&&"toJSON"in e)return l(e.toJSON());let o=[],s=a([t,o],e);for(let t of RP(e))(r||!RI(RT(e[t])))&&o.push([l(t),l(e[t])]);return s}case 3:return a([t,isNaN(e.getTime())?"":e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],i=a([t,n],e);for(let[t,i]of e)(r||!(RI(RT(t))||RI(RT(i))))&&n.push([l(t),l(i)]);return i}case 6:{let n=[],i=a([t,n],e);for(let t of e)(r||!RI(RT(t)))&&n.push(l(t));return i}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},Rz="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?RA(RD(e,t)):structuredClone(e):(e,t)=>RA(RD(e,t));function RR(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let o=e.charCodeAt(n),a="";if(37===o&&zv(e.charCodeAt(n+1))&&zv(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(a=String.fromCharCode(o,t),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function RL(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function R$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let RB=function(e){var t,n;if(null==e)return RU;if("function"==typeof e)return RF(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=RB(e[n]);return RF(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,RF(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,RF(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function RF(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function RU(){return!0}let RH=[];function RK(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let o=RB(i),a=r?-1:1;(function e(i,l,s){let c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){let e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return u;function u(){var c;let u,d,f,p=RH;if((!t||o(i,l,s[s.length-1]||void 0))&&!1===(p=Array.isArray(c=n(i,s))?c:"number"==typeof c?[!0,c]:null==c?RH:[c])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(d=(r?i.children.length:-1)+a,f=s.concat(i);d>-1&&d<i.children.length;){if(!1===(u=e(i.children[d],d,f)())[0])return u;d="number"==typeof u[1]?u[1]:d+a}return p}})(e,void 0,[])()}function RW(e,t,n,r){let i,o,a;"function"==typeof t&&"function"!=typeof n?(o=void 0,a=t,i=n):(o=t,a=n,i=r),RK(e,o,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},i)}function Rq(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift({type:"text",value:"["});let a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function RZ(e){let t=e.spread;return null==t?e.children.length>1:t}function RV(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let RG={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(t,o)]},e.patch(t,o),o},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=RR(i.toLowerCase()),a=e.footnoteOrder.indexOf(i),l=e.footnoteCounts.get(i);void 0===l?(l=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=a+1,l+=1,e.footnoteCounts.set(i,l);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Rq(e,t);let i={src:RR(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){let n={src:RR(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Rq(e,t);let i={href:RR(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){let n={href:RR(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=RZ(n[r])}return t}(n):RZ(t),o={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){let e=r[l];(i||0!==l||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(i||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=DQ(t.children[1]),a=DJ(t.children[t.children.length-1]);o&&a&&(r.position={start:o,end:a}),i.push(r)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,a=o?o.length:t.children.length,l=-1,s=[];for(;++l<a;){let n=t.children[l],r={},a=o?o[l]:void 0;a&&(r.align=a);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,o=[];for(;r;)o.push(RV(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(RV(t.slice(i),i>0,!1)),o.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:RX,yaml:RX,definition:RX,footnoteDefinition:RX};function RX(){}let RY={}.hasOwnProperty,RJ={};function RQ(e,t){e.position&&(t.position=function(e){let t=DQ(e),n=DJ(e);if(t&&n)return{start:t,end:n}}(e))}function R0(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,Rz(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function R1(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function R2(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function R3(e,t){let n,r,i,o,a=(n=t||RJ,r=new Map,i=new Map,o={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=o.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=R2(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=R2(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:R0,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...RG,...n.handlers},one:function(e,t){let n=e.type,r=o.handlers[n];if(RY.call(o.handlers,n)&&r)return r(o,e,t);if(o.options.passThrough&&o.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=Rz(n);return r.children=o.all(e),r}return Rz(e)}return(o.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(RY.call(n,"hProperties")||RY.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(o,e,t)},options:n,patch:RQ,wrap:R1},RW(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o),l=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||RL,r=e.options.footnoteBackLabel||R$,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],s=-1;for(;++s<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[s]);if(!i)continue;let o=e.all(i),a=String(i.identifier).toUpperCase(),c=RR(a.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(i,h),l.push(h)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Rz(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&(Du(),c.children.push({type:"text",value:"\n"},s)),c}function R4(e,t){return e&&"run"in e?async function(n,r){let i=R3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return R3(n,{file:r,...e||t})}}function R9(e){if(e)throw e}var R5=e.i(4100);function R6(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let R8=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');Ln(e);let r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,l=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else a<0&&(n=!0,a=o+1),l>-1&&(e.codePointAt(o)===t.codePointAt(l--)?l<0&&(i=o):(l=-1,i=a));return r===i?i=a:i<0&&(i=e.length),e.slice(r,i)},R7=function(e){let t;if(Ln(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},Le=function(e){let t;Ln(e);let n=e.length,r=-1,i=0,o=-1,a=0;for(;n--;){let l=e.codePointAt(n);if(47===l){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===l?o<0?o=n:1!==a&&(a=1):o>-1&&(a=-1)}return o<0||r<0||0===a||1===a&&o===r-1&&o===i+1?"":e.slice(o,r)},Lt=function(...e){var t;let n,r,i,o=-1;for(;++o<e.length;)Ln(e[o]),e[o]&&(i=void 0===i?e[o]:i+"/"+e[o]);return void 0===i?".":(Ln(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",o=0,a=-1,l=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===l);else if(a!==s-1&&2===l){if(i.length<2||2!==o||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",o=0):o=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),a=s,l=0;continue}}else if(i.length>0){i="",o=0,a=s,l=0;continue}}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(a+1,s):i=e.slice(a+1,s),o=s-a-1;a=s,l=0}else 46===n&&l>-1?l++:l=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function Ln(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function Lr(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let Li=["history","path","basename","stem","extname","dirname"];class Lo{constructor(e){var t;let n,r;n=e?Lr(e)?{path:e}:"string"==typeof e||(t=e)&&"object"==typeof t&&"byteLength"in t&&"byteOffset"in t?{value:e}:e:{},this.cwd="cwd"in n?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Li.length;){let e=Li[i];e in n&&void 0!==n[e]&&null!==n[e]&&(this[e]="history"===e?[...n[e]]:n[e])}for(r in n)Li.includes(r)||(this[r]=n[r])}get basename(){return"string"==typeof this.path?R8(this.path):void 0}set basename(e){Ll(e,"basename"),La(e,"basename"),this.path=Lt(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?R7(this.path):void 0}set dirname(e){Ls(this.basename,"dirname"),this.path=Lt(e||"",this.basename)}get extname(){return"string"==typeof this.path?Le(this.path):void 0}set extname(e){if(La(e,"extname"),Ls(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=Lt(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Lr(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!Lr(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),Ll(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?R8(this.path,this.extname):void 0}set stem(e){Ll(e,"stem"),La(e,"stem"),this.path=Lt(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new D9(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function La(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function Ll(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ls(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let Lc=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Lu={}.hasOwnProperty,Ld=new class e extends Lc{constructor(){let e,t;super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=(e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(o,...a){let l=e[++n],s=-1;if(o)return void r(o);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,l?(function(e,t){let n;return function(...t){let o,a=e.length>t.length;a&&t.push(r);try{o=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(o&&o.then&&"function"==typeof o.then?o.then(i,r):o instanceof Error?r(o):i(o))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(l,i)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}})}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,R5.default)(!0,{},this.namespace)),t}data(e,t){return"string"==typeof e?2==arguments.length?(Lh("data",this.frozen),this.namespace[e]=t,this):Lu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Lh("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Ly(e),n=this.parser||this.Parser;return Lf("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Lf("process",this.parser||this.Parser),Lp("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let o=Ly(e),a=n.parse(o);function l(e,n){e||!n?i(e):r?r(n):(Du(),t(void 0,n))}n.run(a,o,function(e,t,r){var i,o;if(e||!t||!r)return l(e);let a=n.stringify(t,r);"string"==typeof(i=a)||(o=i)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?r.value=a:r.result=a,l(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Lf("processSync",this.parser||this.Parser),Lp("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,R9(e),t=r}),Lg("processSync","process",n),Du(),t}run(e,t,n){Lm(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,o){Du();let a=Ly(t);r.run(e,a,function(t,r,a){let l=r||e;t?o(t):i?i(l):(Du(),n(void 0,l,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){R9(e),n=t,r=!0}),Lg("runSync","run",r),Du(),n}stringify(e,t){this.freeze();let n=Ly(t),r=this.compiler||this.Compiler;return Lp("stringify",r),Lm(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Lh("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?o(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,R5.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...o]=t,a=n[i][1];R6(a)&&R6(r)&&(r=(0,R5.default)(!0,a,r)),n[i]=[e,r,...o]}}}}().freeze();function Lf(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function Lp(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function Lh(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Lm(e){if(!R6(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function Lg(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ly(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new Lo(e)}let Lb=[],Lv={allowDangerousHtml:!0},Lx=/^(https?|ircs?|mailto|xmpp)$/i,Lw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Lk(e){var t;let n,r,i,o,a,l=(n=(t=e).rehypePlugins||Lb,r=t.remarkPlugins||Lb,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Lv}:Lv,Ld().use(RO).use(r).use(R4,i).use(n)),s=(o=e.children||"",a=new Lo,"string"==typeof o?a.value=o:Dd(),a);return function(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,s=t.urlTransform||L_;for(let e of Lw)Object.hasOwn(t,e.from)&&Dd((e.from,e.to&&e.to,e.id));return n&&o&&Dd(),t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:"root"===e.type?e.children:[e]}),RW(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return a?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in zc)if(Object.hasOwn(zc,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=zc[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=s(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!o&&o.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,i)),a&&i&&"number"==typeof t)return l&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),function(e,t){var n,r,i,o;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=l,r=t.jsxDEV,a=function(e,t,i,o){let a=Array.isArray(i.children),l=DQ(e);return r(t,i,o,a,{columnNumber:l?l.column-1:void 0,fileName:n,lineNumber:l?l.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,o=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?o:i;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?DX:DG,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=zn(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:V.Fragment,components:i,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.jsxs,passKeys:!0,passNode:!0})}(l.runSync(l.parse(s),s),e)}function L_(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||Lx.test(e.slice(0,t))?e:""}function LS(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let LE="phrasing",Lj=["autolink","link","image","label"];function LO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function LN(e){this.config.enter.autolinkProtocol.call(this,e)}function LC(e){this.config.exit.autolinkProtocol.call(this,e)}function LA(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];Du(t.type),t.url="http://"+this.sliceSerialize(e)}function LM(e){this.config.exit.autolinkEmail.call(this,e)}function LP(e){this.exit(e)}function LT(e){!function(e,t,n){let r=RB((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),o=-1;for(;++o<i.length;)RK(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){let e=t[a],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[o][0],a=i[o][1],l=0,s=n.children.indexOf(e),c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},o=a(...d,i);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(l!==n&&u.push({type:"text",value:e.value.slice(l,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),l=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}return c?(l<e.value.length&&u.push({type:"text",value:e.value.slice(l)}),n.children.splice(s,1,...u)):u=[e],s+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LI],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,LD]],{ignore:["link","linkReference"]})}function LI(e,t,n,r,i){let o,a="";if(!Lz(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",a="http://"),(o=n.split(".")).length<2||o[o.length-1]&&(/_/.test(o[o.length-1])||!/[a-zA-Z\d]/.test(o[o.length-1]))||o[o.length-2]&&(/_/.test(o[o.length-2])||!/[a-zA-Z\d]/.test(o[o.length-2])))return!1;let l=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=LS(e,"("),o=LS(e,")");for(;-1!==r&&i>o;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),o++;return[e,n]}(n+r);if(!l[0])return!1;let s={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[s,{type:"text",value:l[1]}]:s}function LD(e,t,n,r){return!(!Lz(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Lz(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||zC(n)||zN(n))&&(!t||47!==n)}function LR(){this.buffer()}function LL(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function L$(){this.buffer()}function LB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function LF(e){let t=this.resume(),n=this.stack[this.stack.length-1];Du(n.type),n.identifier=Rt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LU(e){this.exit(e)}function LH(e){let t=this.resume(),n=this.stack[this.stack.length-1];Du(n.type),n.identifier=Rt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LK(e){this.exit(e)}function LW(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),a=n.enter("footnoteReference"),l=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),l(),a(),o+=i.move("]")}function Lq(e,t,n){return 0===t?e:LZ(e,t,n)}function LZ(e,t,n){return(n?"":" ")+e}LW.peek=function(){return"["};let LV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function LG(e){this.enter({type:"delete",children:[]},e)}function LX(e){this.exit(e)}function LY(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function LJ(e){return e.length}function LQ(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}LY.peek=function(){return"~"};function L0(e,t,n){let r=e.value||"",i="`",o=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let e,t=n.unsafe[o],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}L0.peek=function(){return"`"};RB(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let L1=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),o=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let a=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));let l=n.createTracker(r);l.move(o+" ".repeat(a-o.length)),l.shift(a);let s=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),function(e,t,n){return t?(n?"":" ".repeat(a))+e:(n?o:o+" ".repeat(a-o.length))+e});return s(),c};function L2(e){let t=e._align;Du(),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function L3(e){this.exit(e),this.data.inTable=void 0}function L4(e){this.enter({type:"tableRow",children:[]},e)}function L9(e){this.exit(e)}function L5(e){this.enter({type:"tableCell",children:[]},e)}function L6(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,L8));let n=this.stack[this.stack.length-1];Du(n.type),n.value=t,this.exit(e)}function L8(e,t){return"|"===t?t:e}function L7(e){let t=this.stack[this.stack.length-2];Du(t.type),t.checked="taskListCheckValueChecked"===e.type}function $e(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];Du(e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,o=-1;for(;++o<i.length;){let e=i[o];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function $t(e,t,n,r){let i=e.children[0],o="boolean"==typeof e.checked&&i&&"paragraph"===i.type,a="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(a);let s=L1(e,t,n,{...r,...l.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),s}let $n={tokenize:function(e,t,n){let r=0;return function t(o){return(87===o||119===o)&&r<3?(r++,e.consume(o),t):46===o&&3===r?(e.consume(o),i):n(o)};function i(e){return null===e?n(e):t(e)}},partial:!0},$r={tokenize:function(e,t,n){let r,i,o;return a;function a(t){return 46===t||95===t?e.check($o,s,l)(t):null===t||zj(t)||zC(t)||45!==t&&zN(t)?s(t):(o=!0,e.consume(t),a)}function l(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),a}function s(e){return i||r||!o?n(e):t(e)}},partial:!0},$i={tokenize:function(e,t){let n=0,r=0;return i;function i(a){return 40===a?(n++,e.consume(a),i):41===a&&r<n?o(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check($o,t,o)(a):null===a||zj(a)||zC(a)?t(a):(e.consume(a),i)}function o(t){return 41===t&&r++,e.consume(t),i}},partial:!0},$o={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),o):93===a?(e.consume(a),i):60===a||null===a||zj(a)||zC(a)?t(a):n(a)}function i(e){return null===e||40===e||91===e||zj(e)||zC(e)?t(e):r(e)}function o(t){return zb(t)?function t(i){return 59===i?(e.consume(i),r):zb(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},$a={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return zv(e)?n(e):t(e)}},partial:!0},$l={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!$f.call(r,r.previous)||$g(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($n,e.attempt($r,e.attempt($i,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:$f},$s={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",o=!1;return function(t){return(72===t||104===t)&&$p.call(r,r.previous)&&!$g(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),a):n(t)};function a(t){if(zb(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),a;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),l}return n(t)}function l(t){return 47===t?(e.consume(t),o)?s:(o=!0,l):n(t)}function s(t){return null===t||zw(t)||zj(t)||zC(t)||zN(t)?n(t):e.attempt($r,e.attempt($i,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:$p},$c={name:"emailAutolink",tokenize:function(e,t,n){let r,i,o=this;return function(t){return!$m(t)||!$h.call(o,o.previous)||$g(o.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return $m(r)?(e.consume(r),t):64===r?(e.consume(r),a):n(r)}(t))};function a(t){return 46===t?e.check($a,s,l)(t):45===t||95===t||zv(t)?(i=!0,e.consume(t),a):s(t)}function l(t){return e.consume(t),r=!0,a}function s(a){return i&&r&&zb(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:$h},$u={},$d=48;for(;$d<123;)$u[$d]=$c,58==++$d?$d=65:91===$d&&($d=97);function $f(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||zj(e)}function $p(e){return!zb(e)}function $h(e){return!(47===e||$m(e))}function $m(e){return 43===e||45===e||46===e||95===e||zv(e)}function $g(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}$u[43]=$c,$u[45]=$c,$u[46]=$c,$u[95]=$c,$u[72]=[$c,$s],$u[104]=[$c,$s],$u[87]=[$c,$l],$u[119]=[$c,$l];let $y={tokenize:function(e,t,n){let r=this;return zM(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function $b(e,t,n){let r,i=this,o=i.events.length,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;o--;){let e=i.events[o][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!r||!r._balanced)return n(o);let l=Rt(i.sliceSerialize({start:r.end,end:i.now()}));return 94===l.codePointAt(0)&&a.includes(l.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function $v(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function $x(e,t,n){let r,i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),l};function l(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(l){if(a>999||93===l&&!r||null===l||91===l||zj(l))return n(l);if(93===l){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return o.includes(Rt(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(l)}return zj(l)||(r=!0),a++,e.consume(l),92===l?c:s}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,s):s(t)}}function $w(e,t,n){let r,i,o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),l=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(l>999||93===t&&!i||null===t||91===t||zj(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=Rt(o.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return zj(t)||(i=!0),l++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a.includes(r)||a.push(r),zM(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function $k(e,t,n){return e.check(zD,t,e.attempt($y,t,n))}function $_(e){e.exit("gfmFootnoteDefinition")}class $S{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function $E(e,t,n){let r,i=this,o=0,a=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?b:l;return o===b&&i.parser.lazy[i.now().line]?n(e):o(e)};function l(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,a+=1),s(n)}function s(t){return null===t?n(t):zE(t)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):zO(t)?zM(e,s,"whitespace")(t):(a+=1,r&&(r=!1,o+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,s):(e.enter("data"),c(t))}function c(t){return null===t||124===t||zj(t)?(e.exit("data"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,zO(t))?zM(e,f,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t)}function f(t){return 45===t||58===t?h(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return zO(t)?zM(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(a+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||zE(t)?y(t):n(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return zO(t)?zM(e,y,"whitespace")(t):y(t)}function y(i){if(124===i)return f(i);if(null===i||zE(i))return r&&o===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function b(t){return e.enter("tableRow"),v(t)}function v(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),v):null===n||zE(n)?(e.exit("tableRow"),t(n)):zO(n)?zM(e,v,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||zj(t)?(e.exit("data"),v(t)):(e.consume(t),92===t?w:x)}function w(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function $j(e,t){let n,r,i,o=-1,a=!0,l=0,s=[0,0,0,0],c=[0,0,0,0],u=!1,d=0,f=new $S;for(;++o<e.length;){let p=e[o],h=p[1];"enter"===p[0]?"tableHead"===h.type?(u=!1,0!==d&&($N(f,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.add(o,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.type?(a=!0,i=void 0,s=[0,0,0,0],c=[0,o+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.add(o,0,[["enter",r,t]])),l="tableDelimiterRow"===h.type?2:r?3:1):l&&("data"===h.type||"tableDelimiterMarker"===h.type||"tableDelimiterFiller"===h.type)?(a=!1,0===c[2]&&(0!==s[1]&&(c[0]=c[1],i=$O(f,t,s,l,void 0,i),s=[0,0,0,0]),c[2]=o)):"tableCellDivider"===h.type&&(a?a=!1:(0!==s[1]&&(c[0]=c[1],i=$O(f,t,s,l,void 0,i)),c=[(s=c)[1],o,0,0])):"tableHead"===h.type?(u=!0,d=o):"tableRow"===h.type||"tableDelimiterRow"===h.type?(d=o,0!==s[1]?(c[0]=c[1],i=$O(f,t,s,l,o,i)):0!==c[1]&&(i=$O(f,t,c,l,o,i)),l=0):l&&("data"===h.type||"tableDelimiterMarker"===h.type||"tableDelimiterFiller"===h.type)&&(c[3]=o)}for(0!==d&&$N(f,t,d,n,r),f.consume(t.events),o=-1;++o<t.events.length;){let e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,o))}return e}function $O(e,t,n,r,i,o){0!==n[0]&&(o.end=Object.assign({},$C(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let a=$C(t.events,n[1]);if(o={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){let i=$C(t.events,n[2]),o=$C(t.events,n[3]),a={type:"tableContent",start:Object.assign({},i),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==i&&(o.end=Object.assign({},$C(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function $N(e,t,n,r,i){let o=[],a=$C(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function $C(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let $A={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return zj(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return zE(r)?t(r):zO(r)?e.check({tokenize:$M},t,n)(r):n(r)}}};function $M(e,t,n){return zM(e,function(e){return null===e?n(e):t(e)},"whitespace")}let $P={};function $T(e){let t,n,r,i=e||$P,o=this.data(),a=o.micromarkExtensions||(o.micromarkExtensions=[]),l=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),s=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);a.push(zy([{text:$u},{document:{91:{name:"gfmFootnoteDefinition",tokenize:$w,continuation:{tokenize:$k},exit:$_}},text:{91:{name:"gfmFootnoteCall",tokenize:$x},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$b,resolveTo:$v}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,o=this.events,a=0;return function(l){return 126===i&&"characterEscape"!==o[o.length-1][1].type?r(l):(e.enter("strikethroughSequenceTemporary"),function o(l){let s=zV(i);if(126===l)return a>1?r(l):(e.consume(l),a++,o);if(a<2&&!t)return r(l);let c=e.exit("strikethroughSequenceTemporary"),u=zV(l);return c._open=!u||2===u&&!!s,c._close=!s||2===s&&!!u,n(l)}(l))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",o,t]],l=t.parser.constructs.insideSpan.null;l&&zh(a,a.length,0,zG(l,e.slice(r+1,n),t)),zh(a,a.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),zh(e,r-1,n-r+3,a),n=r+a.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:$E,resolveAll:$j}}},{text:{91:$A}}])),l.push([{transforms:[LT],enter:{literalAutolink:LO,literalAutolinkEmail:LN,literalAutolinkHttp:LN,literalAutolinkWww:LN},exit:{literalAutolink:LP,literalAutolinkEmail:LM,literalAutolinkHttp:LC,literalAutolinkWww:LA}},{enter:{gfmFootnoteCallString:LR,gfmFootnoteCall:LL,gfmFootnoteDefinitionLabelString:L$,gfmFootnoteDefinition:LB},exit:{gfmFootnoteCallString:LF,gfmFootnoteCall:LU,gfmFootnoteDefinitionLabelString:LH,gfmFootnoteDefinition:LK}},{canContainEols:["delete"],enter:{strikethrough:LG},exit:{strikethrough:LX}},{enter:{table:L2,tableData:L5,tableHeader:L5,tableRow:L4},exit:{codeText:L6,table:L3,tableData:L9,tableHeader:L9,tableRow:L9}},{exit:{taskListCheckValueChecked:L7,taskListCheckValueUnchecked:L7,paragraph:$e}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:LE,notInConstruct:Lj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:LE,notInConstruct:Lj},{character:":",before:"[ps]",after:"\\/",inConstruct:LE,notInConstruct:Lj}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let o=n.createTracker(i),a=o.move("[^"),l=n.enter("footnoteDefinition"),s=n.enter("label");return a+=o.move(n.safe(n.associationId(e),{before:a,after:"]"})),s(),a+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),a+=o.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,o.current()),r?LZ:Lq))),l(),a},footnoteReference:LW},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:LV}],handlers:{delete:LY}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=L0(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return l(function(e,t,n){let r=e.children,i=-1,o=[],a=t.enter("table");for(;++i<r.length;)o[i]=s(r[i],t,n);return a(),o}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){let i=l([s(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function a(e,t,n,r){let i=n.enter("tableCell"),a=n.enter("phrasing"),l=n.containerPhrasing(e,{...r,before:o,after:o});return a(),i(),l}function l(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||LJ,o=[],a=[],l=[],s=[],c=0,u=-1;for(;++u<e.length;){let t=[],r=[],o=-1;for(e[u].length>c&&(c=e[u].length);++o<e[u].length;){var d;let a=null==(d=e[u][o])?"":String(d);if(!1!==n.alignDelimiters){let e=i(a);r[o]=e,(void 0===s[o]||e>s[o])&&(s[o]=e)}t.push(a)}a[u]=t,l[u]=r}let f=-1;if("object"==typeof r&&"length"in r)for(;++f<c;)o[f]=LQ(r[f]);else{let e=LQ(r);for(;++f<c;)o[f]=e}f=-1;let p=[],h=[];for(;++f<c;){let e=o[f],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,s[f]-t.length-r.length),a=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>s[f]&&(s[f]=i),h[f]=i),p[f]=a}a.splice(1,0,p),l.splice(1,0,h),u=-1;let m=[];for(;++u<a.length;){let e=a[u],t=l[u];f=-1;let r=[];for(;++f<c;){let i=e[f]||"",a="",l="";if(!1!==n.alignDelimiters){let e=s[f]-(t[f]||0),n=o[f];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),l=" ".repeat(e/2-.5)):l=a=" ".repeat(e/2):l=" ".repeat(e)}!1===n.delimiterStart||f||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||f)&&r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(i),!1!==n.alignDelimiters&&r.push(l),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||f!==c-1)&&r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function s(e,t,n){let r=e.children,i=-1,o=[],l=t.enter("tableRow");for(;++i<r.length;)o[i]=a(r[i],e,t,n);return l(),o}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$t}}]})}let $I=function(e,t,n){let r=RB(n);if(!e||!e.type||!e.children)throw Error("Expected parent node");if("number"==typeof t){if(t<0||1/0===t)throw Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},$D=function(e){if(null==e)return $R;if("string"==typeof e){var t;return t=e,$z(function(e){return e.tagName===t})}if("object"==typeof e){var n=e;let t=[],r=-1;for(;++r<n.length;)t[r]=$D(n[r]);return $z(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}if("function"==typeof e)return $z(e);throw Error("Expected function, string, or array as `test`")};function $z(e){return function(t,n,r){var i;return!!(null!==(i=t)&&"object"==typeof i&&"type"in i&&"tagName"in i&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function $R(e){return!!(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}let $L=/\n/g,$$=/[\t ]+/g,$B=$D("br"),$F=$D(function(e){return"td"===e.tagName||"th"===e.tagName}),$U=$D("p"),$H=$D("tr"),$K=$D(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return!!(e.properties||{}).hidden},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),$W=$D(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function $q(e,t){let n,r=String(e.value),i=[],o=[],a=0;for(;a<=r.length;){$L.lastIndex=a;let e=$L.exec(r),n=e&&"index"in e?e.index:r.length;i.push(function(e,t,n){let r,i=[],o=0;for(;o<e.length;){$$.lastIndex=o;let n=$$.exec(e);r=n?n.index:e.length,o||r||!n||t||i.push(""),o!==r&&i.push(e.slice(o,r)),o=n?r+n[0].length:r}return o===r||n||i.push(""),i.join(" ")}(r.slice(a,n).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==a||t.breakBefore,n!==r.length||t.breakAfter)),a=n+1}let l=-1;for(;++l<i.length;)8203===i[l].charCodeAt(i[l].length-1)||l<i.length-1&&8203===i[l+1].charCodeAt(0)?(o.push(i[l]),n=void 0):i[l]?("number"==typeof n&&o.push(n),o.push(i[l]),n=0):(0===l||l===i.length-1)&&o.push(0);return o}function $Z(e,t){if("element"===e.type){let n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}let $V=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],$G=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$X=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),$Y=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$J=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var $Q="[0-9](_*[0-9])*",$0=`\\.(${$Q})`,$1="[0-9a-fA-F](_*[0-9a-fA-F])*",$2={className:"number",variants:[{begin:`(\\b(${$Q})((${$0})|\\.)?|(${$0}))[eE][+-]?(${$Q})[fFdD]?\\b`},{begin:`\\b(${$Q})((${$0})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$0})[fFdD]?\\b`},{begin:`\\b(${$Q})[fFdD]\\b`},{begin:`\\b0[xX]((${$1})\\.?|(${$1})?\\.(${$1}))[pP][+-]?(${$Q})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${$1})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};let $3="[A-Za-z$_][0-9A-Za-z$_]*",$4=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],$9=["true","false","null","undefined","NaN","Infinity"],$5=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],$6=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$8=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$7=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Be=[].concat($8,$5,$6);var Bt="[0-9](_*[0-9])*",Bn=`\\.(${Bt})`,Br="[0-9a-fA-F](_*[0-9a-fA-F])*",Bi={className:"number",variants:[{begin:`(\\b(${Bt})((${Bn})|\\.)?|(${Bn}))[eE][+-]?(${Bt})[fFdD]?\\b`},{begin:`\\b(${Bt})((${Bn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Bn})[fFdD]?\\b`},{begin:`\\b(${Bt})[fFdD]\\b`},{begin:`\\b0[xX]((${Br})\\.?|(${Br})?\\.(${Br}))[pP][+-]?(${Bt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Br})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};let Bo=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ba=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Bl=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Bs=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Bc=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Bu=Bl.concat(Bs).sort().reverse(),Bd=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Bf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Bp=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Bh=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Bm=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Bg(e){return e?"string"==typeof e?e:e.source:null}function By(e){return Bb("(?=",e,")")}function Bb(...e){return e.map(e=>Bg(e)).join("")}function Bv(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>Bg(e)).join("|")+")"}let Bx=e=>Bb(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Bw=["Protocol","Type"].map(Bx),Bk=["init","self"].map(Bx),B_=["Any","Self"],BS=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],BE=["false","nil","true"],Bj=["assignment","associativity","higherThan","left","lowerThan","none","right"],BO=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],BN=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],BC=Bv(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),BA=Bv(BC,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),BM=Bb(BC,BA,"*"),BP=Bv(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),BT=Bv(BP,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),BI=Bb(BP,BT,"*"),BD=Bb(/[A-Z]/,BT,"*"),Bz=["attached","autoclosure",Bb(/convention\(/,Bv("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Bb(/objc\(/,BI,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],BR=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"],BL="[A-Za-z$_][0-9A-Za-z$_]*",B$=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],BB=["true","false","null","undefined","NaN","Infinity"],BF=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],BU=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],BH=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],BK=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],BW=[].concat(BH,BF,BU),Bq={arduino:function(e){let t,n,r,i,o,a,l,s,c,u,d,f,p,h,m,g,y=(t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="[a-zA-Z_]\\w*::",o="(?!struct)("+(r="decltype\\(auto\\)")+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},contains:(h=[p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},c,a,n,e.C_BLOCK_COMMENT_MODE,s,l]).concat([{begin:/\(/,end:/\)/,keywords:f,contains:h.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,s]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,s,a,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]},{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,p,h,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:f,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:f},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}),b=y.keywords;return b.type=[...b.type,"boolean","byte","word","String"],b.literal=[...b.literal,"DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"],b.built_in=[...b.built_in,"KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],b._hints=["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],y.name="Arduino",y.aliases=["ino"],y.supersetOf="cpp",y},bash:function(e){let t=e.regex,n={};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]}]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);let l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},s=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[s,e.SHEBANG(),c,l,i,o,{match:/(\/[a-z._-]+)+/},a,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}},c:function(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[c,a,n,e.C_BLOCK_COMMENT_MODE,s,l],h={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,s,a,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:f,disableAutodetect:!0,illegal:"</",contains:[].concat(h,m,p,[c,{begin:e.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:l,keywords:f}}},cpp:function(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},h=[p,c,a,n,e.C_BLOCK_COMMENT_MODE,s,l],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:h.concat([{begin:/\(/,end:/\)/,keywords:f,contains:h.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,s]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,s,a,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,p,h,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:f,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:f},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},csharp:function(e){let t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(i,{illegal:/\n/}),a={className:"subst",begin:/\{/,end:/\}/,keywords:t},l=e.inherit(a,{illegal:/\n/}),s={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,l]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]});a.contains=[c,s,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],l.contains=[u,s,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let d={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c,s,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},p=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",h={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},d,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+p+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,f],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},h]}},css:function(e){let t=e.regex,n={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+$X.join("|")+")"},{begin:":(:)?("+$Y.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$J.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:$G.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+$V.join("|")+")\\b"}]}},diff:function(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},go:function(e){let t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}},graphql:function(e){let t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}},ini:function(e){let t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,{begin:/\[/,end:/\]/,contains:[r,o,i,a,n,"self"],relevance:0},o,i,a,n]}}]}},java:function(e){let t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+function e(t,n,r){return -1===r?"":t.replace(n,i=>e(t,n,r-1))}("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},a={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,$2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},$2,o]}},javascript:function(e){var t;let n=e.regex,r=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,o={$pattern:$3,keyword:$4,literal:$9,built_in:Be,"variable.language":$7},a="[0-9](_?[0-9])*",l=`\\.(${a})`,s="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${s})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${s})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},d={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},f={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},p={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},h={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:$3+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,f,p,h,{match:/\$\d+/},c];u.contains=g.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(g)});let y=[].concat(m,u.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(y)}]),v={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b},x={variants:[{match:[/class/,/\s+/,$3,/\s+/,/extends/,/\s+/,n.concat($3,"(",n.concat(/\./,$3),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,$3],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...$5,...$6]}},k={match:n.concat(/\b/,(t=[...$8,"super","import"].map(e=>`${e}\\s*\\(`),n.concat("(?!",t.join("|"),")")),$3,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:n.concat(/\./,n.lookahead(n.concat($3,/(?![0-9A-Za-z$_(])/))),end:$3,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,$3,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,f,p,h,m,{match:/\$\d+/},c,w,{scope:"attr",match:$3+n.lookahead(":"),relevance:0},E,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r,"on:begin":(e,t)=>{let n,r=e[0].length+e.index,i=e.input[r];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let n="</"+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:r})||t.ignoreMatch();let o=e.input.substring(r);if((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)return void t.ignoreMatch()},end:i}],subLanguage:"xml",contains:[{begin:r,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,$3,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:$3,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+$3,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,{match:[/get|set/,/\s+/,$3,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},{match:/\$[(.]/}]}},json:function(e){let t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},kotlin:function(e){let t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(o);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},s=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),c={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]};return c.variants[1].contains=[c],c.variants[1].contains=[c],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,s,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[c,e.C_LINE_COMMENT_MODE,s],relevance:0},e.C_LINE_COMMENT_MODE,s,a,l,o,e.C_NUMBER_MODE]},s]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},Bi]}},less:function(e){let t={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},n="[\\w-]+",r="("+n+"|@\\{"+n+"\\})",i=[],o=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},s={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Ba.join(" ")};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,{begin:"\\(",end:"\\)",contains:o,keywords:s,relevance:0},l("variable","@@?"+n,10),l("variable","@\\{"+n+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let c=o.concat({begin:/\{/,end:/\}/,contains:i}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},d={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Bc.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},f={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+n+"\\}"),{begin:"\\b("+Bo.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",r,0),l("selector-id","#"+r),l("selector-class","\\."+r,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Bl.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Bs.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:c},{begin:"!important"},t.FUNCTION_DISPATCH]},p={begin:n+":(:)?"+`(${Bu.join("|")})`,returnBegin:!0,contains:[f]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:s,returnEnd:!0,contains:o,relevance:0}},{className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:c}},p,d,f,u,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}},lua:function(e){let t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}},makefile:function(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,{className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},r,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},{className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]}]}},markdown:function(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},a=e.inherit(i,{contains:[]}),l=e.inherit(o,{contains:[]});i.contains.push(l),o.contains.push(a);let s=[n,r];return[i,o,a,l].forEach(e=>{e.contains=e.contains.concat(s)}),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s=s.concat(i,o)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:s}]}]},n,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,o,{className:"quote",begin:"^>\\s+",contains:s,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},r,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},objectivec:function(e){let t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},perl:function(e){let t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot class close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl field fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map method mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0"},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},s={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,i,l],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(e,r,i="\\1")=>{let o="\\1"===i?i:t.concat(i,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,i,n)},f=(e,r,i)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,n),p=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},s,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...u,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...u,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,s]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}},php:function(e){let t,n=e.regex,r=/(?![A-Za-z0-9])(?![$])/,i=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),o=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),a=n.concat(/[A-Z]+/,r),l={scope:"variable",match:"\\$+"+i},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p="[ \n]",h={scope:"string",variants:[u,c,d,f]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:y,literal:(t=[],g.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t),built_in:b},x=e=>e.map(e=>e.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,n.concat(p,"+"),n.concat("(?!",x(b).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},k=n.concat(i,"\\b(?!\\()"),_={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,n.concat(/::/,n.lookahead(/(?!class\b)/)),k],scope:{1:"title.class",3:"variable.constant"}},{match:[o,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},S={scope:"attr",match:n.concat(i,n.lookahead(":"),n.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[S,l,_,e.C_BLOCK_COMMENT_MODE,h,m,w]},j={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",x(y).join("\\b|"),"|",x(b).join("\\b|"),"\\b)"),i,n.concat(p,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(j);let O=[S,_,e.C_BLOCK_COMMENT_MODE,h,m,w],N={begin:n.concat(/#\[\s*\\?/,n.either(o,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...O]},...O,{scope:"meta",variants:[{match:o},{match:a}]}]};return{case_insensitive:!1,keywords:v,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},l,j,_,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",N,l,_,e.C_BLOCK_COMMENT_MODE,h,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},h,m]}},"php-template":function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}},plaintext:function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}},python:function(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},a={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},l={begin:/\{\{/,relevance:0},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,l,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,l,a]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,l,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,l,a]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,d=`\\b|${r.join("|")}`,f={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${c})[jJ](?=${d})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},h={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,f,s,e.HASH_COMMENT_MODE]}]};return a.contains=[s,f,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[o,f,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},s,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,h,s]}]}},"python-repl":function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}},r:function(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},ruby:function(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[0-9](_?[0-9])*",f={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},h=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},f,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,s),relevance:0}].concat(l,s);c.contains=h,p.contains=h;let m=[{begin:/^\s*=>/,starts:{end:"$",contains:h}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:h}}];return s.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(s).concat(h)}},rust:function(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],s=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:s,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:l},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:l,type:s}},{className:"punctuation",begin:"->"},o]}},scss:function(e){let t={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},n="@[a-z-]+",r={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Bd.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+Bp.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Bh.join("|")+")"},r,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Bm.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,r,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Bf.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},shell:function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}},sql:function(e){let t=e.regex,n=e.COMMENT("--","$"),r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!r.includes(e)),o={match:t.concat(/\b/,t.either(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};function a(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}let l={scope:"keyword",match:a(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:n(e)?`${e}|0`:e)}(i,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:a(["double precision","large object","with timezone","without timezone"])},l,o,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},swift:function(e){let t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Bv(...Bw,...Bk)],className:{2:"keyword"}},o={match:Bb(/\./,Bv(...BS)),relevance:0},a=BS.filter(e=>"string"==typeof e).concat(["_|0"]),l={variants:[{className:"keyword",match:Bv(...BS.filter(e=>"string"!=typeof e).concat(B_).map(Bx),...Bk)}]},s={$pattern:Bv(/\b\w+/,/#\w+/),keyword:a.concat(BO),literal:BE},c=[i,o,l],u=[{match:Bb(/\./,Bv(...BN)),relevance:0},{className:"built_in",match:Bb(/\b/,Bv(...BN),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:"operator",relevance:0,variants:[{match:BM},{match:`\\.(\\.|${BA})+`}]}],p="([0-9]_*)+",h="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${h})(\\.(${h}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:Bb(/\\/,e,/[0\\tnr"']/)},{match:Bb(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),y=(e="")=>({className:"subst",label:"interpol",begin:Bb(/\\/,e,/\(/),end:/\)/}),b=(e="")=>({begin:Bb(e,/"""/),end:Bb(/"""/,e),contains:[g(e),((e="")=>({className:"subst",match:Bb(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}))(e),y(e)]}),v=(e="")=>({begin:Bb(e,/"/),end:Bb(/"/,e),contains:[g(e),y(e)]}),x={className:"string",variants:[b(),b("#"),b("##"),b("###"),v(),v("#"),v("##"),v("###")]},w=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k=e=>{let t=Bb(e,/\//),n=Bb(/\//,e);return{begin:t,end:n,contains:[...w,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},_={scope:"regexp",variants:[k("###"),k("##"),k("#"),{begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:w}]},S={match:Bb(/`/,BI,/`/)},E=[S,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${BT}+`}],j=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:BR,contains:[...f,m,x]}]}},{scope:"keyword",match:Bb(/@/,Bv(...Bz),By(Bv(/\(/,/\s+/)))},{scope:"meta",match:Bb(/@/,BI)}],O={match:By(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Bb(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,BT,"+")},{className:"type",match:BD,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Bb(/\s+&\s+/,By(BD)),relevance:0}]},N={begin:/</,end:/>/,keywords:s,contains:[...r,...c,...j,d,O]};O.contains.push(N);let C={begin:/\(/,end:/\)/,relevance:0,keywords:s,contains:["self",{match:Bb(BI,/\s*:/),keywords:"_|0",relevance:0},...r,_,...c,...u,...f,m,x,...E,...j,O]},A={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,O]},M={begin:/\(/,end:/\)/,keywords:s,contains:[{begin:Bv(By(Bb(BI,/\s*:/)),By(Bb(BI,/\s+/,BI,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:BI}]},...r,...c,...f,m,x,...j,O,C],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,Bv(S.match,BI,BM)],className:{1:"keyword",3:"title.function"},contains:[A,M,t],illegal:[/\[/,/%/]},T={begin:[/precedencegroup/,/\s+/,BD],className:{1:"keyword",3:"title"},contains:[O],keywords:[...Bj,...BE],end:/}/},I={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,BI,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:s,contains:[A,...c,{begin:/:/,end:/\{/,keywords:s,contains:[{scope:"title.class.inherited",match:BD},...c],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>"interpol"===e.label);t.keywords=s;let n=[...c,...u,...f,m,x,...E];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:s,contains:[...r,P,{match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[A,M,t],illegal:/\[|%/},{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},I,{match:[/operator/,/\s+/,BM],className:{1:"keyword",3:"title"}},T,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},_,...c,...u,...f,m,x,...E,...j,O,C]}},typescript:function(e){var t;let n,r,i,o,a,l,s,c,u,d,f,p,h,m,g,y,b,v,x,w,k,_,S,E,j,O=e.regex,N=(n=e.regex,r=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,o=(e,t)=>{let n,r=e[0].length+e.index,i=e.input[r];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let n="</"+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:r})||t.ignoreMatch();let o=e.input.substring(r);if((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)return void t.ignoreMatch()},a={$pattern:BL,keyword:B$,literal:BB,built_in:BW,"variable.language":BK},l="[0-9](_?[0-9])*",s=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:BL+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},d.contains=(y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,h,m,{match:/\$\d+/},u]).concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(y)}),v=(b=[].concat(g,d.contains)).concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(b)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v},w={variants:[{match:[/class/,/\s+/,BL,/\s+/,/extends/,/\s+/,n.concat(BL,"(",n.concat(/\./,BL),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,BL],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...BF,...BU]}},_={match:n.concat(/\b/,(t=[...BH,"super","import"].map(e=>`${e}\\s*\\(`),n.concat("(?!",t.join("|"),")")),BL,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},S={begin:n.concat(/\./,n.lookahead(n.concat(BL,/(?![0-9A-Za-z$_(])/))),end:BL,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,BL,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]},{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,h,m,g,{match:/\$\d+/},u,k,{scope:"attr",match:BL+n.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r,"on:begin":o,end:i}],subLanguage:"xml",contains:[{begin:r,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,BL,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:BL,className:"title.function"})]},{match:/\.\.\./,relevance:0},S,{match:"\\$"+BL,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,{match:[/get|set/,/\s+/,BL,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},{match:/\$[(.]/}]}),C=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],A={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},M={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:C},contains:[N.exports.CLASS_REFERENCE]},P={$pattern:BL,keyword:B$.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:BB,built_in:BW.concat(C),"variable.language":BK},T={className:"meta",begin:"@"+BL},I=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(N.keywords,P),N.exports.PARAMS_CONTAINS.push(T);let D=N.contains.find(e=>"attr"===e.scope),z=Object.assign({},D,{match:O.concat(BL,O.lookahead(/\s*\?:/))});return N.exports.PARAMS_CONTAINS.push([N.exports.CLASS_REFERENCE,D,z]),N.contains=N.contains.concat([T,A,M,z]),I(N,"shebang",e.SHEBANG()),I(N,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),N.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(N,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),N},vbnet:function(e){let t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,a={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(i,o),/ *#/)}]},l=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),s=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},l,s,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[s]}]}},wasm:function(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},xml:function(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),s={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[s],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[s],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:s}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},yaml:function(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},{begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},{begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},r],l=[...a];return l.pop(),l.push(i),o.contains=l,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:a}}},BZ=e.i(19173).default,BV={};class BG{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}let BX={};function BY(e){let t=e||BX,n=t.aliases,r=t.detect||!1,i=t.languages||Bq,o=t.plainText,a=t.prefix,l=t.subset,s="hljs",c=function(e){let t=BZ.newInstance();return e&&i(e),{highlight:n,highlightAuto:function(e,i){let o;Du();let a=(i||BV).subset||r(),l=-1,s=0;for(;++l<a.length;){let r=a[l];if(!t.getLanguage(r))continue;let c=n(r,e,i);c.data&&void 0!==c.data.relevance&&c.data.relevance>s&&(s=c.data.relevance,o=c)}return o||{type:"root",children:[],data:{language:void 0,relevance:s}}},listLanguages:r,register:i,registerAlias:function(e,n){if("string"==typeof e)Du(),t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases("string"==typeof r?r:[...r],{languageName:n})}}},registered:function(e){return!!t.getLanguage(e)}};function n(e,n,r){Du(),Du();let i=r||BV,o="string"==typeof i.prefix?i.prefix:"hljs-";if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:BG,classPrefix:o});let a=t.highlight(n,{ignoreIllegals:!0,language:e});if(a.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:a.errorRaised});let l=a._emitter.root,s=l.data;return s.language=a.language,s.relevance=a.relevance,l}function r(){return t.listLanguages()}function i(e,n){if("string"==typeof e)Du(),t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}(i);if(n&&c.registerAlias(n),a){let e=a.indexOf("-");s=-1===e?a:a.slice(0,e)}return function(e,t){RW(e,"element",function(e,n,i){let u;if("code"!==e.tagName||!i||"element"!==i.type||"pre"!==i.tagName)return;let d=function(e){let t,n=e.properties.className,r=-1;if(Array.isArray(n)){for(;++r<n.length;){let e=String(n[r]);if("no-highlight"===e||"nohighlight"===e)return!1;t||"lang-"!==e.slice(0,5)||(t=e.slice(5)),t||"language-"!==e.slice(0,9)||(t=e.slice(9))}return t}}(e);if(!1===d||!d&&!r||d&&o&&o.includes(d))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(s)||e.properties.className.unshift(s);let f=function(e,t){let n,r="children"in e?e.children:[],i=$W(e),o=$Z(e,{whitespace:(t||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),a=[];("text"===e.type||"comment"===e.type)&&a.push(...$q(e,{whitespace:o,breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)a.push(...function e(t,n,r){return"element"===t.type?function(t,n,r){let i,o,a=$Z(t,r),l=t.children||[],s=-1,c=[];if($K(t))return c;for($B(t)||$H(t)&&$I(n,t,$H)?o="\n":$U(t)?(i=2,o=2):$W(t)&&(i=1,o=1);++s<l.length;)c=c.concat(e(l[s],t,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<l.length-1?$B(l[s+1]):o}));return $F(t)&&$I(n,t,$F)&&c.push(" "),i&&c.unshift(i),o&&c.push(o),c}(t,n,r):"text"===t.type?"normal"===r.whitespace?$q(t,r):[String(t.value)]:[]}(r[l],e,{whitespace:o,breakBefore:l?void 0:i,breakAfter:l<r.length-1?$B(r[l+1]):i}));let s=[];for(l=-1;++l<a.length;){let e=a[l];"number"==typeof e?void 0!==n&&e>n&&(n=e):e&&(void 0!==n&&n>-1&&s.push("\n".repeat(n)||" "),n=-1,s.push(e))}return s.join("")}(e,{whitespace:"pre"});try{u=d?c.highlight(d,f,{prefix:a}):c.highlightAuto(f,{prefix:a,subset:l})}catch(n){if(d&&/Unknown language/.test(n.message))return void t.message("Cannot highlight as `"+d+"`, it’s not registered",{ancestors:[i,e],cause:n,place:e.position,ruleId:"missing-language",source:"rehype-highlight"});throw n}!d&&u.data&&u.data.language&&e.properties.className.push("language-"+u.data.language),u.children.length>0&&(e.children=u.children)})}}let BJ=/^(https?:|mailto:|attachment:\/\/)/i;function BQ(e){return BJ.test(e)?e:""}function B0({text:e,projectId:t,className:n,onToggleTask:r}){let i={i:0};return(0,V.jsx)("div",{className:n,children:(0,V.jsx)("div",{className:"bd-md",children:(0,V.jsx)(Lk,{remarkPlugins:[$T],rehypePlugins:[[BY,{ignoreMissing:!0}]],urlTransform:BQ,components:{a:({children:e,...t})=>(0,V.jsx)("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--brand)] underline",children:e}),img:({src:e,alt:n})=>{let r="string"==typeof e?e:"",i=r.startsWith("attachment://")?ei.k.attachments.urlFor(t,r):r;return(0,V.jsx)("img",{src:i,alt:n??"",className:"my-2 block max-h-[320px] max-w-full rounded-[8px] border border-border"})},input:({type:e,checked:t})=>{if("checkbox"!==e)return null;let n=i.i++;return(0,V.jsx)(er.h,{checked:!!t,disabled:!r,onChange:()=>r?.(n),className:"mr-[6px] translate-y-[2px] disabled:cursor-default"})}},children:e})})})}function B1({links:e}){let{projectId:t}=eu();return e.length?(0,V.jsx)("div",{"data-review-links":!0,className:"flex flex-wrap gap-[6px]",children:e.map(e=>{let n=e.startsWith("attachment://"),r=n?ei.k.attachments.urlFor(t,e):e,i=n||e.startsWith("/api/p/")?`Attachment: ${e.split("/").at(-1)}`:e.replace(/^https?:\/\//i,"");return(0,V.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",title:r,className:"flex h-8 max-w-[300px] items-center gap-[6px] rounded-[9px] border border-border bg-[var(--surface-2)] px-[11px] text-label text-[var(--brand)] hover:underline",children:[(0,V.jsx)(en.W,{name:"link",size:13,className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"truncate",children:i})]},e)})}):null}function B2(){let{beads:e,index:t,loading:n}=eu(),r=n&&0===e.length,i=G.useMemo(()=>e.filter(lP),[e]),o=G.useMemo(()=>e.filter(e=>lI(e,t)),[e,t]),a=i.length+o.length;return(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)(f3,{title:"Needs You",subtitle:r?"Loading…":0===a?"nothing waiting":`${a} waiting on you`}),(0,V.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:r?(0,V.jsx)("div",{className:"p-10 text-center text-body text-[var(--text-3)]",children:"Loading…"}):0===a?(0,V.jsxs)("div",{className:"p-10 text-center text-body text-[var(--text-3)]",children:["🎉 Nothing needs you right now. Agents flag beads here with"," ",(0,V.jsx)("span",{className:"font-mono",children:"bd human"}),", and human-approval gates (",(0,V.jsx)("span",{className:"font-mono",children:"bd gate create --type human"}),") show up once their blockers clear."]}):(0,V.jsxs)("div",{className:"mx-auto flex max-w-3xl flex-col gap-3",children:[o.map(e=>(0,V.jsx)(B9,{gate:e},e.id)),i.map(e=>(0,V.jsx)(B5,{bead:e},e.id))]})})]})}function B3({bead:e}){let{projectId:t}=eu();return e.description?(0,V.jsx)(B0,{text:e.description,projectId:t,className:"mb-3 text-label leading-[1.5] text-[var(--text-2)]"}):null}function B4({bead:e}){let t=Dc(e);return t.length?(0,V.jsxs)("div",{className:"mb-3",children:[(0,V.jsx)("div",{className:"mb-1 text-meta font-semibold text-[var(--text-3)]",children:"Links & attachments"}),(0,V.jsx)(B1,{links:t})]}):(0,V.jsx)("p",{className:"mb-3 text-label text-[var(--text-3)]",children:"No supporting links found. Review the bead details before deciding."})}function B9({gate:e}){let{beads:t,openDetail:n,selectedBeadId:r,selectBead:i}=eu(),o=G.useMemo(()=>{var n;return n=e.id,t.filter(e=>(e.dependencies??[]).some(e=>e.depends_on_id===n&&lS.includes(e.type)))},[e.id,t]);return(0,V.jsxs)("div",{role:"button",tabIndex:0,"data-keyboard-bead-id":e.id,"aria-current":r===e.id?"true":void 0,onFocus:()=>i(e.id),className:`rounded-[12px] border bg-[var(--surface)] p-4 focus-visible:outline-none ${r===e.id?"border-[var(--brand)] ring-2 ring-[var(--brand)]/30":"border-border"}`,children:[(0,V.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,V.jsx)(en.W,{name:"gate",size:15,style:{color:"var(--brand)"}}),(0,V.jsx)(er.W,{mono:!0,className:"text-meta",onClick:()=>n(e.id),children:e.id}),(0,V.jsx)(pn,{tone:"strong",className:"font-semibold uppercase tracking-wide",children:"Approval gate"}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)("span",{title:l3(e.updated_at),className:"text-meta text-[var(--text-3)]",children:l1(e.updated_at)})]}),(0,V.jsx)(er.W,{tone:"text",className:"mb-2 block text-section font-semibold leading-snug",onClick:()=>n(e.id),children:e.title}),(0,V.jsx)(B3,{bead:e}),(0,V.jsx)(B4,{bead:e}),o.length>0&&(0,V.jsxs)("p",{className:"mb-3 text-label leading-[1.5] text-[var(--text-2)]",children:["Approving unblocks"," ",o.map((e,t)=>(0,V.jsxs)(G.Fragment,{children:[t>0&&", ",(0,V.jsx)(er.W,{mono:!0,tone:"text",onClick:()=>n(e.id),children:e.id})]},e.id)),"."]}),(0,V.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,V.jsx)(Ds,{id:e.id})})]})}function B5({bead:e}){let{humanAllowlist:t,openDetail:n,readOnly:r,selectedBeadId:i,selectBead:o}=eu(),a=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t,text:n})=>ei.k.human.respond(e,t,n),e=>`Responded to ${e.id}`,t,ed(e)))}(),l=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t})=>ei.k.human.dismiss(e,t),e=>`Dismissed ${e.id}`,t,ed(e)))}(),[s,c]=G.useState(""),u=fU(e,t),d=a.isPending||l.isPending,f=!r&&!d&&!!s.trim(),p=()=>a.mutate({id:e.id,text:s.trim()});return(0,V.jsxs)("div",{role:"button",tabIndex:0,"data-keyboard-bead-id":e.id,"aria-current":i===e.id?"true":void 0,onFocus:()=>o(e.id),className:`rounded-[12px] border bg-[var(--surface)] p-4 focus-visible:outline-none ${i===e.id?"border-[var(--brand)] ring-2 ring-[var(--brand)]/30":"border-border"}`,children:[(0,V.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:14,style:{color:lK(e.issue_type)}}),(0,V.jsx)(er.W,{mono:!0,className:"text-meta",onClick:()=>n(e.id),children:e.id}),(0,V.jsx)(ps,{origin:u,title:"human"===u?"Human":"Agent"}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)("span",{title:l3(e.updated_at),className:"text-meta text-[var(--text-3)]",children:l1(e.updated_at)})]}),(0,V.jsx)(er.W,{tone:"text",className:"mb-2 block text-section font-semibold leading-snug",onClick:()=>n(e.id),children:e.title}),(0,V.jsx)(B3,{bead:e}),(0,V.jsx)(B4,{bead:e}),(0,V.jsx)(er.p,{disabled:r,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{Di(e)&&(e.preventDefault(),f&&p())},rows:2,placeholder:"Answer the agent's question… (posts a comment; the bead stays open)",className:"mb-2"}),(0,V.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,V.jsx)(er.K,{size:"sm",disabled:r||d,onClick:()=>l.mutate({id:e.id}),children:"Dismiss"}),(0,V.jsx)(ub.f,{size:"sm",icon:"check",disabled:!f,onClick:p,children:"Respond"})]})]})}function B6(){let{projectId:e,meta:t}=eu(),n=!!t?.gamification,{data:r,isLoading:i}=eh(e,n);if(!n)return(0,V.jsx)(B8,{children:(0,V.jsxs)("div",{className:"p-10 text-center text-body text-[var(--text-3)]",children:["Gamification is off. Enable it in ",(0,V.jsx)("span",{className:"font-medium",children:"Settings → Gamification"})," to earn XP, streaks, and badges."]})});if(i&&!r)return(0,V.jsx)(B8,{children:(0,V.jsx)("div",{className:"p-10 text-center text-body text-[var(--text-3)]",children:"Loading achievements…"})});if(!r)return(0,V.jsx)(B8,{children:null});let o=r.you,a=r.actors.filter(e=>"human"===e.origin),l=r.actors.filter(e=>"agent"===e.origin);return(0,V.jsx)(B8,{children:(0,V.jsxs)("div",{className:"mx-auto flex max-w-4xl flex-col gap-5",children:[(0,V.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[(0,V.jsxs)("div",{className:"rounded-[13px] border border-border bg-[var(--surface)] p-4 md:col-span-2",children:[(0,V.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,V.jsxs)("div",{className:"text-body font-semibold",children:["Level ",o.level]}),(0,V.jsxs)("div",{className:"font-mono text-label text-[var(--text-3)]",children:[o.xp," XP · ",o.closed," closed"]})]}),(0,V.jsx)("div",{className:"mt-2 h-[8px] overflow-hidden rounded-full bg-[var(--surface-3)]",children:(0,V.jsx)("div",{className:"h-full rounded-full",style:{width:`${Math.round(100*o.progress)}%`,background:"var(--brand)"}})}),(0,V.jsxs)("div",{className:"mt-1 text-meta text-[var(--text-3)]",children:[Math.max(0,o.span-o.intoLevel)," XP to level ",o.level+1]})]}),(0,V.jsxs)("div",{className:"flex items-center justify-around rounded-[13px] border border-border bg-[var(--surface)] p-4",children:[(0,V.jsx)(B7,{value:`🔥 ${o.currentStreak}`,label:"current streak"}),(0,V.jsx)(B7,{value:`${o.longestStreak}d`,label:"longest"})]})]}),(0,V.jsxs)("section",{className:"rounded-[13px] border border-border bg-[var(--surface)] p-[16px_18px]",children:[(0,V.jsx)("div",{className:"mb-3 text-body font-semibold",children:"Badges"}),(0,V.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:o.badges.map(e=>(0,V.jsxs)("div",{title:e.description,className:`flex flex-col items-center gap-1 rounded-[10px] border p-3 text-center ${e.earned?"border-[var(--brand)] bg-[var(--brand-weak)]":"border-border bg-[var(--surface-2)] opacity-60"}`,children:[(0,V.jsx)(en.W,{name:"feature",size:20,style:{color:e.earned?"var(--brand)":"var(--text-3)"}}),(0,V.jsx)("span",{className:"text-label font-semibold",children:e.label}),(0,V.jsx)("span",{className:"text-meta leading-tight text-[var(--text-3)]",children:e.description})]},e.key))})]}),(0,V.jsxs)("section",{className:"rounded-[13px] border border-border bg-[var(--surface)] p-[16px_18px]",children:[(0,V.jsx)("div",{className:"mb-3 text-body font-semibold",children:"Leaderboard · humans vs agents"}),(0,V.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,V.jsx)(Fe,{title:"👤 Humans",actors:a,you:o.actor}),(0,V.jsx)(Fe,{title:"🤖 Agents",actors:l,you:o.actor})]})]})]})})}function B8({children:e}){return(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)(f3,{title:"Achievements",subtitle:"XP, streaks, badges & leaderboard"}),(0,V.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:e})]})}function B7({value:e,label:t}){return(0,V.jsxs)("div",{className:"text-center",children:[(0,V.jsx)("div",{className:"text-page-title font-semibold",children:e}),(0,V.jsx)("div",{className:"text-meta uppercase tracking-[.03em] text-[var(--text-3)]",children:t})]})}function Fe({title:e,actors:t,you:n}){return(0,V.jsxs)("div",{children:[(0,V.jsx)("div",{className:"mb-2 text-label font-medium text-[var(--text-2)]",children:e}),0===t.length?(0,V.jsx)("div",{className:"text-label text-[var(--text-3)]",children:"No closes yet."}):(0,V.jsx)("ol",{className:"flex flex-col gap-[5px]",children:t.map((e,t)=>(0,V.jsxs)("li",{className:`flex items-center gap-2 rounded-[9px] px-2 py-[6px] text-label ${e.actor===n?"bg-[var(--brand-weak)]":"bg-[var(--surface-2)]"}`,children:[(0,V.jsx)("span",{className:"w-4 text-center font-mono text-meta text-[var(--text-3)]",children:t+1}),(0,V.jsx)("span",{className:"flex h-[22px] w-[22px] items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.actor)},children:lV(e.actor)}),(0,V.jsx)("span",{className:"flex-1 truncate",children:e.actor}),e.currentStreak>=2&&(0,V.jsxs)("span",{className:"text-meta",title:"current streak",children:["🔥",e.currentStreak]}),(0,V.jsx)("span",{className:"font-mono text-label font-semibold",children:e.xp}),(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:"XP"})]},e.actor))})]})}var Ft=e.i(10223);let Fn=[{id:"manager",name:"Manager Dashboard",blurb:"Stats-forward hero + highlights. Warm & fuzzy for managers."},{id:"timeline",name:"Activity Timeline",blurb:"A chronological feed of everything that got done."},{id:"portfolio",name:"Minimal Portfolio",blurb:"Clean card grid — understated and tidy."}];function Fr(){let{projectId:e,beads:t,meta:n,readOnly:r}=eu(),[i,o]=G.useState("manager"),[a,l]=G.useState("Look at my productivity 😄"),[s,c]=G.useState("project"),[u,d]=G.useState(!0),[f,p]=G.useState(!0),h=!!n?.gamification,[m,g]=G.useState(!1),[y,b]=G.useState(null),[v,x]=G.useState(null),w=(0,Q.f)({mutationFn:()=>ei.k.showcase.build(e,{template:i,title:a,scope:s,stats:u,search:f,gamification:h&&m}),onSuccess:e=>{b(e),x(null),X.c.success(`Published ${e.count} beads \xb7 opening preview`)},onError:e=>X.c.error(e.message)}),k=(0,Q.f)({mutationFn:()=>ei.k.showcase.open(e,y.indexPath),onError:e=>X.c.error(e.message)}),_=(0,Q.f)({mutationFn:()=>ei.k.showcase.deploy(e,y.outDir),onSuccess:e=>{e.deployed&&e.url?(x(e.url),X.c.success("Deployed"),window.open(e.url,"_blank","noopener,noreferrer")):X.c.error(e.error||"Deploy unavailable")},onError:e=>X.c.error(e.message)}),S=t.filter(e=>!(e.labels??[]).includes("archived")).length;return(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"Publish",subtitle:"Generate a shareable static site from your beads — built with Eleventy"}),(0,V.jsx)("div",{className:"bd-scroll min-h-0 flex-1 overflow-y-auto p-[24px_22px] max-md:p-4",children:(0,V.jsxs)("div",{className:"mx-auto flex max-w-[640px] flex-col gap-[18px]",children:[(0,V.jsx)(Ft.N,{title:"Template",children:(0,V.jsx)("div",{className:"grid grid-cols-1 gap-[10px] sm:grid-cols-3",children:Fn.map(e=>{let t=i===e.id;return(0,V.jsxs)("button",{onClick:()=>o(e.id),className:"rounded-[12px] border bg-[var(--surface)] p-[14px_16px] text-left transition-colors",style:{borderColor:t?"var(--brand)":"var(--border)",background:t?"var(--brand-weak)":"var(--surface)"},children:[(0,V.jsxs)("div",{className:"flex items-center gap-2",children:[(0,V.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-[7px]",style:{background:t?"var(--brand)":"var(--surface-2)",color:t?"#fff":"var(--text-3)"},children:(0,V.jsx)(en.W,{name:"rocket",size:13})}),(0,V.jsx)("span",{className:"text-body font-semibold",children:e.name})]}),(0,V.jsx)("div",{className:"mt-[6px] text-meta leading-[1.4] text-[var(--text-3)]",children:e.blurb})]},e.id)})})}),(0,V.jsxs)(Ft.N,{title:"Options",children:[(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:"Site title"}),(0,V.jsx)(er.C,{value:a,onChange:e=>l(e.target.value),onKeyDown:e=>{Di(e)&&(e.preventDefault(),r||w.isPending||w.mutate())},placeholder:"Look at my productivity 😄"})]}),(0,V.jsxs)("div",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:"Scope"}),(0,V.jsx)(er.L,{label:"Scope",fill:!0,options:[{value:"project",label:"This project"},{value:"all",label:"All projects"}],value:s,onChange:c}),(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:"project"===s?`${S} beads in this project (archived excluded)`:"Aggregates beads across every project you've added"})]}),(0,V.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[(0,V.jsx)(Fi,{checked:u,onChange:d,label:"Include a stats dashboard (counts, human vs agent)"}),(0,V.jsx)(Fi,{checked:f,onChange:p,label:"Include client-side search"}),h&&(0,V.jsx)(Fi,{checked:m,onChange:g,label:"Include gamification (level, XP, badges, leaderboard)"})]})]}),(0,V.jsx)("div",{className:"flex justify-end",children:(0,V.jsx)(ub.f,{icon:"rocket",onClick:()=>w.mutate(),disabled:r||w.isPending,className:"max-md:w-full",children:w.isPending?"Building…":"Publish site"})}),y&&(0,V.jsxs)(Ft.N,{title:"Published",children:[(0,V.jsxs)("div",{className:"text-body text-[var(--text-2)]",children:["Built ",(0,V.jsx)("b",{children:y.count})," beads into a static site."]}),(0,V.jsx)("div",{className:"break-all rounded-[9px] border border-border bg-[var(--surface-2)] p-[9px_11px] font-mono text-meta text-[var(--text-3)]",children:y.outDir}),(0,V.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,V.jsx)(er.K,{icon:"board",onClick:()=>k.mutate(),disabled:r||k.isPending,children:"Open preview"}),(0,V.jsx)(ub.f,{size:"sm",icon:"rocket",onClick:()=>_.mutate(),disabled:r||_.isPending,children:_.isPending?"Deploying…":"Deploy"}),v&&(0,V.jsxs)("a",{href:v,target:"_blank",rel:"noopener noreferrer",title:v,className:"tap-target flex h-9 min-w-0 items-center gap-[6px] rounded-[9px] border border-border bg-[var(--surface-2)] px-3 text-label font-medium text-[var(--brand)] hover:bg-[var(--surface-3)]",children:[(0,V.jsx)(en.W,{name:"link",size:14}),(0,V.jsx)("span",{className:"truncate",children:v.replace(/^https?:\/\//,"")})]})]}),(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:"Deploy uses the Vercel CLI (best-effort). The folder above can also be hosted anywhere."})]})]})})]})}function Fi({checked:e,onChange:t,label:n}){return(0,V.jsxs)("label",{className:"flex cursor-pointer select-none items-center gap-[9px] max-md:min-h-11",children:[(0,V.jsx)(er.h,{checked:e,onChange:e=>t(e.target.checked)}),(0,V.jsx)("span",{className:"text-body text-[var(--text-2)]",children:n})]})}var Fo=e.i(14690);let Fa="beadscope.notifications",Fl="beadscope:open-bead",Fs={enabled:!1,finished:!0,blocked:!0,escalation:!0};function Fc(){try{return{...Fs,...JSON.parse(localStorage.getItem(Fa)||"{}")}}catch{return Fs}}function Fu(e,t,n,r){if((0,X.c)(e,{description:t}),"Notification"in window&&"granted"===Notification.permission)try{let i=new Notification(e,{body:t});i.onclick=()=>{i.close(),window.focus(),function(e,t){if(function(){let e=/^\/p\/([^/]+)\/?$/.exec(window.location.pathname);if(!e)return null;try{return decodeURIComponent(e[1])}catch{return null}}()===e){let n=new CustomEvent(Fl,{cancelable:!0,detail:{projectId:e,beadId:t}});if(!window.dispatchEvent(n))return}window.location.assign(`/p/${encodeURIComponent(e)}?bead=${encodeURIComponent(t)}`)}(n,r)}}catch{}}let Fd=(0,l6.f)("lock-keyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]),Ff=["viewer-mode"],Fp="beadscope-viewer-mode";function Fh(){let e=(0,et.d)(),t=(0,ee.f)({queryKey:Ff,queryFn:ei.k.viewerMode,refetchInterval:5e3});G.useEffect(()=>{if("u"<typeof BroadcastChannel)return;let t=new BroadcastChannel(Fp);return t.onmessage=()=>{e.invalidateQueries({queryKey:Ff})},()=>t.close()},[e]);let n=(0,Q.f)({mutationFn:ei.k.setViewerMode,onSuccess:t=>{if(e.setQueryData(Ff,t),e.invalidateQueries({queryKey:["beads"]}),"u">typeof BroadcastChannel){let e=new BroadcastChannel(Fp);e.postMessage("changed"),e.close()}}});return{...t,change:n}}let Fm="beadscope.read-only-banner",Fg="beadscope:banner",Fy={size:"small",background:"#fff3cd",text:"#664d03"},Fb=JSON.stringify(Fy),Fv=Fb;function Fx(){try{return localStorage.getItem(Fm)??Fv}catch{return Fv}}function Fw(e){return window.addEventListener("storage",e),window.addEventListener(Fg,e),()=>{window.removeEventListener("storage",e),window.removeEventListener(Fg,e)}}function Fk(){let{data:e,change:t}=Fh(),[n,r]=G.useState(!1),i=G.useSyncExternalStore(Fw,Fx,()=>Fb),o=G.useMemo(()=>(function(e){try{let t=JSON.parse(e),n=(e,t)=>"string"==typeof e&&/^#[0-9a-f]{6}$/i.test(e)?e:t;return{size:"large"===t.size?"large":"small",background:n(t.background,Fy.background),text:n(t.text,Fy.text)}}catch{return Fy}})(i),[i]);function a(e){var t=JSON.stringify({...o,...e});Fv=t;try{localStorage.setItem(Fm,t)}catch{}window.dispatchEvent(new Event(Fg))}return e?.readOnly?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("button",{type:"button","aria-label":"Read Only Mode",title:"Read Only Mode — click to customize or enable editing",onClick:()=>r(!0),className:`flex w-full shrink-0 items-center justify-center gap-2 border-b border-black/10 px-3 font-semibold focus-visible:outline-2 focus-visible:outline-offset-[-3px] ${"large"===o.size?"min-h-12 text-section":"min-h-7 text-label max-md:min-h-11"}`,style:{backgroundColor:o.background,color:o.text},children:[(0,V.jsx)(Fd,{size:14,"aria-hidden":"true"}),"Read Only Mode"]}),(0,V.jsx)(ug.N,{open:n,onOpenChange:r,children:(0,V.jsxs)(ug.d,{"data-viewer-dialog":!0,children:[(0,V.jsx)(ug.F,{children:"Read Only Mode"}),(0,V.jsx)(ug.C,{children:"Editing is disabled for this browser session. Changes here apply to tabs sharing this session, not other browsers."}),(0,V.jsxs)("fieldset",{className:"flex gap-4",children:[(0,V.jsx)("legend",{className:"mb-2 font-medium",children:"Banner size"}),["small","large"].map(e=>(0,V.jsxs)("label",{className:"flex items-center gap-2 capitalize",children:[(0,V.jsx)("input",{type:"radio",name:"banner-size",value:e,checked:o.size===e,onChange:()=>a({size:e})}),"large"===e?"Large":"Small"]},e))]}),(0,V.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,V.jsxs)("label",{className:"flex flex-col gap-2",children:["Background color",(0,V.jsx)("input",{type:"color",value:o.background,onChange:e=>a({background:e.target.value}),className:"h-9 w-full cursor-pointer"})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-2",children:["Text color",(0,V.jsx)("input",{type:"color",value:o.text,onChange:e=>a({text:e.target.value}),className:"h-9 w-full cursor-pointer"})]})]}),(0,V.jsx)("div",{className:"rounded-md px-3 py-2 text-center font-semibold",style:{backgroundColor:o.background,color:o.text},children:"Read Only Mode"}),(0,V.jsx)("p",{className:"text-label text-muted-foreground",children:"Size and colors are saved automatically in this browser."}),(0,V.jsx)(er.W,{underline:!0,className:"justify-self-start text-label",onClick:()=>a(Fy),children:"Reset appearance"}),t.error&&(0,V.jsx)("p",{role:"alert",className:"text-body text-destructive",children:t.error.message}),(0,V.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,V.jsx)(er.K,{onClick:()=>r(!1),children:"Keep read-only mode"}),(0,V.jsx)(ub.f,{disabled:t.isPending,onClick:()=>t.mutate(!1,{onSuccess:()=>r(!1)}),children:"Disable read-only mode"})]})]})})]}):null}function F_(){let{data:e,change:t,error:n}=Fh();return(0,V.jsxs)(Ft.N,{title:"Read-only mode",children:[(0,V.jsx)(Ft.s,{title:"Prevent edits while you watch progress",description:"This setting applies to your current browser session.",control:(0,V.jsx)(Ft.K,{on:!!e?.readOnly,disabled:!e||t.isPending,onClick:()=>t.mutate(!e?.readOnly),children:e?.readOnly?"Disable read-only mode":"Enable read-only mode"})}),(t.error||n)&&(0,V.jsx)("p",{role:"alert",className:"m-0 text-label text-destructive",children:(t.error||n)?.message})]})}function FS({keys:e,sequence:t}){return(0,V.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.map((e,n)=>(0,V.jsxs)("span",{className:"contents",children:[n>0&&(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:t?"then":"+"}),(0,V.jsx)("kbd",{className:"min-w-7 rounded-md border border-border bg-[var(--surface-2)] px-2 py-1 text-center font-mono text-meta font-semibold text-[var(--text-2)] shadow-[var(--shadow)]",children:e})]},`${e}-${n}`))})}function FE({open:e,onOpenChangeAction:t}){return(0,V.jsx)(ug.N,{open:e,onOpenChange:t,children:(0,V.jsxs)(ug.d,{className:"max-h-[calc(100dvh-2rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden border border-border bg-[var(--surface)] p-0 shadow-[var(--shadow-lg)] sm:max-w-[760px]",children:[(0,V.jsxs)("div",{className:"border-b border-border px-6 py-5",children:[(0,V.jsx)(ug.F,{className:"text-section font-semibold",children:"Keyboard shortcuts"}),(0,V.jsx)(ug.C,{className:"mt-1 text-label text-[var(--text-3)]",children:"Vim-style navigation is disabled while typing. View and repository shortcuts are two-key sequences."})]}),(0,V.jsx)("div",{className:"bd-scroll grid min-h-0 grid-cols-1 gap-6 overflow-y-auto px-6 py-5 md:grid-cols-2",children:Da.map(e=>(0,V.jsxs)("section",{children:[(0,V.jsx)("h2",{className:"mb-2 text-meta font-semibold uppercase tracking-[.08em] text-[var(--text-3)]",children:e.topic}),(0,V.jsx)("div",{className:"flex flex-col gap-1",children:e.shortcuts.map(t=>(0,V.jsxs)("div",{className:"flex min-h-9 items-center justify-between gap-4 rounded-lg px-2 py-1.5 hover:bg-[var(--surface-2)]",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:t.label}),(0,V.jsx)(FS,{keys:t.keys,sequence:t.sequence})]},`${e.topic}-${t.keys.join("-")}-${t.label}`))})]},e.topic))})]})})}var Fj=e.i(40676);function FO({agents:e}){let{projectId:t}=eu(),n=(0,et.d)(),[r,i]=G.useState({}),[o,a]=G.useState(null),[l,s]=G.useState(""),[c,u]=G.useState(e),d=(0,Q.f)({mutationFn:e=>ei.k.saveConfig({agents:e}),onSuccess:e=>{n.setQueryData(["doctor",t],t=>t?{...t,config:e}:t),n.invalidateQueries({queryKey:["beads"]})},onError:t=>{i({}),u(e),X.c.error(t.message)}}),f=e=>{u(e),d.mutate(e)},p=(e,t)=>f(c.map(n=>n.id===e?{...n,...t}:n)),h=e=>{let t=r[e.id];void 0!==t&&t.trim()!==e.name&&p(e.id,{name:t.trim()})},m=()=>{let e=l.trim();e&&(f([...c,{id:`custom-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,name:e,enabled:!0,color:pm}]),s(""))};return(0,V.jsxs)("div",{className:"flex flex-col gap-[10px]",children:[(0,V.jsxs)("div",{className:"text-meta text-[var(--text-3)]",children:["Checked agents are offered when assigning a bead. The name is what ",(0,V.jsx)("span",{className:"font-mono",children:"bd"})," ","records, so it should match the ",(0,V.jsx)("span",{className:"font-mono",children:"BEADS_ACTOR"})," that agent runs with. Renaming does not change beads already assigned to the old name."]}),(0,V.jsx)("ul",{className:"m-0 flex list-none flex-col gap-[8px] p-0",children:c.map(e=>{let t=pg(e.id),n=r[e.id]??e.name;return(0,V.jsxs)("li",{"data-agent-row":e.id,className:"flex flex-col gap-[8px]",children:[(0,V.jsxs)("div",{className:"flex items-center gap-[10px] max-md:flex-wrap",children:[(0,V.jsx)("label",{className:"flex shrink-0 cursor-pointer items-center justify-center max-md:h-11 max-md:w-11",children:(0,V.jsx)(er.h,{checked:e.enabled,onChange:t=>p(e.id,{enabled:t.target.checked}),"aria-label":`Offer ${e.name} as an assignee`})}),(0,V.jsx)(pv,{agent:e,size:24}),(0,V.jsx)(er.C,{size:"sm",mono:!0,value:n,maxLength:64,onChange:t=>i(n=>({...n,[e.id]:t.target.value})),onBlur:()=>h(e),onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),h(e)):"Escape"===t.key&&i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.id)))},"aria-label":`Name of ${t?.label??e.name}`,className:"flex-1"}),t?(0,V.jsx)("span",{className:"hidden w-[96px] shrink-0 truncate text-meta text-[var(--text-3)] sm:block",children:t.label}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(er.K,{variant:"outline",size:"sm","aria-expanded":o===e.id,"aria-label":`Choose icon for ${e.name}`,onClick:()=>a(t=>t===e.id?null:e.id),children:"Icon"}),(0,V.jsx)(er.K,{variant:"outline",size:"sm","aria-label":`Remove ${e.name}`,disabled:d.isPending,onClick:()=>f(c.filter(t=>t.id!==e.id)),className:"text-[var(--text-3)] hover:text-[#ef4444]",children:"Remove"})]})]}),!t&&o===e.id&&(0,V.jsxs)("div",{className:"ml-[34px] max-md:ml-0 flex flex-col gap-[8px] rounded-[10px] border border-border bg-[var(--surface-2)] p-[10px]",children:[(0,V.jsx)("div",{role:"group","aria-label":"Emoji",className:"flex flex-wrap gap-[4px]",children:pp.map(t=>(0,V.jsx)(er._,{label:`Emoji ${t}`,variant:"ghost","aria-pressed":e.emoji===t,onClick:()=>p(e.id,{emoji:t}),className:"border text-page-title",style:{borderColor:e.emoji===t?"var(--brand)":"transparent"},children:t},t))}),(0,V.jsxs)("div",{role:"group","aria-label":"Colour",className:"flex flex-wrap items-center gap-[6px]",children:[ph.map(t=>{let n=!e.emoji&&e.color===t;return(0,V.jsx)("button",{type:"button","aria-label":`Colour ${t}`,"aria-pressed":n,onClick:()=>p(e.id,{color:t,emoji:void 0}),className:"tap-target h-[22px] w-[22px] rounded-full border-2 max-md:h-11 max-md:w-11",style:{background:t,borderColor:n?"var(--text)":"transparent"}},t)}),(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:"Colour shows the initials"})]})]})]},e.id)})}),(0,V.jsxs)("div",{className:"flex items-center gap-[8px] max-md:flex-wrap",children:[(0,V.jsx)(er.C,{size:"sm",mono:!0,dashed:!0,value:l,maxLength:64,onChange:e=>s(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),m())},"aria-label":"Name of a new agent",placeholder:"+ add an agent, e.g. my-agent",className:"flex-1"}),(0,V.jsx)(er.K,{variant:"outline",size:"sm",onClick:m,disabled:!l.trim()||d.isPending,children:"Add agent"})]})]})}function FN(){let{projectId:e}=eu(),{data:t}=(0,ee.f)({queryKey:["doctor",e],queryFn:()=>ei.k.doctor(e)}),n=t?.config?`${t.repoPath}|${t.config.humanActor}|${t.config.humanAllowlist.join(",")}`:"loading";return(0,V.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,V.jsx)(f3,{title:"Settings",subtitle:"Local config · stored under the OS config dir, not in beads"}),(0,V.jsxs)("div",{className:"bd-scroll min-h-0 flex-1 overflow-y-auto p-[24px_22px] max-md:p-4",children:[(0,V.jsxs)("div",{className:"mx-auto mb-[18px] flex max-w-[620px] flex-col gap-[18px]",children:[(0,V.jsx)(F_,{}),(0,V.jsx)(FC,{}),(0,V.jsx)(Ft.N,{title:"Usage statistics",children:(0,V.jsx)(Fj.u,{})})]}),t?(0,V.jsx)(FA,{data:t},n):(0,V.jsx)("div",{className:"text-body text-[var(--text-3)]",children:"Loading…"})]})]})}function FC(){let{enabled:e,save:t}=eT();return(0,V.jsx)(Ft.N,{title:"Default view",children:(0,V.jsx)(Ft.s,{titleId:"default-focus-label",descriptionId:"default-focus-description",title:"Use Focus as the default view",description:"Off opens projects in Board. Turn on to open in Focus instead, showing current work, blockers, and high-priority next steps. Links to a specific view open that view, including on reload. Switching views does not change this setting. Saved automatically for all projects in this browser.",control:(0,V.jsx)(Ft.K,{on:e,onText:"On",offText:"Off",role:"switch","aria-checked":e,"aria-labelledby":"default-focus-label","aria-describedby":"default-focus-description",onClick:()=>{try{t(!e)}catch{X.c.error("Could not save the default view. Browser storage may be unavailable.")}}})})})}function FA({data:e}){let{theme:t,choice:n,setTheme:r}=(0,eD.i)(),i=(0,et.d)(),[o,a]=G.useState(e.config.humanActor),[l,s]=G.useState(e.config.humanAllowlist),[c,u]=G.useState(""),[d,f]=G.useState(String(Math.round(e.config.pollIntervalMs/1e3))),p=t=>{let n=Math.round(Number(t));return Number.isFinite(n)&&n>0?Math.min(300,Math.max(1,n)):Math.round(e.config.pollIntervalMs/1e3)},h=(0,Q.f)({mutationFn:()=>ei.k.saveConfig({humanActor:o,humanAllowlist:l,pollIntervalMs:1e3*p(d)}),onSuccess:()=>{X.c.success("Settings saved"),i.invalidateQueries({queryKey:["doctor"]}),i.invalidateQueries({queryKey:["beads"]})},onError:e=>X.c.error(e.message)}),m=e=>{Di(e)&&(e.preventDefault(),h.isPending||h.mutate())},g="demo"===e.kind;return(0,V.jsxs)("div",{className:"mx-auto flex max-w-[620px] flex-col gap-[18px]",children:[(0,V.jsxs)(Ft.N,{title:"Project",children:[(0,V.jsxs)("div",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:e.project?.name??"—"}),(0,V.jsx)("span",{className:"break-all font-mono text-label text-[var(--text-3)]",children:g?"built-in sample data (no path)":e.repoPath})]}),(0,V.jsxs)("div",{className:"flex items-center gap-2 text-label text-[var(--text-2)]",children:[(0,V.jsx)(en.W,{name:e.ok?"check":"x",size:14,style:{color:pe(e.ok?"#22c55e":"#ef4444")}}),(0,V.jsx)("span",{children:g?"Demo mode — in-memory sample data. Add a real project to manage live beads.":`${e.message}${e.version?` \xb7 ${e.version}`:""}`})]}),(0,V.jsx)("div",{className:"text-meta text-[var(--text-3)]",children:"Use the project menu on desktop or open the mobile Menu to switch projects."})]}),(0,V.jsxs)(Ft.N,{title:"Attribution",children:[(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsxs)("span",{className:"text-label text-[var(--text-2)]",children:["Human actor (stamps ",(0,V.jsx)("span",{className:"font-mono",children:"BEADS_ACTOR"}),")"]}),(0,V.jsx)(er.C,{value:o,onChange:e=>a(e.target.value),onKeyDown:m})]}),(0,V.jsxs)("div",{className:"flex flex-col gap-[7px]",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:"Human allowlist · others render as agent"}),(0,V.jsxs)("div",{className:"flex flex-wrap gap-[7px]",children:[l.map(e=>(0,V.jsxs)("span",{className:"inline-flex items-center gap-[6px] rounded-lg border border-border bg-[var(--surface-2)] px-[9px] py-1 text-label",children:[e,(0,V.jsx)(er.W,{onClick:()=>s(t=>t.filter(t=>t!==e)),"aria-label":`Remove ${e}`,className:"hover:text-[#ef4444]",children:"×"})]},e)),(0,V.jsx)(er.C,{size:"sm",dashed:!0,value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&c.trim()&&(s(e=>Array.from(new Set([...e,c.trim()]))),u(""))},placeholder:"+ add name, Enter",className:"w-[120px]"})]})]}),(0,V.jsx)("div",{className:"text-meta text-[var(--text-3)]",children:"Attribution is global — it applies to every project."})]}),(0,V.jsx)(Ft.N,{title:"Agents",children:(0,V.jsx)(FO,{agents:e.config.agents})}),(0,V.jsxs)(Ft.N,{title:"Freshness & theme",children:[(0,V.jsx)(Ft.s,{title:"Fallback refresh interval",description:"Live changes stream in instantly; this only backstops a dropped stream",control:(0,V.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-[6px]",children:[(0,V.jsx)(er.C,{type:"number",min:1,max:300,value:d,onChange:e=>f(e.target.value),onBlur:()=>f(String(p(d))),onKeyDown:m,"aria-label":"Fallback refresh interval in seconds",mono:!0,className:"w-[72px] text-right"}),(0,V.jsx)("span",{className:"font-mono text-body text-[var(--text-3)]",children:"s"})]})}),(0,V.jsxs)("div",{className:"flex flex-col gap-[10px]",children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("div",{className:"text-body",children:"Theme"}),(0,V.jsxs)("div",{className:"text-meta text-[var(--text-3)]",children:["Saved per project — each project remembers its own theme on this device. Currently ",(0,V.jsx)("span",{className:"font-medium text-[var(--text-2)]",children:n===Fo.y.id?`System (${t.name})`:t.name}),"."]})]}),(0,V.jsx)("div",{className:"grid grid-cols-2 gap-[8px] sm:grid-cols-3",children:[Fo.y,...Fo.z].map(e=>{let t=e.id===n;return(0,V.jsxs)("button",{onClick:()=>r(e.id),className:"flex items-center gap-[9px] rounded-[10px] border p-[9px] text-left transition-colors hover:bg-[var(--surface-3)]",style:{background:"var(--surface-2)",borderColor:t?"var(--brand)":"var(--border)",boxShadow:t?"0 0 0 1px var(--brand)":"none"},children:[(0,V.jsx)("span",{className:"flex h-[24px] w-[24px] flex-shrink-0 overflow-hidden rounded-[7px] border border-border",children:e.swatch.map((e,t)=>(0,V.jsx)("span",{style:{background:e,width:"33.34%"}},t))}),(0,V.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,V.jsx)("span",{className:"block truncate text-label font-medium text-[var(--text)]",children:e.name}),(0,V.jsx)("span",{className:"block text-meta capitalize text-[var(--text-3)]",children:e.id===Fo.y.id?"follows OS":e.mode})]})]},e.id)})})]})]}),(0,V.jsx)(FP,{}),(0,V.jsx)(FT,{}),(0,V.jsx)(FD,{}),(0,V.jsx)(FI,{}),(0,V.jsx)(FM,{}),(0,V.jsx)("div",{className:"flex justify-end",children:(0,V.jsx)(ub.f,{icon:"check",onClick:()=>h.mutate(),disabled:h.isPending,className:"max-md:w-full",children:"Save settings"})})]})}function FM(){let[e,t]=G.useState(!1);return(0,V.jsxs)(Ft.N,{title:"Keyboard shortcuts",children:[(0,V.jsx)("div",{className:"grid grid-cols-1 gap-x-6 gap-y-4 md:grid-cols-2",children:Da.map(e=>(0,V.jsxs)("section",{children:[(0,V.jsx)("h3",{className:"mb-1.5 text-meta font-semibold uppercase tracking-[.08em] text-[var(--text-3)]",children:e.topic}),(0,V.jsx)("div",{className:"flex flex-col gap-1",children:e.shortcuts.map(t=>(0,V.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-4",children:[(0,V.jsx)("span",{className:"text-label text-[var(--text-2)]",children:t.label}),(0,V.jsx)(FS,{keys:t.keys,sequence:t.sequence})]},`${e.topic}-${t.keys.join("-")}-${t.label}`))})]},e.topic))}),(0,V.jsx)(Ft.s,{title:"Shortcuts are disabled while typing in a field",description:(0,V.jsxs)(V.Fragment,{children:["Press"," ",(0,V.jsx)("kbd",{className:"rounded border border-border bg-[var(--surface-2)] px-1.5 py-0.5 font-mono",children:"?"})," ","anywhere outside a field for the same reference."]}),control:(0,V.jsx)(er.K,{variant:"outline",size:"sm",onClick:()=>t(!0),children:"Open reference"})}),(0,V.jsx)(FE,{open:e,onOpenChangeAction:t})]})}function FP(){let{prefs:e,setPrefs:t}=uP();return(0,V.jsx)(Ft.N,{title:"Board",children:(0,V.jsx)(Ft.s,{title:"Blocked column",description:"Hide the Blocked column when nothing is blocked, or keep it pinned.",control:(0,V.jsx)(er.L,{label:"Blocked column",options:[{value:"auto",label:"Only when it has beads"},{value:"always",label:"Always show"}],value:e.blockedColumn,onChange:n=>t({...e,blockedColumn:n})})})})}function FT(){let{prefs:e,setPrefs:t}=uP(),n=e.checkUpdates;return(0,V.jsxs)(Ft.N,{title:"Software updates",children:[(0,V.jsx)(Ft.s,{title:"Check for new versions",description:"Check GitHub every five minutes and show new versions in the sidebar. This choice applies to this browser.",control:(0,V.jsx)(Ft.K,{on:n,role:"switch","aria-label":"Check for new versions","aria-checked":n,onClick:()=>t({...e,checkUpdates:!n})})}),(0,V.jsxs)("label",{className:"flex items-center justify-between gap-4 text-body max-md:flex-col max-md:items-start max-md:gap-2",children:["Update channel",(0,V.jsxs)(er.$,{"aria-label":"Update channel",value:e.updateChannel,onChange:n=>t({...e,updateChannel:"development"===n.target.value?"development":"stable"}),className:"max-md:w-full",children:[(0,V.jsx)("option",{value:"stable",children:"Stable releases (recommended)"}),(0,V.jsx)("option",{value:"development",children:"Development (main)"})]})]}),(0,V.jsx)("p",{className:"m-0 text-meta text-[var(--text-3)]",children:"Stable follows published versions and includes release notes. Development follows the latest commits on main and requires a Git checkout. Updates only install when you choose Update now."})]})}function FI(){let{meta:e}=eu(),t=(0,et.d)(),n=!!e?.gamification,r=(0,Q.f)({mutationFn:e=>ei.k.saveConfig({gamification:e}),onSuccess:()=>{X.c.success("Settings saved"),t.invalidateQueries({queryKey:["beads"]}),t.invalidateQueries({queryKey:["doctor"]})},onError:e=>X.c.error(e.message)});return(0,V.jsx)(Ft.N,{title:"Gamification",children:(0,V.jsx)(Ft.s,{title:"Productivity XP & levels",description:"Earn XP for closing beads (weighted by priority and how many they unblock); a level/progress bar appears in the sidebar. Derived from bd history — opt-in.",control:(0,V.jsx)(Ft.K,{on:n,onClick:()=>r.mutate(!n),disabled:r.isPending})})})}function FD(){let{prefs:e,setPrefs:t,permission:n,requestPermission:r}=function(){let[e,t]=G.useState(()=>Fc()),[n,r]=G.useState(()=>"Notification"in window?Notification.permission:"unsupported");return{prefs:e,setPrefs:G.useCallback(e=>{t(e),localStorage.setItem(Fa,JSON.stringify(e))},[]),permission:n,requestPermission:G.useCallback(async()=>{if(!("Notification"in window))return"unsupported";let e=await Notification.requestPermission();return r(e),e},[])}}(),i="unsupported"===n,o=async()=>{e.enabled||"default"!==n||await r(),t({...e,enabled:!e.enabled})},a=(n,r)=>(0,V.jsxs)("label",{className:"flex cursor-pointer select-none items-center gap-[9px] max-md:min-h-11",children:[(0,V.jsx)(er.h,{checked:e[n],disabled:!e.enabled,onChange:r=>t({...e,[n]:r.target.checked})}),(0,V.jsx)("span",{className:`text-body ${e.enabled?"text-[var(--text-2)]":"text-[var(--text-3)]"}`,children:r})]});return(0,V.jsxs)(Ft.N,{title:"Notifications",children:[(0,V.jsx)(Ft.s,{title:"Desktop & toast notifications",description:i?"This browser does not support desktop notifications.":"Get notified when an agent finishes or blocks a bead, or escalates one to you.",control:(0,V.jsx)(Ft.K,{on:e.enabled,onClick:o,disabled:i})}),e.enabled&&"denied"===n&&(0,V.jsx)("div",{className:"text-meta text-[#ef4444]",children:"Desktop permission is blocked in your browser — you will still see in-app toasts. Re-enable notifications for this site in your browser settings for desktop alerts."}),(0,V.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[a("finished","An agent finishes a bead"),a("blocked","A bead becomes blocked"),a("escalation","A bead is escalated to you (Needs You)")]}),(0,V.jsx)("div",{className:"text-meta text-[var(--text-3)]",children:"Per-device — stored in this browser, not in beads. Your own (human) actions never notify."})]})}function Fz(){let{beads:e,meta:t}=eu();return G.useMemo(()=>{let n=e=>e.map(e=>e?.trim()).filter(e=>!!e),r=Array.from(new Set(n([t?.humanActor,...(t?.agents??[]).filter(e=>e.enabled).map(e=>e.name)]))),i=Array.from(new Set(n([...e.map(e=>e.assignee)]))).filter(e=>!r.includes(e)).sort((e,t)=>e.localeCompare(t));return[...r,...i]},[e,t?.humanActor,t?.agents])}function FR({name:e,size:t=18}){let{meta:n}=eu(),r=py(n?.agents,e);return r?(0,V.jsx)(pv,{agent:r,size:t}):(0,V.jsx)("span",{"aria-hidden":"true",className:"flex shrink-0 items-center justify-center rounded-full font-semibold text-white",style:{width:t,height:t,fontSize:Math.round(.5*t),background:lZ(e)},children:lV(e)})}function FL({name:e,label:t}){return(0,V.jsxs)(V.Fragment,{children:[e?(0,V.jsx)(FR,{name:e,size:18}):(0,V.jsx)("span",{className:"h-[18px] w-[18px] shrink-0"}),(0,V.jsx)("span",{className:"min-w-0 flex-1 truncate",children:t??e})]})}let F$="bd-scroll absolute left-0 right-0 z-30 mt-1 max-h-[220px] overflow-y-auto rounded-[9px] border border-[var(--border-strong)] bg-[var(--surface)] p-1 shadow-[var(--shadow-lg)]",FB=(e,t)=>`flex cursor-pointer items-center gap-[8px] rounded-[7px] px-[8px] py-[6px] text-body ${e?"bg-[var(--surface-3)]":""} ${t?"font-semibold":""}`;function FF({value:e,onChange:t,names:n,label:r="Assignee"}){let[i,o]=G.useState(!1),[a,l]=G.useState(0),s=G.useRef(null),c=G.useId(),u=["",...n];G.useEffect(()=>{if(!i)return;let e=e=>{s.current?.contains(e.target)||o(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[i]);let d=e=>{t(e),o(!1)},f=()=>{l(Math.max(0,u.indexOf(e))),o(e=>!e)};return(0,V.jsxs)("div",{ref:s,className:"relative",children:[(0,V.jsxs)("button",{type:"button",role:"combobox","aria-label":r,"aria-haspopup":"listbox","aria-expanded":i,"aria-controls":c,onClick:f,onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(e.preventDefault(),!i)return f();l(t=>(t+("ArrowDown"===e.key?1:-1)+u.length)%u.length)}else i&&"Enter"===e.key?(e.preventDefault(),d(u[a])):i&&"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),o(!1))},className:"flex h-[38px] w-full cursor-pointer items-center gap-[8px] rounded-[9px] border border-border bg-[var(--surface-2)] px-[10px] text-left text-body text-[var(--text)] outline-none focus:border-[var(--brand)]",children:[(0,V.jsx)(FL,{name:e,label:e||"Unassigned"}),(0,V.jsx)(en.W,{name:"chevron",size:12,className:"shrink-0 text-[var(--text-3)]"})]}),i&&(0,V.jsx)("ul",{id:c,role:"listbox","aria-label":r,className:F$,children:u.map((t,n)=>(0,V.jsx)("li",{role:"option","aria-selected":t===e,onPointerEnter:()=>l(n),onClick:()=>d(t),className:FB(n===a,t===e),children:(0,V.jsx)(FL,{name:t,label:t||"Unassigned"})},t||"__unassigned"))})]})}function FU({id:e,names:t,typed:n,active:r,onPick:i}){return 0===t.length?null:(0,V.jsx)("ul",{id:e,role:"listbox","aria-label":"Suggested assignees",className:`${F$} !static !mt-0`,children:t.map((t,o)=>(0,V.jsx)("li",{id:`${e}-${o}`,role:"option","aria-selected":t===n.trim(),onMouseDown:e=>{e.preventDefault(),i(t)},className:FB(o===r,t===n.trim()),children:(0,V.jsx)(FL,{name:t})},t))})}function FH({bead:e}){var t;let n,{readOnly:r}=eu(),i=ey(),[o,a]=G.useState(!1),[l,s]=G.useState(""),[c,u]=G.useState(!1),[d,f]=G.useState(-1),p=G.useRef(!1),h=G.useId(),m=(t=Fz(),!(n=l.trim().toLowerCase())||t.some(e=>e.toLowerCase()===n)?t:t.filter(e=>e.toLowerCase().includes(n))),g=(t=l)=>{if(r||p.current)return;let n=t.trim();n===(e.assignee??"")?a(!1):(p.current=!0,i.mutate({id:e.id,patch:{assignee:n}},{onSuccess:()=>a(!1),onSettled:()=>{p.current=!1}}))},y=c&&m.length>0;return(0,V.jsxs)("div",{className:"flex min-w-0 flex-col gap-[5px]",children:[(0,V.jsx)("span",{className:"text-meta font-medium uppercase tracking-[.03em] text-[var(--text-3)]",children:"Assignee"}),o?(0,V.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,V.jsx)(er.C,{autoFocus:!0,role:"combobox","aria-label":"Assignee","aria-expanded":y,"aria-controls":h,"aria-autocomplete":"list","aria-activedescendant":y&&d>=0?`${h}-${d}`:void 0,placeholder:"Unassigned",value:l,disabled:r||i.isPending,onFocus:()=>u(!0),onBlur:()=>u(!1),onChange:e=>{s(e.target.value),f(-1)},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault(),u(!0);let t=m.length;t&&f(n=>"ArrowDown"===e.key?(n+1)%t:n<=0?t-1:n-1)}else"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),y&&d>=0?g(m[d]):g()):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),y?u(!1):a(!1))}}),y&&(0,V.jsx)(FU,{id:h,names:m,typed:l,active:d,onPick:e=>{s(e),f(-1)}}),(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:"Choose or type a name. Leave blank to unassign."}),(0,V.jsxs)("div",{className:"flex gap-2",children:[(0,V.jsx)(ub.f,{size:"sm","aria-label":"Save assignee",disabled:r||i.isPending,onClick:()=>g(),children:"Save"}),(0,V.jsx)(er.K,{variant:"outline",size:"sm","aria-label":"Cancel assignee edit",disabled:r||i.isPending,onClick:()=>a(!1),children:"Cancel"})]})]}):(0,V.jsxs)("button",{type:"button","aria-label":"Change assignee",title:"Change assignee",disabled:r||i.isPending,onClick:()=>{s(e.assignee??""),f(-1),a(!0)},className:"flex h-[38px] min-w-0 items-center gap-[7px] rounded-[9px] border border-border bg-[var(--surface-2)] px-[10px] text-left hover:border-[var(--brand)]",children:[(0,V.jsx)(FR,{name:e.assignee??""}),(0,V.jsx)("span",{className:"min-w-0 flex-1 truncate text-body",children:e.assignee||"Unassigned"}),(0,V.jsx)(en.W,{name:"pencil",size:12,className:"shrink-0 text-[var(--text-3)]"})]})]})}var FK=/[\\\/_+.#"@\[\(\{&]/,FW=/[\\\/_+.#"@\[\(\{&]/g,Fq=/[\s-]/,FZ=/[\s-]/g;function FV(e){return e.toLowerCase().replace(FZ," ")}function FG(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}function FX(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function FY(...e){return t=>{let n=!1,r=e.map(e=>{let r=FX(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():FX(e[t],null)}}}}function FJ(...e){return G.useCallback(FY(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var FQ=globalThis?.document?G.useLayoutEffect:()=>{},F0=G[" useId ".trim().toString()]||(()=>void 0),F1=0;function F2(e){let[t,n]=G.useState(F0());return FQ(()=>{e||n(e=>e??String(F1++))},[e]),e||(t?`radix-${t}`:"")}G[" useEffectEvent ".trim().toString()],G[" useInsertionEffect ".trim().toString()];var F3=G[" useInsertionEffect ".trim().toString()]||FQ;function F4(e){let t=G.forwardRef((t,n)=>{var r;let i,o,{children:a,...l}=t,s=null,c=!1,u=[];F8(a)&&"function"==typeof Ut&&(a=Ut(a._payload)),G.Children.forEach(a,e=>{var t;if(t=e,G.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===F9){c=!0;let t="child"in e.props?e.props.child:e.props.children;F8(t)&&"function"==typeof Ut&&(t=Ut(t._payload)),s=F5(e,t),u.push(s?.props?.children)}else u.push(e)}),s?s=G.cloneElement(s,void 0,u):!c&&1===G.Children.count(a)&&G.isValidElement(a)&&(s=a);let d=s?(r=s,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,f=FJ(n,d);if(!s){if(a||0===a)throw Error(c?Ue(e):F7(e));return a}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(l,s.props??{});return s.type!==G.Fragment&&(p.ref=n?f:d),G.cloneElement(s,p)});return t.displayName=`${e}.Slot`,t}Symbol("RADIX:SYNC_STATE");var F9=Symbol.for("radix.slottable"),F5=(e,t)=>{if("child"in e.props){let t=e.props.child;return G.isValidElement(t)?G.cloneElement(t,void 0,e.props.children(t.props.children)):null}return G.isValidElement(t)?t:null},F6=Symbol.for("react.lazy");function F8(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===F6&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var F7=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ue=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ut=G[" use ".trim().toString()],Un=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=F4(`Primitive.${t}`),r=G.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,V.jsx)(i?n:t,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ur(e){let t=G.useRef(e);return G.useEffect(()=>{t.current=e}),G.useMemo(()=>(...e)=>t.current?.(...e),[])}var Ui="dismissableLayer.update",Uo=G.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ua=G.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:l,onDismiss:s,...c}=e,u=G.useContext(Uo),[d,f]=G.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=G.useState({}),m=FJ(t,f),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?g.indexOf(y):-1,v=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,w=v>=b,k=G.useRef(!1),_=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:a=Ul}=t,l=Ur(e),s=G.useRef(!1),c=G.useRef(!1),u=G.useRef(new Map),d=G.useRef(()=>{});return G.useEffect(()=>{function e(){c.current=!1,i.current=!1,u.current.clear()}function t(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function f(e){c.current&&u.current.set(e.type,!1)}let p=t=>{if(t.target&&!s.current){let o=function(){n.removeEventListener("click",d.current);let t=Array.from(u.current.values()).some(Boolean);e(),t||Uc("dismissableLayer.pointerDownOutside",l,f,{discrete:!0})};if(!a(t.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let f={originalEvent:t};c.current=!0,i.current=r&&0===t.button,u.current.clear(),r&&0===t.button?(n.removeEventListener("click",d.current),d.current=o,n.addEventListener("click",d.current,{once:!0})):o()}else n.removeEventListener("click",d.current),e();s.current=!1},h=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of h)n.addEventListener(e,t,!0),n.addEventListener(e,f);let m=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{for(let e of(window.clearTimeout(m),n.removeEventListener("pointerdown",p),n.removeEventListener("click",d.current),h))n.removeEventListener(e,t,!0),n.removeEventListener(e,f)}},[n,l,r,i,o,a]),{onPointerDownCapture:()=>s.current=!0}}(e=>{o?.(e),l?.(e),e.defaultPrevented||s?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:G.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return w&&!t},[u.branches,w])}),S=function(e,t=globalThis?.document){let n=Ur(e),r=G.useRef(!1);return G.useEffect(()=>{let e=e=>{e.target&&!r.current&&Uc("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&k.current)return;let t=e.target;![...u.branches].some(e=>e.contains(t))&&(a?.(e),l?.(e),e.defaultPrevented||s?.())},p),E=!!d&&v===g.length-1,j=Ur(e=>{"Escape"===e.key&&(i?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return G.useEffect(()=>{if(E)return p.addEventListener("keydown",j,{capture:!0}),()=>p.removeEventListener("keydown",j,{capture:!0})},[p,E,j]),G.useEffect(()=>{if(d)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(q=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Us(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),0===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=q))}},[d,p,n,u]),G.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Us())},[d,u]),G.useEffect(()=>{let e=()=>h({});return document.addEventListener(Ui,e),()=>document.removeEventListener(Ui,e)},[]),(0,V.jsx)(Un.div,{...c,ref:m,style:{pointerEvents:x?w?"auto":"none":void 0,...e.style},onFocusCapture:FG(e.onFocusCapture,S.onFocusCapture),onBlurCapture:FG(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:FG(e.onPointerDownCapture,_.onPointerDownCapture)})});Ua.displayName="DismissableLayer",G.forwardRef((e,t)=>{let n=G.useContext(Uo),r=G.useRef(null),i=FJ(t,r);return G.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,V.jsx)(Un.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var Ul=()=>!0;function Us(){let e=new CustomEvent(Ui);document.dispatchEvent(e)}function Uc(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&cQ.flushSync(()=>i.dispatchEvent(o));else i.dispatchEvent(o)}var Uu="focusScope.autoFocusOnMount",Ud="focusScope.autoFocusOnUnmount",Uf={bubbles:!1,cancelable:!0},Up=G.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,s]=G.useState(null),c=Ur(i),u=Ur(o),d=G.useRef(null),f=FJ(t,s),p=G.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;G.useEffect(()=>{if(r){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:Ug(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||Ug(d.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ug(l)});return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,l,p.paused]),G.useEffect(()=>{if(l){Uy.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Uu,Uf);l.addEventListener(Uu,c),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ug(r,{select:t}),document.activeElement!==n)return}(Uh(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&Ug(l))}return()=>{l.removeEventListener(Uu,c),setTimeout(()=>{let t=new CustomEvent(Ud,Uf);l.addEventListener(Ud,u),l.dispatchEvent(t),t.defaultPrevented||Ug(e??document.body,{select:!0}),l.removeEventListener(Ud,u),Uy.remove(p)},0)}}},[l,c,u,p]);let h=G.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){var o;let t,r=e.currentTarget,[a,l]=[Um(t=Uh(o=r),o),Um(t.reverse(),o)];a&&l?e.shiftKey||i!==l?e.shiftKey&&i===a&&(e.preventDefault(),n&&Ug(l,{select:!0})):(e.preventDefault(),n&&Ug(a,{select:!0})):i===r&&e.preventDefault()}},[n,r,p.paused]);return(0,V.jsx)(Un.div,{tabIndex:-1,...a,ref:f,onKeyDown:h})});function Uh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Um(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t})))return r}function Ug(e,{select:t=!1}={}){if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}Up.displayName="FocusScope";var Uy=(p=[],{add(e){let t=p[0];e!==t&&t?.pause(),(p=Ub(p,e)).unshift(e)},remove(e){p=Ub(p,e),p[0]?.resume()}});function Ub(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var Uv=G.forwardRef((e,t)=>{let{container:n,...r}=e,[i,o]=G.useState(!1);FQ(()=>o(!0),[]);let a=n||i&&globalThis?.document?.body;return a?cQ.createPortal((0,V.jsx)(Un.div,{...r,ref:t}),a):null});Uv.displayName="Portal";var Ux=e=>{var t;let n,r,{present:i,children:o}=e,a=function(e){var t,n;let[r,i]=G.useState(),o=G.useRef(null),a=G.useRef(e),l=G.useRef("none"),s=G.useRef(void 0),[c,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},G.useReducer((e,t)=>n[e][t]??e,t));return G.useEffect(()=>{"mounted"===c?(l.current=s.current??Uk(o.current),s.current=void 0):l.current="none"},[c]),FQ(()=>{let t=o.current,n=a.current;if(n!==e){let r=l.current,i=Uk(t);e?(s.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),a.current=e}},[e,u]),FQ(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=Uk(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!a.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(l.current=Uk(o.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:G.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,s.current=Uk(t)}else o.current=null;i(e)},[])}}(i),l="function"==typeof o?o({present:a.isPresent}):G.Children.only(o),s=function(...e){let t=G.useRef(e);return t.current=e,G.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Uw(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():Uw(n[e],null)}}},[])}(a.ref,(t=l,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||a.isPresent?G.cloneElement(l,{ref:s}):null};function Uw(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Uk(e){return e?.animationName||"none"}Ux.displayName="Presence";var U_=0,US=null;function UE(){let 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 Uj=function(){return(Uj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function UO(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var UN=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),UC="width-before-scroll-bar";function UA(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var UM="u">typeof window?G.useLayoutEffect:G.useEffect,UP=new WeakMap,UT=(void 0===S&&(S={}),(void 0===E&&(E=function(e){return e}),j=[],O=!1,N={read:function(){if(O)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return j.length?j[j.length-1]:null},useMedium:function(e){var t=E(e,O);return j.push(t),function(){j=j.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(O=!0;j.length;){var t=j;j=[],t.forEach(e)}j={push:function(t){return e(t)},filter:function(){return j}}},assignMedium:function(e){O=!0;var t=[];if(j.length){var n=j;j=[],n.forEach(e),t=j}var r=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(r)};i(),j={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),j}}}}).options=Uj({async:!0,ssr:!1},S),N),UI=function(){},UD=G.forwardRef(function(e,t){var n,r,i,o,a=G.useRef(null),l=G.useState({onScrollCapture:UI,onWheelCapture:UI,onTouchMoveCapture:UI}),s=l[0],c=l[1],u=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,g=e.sideCar,y=e.noRelative,b=e.noIsolation,v=e.inert,x=e.allowPinchZoom,w=e.as,k=e.gapMode,_=UO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=(n=[a,t],r=function(e){return n.forEach(function(t){return UA(t,e)})},(i=(0,G.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=r,o=i.facade,UM(function(){var e=UP.get(o);if(e){var t=new Set(e),r=new Set(n),i=o.current;t.forEach(function(e){r.has(e)||UA(e,null)}),r.forEach(function(e){t.has(e)||UA(e,i)})}UP.set(o,n)},[n]),o),E=Uj(Uj({},_),s);return G.createElement(G.Fragment,null,h&&G.createElement(g,{sideCar:UT,removeScrollBar:p,shards:m,noRelative:y,noIsolation:b,inert:v,setCallbacks:c,allowPinchZoom:!!x,lockRef:a,gapMode:k}),u?G.cloneElement(G.Children.only(d),Uj(Uj({},E),{ref:S})):G.createElement(void 0===w?"div":w,Uj({},E,{className:f,ref:S}),d))});UD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},UD.classNames={fullWidth:UC,zeroRight:UN};var Uz=function(e){var t=e.sideCar,n=UO(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return G.createElement(r,Uj({},n))};Uz.isSideCarExport=!0;var UR=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Z||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,i;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},UL=function(){var e=UR();return function(t,n){G.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},U$=function(){var e=UL();return function(t){return e(t.styles,t.dynamic),null}},UB={left:0,top:0,right:0,gap:0},UF=function(e){return parseInt(e||"",10)||0},UU=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[UF(n),UF(r),UF(i)]},UH=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return UB;var t=UU(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])}},UK=U$(),UW="data-scroll-locked",Uq=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(UW,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(UN," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(UC," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(UN," .").concat(UN," {\n right: 0 ").concat(r,";\n }\n \n .").concat(UC," .").concat(UC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(UW,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},UZ=function(){var e=parseInt(document.body.getAttribute(UW)||"0",10);return isFinite(e)?e:0},UV=function(){G.useEffect(function(){return document.body.setAttribute(UW,(UZ()+1).toString()),function(){var e=UZ()-1;e<=0?document.body.removeAttribute(UW):document.body.setAttribute(UW,e.toString())}},[])},UG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;UV();var o=G.useMemo(function(){return UH(i)},[i]);return G.createElement(UK,{styles:Uq(o,!t,i,n?"":"!important")})},UX=!1;if("u">typeof window)try{var UY=Object.defineProperty({},"passive",{get:function(){return UX=!0,!0}});window.addEventListener("test",UY,UY),window.removeEventListener("test",UY,UY)}catch(e){UX=!1}var UJ=!!UX&&{passive:!1},UQ=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},U0=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),U1(e,r)){var i=U2(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},U1=function(e,t){return"v"===e?UQ(t,"overflowY"):UQ(t,"overflowX")},U2=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},U3=function(e,t,n,r,i){var o,a=(o=window.getComputedStyle(t).direction,"h"===e&&"rtl"===o?-1:1),l=a*r,s=n.target,c=t.contains(s),u=!1,d=l>0,f=0,p=0;do{if(!s)break;var h=U2(e,s),m=h[0],g=h[1]-h[2]-a*m;(m||g)&&U1(e,s)&&(f+=g,p+=m);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&s!==document.body||c&&(t.contains(s)||t===s))return d&&(i&&1>Math.abs(f)||!i&&l>f)?u=!0:!d&&(i&&1>Math.abs(p)||!i&&-l>p)&&(u=!0),u},U4=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},U9=function(e){return[e.deltaX,e.deltaY]},U5=function(e){return e&&"current"in e?e.current:e},U6=0,U8=[];let U7=(C=function(e){var t=G.useRef([]),n=G.useRef([0,0]),r=G.useRef(),i=G.useState(U6++)[0],o=G.useState(U$)[0],a=G.useRef(e);G.useEffect(function(){a.current=e},[e]),G.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(U5),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=G.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var i,o=U4(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-o[0],c="deltaY"in e?e.deltaY:l[1]-o[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var h=U0(d,u);if(!h)return!0;if(h?i=d:(i="v"===d?"h":"v",h=U0(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=i),!i)return!0;var m=r.current||i;return U3(m,t,e,"h"===m?s:c,!0)},[]),s=G.useCallback(function(e){if(U8.length&&U8[U8.length-1]===o){var n="deltaY"in e?U9(e):U4(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(a.current.shards||[]).map(U5).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?l(e,i[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=G.useCallback(function(e,n,r,i){var o={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),u=G.useCallback(function(e){n.current=U4(e),r.current=void 0},[]),d=G.useCallback(function(t){c(t.type,U9(t),t.target,l(t,e.lockRef.current))},[]),f=G.useCallback(function(t){c(t.type,U4(t),t.target,l(t,e.lockRef.current))},[]);G.useEffect(function(){return U8.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",s,UJ),document.addEventListener("touchmove",s,UJ),document.addEventListener("touchstart",u,UJ),function(){U8=U8.filter(function(e){return e!==o}),document.removeEventListener("wheel",s,UJ),document.removeEventListener("touchmove",s,UJ),document.removeEventListener("touchstart",u,UJ)}},[]);var p=e.removeScrollBar,h=e.inert;return G.createElement(G.Fragment,null,h?G.createElement(o,{styles:"\n .block-interactivity-".concat(i," {pointer-events: none;}\n .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,p?G.createElement(UG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},UT.useMedium(C),Uz);var He=G.forwardRef(function(e,t){return G.createElement(UD,Uj({},e,{ref:t,sideCar:U7}))});He.classNames=UD.classNames;var Ht=new WeakMap,Hn=new WeakMap,Hr={},Hi=0,Ho=function(e){return e&&(e.host||Ho(e.parentNode))},Ha=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=Ho(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});Hr[n]||(Hr[n]=new WeakMap);var o=Hr[n],a=[],l=new Set,s=new Set(i),c=function(e){!e||l.has(e)||(l.add(e),c(e.parentNode))};i.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,s=(Ht.get(e)||0)+1,c=(o.get(e)||0)+1;Ht.set(e,s),o.set(e,c),a.push(e),1===s&&i&&Hn.set(e,!0),1===c&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),Hi++,function(){a.forEach(function(e){var t=Ht.get(e)-1,i=o.get(e)-1;Ht.set(e,t),o.set(e,i),t||(Hn.has(e)||e.removeAttribute(r),Hn.delete(e)),i||e.removeAttribute(n)}),--Hi||(Ht=new WeakMap,Ht=new WeakMap,Hn=new WeakMap,Hr={})}},Hl=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Ha(r,i,n,"aria-hidden")):function(){return null}},Hs="Dialog",[Hc,Hu]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>G.createContext(e));return function(n){let r=n?.[e]||t;return G.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=G.createContext(r);i.displayName=t+"Context";let o=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,l=n?.[e]?.[o]||i,s=G.useMemo(()=>a,Object.values(a));return(0,V.jsx)(l.Provider,{value:s,children:r})};return a.displayName=t+"Provider",[a,function(n,a,l={}){let{optional:s=!1}=l,c=a?.[e]?.[o]||i,u=G.useContext(c);if(u)return u;if(void 0!==r)return r;if(!s)throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return G.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(Hs),[Hd,Hf]=Hc(Hs),Hp=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,l=G.useRef(null),s=G.useRef(null),[c,u]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,a]=function({defaultProp:e,onChange:t}){let[n,r]=G.useState(e),i=G.useRef(n),o=G.useRef(t);return F3(()=>{o.current=t},[t]),G.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:i;{let t=G.useRef(void 0!==e);G.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}return[s,G.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&a.current?.(n)}else o(t)},[l,e,o,a])]}({prop:r,defaultProp:i??!1,onChange:o,caller:Hs});return(0,V.jsx)(Hd,{scope:t,triggerRef:l,contentRef:s,contentId:F2(),titleId:F2(),descriptionId:F2(),open:c,onOpenChange:u,onOpenToggle:G.useCallback(()=>u(e=>!e),[u]),modal:a,children:n})};Hp.displayName=Hs;var Hh="DialogTrigger";G.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Hf(Hh,n),o=FJ(t,i.triggerRef);return(0,V.jsx)(Un.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":HM(i.open),...r,ref:o,onClick:FG(e.onClick,i.onOpenToggle)})}).displayName=Hh;var Hm="DialogPortal",[Hg,Hy]=Hc(Hm,{forceMount:void 0}),Hb=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Hf(Hm,t);return(0,V.jsx)(Hg,{scope:t,forceMount:n,children:G.Children.map(r,e=>(0,V.jsx)(Ux,{present:n||o.open,children:(0,V.jsx)(Uv,{asChild:!0,container:i,children:e})}))})};Hb.displayName=Hm;var Hv="DialogOverlay",Hx=G.forwardRef((e,t)=>{let n=Hy(Hv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Hf(Hv,e.__scopeDialog);return o.modal?(0,V.jsx)(Ux,{present:r||o.open,children:(0,V.jsx)(Hk,{...i,ref:t})}):null});Hx.displayName=Hv;var Hw=F4("DialogOverlay.RemoveScroll"),Hk=G.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Hf(Hv,n),o=FJ(t,function(){let e=G.useContext(Uo),[t,n]=G.useState(null);return G.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}());return(0,V.jsx)(He,{as:Hw,allowPinchZoom:!0,shards:[i.contentRef],children:(0,V.jsx)(Un.div,{"data-state":HM(i.open),...r,ref:o,style:{pointerEvents:"auto",...r.style}})})}),H_="DialogContent",HS=G.forwardRef((e,t)=>{let n=Hy(H_,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Hf(H_,e.__scopeDialog);return(0,V.jsx)(Ux,{present:r||o.open,children:o.modal?(0,V.jsx)(HE,{...i,ref:t}):(0,V.jsx)(Hj,{...i,ref:t})})});HS.displayName=H_;var HE=G.forwardRef((e,t)=>{let n=Hf(H_,e.__scopeDialog),r=G.useRef(null),i=FJ(t,n.contentRef,r);return G.useEffect(()=>{let e=r.current;if(e)return Hl(e)},[]),(0,V.jsx)(HO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:FG(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:FG(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:FG(e.onFocusOutside,e=>e.preventDefault())})}),Hj=G.forwardRef((e,t)=>{let n=Hf(H_,e.__scopeDialog),r=G.useRef(!1),i=G.useRef(!1);return(0,V.jsx)(HO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let o=t.target;n.triggerRef.current?.contains(o)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),HO=G.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,l=Hf(H_,n);return G.useEffect(()=>{US||(US={start:UE(),end:UE()});let{start:e,end:t}=US;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),U_++,()=>{1===U_&&(US?.start.remove(),US?.end.remove(),US=null),U_=Math.max(0,U_-1)}},[]),(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(Up,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,V.jsx)(Ua,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":HM(l.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),HN="DialogTitle";G.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Hf(HN,n);return(0,V.jsx)(Un.h2,{id:i.titleId,...r,ref:t})}).displayName=HN;var HC="DialogDescription";G.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Hf(HC,n);return(0,V.jsx)(Un.p,{id:i.descriptionId,...r,ref:t})}).displayName=HC;var HA="DialogClose";function HM(e){return e?"open":"closed"}G.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Hf(HA,n);return(0,V.jsx)(Un.button,{type:"button",...r,ref:t,onClick:FG(e.onClick,()=>i.onOpenChange(!1))})}).displayName=HA;var HP='[cmdk-group=""]',HT='[cmdk-group-items=""]',HI='[cmdk-item=""]',HD=`${HI}:not([aria-disabled="true"])`,Hz="cmdk-item-select",HR="data-value",HL=(e,t,n)=>{var r;return r=e,function e(t,n,r,i,o,a,l){if(a===n.length)return o===t.length?1:.99;var s=`${o},${a}`;if(void 0!==l[s])return l[s];for(var c,u,d,f,p=i.charAt(a),h=r.indexOf(p,o),m=0;h>=0;)(c=e(t,n,r,i,h+1,a+1,l))>m&&(h===o?c*=1:FK.test(t.charAt(h-1))?(c*=.8,(d=t.slice(o,h-1).match(FW))&&o>0&&(c*=Math.pow(.999,d.length))):Fq.test(t.charAt(h-1))?(c*=.9,(f=t.slice(o,h-1).match(FZ))&&o>0&&(c*=Math.pow(.999,f.length))):(c*=.17,o>0&&(c*=Math.pow(.999,h-o))),t.charAt(h)!==n.charAt(a)&&(c*=.9999)),(c<.1&&r.charAt(h-1)===i.charAt(a+1)||i.charAt(a+1)===i.charAt(a)&&r.charAt(h-1)!==i.charAt(a))&&.1*(u=e(t,n,r,i,h+1,a+2,l))>c&&(c=.1*u),c>m&&(m=c),h=r.indexOf(p,h+1);return l[s]=m,m}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,FV(r),FV(t),0,0,{})},H$=G.createContext(void 0),HB=G.createContext(void 0),HF=G.createContext(void 0),HU=G.forwardRef((e,t)=>{let n=HJ(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=HJ(()=>new Set),i=HJ(()=>new Map),o=HJ(()=>new Map),a=HJ(()=>new Set),l=HX(e),{label:s,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:g=!0,...y}=e,b=F2(),v=F2(),x=F2(),w=G.useRef(null),k=H1();HY(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,_.emit()}},[u]),HY(()=>{k(6,C)},[]);let _=G.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,o,a,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)N(),j(),k(1,O);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(i=document.getElementById(b))||i.focus()}if(k(7,()=>{var e;n.current.selectedItemId=null==(e=A())?void 0:e.id,_.emit()}),r||k(5,C),(null==(o=l.current)?void 0:o.value)!==void 0){null==(s=(a=l.current).onValueChange)||s.call(a,null!=t?t:"");return}}_.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),S=G.useMemo(()=>({value:(e,t,r)=>{var i;t!==(null==(i=o.current.get(e))?void 0:i.value)&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),k(2,()=>{j(),_.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),k(3,()=>{N(),j(),n.current.value||O(),_.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();k(4,()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&O(),_.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:s||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:x,labelId:v,listInnerRef:w}),[]);function E(e,t){var r,i;let o=null!=(i=null==(r=l.current)?void 0:r.filter)?i:HL;return e?o(e,n.current.search,t):0}function j(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),o=0;r.forEach(t=>{o=Math.max(e.get(t),o)}),t.push([n,o])});let r=w.current;M().sort((t,n)=>{var r,i;let o=t.getAttribute("id"),a=n.getAttribute("id");return(null!=(r=e.get(a))?r:0)-(null!=(i=e.get(o))?i:0)}).forEach(e=>{let t=e.closest(HT);t?t.appendChild(e.parentElement===t?e:e.closest(`${HT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${HT} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=w.current)?void 0:t.querySelector(`${HP}[${HR}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function O(){let e=M().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(HR);_.setState("value",t||void 0)}function N(){var e,t,a,s;if(!n.current.search||!1===l.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let c=0;for(let i of r.current){let r=E(null!=(t=null==(e=o.current.get(i))?void 0:e.value)?t:"",null!=(s=null==(a=o.current.get(i))?void 0:a.keywords)?s:[]);n.current.filtered.items.set(i,r),r>0&&c++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function C(){var e,t,n;let r=A();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(HP))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function A(){var e;return null==(e=w.current)?void 0:e.querySelector(`${HI}[aria-selected="true"]`)}function M(){var e;return Array.from((null==(e=w.current)?void 0:e.querySelectorAll(HD))||[])}function P(e){let t=M()[e];t&&_.setState("value",t.getAttribute(HR))}function T(e){var t;let n=A(),r=M(),i=r.findIndex(e=>e===n),o=r[i+e];null!=(t=l.current)&&t.loop&&(o=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),o&&_.setState("value",o.getAttribute(HR))}function I(e){let t=A(),n=null==t?void 0:t.closest(HP),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,HP):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,HP))?void 0:n.querySelector(HD);r?_.setState("value",r.getAttribute(HR)):T(e)}let D=()=>P(M().length-1),z=e=>{e.preventDefault(),e.metaKey?D():e.altKey?I(1):T(1)},R=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):T(-1)};return G.createElement(Un.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=y.onKeyDown)||t.call(y,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":g&&e.ctrlKey&&z(e);break;case"ArrowDown":z(e);break;case"p":case"k":g&&e.ctrlKey&&R(e);break;case"ArrowUp":R(e);break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),D();break;case"Enter":{e.preventDefault();let t=A();if(t){let e=new Event(Hz);t.dispatchEvent(e)}}}}},G.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:H3},s),H2(e,e=>G.createElement(HB.Provider,{value:_},G.createElement(H$.Provider,{value:S},e))))}),HH=G.forwardRef((e,t)=>{var n,r;let i=F2(),o=G.useRef(null),a=G.useContext(HF),l=G.useContext(H$),s=HX(e),c=null!=(r=null==(n=s.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;HY(()=>{if(!c)return l.item(i,null==a?void 0:a.id)},[c]);let u=H0(i,o,[e.value,e.children,o],e.keywords),d=G.useContext(HB),f=HQ(e=>e.value&&e.value===u.current),p=HQ(e=>!!c||!1===l.filter()||!e.search||e.filtered.items.get(i)>0);function h(){var e,t;m(),null==(t=(e=s.current).onSelect)||t.call(e,u.current)}function m(){d.setState("value",u.current,!0)}if(G.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(Hz,h),()=>t.removeEventListener(Hz,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:y,onSelect:b,forceMount:v,keywords:x,...w}=e;return G.createElement(Un.div,{ref:FY(o,t),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||l.getDisablePointerSelection()?void 0:m,onClick:g?void 0:h},e.children)}),HK=G.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,a=F2(),l=G.useRef(null),s=G.useRef(null),c=F2(),u=G.useContext(H$),d=HQ(e=>!!i||!1===u.filter()||!e.search||e.filtered.groups.has(a));HY(()=>u.group(a),[]),H0(a,l,[e.value,e.heading,s]);let f=G.useMemo(()=>({id:a,forceMount:i}),[i]);return G.createElement(Un.div,{ref:FY(l,t),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&G.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),H2(e,e=>G.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},G.createElement(HF.Provider,{value:f},e))))}),HW=G.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=G.useRef(null),o=HQ(e=>!e.search);return n||o?G.createElement(Un.div,{ref:FY(i,t),...r,"cmdk-separator":"",role:"separator"}):null}),Hq=G.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=null!=e.value,o=G.useContext(HB),a=HQ(e=>e.search),l=HQ(e=>e.selectedItemId),s=G.useContext(H$);return G.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),G.createElement(Un.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":l,id:s.inputId,type:"text",value:i?e.value:a,onChange:e=>{i||o.setState("search",e.target.value),null==n||n(e.target.value)}})}),HZ=G.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=G.useRef(null),a=G.useRef(null),l=HQ(e=>e.selectedItemId),s=G.useContext(H$);return G.useEffect(()=>{if(a.current&&o.current){let e=a.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),G.createElement(Un.div,{ref:FY(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:s.listId},H2(e,e=>G.createElement("div",{ref:FY(a,s.listInnerRef),"cmdk-list-sizer":""},e)))}),HV=G.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...l}=e;return G.createElement(Hp,{open:n,onOpenChange:r},G.createElement(Hb,{container:a},G.createElement(Hx,{"cmdk-overlay":"",className:i}),G.createElement(HS,{"aria-label":e.label,"cmdk-dialog":"",className:o},G.createElement(HU,{ref:t,...l}))))}),HG=Object.assign(HU,{List:HZ,Item:HH,Input:Hq,Group:HK,Separator:HW,Dialog:HV,Empty:G.forwardRef((e,t)=>HQ(e=>0===e.filtered.count)?G.createElement(Un.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:G.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return G.createElement(Un.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},H2(e,e=>G.createElement("div",{"aria-hidden":!0},e)))})});function HX(e){let t=G.useRef(e);return HY(()=>{t.current=e}),t}var HY="u"<typeof window?G.useEffect:G.useLayoutEffect;function HJ(e){let t=G.useRef();return void 0===t.current&&(t.current=e()),t}function HQ(e){let t=G.useContext(HB),n=()=>e(t.snapshot());return G.useSyncExternalStore(t.subscribe,n,n)}function H0(e,t,n,r=[]){let i=G.useRef(),o=G.useContext(H$);return HY(()=>{var a;let l=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),s=r.map(e=>e.trim());o.value(e,l,s),null==(a=t.current)||a.setAttribute(HR,l),i.current=l}),i}var H1=()=>{let[e,t]=G.useState(),n=HJ(()=>new Map);return HY(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function H2({asChild:e,children:t},n){let r;return e&&G.isValidElement(t)?G.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var H3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function H4(e,t,n){let r=t.trim().toLowerCase(),i=new Set(n.linkedIds);return e.filter(e=>e.id!==n.currentId&&!i.has(e.id)&&(!r||e.id.toLowerCase().includes(r)||e.title.toLowerCase().includes(r))).sort((e,t)=>Number(t.id.toLowerCase()===r)-Number(e.id.toLowerCase()===r)||e.id.localeCompare(t.id,"en",{numeric:!0})||e.title.localeCompare(t.title,"en"))}function H9({bead:e,onDone:t}){let{beads:n,readOnly:r}=eu(),i=eb(),[o,a]=G.useState(""),[l,s]=G.useState(""),[c,u]=G.useState("blocks"),d=G.useRef(!1),f=r||i.isPending,p=H4(n,"",{currentId:e.id,linkedIds:(e.dependencies??[]).map(e=>e.depends_on_id)}),h=H4(p,o,{currentId:e.id,linkedIds:[]}),m=p.find(e=>e.id===l);return(0,V.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 rounded-[9px] border border-border bg-[var(--surface)] p-[9px_11px]",onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),f||t())},children:[m?(0,V.jsxs)("div",{className:"flex min-w-0 items-start gap-2 rounded-[9px] border border-border bg-[var(--surface-2)] p-2",children:[(0,V.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:m.id}),(0,V.jsx)("div",{className:"break-words text-label text-[var(--text)]",children:m.title})]}),(0,V.jsx)(er._,{autoFocus:!0,variant:"ghost",size:"sm",label:"Clear selected bead",title:"Clear selected bead",disabled:f,onClick:()=>{s(""),a("")},children:(0,V.jsx)(en.W,{name:"x",size:13})})]}):(0,V.jsxs)(HG,{shouldFilter:!1,label:"Search dependency beads",className:"min-w-0",children:[(0,V.jsxs)("div",{className:"flex items-center gap-2 rounded-[9px] border border-border bg-[var(--surface-2)] px-2 focus-within:border-[var(--brand)]",children:[(0,V.jsx)(en.W,{name:"search",size:13,className:"shrink-0 text-[var(--text-3)]"}),(0,V.jsx)(HG.Input,{autoFocus:!0,"aria-label":"Search dependency beads",placeholder:"Search by ID or title…",value:o,onValueChange:a,disabled:f,className:"h-9 min-w-0 flex-1 bg-transparent text-label text-[var(--text)] outline-none"})]}),(0,V.jsxs)(HG.List,{className:"mt-2 max-h-52 overflow-y-auto rounded-[9px] border border-border bg-[var(--surface-2)] py-1",children:[(0,V.jsx)(HG.Empty,{className:"px-3 py-4 text-center text-label text-[var(--text-3)]",children:"No matching beads."}),h.map(e=>(0,V.jsxs)(HG.Item,{value:e.id,disabled:f,onSelect:()=>{f||s(e.id)},className:"flex cursor-pointer items-start gap-2 px-[9px] py-2 text-label data-[selected=true]:bg-[var(--brand-weak)] data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",children:[(0,V.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:e.id}),(0,V.jsx)("div",{className:"break-words text-[var(--text)]",children:e.title})]}),(0,V.jsx)("span",{className:"mt-0.5 shrink-0 text-meta uppercase text-[var(--text-3)]",children:lW(e.issue_type)}),(0,V.jsx)("span",{className:"mt-1.5 h-[7px] w-[7px] shrink-0 rounded-full",style:{background:lL(e.status)},title:lB(e.status)})]},e.id))]})]}),(0,V.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,V.jsxs)(er.$,{size:"sm","aria-label":"Dependency type",value:c,onChange:e=>u(e.target.value),disabled:f,className:"min-w-0 flex-1",children:[(0,V.jsx)("option",{value:"blocks",children:"blocked by"}),(0,V.jsx)("option",{value:"related",children:"related"})]}),(0,V.jsx)(er.K,{variant:"outline",size:"sm","aria-label":"Cancel dependency",disabled:f,onClick:t,children:"Cancel"}),(0,V.jsx)(ub.f,{size:"sm",disabled:f||!m,onClick:()=>{f||d.current||!m||(d.current=!0,i.mutate({id:e.id,dependsOnId:m.id,type:c},{onSuccess:t,onSettled:()=>{d.current=!1}}))},children:"Add"})]})]})}var H5=e.i(26323),H6=e.i(98218),H8=e.i(21637),H7=e.i(9977),Ke=e.i(41708),Kt=e.i(93480),Kn=e.i(9169),Kr=e.i(52744),Ki=e.i(67881),Ko=e.i(60964);function Ka({...e}){return(0,V.jsx)(H5.f.Root,{"data-slot":"sheet",...e})}function Kl({...e}){return(0,V.jsx)(H6.f.Trigger,{"data-slot":"sheet-trigger",...e})}function Ks({...e}){return(0,V.jsx)(H7.f.Portal,{"data-slot":"sheet-portal",...e})}function Kc({className:e,...t}){return(0,V.jsx)(Ke.f.Backdrop,{"data-slot":"sheet-overlay",className:(0,uo.f)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function Ku({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return(0,V.jsxs)(Ks,{children:[(0,V.jsx)(Kc,{}),(0,V.jsxs)(Kt.f.Popup,{"data-slot":"sheet-content","data-side":n,className:(0,uo.f)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-body text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...i,children:[t,r&&(0,V.jsxs)(H8.f.Close,{"data-slot":"sheet-close",render:(0,V.jsx)(Ki.f,{variant:"ghost",className:"absolute top-3 right-3 max-md:size-11",size:"icon-sm"}),children:[(0,V.jsx)(Ko.f,{}),(0,V.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function Kd({className:e,...t}){return(0,V.jsx)(Kn.f.Title,{"data-slot":"sheet-title",className:(0,uo.f)("font-heading text-section font-medium text-foreground",e),...t})}function Kf({className:e,...t}){return(0,V.jsx)(Kr.f.Description,{"data-slot":"sheet-description",className:(0,uo.f)("text-body text-muted-foreground",e),...t})}function Kp({projectId:e,beadId:t,disabled:n,disabledMessage:r,textareaRef:i,value:o,onChange:a}){let[l,s]=G.useState(0),[c,u]=G.useState(!1),d=G.useRef(o);G.useEffect(()=>{d.current=o},[o]);let f=G.useCallback(async o=>{let l=o.filter(e=>e.type.startsWith("image/"));if(0===l.length)return;if(n)return void X.c.error(r||"Attachments aren't available here.");let c=i.current,u=c?.selectionStart??d.current.length,f=c?.selectionEnd??d.current.length,p=[];for(let n of l){s(e=>e+1);try{let{ref:r,name:i}=await ei.k.attachments.upload(e,t,n);p.push(``)}catch(e){X.c.error(e.message)}finally{s(e=>e-1)}}if(0===p.length)return;let h=d.current,m=(u>0&&"\n"!==h[u-1]?"\n":"")+p.join("\n")+"\n";a(h.slice(0,u)+m+h.slice(f)),requestAnimationFrame(()=>{let e=i.current;if(e){e.focus();let t=u+m.length;e.setSelectionRange(t,t)}})},[e,t,n,r,i,a]),p=G.useCallback(e=>{let t=Array.from(e.dataTransfer?.files??[]);0!==t.length&&(e.preventDefault(),u(!1),f(t))},[f]),h=G.useCallback(e=>{Array.from(e.dataTransfer?.types??[]).includes("Files")&&(e.preventDefault(),u(!0))},[]),m=G.useCallback(()=>u(!1),[]);return{uploading:l>0,dragOver:c,onDrop:p,onDragOver:h,onDragLeave:m,onPaste:G.useCallback(e=>{let t=Array.from(e.clipboardData?.files??[]);0!==t.length&&(e.preventDefault(),f(t))},[f]),pickFiles:G.useCallback(e=>{let t=Array.from(e.target.files??[]);e.target.value="",t.length&&f(t)},[f])}}function Kh(e){return({value:t,start:n,end:r})=>{let i=t.slice(n,r);if(t.slice(n-e.length,n)===e&&t.slice(r,r+e.length)===e)return{value:t.slice(0,n-e.length)+i+t.slice(r+e.length),start:n-e.length,end:r-e.length};if(i.length>=2*e.length&&i.startsWith(e)&&i.endsWith(e)){let o=i.slice(e.length,i.length-e.length);return{value:t.slice(0,n)+o+t.slice(r),start:n,end:n+o.length}}if(n===r){let i=n+e.length;return{value:t.slice(0,n)+e+e+t.slice(r),start:i,end:i}}return{value:t.slice(0,n)+e+i+e+t.slice(r),start:n+e.length,end:r+e.length}}}function Km(e){return({value:t,start:n,end:r})=>{let i=t.lastIndexOf("\n",n-1)+1,o=t.indexOf("\n",r);-1===o&&(o=t.length);let a=t.slice(i,o).split("\n"),l=a.filter(e=>""!==e.trim()),s=(l.length>0&&l.every(t=>t.startsWith(e))?a.map(t=>t.startsWith(e)?t.slice(e.length):t):a.map(t=>e+t)).join("\n");return{value:t.slice(0,i)+s+t.slice(o),start:i,end:i+s.length}}}let Kg=({value:e,start:t,end:n})=>{let r=e.slice(t,n);if(r){let i=`[${r}](url)`,o=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:o,end:o+3}}return{value:e.slice(0,t)+"[](url)"+e.slice(n),start:t+1,end:t+1}},Ky=Kh("**"),Kb=Kh("*");function Kv(e,t,n,r){if(!e)return;let i=r({value:t,start:e.selectionStart,end:e.selectionEnd});n(i.value),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(i.start,i.end)})}let Kx=[{kind:"btn",title:"Bold (⌘B)",fn:Ky,glyph:"B",glyphClass:"font-semibold"},{kind:"btn",title:"Italic (⌘I)",fn:Kb,glyph:"I",glyphClass:"italic font-serif"},{kind:"btn",title:"Inline code",fn:Kh("`"),glyph:"</>",glyphClass:"font-mono text-meta"},{kind:"sep"},{kind:"btn",title:"Heading",fn:Km("## "),glyph:"H",glyphClass:"font-semibold"},{kind:"btn",title:"Bullet list",fn:Km("- "),icon:"list"},{kind:"btn",title:"Checklist",fn:Km("- [ ] "),glyph:"☑",glyphClass:"text-body"},{kind:"btn",title:"Quote",fn:Km("> "),glyph:"❝",glyphClass:"text-body"},{kind:"sep"},{kind:"btn",title:"Link (⌘K)",fn:Kg,icon:"link"},{kind:"btn",title:"Code block",fn:({value:e,start:t,end:n})=>{let r=e.slice(t,n),i=t>0&&"\n"!==e[t-1]?"\n":"",o="```\n",a=i+o+r+"\n```",l=t+i.length+o.length;return{value:e.slice(0,t)+a+e.slice(n),start:l,end:l+r.length}},glyph:"{ }",glyphClass:"font-mono text-meta"}];function Kw({textareaRef:e,value:t,onChange:n}){return(0,V.jsx)("div",{className:"mb-[6px] flex flex-wrap items-center gap-[3px]",children:Kx.map((r,i)=>"sep"===r.kind?(0,V.jsx)("span",{className:"mx-[3px] h-[16px] w-px bg-border"},i):(0,V.jsx)(er.K,{size:"sm",title:r.title,onMouseDown:e=>e.preventDefault(),onClick:()=>Kv(e.current,t,n,r.fn),className:"h-7 min-w-7 rounded-md px-[6px] text-[var(--text-2)] hover:text-[var(--text)]",children:r.icon?(0,V.jsx)(en.W,{name:r.icon,size:14}):(0,V.jsx)("span",{className:r.glyphClass,children:r.glyph})},i))})}function Kk({bead:e}){let{projectId:t,pushDetail:n}=eu(),r=ey(),[i,o]=G.useState(null),a=(0,Q.f)({mutationFn:()=>ei.k.assist(t,e.id),onSuccess:e=>o(e),onError:e=>X.c.error(e.message)});return(0,V.jsxs)("div",{className:"mt-2",children:[(0,V.jsxs)(er.K,{size:"sm",onClick:()=>a.mutate(),disabled:a.isPending,children:[(0,V.jsx)(en.W,{name:"feature",size:14,style:{color:"var(--brand)"}}),a.isPending?"Refining with AI…":"Refine with AI"]}),i&&(0,V.jsxs)("div",{className:"mt-2 rounded-[10px] border bg-[var(--surface-2)] p-3",style:{borderColor:"var(--brand)"},children:[(0,V.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-label font-semibold text-[var(--brand)]",children:[(0,V.jsx)(en.W,{name:"feature",size:14})," AI suggestion",(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)(er._,{variant:"ghost",size:"sm",label:"Dismiss",title:"Dismiss",onClick:()=>o(null),children:(0,V.jsx)(en.W,{name:"x",size:13})})]}),(0,V.jsx)("div",{className:"mb-1 text-meta uppercase tracking-[.03em] text-[var(--text-3)]",children:"Refined description"}),(0,V.jsx)(B0,{text:i.description,projectId:t,className:"rounded-[8px] border border-border bg-[var(--surface)] p-[10px_11px] text-body text-[var(--text-2)]"}),i.labels.length>0&&(0,V.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-[6px] text-meta",children:[(0,V.jsx)("span",{className:"text-[var(--text-3)]",children:"Suggested labels:"}),i.labels.map(e=>(0,V.jsx)("span",{className:"rounded-md border border-border bg-[var(--surface)] px-[7px] py-px font-mono",children:e},e))]}),i.duplicates.length>0&&(0,V.jsxs)("div",{className:"mt-2 text-meta",children:[(0,V.jsx)("div",{className:"text-[var(--text-3)]",children:"Possible duplicates:"}),i.duplicates.map(e=>(0,V.jsxs)(er.W,{tone:"text",onClick:()=>n(e.id),className:"mt-1 block",children:[(0,V.jsx)("span",{className:"font-mono text-[var(--text-3)]",children:e.id})," ",(0,V.jsx)("span",{className:"text-[var(--text-2)]",children:e.title}),e.reason?(0,V.jsxs)("span",{className:"text-[var(--text-3)]",children:[" — ",e.reason]}):null]},e.id))]}),(0,V.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,V.jsx)(er.K,{size:"sm",onClick:()=>o(null),children:"Reject"}),(0,V.jsx)(ub.f,{size:"sm",icon:"check",onClick:()=>{i&&r.mutate({id:e.id,patch:{description:i.description}},{onSuccess:()=>{X.c.success("Applied AI description"),o(null)}})},disabled:r.isPending,children:"Apply description"})]}),(0,V.jsx)("div",{className:"mt-1 text-meta text-[var(--text-3)]",children:"Labels and duplicates are advisory — only the description is written, on confirm."})]})]})}let K_="text-meta font-medium uppercase tracking-[.03em] text-[var(--text-3)]",KS="rounded-[10px] border border-border bg-[var(--surface-2)] p-[12px_13px] text-body leading-[1.55] text-[var(--text-2)] [text-wrap:pretty]",KE="archived",Kj="inline-flex items-center gap-[5px] rounded-md border border-border bg-[var(--surface-2)] px-[6px] py-[2px] font-mono text-meta text-[var(--text-3)]";function KO(e){return"parent-child"!==e&&lS.includes(e)}function KN(e,t){return"closed"===e.status||t?.status==="closed"}function KC({openId:e,canGoBack:t,backTo:n,onBack:r,onClose:i,initialAction:o="view",actionNonce:a=0}){let{index:l,readOnly:s}=eu(),c=e?l.get(e):void 0,{width:u,startResize:d}=uD({storageKey:"beadscope.width.drawer",defaultWidth:720,min:480,max:1200,deltaFactor:-1}),f=eO(),p=G.useRef(null),h=G.useRef(!1);return(0,V.jsx)(Ka,{open:!!e&&!!c,onOpenChange:(e,t)=>{if(!e){if("outside-press"===t.reason&&h.current){t.cancel(),(0,X.c)("You have unsaved changes",{id:"drawer-unsaved",description:"Save them, or press Esc to close without saving."});return}i()}},children:(0,V.jsxs)(Ku,{"data-bead-drawer":!0,showCloseButton:!1,ref:p,initialFocus:!f||p,tabIndex:-1,style:{width:f?"100vw":u,maxWidth:f?"100vw":"96vw"},className:"flex gap-0 overflow-hidden border-l border-border bg-[var(--drawer)] p-0 outline-none",children:[(0,V.jsx)("div",{onPointerDown:d,title:"Drag to resize",className:"absolute left-0 top-0 z-20 h-full w-1.5 cursor-ew-resize hover:bg-[var(--brand)]/40 max-md:hidden"}),(0,V.jsx)("div",{className:"bd-scroll min-w-0 flex-1 overflow-y-auto overflow-x-hidden",children:c?(0,V.jsx)(KA,{bead:c,initialAction:s?"view":o,canGoBack:!!t,backTo:n??null,onBack:r,onClose:i,dirtyRef:h},`${c.id}-${a}`):(0,V.jsx)(Kd,{className:"sr-only",children:"Bead details"})})]})})}function KA({bead:e,initialAction:t,canGoBack:n,backTo:r,onBack:i,onClose:o,dirtyRef:a}){let l,{index:s,beads:c,humanAllowlist:u,meta:d,projectId:f,pushDetail:p,openCreate:h,readOnly:m}=eu(),g=d?.humanActor??"you",y=d?.kind==="demo",b=ey(),v=em(),x=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t,text:n})=>ei.k.addComment(e,t,n),()=>"Comment added",t,ed(e)))}(),w=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t,dependsOnId:n})=>ei.k.removeDep(e,t,n),()=>"Dependency removed · bd dep remove",t,ed(e)))}(),k=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(t=>ei.k.archive(e,t),e=>`Archived ${e} \xb7 bd close + label`,t,ed(e)))}(),_=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(t=>ei.k.remove(e,t),e=>`Deleted ${e} \xb7 bd delete`,t,ed(e)))}(),S=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(({id:t,reason:n})=>ei.k.createGate(e,t,n),(e,t)=>`Created approval gate ${t.id} \xb7 bd gate create`,t,ed(e)))}(),[E,j]=G.useState(""),[O,N]=G.useState(!1),[C,A]=G.useState(!1),[M,P]=G.useState(""),T=lT(e),[I,D]=G.useState(!m&&"close"===t),[z,R]=G.useState(""),L=G.useRef(null),$=()=>{D(!1),R("")},B=()=>{m||v.mutate({id:e.id,status:"closed",reason:z.trim()||void 0},{onSuccess:$})};G.useEffect(()=>{I&&L.current?.focus()},[I]);let[F,U]=G.useState(!m&&"edit"===t),[H,K]=G.useState(m);H!==m&&(K(m),m&&(D(!1),U(!1)));let[W,q]=G.useState(!1),[Z,Y]=G.useState(e.title),[J,ee]=G.useState(e.description??""),eo=lz(e.description),ea=G.useRef(null),el=G.useRef(null),es=Kp({projectId:f,beadId:e.id,disabled:y,disabledMessage:"Attachments aren't available for the Demo project.",textareaRef:ea,value:J,onChange:ee}),ec=F&&(Z!==e.title||J!==(e.description??""))||[E,z,M].some(e=>""!==e.trim());G.useEffect(()=>(a.current=ec,()=>{a.current=!1}),[a,ec]);let ef=()=>U(!1),ep=()=>{if(m)return;let t=Z.trim();t&&b.mutate({id:e.id,patch:{title:t,description:J}},{onSuccess:()=>U(!1)})},eh=!m&&!!E.trim()&&!x.isPending,eb=()=>{x.mutate({id:e.id,text:E.trim()},{onSuccess:()=>j(e=>e===E?"":e)})},ev=fU(e,u),ex=lY(e,s),ew=lQ(e.id,c),ek=l0(e.id,c),e_=G.useMemo(()=>(e.dependencies??[]).filter(e=>"parent-child"!==e.type),[e.dependencies]),eS=G.useMemo(()=>[...e_.map(t=>{var n;let r=s.get(t.depends_on_id),i=KN(e,r);return{key:`dependency:${t.depends_on_id}:${t.type}`,target:r,targetId:t.depends_on_id,label:(n=t.type,"blocks"===n?i?"was blocked by":"blocked by":"conditional-blocks"===n?i?"was conditionally blocked by":"conditionally blocked by":"waits-for"===n?i?"previously waited for":"waits for":n),active:!i,activeBlocking:KO(t.type)&&!i,removeIssueId:e.id,removeDependsOnId:t.depends_on_id}}),...c.flatMap(t=>(t.dependencies??[]).flatMap(n=>{var r;if(n.depends_on_id!==e.id||!KO(n.type))return[];let i=KN(e,t);return[{key:`dependent:${t.id}:${n.type}`,target:t,targetId:t.id,label:(r=n.type,"conditional-blocks"===r?i?"previously conditionally blocked":"conditionally blocks":"waits-for"===r?i?"was waited for by":"waited for by":i?"previously blocked":"blocks"),active:!i,activeBlocking:!i,removeIssueId:t.id,removeDependsOnId:e.id}]}))].sort((e,t)=>Number(t.active)-Number(e.active)),[e,c,e_,s]),eE=e.notes?.trim()??"",ej=e.design?.trim()??"",eO=e.acceptance_criteria?.trim()??"",eN="closed"===(l=e.close_reason?.trim()??"").toLowerCase()?"":l,eC=e.comments??[],eA=Dc(e),eM=[{label:`Created by ${e.created_by||"unknown"}`,time:l2(e.created_at)},e.updated_at?{label:"Last updated",time:l2(e.updated_at)}:null,e.closed_at?{label:"Closed",time:l2(e.closed_at)}:null].filter(Boolean),eP=G.useMemo(()=>{let e=new Set;for(let t of c)for(let n of t.labels??[])n!==KE&&e.add(n);return[...e].sort()},[c]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Kf,{className:"sr-only",children:["Bead details for ",e.id]}),(0,V.jsxs)("div",{className:"sticky top-0 z-[2] flex flex-wrap items-center gap-[10px] border-b border-border bg-[var(--drawer)] p-[15px_20px] max-md:gap-x-2 max-md:p-[10px_12px]",children:[n&&(0,V.jsx)(KI,{title:r?`Back to ${r}`:"Back",onClick:()=>i?.(),children:(0,V.jsx)(en.W,{name:"chevron",size:15,className:"rotate-90"})}),(0,V.jsx)("span",{className:"h-[9px] w-[9px] rounded-full",style:{background:lL(e.status)}}),(0,V.jsx)(f7,{id:e.id,className:"whitespace-nowrap font-mono text-body text-[var(--text-2)]"}),(0,V.jsx)(pr,{status:e.status}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsxs)("div",{className:"contents max-md:order-2 max-md:flex max-md:basis-full max-md:items-center max-md:gap-2",children:[(0,V.jsx)(KI,{title:"Copy link",onClick:()=>{let t=`${window.location.origin}/p/${encodeURIComponent(f)}?bead=${encodeURIComponent(e.id)}`;navigator.clipboard?navigator.clipboard.writeText(t).then(()=>X.c.success(`Copied link to ${e.id}`),()=>X.c.error("Couldn’t copy to clipboard")):X.c.error("Clipboard unavailable in this context")},children:(0,V.jsx)(en.W,{name:"link",size:15})}),!m&&(0,V.jsx)(KI,{title:F?"Stop editing":"Edit title & description",onClick:F?ef:()=>{m||(Y(e.title),ee(e.description??""),U(!0))},children:(0,V.jsx)(en.W,{name:"pencil",size:15})}),!m&&(0,V.jsx)(KI,{title:"Archive (close + label)",onClick:()=>k.mutate(e.id),children:(0,V.jsx)(en.W,{name:"archive",size:15})}),!m&&(0,V.jsx)(KI,{title:"Delete",className:"max-md:ml-auto",danger:!0,onClick:()=>{confirm(`Delete ${e.id}? This calls bd delete.`)&&(_.mutate(e.id),o())},children:(0,V.jsx)(en.W,{name:"trash",size:15})})]}),(0,V.jsx)(KI,{title:"Close",className:"max-md:order-1",onClick:o,children:(0,V.jsx)(en.W,{name:"x",size:15})})]}),(0,V.jsxs)("div",{className:"p-5 [&_button:disabled]:cursor-not-allowed [&_button:disabled]:opacity-50 [&_select:disabled]:opacity-60 [&_textarea:disabled]:opacity-60 [&_input:disabled]:opacity-60",children:[(0,V.jsxs)("div",{className:"mb-[10px] flex items-center gap-2",children:[(0,V.jsxs)("span",{className:"inline-flex items-center gap-[6px] rounded-[7px] border border-border bg-[var(--surface-2)] px-[9px] py-[3px] text-label text-[var(--text-2)]",children:[(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:13,style:{color:lK(e.issue_type)}}),lW(e.issue_type)]}),(0,V.jsx)(ps,{origin:ev,title:fH(e.created_by,ev),withLabel:!0})]}),T&&"closed"!==e.status&&(0,V.jsxs)("div",{className:"mb-4 flex items-center gap-3 rounded-[10px] border border-[var(--brand)]/40 bg-[var(--brand-weak)] p-[11px_13px]",children:[(0,V.jsx)(en.W,{name:"gate",size:16,style:{color:"var(--brand)"},className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"flex-1 text-label leading-[1.45] text-[var(--text-2)]",children:"Human approval gate. Approving closes it and unblocks everything waiting on it."}),(0,V.jsx)(Ds,{id:e.id})]}),F&&!m?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Kd,{className:"sr-only",children:["Edit ",e.id]}),(0,V.jsx)(er.C,{autoFocus:!0,value:Z,onChange:e=>Y(e.target.value),onKeyDown:e=>{Di(e)&&(e.preventDefault(),ep())},placeholder:"Title",className:"mb-[14px] h-auto py-[9px] text-page-title font-semibold leading-[1.25] tracking-[-.02em]"})]}):(0,V.jsx)(Kd,{className:"mb-[14px] text-page-title font-semibold leading-[1.25] tracking-[-.02em] [text-wrap:pretty]",children:e.title}),(0,V.jsxs)("div",{className:"mb-4 grid grid-cols-2 gap-[10px]",children:[(0,V.jsxs)("label",{className:"flex flex-col gap-[5px]",children:[(0,V.jsx)("span",{className:K_,children:"Status"}),(0,V.jsx)(er.$,{disabled:m,value:I&&!m?"closed":e.status,onChange:t=>{let n=t.target.value;"closed"===n&&"closed"!==e.status?m||(R(""),D(!0)):($(),v.mutate({id:e.id,status:n}))},children:lk.map(e=>(0,V.jsx)("option",{value:e,children:lB(e)},e))})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-[5px]",children:[(0,V.jsx)("span",{className:K_,children:"Priority"}),(0,V.jsx)(er.$,{disabled:m,value:String(e.priority),onChange:t=>b.mutate({id:e.id,patch:{priority:Number(t.target.value)}}),children:[0,1,2,3,4].map(e=>(0,V.jsxs)("option",{value:String(e),children:[e," · ",["Critical","High","Medium","Low","Backlog"][e]]},e))})]}),(0,V.jsx)(FH,{bead:e}),(0,V.jsxs)("div",{className:"flex flex-col gap-[5px]",children:[(0,V.jsx)("span",{className:K_,children:ex&&"epic"!==ex.issue_type?"Parent":"Epic"}),ex?(0,V.jsxs)("button",{type:"button",onClick:()=>p(ex.id),title:`Open ${ex.id}`,className:"flex h-[38px] items-center gap-[7px] rounded-[9px] border border-border bg-[var(--surface-2)] px-[10px] text-left text-[var(--brand)] hover:border-[var(--brand)] hover:bg-[var(--brand-weak)]",children:[(0,V.jsx)(en.W,{name:"epic"===ex.issue_type?"target":(0,en.F)(ex.issue_type),size:14,className:"flex-shrink-0"}),(0,V.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-label",children:ex.title}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)(en.W,{name:"chevron",size:13,className:"-rotate-90 flex-shrink-0 text-[var(--text-3)]"})]}):(0,V.jsxs)("div",{className:"flex h-[38px] items-center gap-[7px] rounded-[9px] border border-border bg-[var(--surface-2)] px-[10px] text-[var(--text-3)]",children:[(0,V.jsx)(en.W,{name:"target",size:14}),(0,V.jsx)("span",{className:"text-label",children:"—"})]})]})]}),(0,V.jsx)(KP,{bead:e,suggestions:eP,onChange:t=>b.mutate({id:e.id,patch:{labels:t}})}),I&&!m&&(0,V.jsxs)("div",{className:"mb-4 rounded-[10px] border border-border bg-[var(--surface-2)] p-[11px_13px]",children:[(0,V.jsx)("div",{className:`${K_} mb-[7px]`,children:"Close reason — optional"}),(0,V.jsx)(er.p,{ref:L,value:z,onChange:e=>R(e.target.value),onKeyDown:e=>{"Escape"===e.key&&$(),Di(e)&&B()},rows:3,placeholder:"Why is this done? A commit, a PR link, or a one-liner. Markdown and bead IDs render.",className:"bg-[var(--surface)]"}),(0,V.jsxs)("div",{className:"mt-[9px] flex flex-wrap items-center gap-2",children:[(0,V.jsx)(ub.f,{size:"sm",icon:"check",disabled:m||v.isPending,onClick:B,children:z.trim()?"Close with reason":"Close without a reason"}),(0,V.jsx)(er.K,{variant:"outline",size:"sm",disabled:m||v.isPending,onClick:$,children:"Cancel"}),(0,V.jsx)("span",{className:"text-meta text-[var(--text-3)]",children:"bd can’t attach a reason later — this is the only chance to record one."})]})]}),(0,V.jsxs)(KM,{children:[(0,V.jsxs)("div",{className:`${K_} mb-[6px] flex items-center gap-2`,children:[(0,V.jsx)("span",{children:"Description"}),eo.total>0&&(0,V.jsxs)(pn,{tone:"strong",className:"font-normal normal-case tracking-normal",children:[eo.done,"/",eo.total," done"]}),F&&!m&&!y&&!W&&(0,V.jsx)("span",{className:"font-normal normal-case tracking-normal text-[var(--text-3)]",children:"· drop or paste images"}),F&&!m&&(0,V.jsx)(er.K,{variant:"secondary",size:"sm",onClick:()=>q(e=>!e),className:"ml-auto h-6 px-2 text-meta font-normal normal-case tracking-normal",children:W?"Write":"Preview"})]}),F&&!m?(0,V.jsxs)(V.Fragment,{children:[W?(0,V.jsx)(B0,{text:J.trim()?J:"_Nothing to preview yet._",projectId:f,className:"rounded-[10px] border border-border bg-[var(--surface-2)] p-[12px_13px] text-body leading-[1.55] text-[var(--text-2)]"}):(0,V.jsxs)("div",{className:"relative",onDrop:es.onDrop,onDragOver:es.onDragOver,onDragLeave:es.onDragLeave,children:[(0,V.jsx)(Kw,{textareaRef:ea,value:J,onChange:ee}),(0,V.jsx)(er.p,{ref:ea,value:J,onChange:e=>ee(e.target.value),onPaste:es.onPaste,onKeyDown:e=>{if(Di(e)){e.preventDefault(),ep();return}if(e.metaKey||e.ctrlKey){let t="b"===e.key?Ky:"i"===e.key?Kb:"k"===e.key?Kg:null;t&&(e.preventDefault(),Kv(ea.current,J,ee,t))}},rows:6,placeholder:"Describe this bead…",className:`rounded-[10px] p-[12px_13px] leading-[1.55] ${es.dragOver?"border-[var(--brand)] ring-1 ring-[var(--brand)]":""}`}),es.uploading&&(0,V.jsxs)("span",{className:"absolute right-2 top-2 inline-flex items-center gap-1 rounded-md bg-[var(--surface)] px-2 py-0.5 text-meta text-[var(--text-3)]",children:[(0,V.jsx)(en.W,{name:"image",size:12})," Uploading…"]})]}),(0,V.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[!y&&!W&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("input",{ref:el,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:es.pickFiles}),(0,V.jsxs)(er.K,{size:"sm",onClick:()=>el.current?.click(),children:[(0,V.jsx)(en.W,{name:"image",size:14})," Attach image"]})]}),(0,V.jsx)("span",{className:"flex-1"}),(0,V.jsx)(er.K,{size:"sm",onClick:ef,children:"Cancel"}),(0,V.jsx)(ub.f,{size:"sm",icon:"check",onClick:ep,disabled:!Z.trim()||b.isPending,children:"Save"})]})]}):e.description?(0,V.jsx)(B0,{text:e.description,projectId:f,onToggleTask:m?void 0:t=>{var n;let r;return b.mutate({id:e.id,patch:{description:(n=e.description??"",r=0,n.replace(lD,(e,n,i)=>r++!==t?e:`${n}[${"x"===i.toLowerCase()?" ":"x"}]`))}})},className:KS}):(0,V.jsx)("div",{className:"rounded-[10px] border border-border bg-[var(--surface-2)] p-[12px_13px] text-body leading-[1.55] text-[var(--text-3)]",children:"No description."}),!F&&!m&&(0,V.jsx)(Kk,{bead:e})]}),eA.length>0&&(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"link",label:"Links & attachments",count:eA.length}),(0,V.jsx)(B1,{links:eA})]}),(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"link",label:"Dependencies",count:eS.length}),(0,V.jsxs)("div",{className:"flex flex-col gap-[7px]",children:[eS.map(e=>{let t=e.activeBlocking?"#ef4444":"var(--text-2)";return(0,V.jsxs)("div",{className:"flex items-center gap-[9px] rounded-[9px] border border-border bg-[var(--surface)] p-[9px_11px]",children:[(0,V.jsxs)("button",{type:"button",disabled:!e.target,title:e.target?`Open ${e.target.id}`:void 0,onClick:()=>p(e.targetId),className:"flex min-w-0 flex-1 items-center gap-[9px] text-left disabled:cursor-default max-md:flex-wrap max-md:gap-y-1",children:[(0,V.jsx)("span",{className:"flex-shrink-0 rounded-[5px] px-[7px] py-[2px] font-mono text-meta font-semibold",style:{color:t,background:e.activeBlocking?"#ef444418":"var(--surface-2)",border:`1px solid ${e.activeBlocking?"#ef444433":"var(--border)"}`},children:e.label}),(0,V.jsx)("span",{className:"min-w-0 truncate font-mono text-meta text-[var(--text-3)] md:flex-shrink-0",children:e.targetId}),(0,V.jsx)("span",{className:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-label max-md:order-last max-md:basis-full",children:e.target?.title??"(unknown)"}),(0,V.jsx)("span",{className:"h-[7px] w-[7px] flex-shrink-0 rounded-full max-md:ml-auto",style:{background:lL(e.target?.status??"open")},title:lB(e.target?.status??"open")})]}),(0,V.jsx)(er._,{variant:"ghost",size:"sm",danger:!0,label:"remove",title:"remove",disabled:m,onClick:()=>w.mutate({id:e.removeIssueId,dependsOnId:e.removeDependsOnId}),children:(0,V.jsx)(en.W,{name:"x",size:12})})]},e.key)}),0===eS.length&&!O&&(0,V.jsx)("div",{className:"px-[2px] py-1 text-label text-[var(--text-3)]",children:"No dependency relationships."}),O?(0,V.jsx)(H9,{bead:e,onDone:()=>N(!1)}):(0,V.jsx)(er.K,{variant:"dashed",icon:"plus",className:"justify-start",disabled:m,onClick:()=>N(!0),children:"Add dependency"}),!m&&!T&&"closed"!==e.status&&(C?(0,V.jsxs)("div",{className:"flex items-center gap-[7px] rounded-[9px] border border-border bg-[var(--surface)] p-[9px_11px]",children:[(0,V.jsx)(er.C,{size:"sm",autoFocus:!0,value:M,onChange:e=>P(e.target.value),onKeyDown:t=>{"Enter"!==t.key||S.isPending||(S.mutate({id:e.id,reason:M.trim()||void 0}),A(!1),P("")),"Escape"===t.key&&A(!1)},placeholder:"Reason (optional) — e.g. needs design sign-off",className:"flex-1"}),(0,V.jsx)(ub.f,{size:"sm",disabled:S.isPending,onClick:()=>{S.mutate({id:e.id,reason:M.trim()||void 0}),A(!1),P("")},children:"Create gate"})]}):(0,V.jsx)(er.K,{variant:"dashed",icon:"gate",className:"justify-start",onClick:()=>A(!0),title:"Block this bead on a human approval gate",children:"Require approval"}))]})]}),(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"target",label:"Subtasks",count:ew.length}),ew.length>0&&(0,V.jsxs)("div",{className:"mb-[9px] flex items-center gap-[9px]",children:[(0,V.jsx)("div",{className:"h-[6px] flex-1 overflow-hidden rounded-full bg-[var(--surface-3)]",children:(0,V.jsx)("div",{className:"h-full rounded-full transition-[width]",style:{width:`${ek.pct}%`,background:100===ek.pct?"#16a34a":"var(--brand)"}})}),(0,V.jsxs)("span",{className:"flex-shrink-0 font-mono text-meta text-[var(--text-3)]",children:[ek.closed,"/",ek.total," · ",ek.pct,"%"]})]}),(0,V.jsxs)("div",{className:"flex flex-col gap-[7px]",children:[ew.map(e=>(0,V.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>p(e.id),onKeyDown:t=>{t.target===t.currentTarget&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),p(e.id))},className:"flex cursor-pointer items-center gap-[9px] rounded-[9px] border border-border bg-[var(--surface)] p-[9px_11px] hover:border-[var(--border-strong)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)]",children:[(0,V.jsx)("span",{className:"h-[7px] w-[7px] flex-shrink-0 rounded-full",style:{background:lL(e.status)},title:lB(e.status)}),(0,V.jsx)("span",{className:"flex-shrink-0 font-mono text-meta text-[var(--text-3)]",children:e.id}),(0,V.jsx)(en.W,{name:(0,en.F)(e.issue_type),size:14,className:"flex-shrink-0",style:{color:lK(e.issue_type)}}),(0,V.jsx)("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-label",children:e.title}),(0,V.jsx)(pl,{p:e.priority}),(0,V.jsx)(ps,{origin:fU(e,u),title:fH(e.created_by,fU(e,u))}),(0,V.jsx)("span",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.assignee??"")},title:e.assignee||"Unassigned",children:lV(e.assignee??"")}),(0,V.jsx)(er._,{variant:"ghost",size:"sm",danger:!0,label:`Detach ${e.id}`,title:`Detach ${e.id} from this bead`,disabled:m,onClick:t=>{t.stopPropagation(),b.mutate({id:e.id,patch:{parent:""}})},children:(0,V.jsx)(en.W,{name:"x",size:12})})]},e.id)),0===ew.length&&(0,V.jsx)("div",{className:"px-[2px] py-1 text-label text-[var(--text-3)]",children:"No subtasks yet."}),!m&&(0,V.jsx)(er.K,{variant:"dashed",icon:"plus",className:"justify-start",onClick:()=>h({parent:e.id}),children:"Add subtask"})]})]}),ej&&(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"pencil",label:"Design"}),(0,V.jsx)(B0,{text:ej,projectId:f,className:KS})]}),eO&&(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"target",label:"Acceptance criteria"}),(0,V.jsx)(B0,{text:eO,projectId:f,className:KS})]}),eE&&(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"list",label:"Notes"}),(0,V.jsx)(B0,{text:eE,projectId:f,className:KS})]}),eN&&(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"check",label:"Close reason"}),(0,V.jsx)(B0,{text:eN,projectId:f,className:KS})]}),(0,V.jsxs)(KM,{children:[(0,V.jsx)(KT,{icon:"comment",label:"Comments",count:eC.length}),(0,V.jsxs)("div",{className:"mb-3 flex flex-col gap-3",children:[eC.map((e,t)=>{let n=fF(e.author,u);return(0,V.jsxs)("div",{className:"flex gap-[10px]",children:[(0,V.jsx)("span",{className:"flex h-[26px] w-[26px] flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:lZ(e.author)},children:lV(e.author)}),(0,V.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,V.jsxs)("div",{className:"mb-[3px] flex items-center gap-[7px]",children:[(0,V.jsx)("span",{className:"text-label font-semibold",children:e.author}),(0,V.jsx)(ps,{origin:n,title:"human"===n?"Human":"Agent"}),(0,V.jsx)("span",{title:l3(e.created_at),className:"text-meta text-[var(--text-3)]",children:l1(e.created_at)})]}),(0,V.jsx)(B0,{text:e.text,projectId:f,className:"text-body leading-[1.5] text-[var(--text-2)] [text-wrap:pretty]"})]})]},e.id??t)}),0===eC.length&&(0,V.jsx)("div",{className:"text-label text-[var(--text-3)]",children:"No comments yet."})]}),(0,V.jsxs)("div",{className:"flex items-start gap-[9px]",children:[(0,V.jsx)("span",{className:"flex h-[26px] w-[26px] flex-shrink-0 items-center justify-center rounded-full text-meta font-semibold text-white",style:{background:"var(--brand-solid)"},children:lV(g)}),(0,V.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,V.jsx)(er.p,{value:E,onChange:e=>j(e.target.value),onKeyDown:e=>{Di(e)&&(e.preventDefault(),eh&&eb())},placeholder:`Comment as ${g}…`,disabled:m,rows:2,className:"rounded-[10px]"}),(0,V.jsx)("div",{className:"flex justify-end",children:(0,V.jsx)(ub.f,{size:"sm",disabled:!eh,onClick:eb,children:"Comment"})})]})]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("div",{className:`${K_} mb-[9px]`,children:"Activity"}),(0,V.jsx)("div",{className:"flex flex-col gap-2",children:eM.map((e,t)=>(0,V.jsxs)("div",{className:"flex items-center gap-[9px] text-label text-[var(--text-2)]",children:[(0,V.jsx)("span",{className:"h-[6px] w-[6px] flex-shrink-0 rounded-full bg-[var(--text-3)]"}),(0,V.jsx)("span",{className:"flex-1",children:e.label}),(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:e.time})]},t))})]})]})]})}function KM({children:e}){return(0,V.jsx)("div",{className:"mb-[18px]",children:e})}function KP({bead:e,suggestions:t,onChange:n}){let{readOnly:r}=eu(),[i,o]=G.useState(""),a=`labels-${e.id}`,l=e.labels??[],s=l.includes(KE),c=l.filter(e=>e!==KE),u=e=>!r&&n(s?[...e,KE]:e),d=()=>{if(r)return;let e=i.trim().replace(/,+$/,"").trim();o(""),!e||e===KE||c.includes(e)||u([...c,e])};return(0,V.jsxs)("fieldset",{disabled:r,className:"mb-4 flex min-w-0 flex-col gap-[5px]",children:[(0,V.jsx)("span",{className:K_,children:"Labels"}),(0,V.jsxs)("div",{className:"flex flex-wrap items-center gap-[6px] rounded-[9px] border border-border bg-[var(--surface-2)] p-[7px_9px]",children:[c.map(e=>(0,V.jsxs)("span",{className:Kj,children:[e,(0,V.jsx)(er.W,{onClick:()=>u(c.filter(t=>t!==e)),title:`Remove label “${e}”`,"aria-label":`Remove label ${e}`,className:"hover:text-[#ef4444]",children:(0,V.jsx)(en.W,{name:"x",size:11})})]},e)),s&&(0,V.jsxs)("span",{className:`${Kj} opacity-70`,title:"This bead is archived. Use the archive button in the header to change that.",children:[(0,V.jsx)(en.W,{name:"archive",size:10}),KE]}),(0,V.jsx)("input",{value:i,onChange:e=>{if(e.target.value.includes(",")){let[t,...n]=e.target.value.split(","),r=t.trim();r&&r!==KE&&!c.includes(r)&&u([...c,r]),o(n.join(",").trim());return}o(e.target.value)},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),d()):"Escape"===e.key?(e.preventDefault(),o("")):"Backspace"===e.key&&!i&&c.length&&u(c.slice(0,-1))},onBlur:d,list:a,placeholder:c.length?"Add label…":"Add a label…","aria-label":"Add label",className:"min-w-[110px] flex-1 border-none bg-transparent text-label text-[var(--text)] outline-none placeholder:text-[var(--text-3)]"}),(0,V.jsx)("datalist",{id:a,children:t.filter(e=>!c.includes(e)).map(e=>(0,V.jsx)("option",{value:e},e))})]})]})}function KT({icon:e,label:t,count:n}){return(0,V.jsxs)("div",{className:"mb-[9px] flex items-center gap-2",children:[(0,V.jsx)(en.W,{name:e,size:15,className:"text-[var(--text-2)]"}),(0,V.jsx)("span",{className:"text-body font-semibold",children:t}),void 0!==n&&(0,V.jsx)("span",{className:"font-mono text-meta text-[var(--text-3)]",children:n})]})}function KI({children:e,title:t,onClick:n,danger:r,className:i=""}){return(0,V.jsx)(er._,{label:t,title:t,danger:r,onClick:n,className:i,children:e})}let KD="text-label font-medium text-[var(--text-2)]";function Kz({open:e,parent:t,type:n,onOpenChange:r}){let{width:i,startResize:o}=uD({storageKey:"beadscope.width.create",defaultWidth:810,min:480,max:1200,deltaFactor:2}),a=G.useRef(!1),l=eO();return(0,V.jsx)(ug.N,{open:e,onOpenChange:(e,t)=>{if(!e&&"outside-press"===t.reason&&a.current){t.cancel(),(0,X.c)("Your new bead isn't saved yet",{id:"create-unsaved",description:"Press Esc or Cancel to discard it."});return}r(e)},children:(0,V.jsxs)(ug.d,{showCloseButton:!1,style:{width:l?"100vw":i,maxWidth:l?"100vw":"96vw"},className:"flex max-h-[92vh] flex-col gap-0 overflow-hidden rounded-2xl border border-border bg-[var(--surface)] p-0 shadow-[var(--shadow-lg)] max-md:h-dvh max-md:max-h-dvh max-md:rounded-none",children:[(0,V.jsx)("div",{onPointerDown:o,title:"Drag to resize",className:"absolute right-0 top-0 z-20 h-full w-1.5 cursor-ew-resize hover:bg-[var(--brand)]/40 max-md:hidden"}),e&&(0,V.jsx)(KR,{parent:t,type:n,dirtyRef:a,onClose:()=>r(!1)})]})})}function KR({parent:e,type:t,dirtyRef:n,onClose:r}){var i;let{beads:o,meta:a,projectId:l}=eu(),s=function(){let{projectId:e}=eu(),t=(0,et.d)();return(0,Q.f)(eg(t=>ei.k.create(e,t),(e,t)=>`Created ${t.id} \xb7 bd create`,t,ed(e)))}(),c=(0,et.d)(),u=a?.humanActor??"you",d=a?.kind==="demo",[f,p]=G.useState({type:t??"task",priority:2,title:"",description:"",assignee:"",parent:e,labels:"",backlog:!1}),h=`parents-${G.useId()}`,[m,g]=G.useState(()=>{if(!e)return"";let t=o.find(t=>t.id===e);return t?`${t.id} \xb7 ${t.title}`:e}),y=t?`New ${f.parent?"child ":""}${lW(t).toLowerCase()}`:f.parent?"New child bead":"New bead",b=[f.title,f.description,f.assignee,f.labels].some(e=>""!==e.trim());G.useEffect(()=>(n.current=b,()=>{n.current=!1}),[n,b]);let v=(e,t)=>p(n=>({...n,[e]:t})),x=G.useRef(null),w=G.useRef(null),k=G.useId(),_=G.useMemo(()=>"draft-"+k.replace(/[^a-zA-Z0-9]/g,""),[k]),S=e=>{e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},E=Kp({projectId:l,beadId:_,disabled:d,disabledMessage:"Attachments aren't available for the Demo project.",textareaRef:x,value:f.description,onChange:e=>v("description",e)}),j=G.useMemo(()=>o.filter(e=>"closed"!==e.status).sort((e,t)=>Number("epic"!==e.issue_type)-Number("epic"!==t.issue_type)||e.priority-t.priority||e.id.localeCompare(t.id)),[o]),O=Fz();function N(){f.title.trim()&&!s.isPending&&s.mutate({title:f.title.trim(),issue_type:f.type,priority:f.priority,description:f.description,assignee:f.assignee,labels:f.labels.split(",").map(e=>e.trim()).filter(Boolean),parent:f.parent,backlog:f.backlog},{onSuccess:async e=>{if(f.description.includes(`attachment://${_}/`))try{await ei.k.attachments.finalize(l,_,e.id);let t=f.description.replaceAll(`attachment://${_}/`,`attachment://${e.id}/`);await ei.k.update(l,e.id,{description:t}),c.invalidateQueries({queryKey:ed(l)})}catch(e){X.c.error(e.message)}r()}})}let C=G.useRef(N);return G.useEffect(()=>{C.current=N}),G.useEffect(()=>{let e=e=>{Di(e)&&(e.preventDefault(),C.current())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{className:"flex shrink-0 items-center gap-[10px] border-b border-border p-[17px_20px]",children:[(0,V.jsx)("div",{className:"flex h-[30px] w-[30px] items-center justify-center rounded-[9px] bg-[var(--brand-weak)] text-[var(--brand)]",children:(0,V.jsx)(en.W,{name:"plus",size:16})}),(0,V.jsxs)("div",{className:"flex-1",children:[(0,V.jsx)(ug.F,{className:"text-section font-semibold",children:y}),(0,V.jsx)(ug.C,{className:"font-mono text-meta text-[var(--text-3)]",children:"bd create … --json"})]}),(0,V.jsx)(er._,{label:"Close",onClick:r,children:(0,V.jsx)(en.W,{name:"x",size:14})})]}),(0,V.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-[14px] overflow-y-auto p-5",children:[(0,V.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:KD,children:"Type"}),(0,V.jsx)(er.$,{value:f.type,onChange:e=>v("type",e.target.value),children:l_.map(e=>(0,V.jsx)("option",{value:e,children:lW(e)},e))})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:KD,children:"Priority"}),(0,V.jsx)(er.$,{value:String(f.priority),onChange:e=>v("priority",Number(e.target.value)),children:[0,1,2,3,4].map(e=>(0,V.jsxs)("option",{value:String(e),children:[e," · ",["Critical","High","Medium","Low","Backlog"][e]]},e))})]})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:KD,children:"Title"}),(0,V.jsx)(er.p,{autoFocus:!0,ref:S,rows:1,className:"min-h-[38px] resize-none overflow-hidden leading-[1.4]",value:f.title,onChange:e=>{v("title",e.target.value),S(e.currentTarget)},placeholder:"What needs doing?",onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.metaKey||e.ctrlKey||(e.preventDefault(),N())}})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsxs)("span",{className:KD,children:["Description"," ",!d&&(0,V.jsx)("span",{className:"font-normal text-[var(--text-3)]",children:"· drop or paste images"})]}),(0,V.jsxs)("div",{className:"relative",onDrop:E.onDrop,onDragOver:E.onDragOver,onDragLeave:E.onDragLeave,children:[(0,V.jsx)(er.p,{ref:x,className:E.dragOver?"border-[var(--brand)] ring-1 ring-[var(--brand)]":"",rows:3,value:f.description,onChange:e=>v("description",e.target.value),onPaste:E.onPaste,placeholder:d?"Optional details, acceptance criteria…":"Optional details, acceptance criteria… drag and drop screenshots and images here too!"}),E.uploading&&(0,V.jsxs)("span",{className:"absolute right-2 top-2 inline-flex items-center gap-1 rounded-md bg-[var(--surface)] px-2 py-0.5 text-meta text-[var(--text-3)]",children:[(0,V.jsx)(en.W,{name:"image",size:12})," Uploading…"]})]}),!d&&(0,V.jsxs)("div",{children:[(0,V.jsx)("input",{ref:w,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:E.pickFiles}),(0,V.jsxs)(er.K,{size:"sm",onClick:()=>w.current?.click(),children:[(0,V.jsx)(en.W,{name:"image",size:14})," Attach image"]})]}),(i=f.description,RegExp("!\\[([^\\]]*)\\]\\((attachment:\\/\\/[^)\\s]+|https?:\\/\\/[^)\\s]+)\\)").test(i)&&(0,V.jsx)(B0,{text:f.description,projectId:l,className:"mt-1 rounded-[8px] border border-border bg-[var(--surface-2)] p-2 text-label text-[var(--text-2)]"}))]}),(0,V.jsxs)("div",{className:"grid grid-cols-2 gap-3 max-md:grid-cols-1",children:[(0,V.jsxs)("div",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:KD,children:"Assignee"}),(0,V.jsx)(FF,{value:f.assignee,onChange:e=>v("assignee",e),names:O})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsx)("span",{className:KD,children:"Parent"}),(0,V.jsx)(er.C,{list:h,value:m,onChange:e=>{let t=e.target.value;g(t);let n=t.split(" · ")[0].trim();v("parent",j.some(e=>e.id===n)?n:"")},placeholder:"No parent — type to search…",className:"cursor-text"}),(0,V.jsx)("datalist",{id:h,children:j.map(e=>(0,V.jsx)("option",{value:`${e.id} \xb7 ${e.title}`,children:lW(e.issue_type)},e.id))})]})]}),(0,V.jsxs)("label",{className:"flex flex-col gap-[6px]",children:[(0,V.jsxs)("span",{className:KD,children:["Labels ",(0,V.jsx)("span",{className:"font-normal text-[var(--text-3)]",children:"· comma separated"})]}),(0,V.jsx)(er.C,{mono:!0,value:f.labels,onChange:e=>v("labels",e.target.value),placeholder:"ui, dnd, m3"})]}),(0,V.jsxs)("label",{className:"flex cursor-pointer select-none items-center gap-[9px] max-md:min-h-11",children:[(0,V.jsx)(er.h,{checked:f.backlog,onChange:e=>v("backlog",e.target.checked)}),(0,V.jsxs)("span",{className:"text-body text-[var(--text-2)]",children:["Start in Backlog (",(0,V.jsx)("span",{className:"font-mono",children:"deferred"}),") instead of Ready"]})]})]}),(0,V.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-[10px] border-t border-border p-[15px_20px] max-md:p-[12px_16px]",children:[(0,V.jsxs)("div",{className:"flex flex-1 items-center gap-[7px] text-meta text-[var(--text-3)] max-md:order-first max-md:basis-full",children:[(0,V.jsx)(en.W,{name:"user",size:13,className:"text-[var(--text-2)]"}),(0,V.jsxs)("span",{children:["Stamped ",(0,V.jsxs)("span",{className:"font-mono text-[var(--text-2)]",children:["created_by=",u]})]})]}),(0,V.jsx)(er.K,{size:"lg",className:"max-md:flex-1",onClick:r,children:"Cancel"}),(0,V.jsx)(ub.f,{icon:"check",onClick:N,disabled:!f.title.trim()||s.isPending,className:"max-md:flex-[2]",children:"Create bead"})]})]})}let KL={create:Dl("Global","Create an issue"),toggleTheme:Dl("Global","Cycle theme: System / Light / Dark"),switchProject:Dl("Repositories","Choose a repository"),openDetails:Dl("Issues","Open selected issue","O"),setStatus:Dl("Issues","Set selected issue status"),setPriority:Dl("Issues","Set selected issue priority"),copyId:Dl("Issues","Copy selected issue ID")},K$=["Critical","High","Medium","Low","Backlog"],KB="beadscope.palette.recentBeads";function KF(){try{let e=JSON.parse(localStorage.getItem(KB)||"[]");return Array.isArray(e)?e.slice(0,6):[]}catch{return[]}}function KU({open:e,onOpenChangeAction:t,onViewAction:n,initialPage:r="root",initialBeadId:i=null}){return(0,V.jsx)(ug.N,{open:e,onOpenChange:t,children:(0,V.jsxs)(ug.d,{showCloseButton:!1,className:"flex max-h-(--palette-max-height) flex-col gap-0 overflow-hidden rounded-2xl border border-border bg-[var(--surface)] p-0 shadow-[var(--shadow-lg)] sm:max-w-[640px]",style:{width:640,maxWidth:"94vw"},children:[(0,V.jsx)(ug.F,{className:"sr-only",children:"Command palette"}),(0,V.jsx)(KH,{onView:n,close:()=>t(!1),initialPage:r,initialBeadId:i})]})})}function KH({onView:e,close:t,initialPage:n,initialBeadId:r}){let{beads:i,index:o,meta:a,openDetail:l,openCreate:s,projectId:c,readOnly:u}=eu(),d=(0,J.useRouter)(),f=eO(),{mode:p,choice:h,setTheme:m,toggle:g}=(0,eD.i)(),y=(0,Fo.a)(h,p),b=em(),v=ey(),{data:x}=(0,uh.f)(),w=x?.projects??[],[k,_]=G.useState(u&&("status"===n||"priority"===n)?r?"bead":"root":n),[S,E]=G.useState(""),[j,O]=G.useState(r),N=j?o.get(j):void 0,C=e=>{e(),t()},A=e=>{u||C(e)},M=e=>{O(e),E(""),_("bead")},P=()=>{E(""),_("status"===k||"priority"===k?"bead":"root")},T=G.useMemo(()=>KF().map(e=>o.get(e)).filter(Boolean),[o]);return(0,V.jsxs)(HG,{label:"Command palette",className:"flex min-h-0 w-full max-h-[min(680px,var(--palette-max-height))] flex-col",onKeyDown:e=>{"Backspace"===e.key&&""===S&&"root"!==k&&(e.preventDefault(),P())},children:[(0,V.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:["root"!==k?(0,V.jsx)(er._,{variant:"ghost",label:"Back",title:"Back",onClick:P,children:(0,V.jsx)(en.W,{name:"chevron",size:16,className:"rotate-90"})}):(0,V.jsx)(en.W,{name:"search",size:16,className:"ml-1 text-[var(--text-3)]"}),(0,V.jsx)(HG.Input,{autoFocus:!0,value:S,onValueChange:E,placeholder:"bead"===k?`Action for ${N?.id??""}…`:"status"===k?"Set status…":"priority"===k?"Set priority…":"projects"===k?"Switch project…":"theme"===k?"Pick a theme…":"Search beads or run a command…",className:"h-12 flex-1 bg-transparent text-section text-[var(--text)] outline-none placeholder:text-[var(--text-3)]"})]}),(0,V.jsxs)(HG.List,{className:"min-h-0 flex-1 overflow-y-auto p-2 pb-4",children:[(0,V.jsx)(HG.Empty,{className:"px-3 py-6 text-center text-body text-[var(--text-3)]",children:"No results."}),"root"===k&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(HG.Group,{heading:"Actions",children:[!u&&(0,V.jsx)(KK,{icon:"plus",value:"create bead new",shortcut:KL.create,onSelect:()=>C(()=>s()),children:"Create bead…"}),(0,V.jsx)(KK,{icon:y.icon,value:"toggle theme cycle system dark light",shortcut:KL.toggleTheme,onSelect:()=>C(()=>g()),children:y.title}),(0,V.jsx)(KK,{icon:"settings",value:"change theme palette dracula nord",onSelect:()=>{E(""),_("theme")},children:"Change theme…"}),(0,V.jsx)(KK,{icon:"logo",value:"switch project",shortcut:KL.switchProject,onSelect:()=>{E(""),_("projects")},children:"Switch project…"})]}),(0,V.jsx)(HG.Group,{heading:"Go to",children:e_(!!a?.gamification,f).map(t=>(0,V.jsx)(KK,{icon:t.icon,value:`go ${t.label}`,shortcut:Dl("Views",t.label),onSelect:()=>C(()=>e(t.key)),children:t.label},t.key))}),T.length>0&&""===S&&(0,V.jsx)(HG.Group,{heading:"Recent beads",children:T.map(e=>(0,V.jsx)(KW,{bead:e,valuePrefix:"recent ",onSelect:()=>M(e.id)},`r-${e.id}`))}),(0,V.jsx)(HG.Group,{heading:"Beads",children:i.slice(0,300).map(e=>(0,V.jsx)(KW,{bead:e,onSelect:()=>M(e.id)},e.id))})]}),"bead"===k&&N&&(0,V.jsxs)(HG.Group,{heading:`${N.id} \xb7 ${N.title.slice(0,52)}`,children:[(0,V.jsx)(KK,{icon:"search",value:"open details view",shortcut:KL.openDetails,onSelect:()=>{var e;let t;t=[e=N.id,...KF().filter(t=>t!==e)].slice(0,6),localStorage.setItem(KB,JSON.stringify(t)),C(()=>l(N.id))},children:"Open details"}),(0,V.jsx)(KK,{icon:"link",value:"copy id",shortcut:KL.copyId,onSelect:()=>C(()=>f8(N.id)),children:"Copy ID"}),!u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(KK,{icon:"user",value:"claim in progress",onSelect:()=>A(()=>b.mutate({id:N.id,status:"in_progress"})),children:"Claim · set In Progress"}),(0,V.jsx)(KK,{icon:"check",value:"close done",onSelect:()=>A(()=>b.mutate({id:N.id,status:"closed"})),children:"Close"}),(0,V.jsx)(KK,{icon:"chevron",value:"set status",shortcut:KL.setStatus,onSelect:()=>{E(""),_("status")},children:"Set status…"}),(0,V.jsx)(KK,{icon:"chevron",value:"set priority",shortcut:KL.setPriority,onSelect:()=>{E(""),_("priority")},children:"Set priority…"})]})]}),!u&&"status"===k&&N&&(0,V.jsx)(HG.Group,{heading:"Set status",children:lk.map(e=>(0,V.jsx)(KK,{dotColor:lL(e),value:`status ${lB(e)}`,onSelect:()=>A(()=>b.mutate({id:N.id,status:e})),children:lB(e)},e))}),!u&&"priority"===k&&N&&(0,V.jsx)(HG.Group,{heading:"Set priority",children:[0,1,2,3,4].map(e=>(0,V.jsxs)(KK,{value:`priority ${e} ${K$[e]}`,onSelect:()=>A(()=>v.mutate({id:N.id,patch:{priority:e}})),children:["P",e," · ",K$[e]]},e))}),"projects"===k&&(0,V.jsxs)(HG.Group,{heading:"Switch project",children:[(0,V.jsxs)(KK,{icon:"logo",value:"project demo",onSelect:()=>C(()=>d.push("/p/demo")),children:["Demo","demo"===c?" · current":""]}),w.filter(e=>"demo"!==e.id).map(e=>(0,V.jsxs)(KK,{icon:"logo",value:`project ${e.name} ${e.id}`,onSelect:()=>C(()=>d.push(`/p/${e.id}`)),children:[e.name,e.id===c?" · current":""]},e.id))]}),"theme"===k&&(0,V.jsx)(HG.Group,{heading:"Theme",children:[Fo.y,...Fo.z].map(e=>(0,V.jsx)(KK,{dotColor:e.swatch[2],value:`theme ${e.name} ${e.id}`,onSelect:()=>C(()=>m(e.id)),children:e.name},e.id))})]})]})}function KK({icon:e,dotColor:t,value:n,shortcut:r,children:i,onSelect:o}){return(0,V.jsxs)(HG.Item,{value:n,onSelect:o,className:"flex cursor-pointer items-center gap-[10px] rounded-[8px] px-3 py-[7px] max-md:py-3 text-body text-[var(--text)] data-[selected=true]:bg-[var(--surface-2)]",children:[t?(0,V.jsx)("span",{className:"h-[8px] w-[8px] flex-shrink-0 rounded-full",style:{background:t}}):e?(0,V.jsx)(en.W,{name:e,size:15,className:"flex-shrink-0 text-[var(--text-2)]"}):(0,V.jsx)("span",{className:"w-[15px] flex-shrink-0"}),(0,V.jsx)("span",{className:"flex-1 truncate",children:i}),r&&(0,V.jsx)("span",{className:"-my-1",children:(0,V.jsx)(FS,{keys:r.keys,sequence:r.sequence})})]})}function KW({bead:e,onSelect:t,valuePrefix:n=""}){return(0,V.jsxs)(HG.Item,{value:`${n}${e.id} ${e.title}`,onSelect:t,className:"flex cursor-pointer items-center gap-[10px] rounded-[8px] px-3 py-[7px] max-md:py-3 text-body data-[selected=true]:bg-[var(--surface-2)]",children:[(0,V.jsx)("span",{className:"h-[8px] w-[8px] flex-shrink-0 rounded-full",style:{background:lL(e.status)},title:lB(e.status)}),(0,V.jsx)("span",{className:"flex-shrink-0 font-mono text-meta text-[var(--text-3)]",children:e.id}),(0,V.jsx)("span",{className:"flex-1 truncate text-[var(--text)]",children:e.title}),(0,V.jsx)("span",{className:"flex-shrink-0 text-meta uppercase tracking-[.03em] text-[var(--text-3)]",children:lW(e.issue_type)})]})}let Kq="[data-keyboard-bead-id]";function KZ(e=!1){return Array.from(document.querySelectorAll('[data-slot="dialog-content"], [data-slot="sheet-content"], [data-slot="dropdown-menu-content"], [data-slot="select-content"]')).some(t=>!(e&&t.hasAttribute("data-bead-drawer")))}function KV(){return Array.from(document.querySelectorAll(Kq)).filter(e=>{let t=e.getBoundingClientRect(),n=getComputedStyle(e);return t.width>0&&t.height>0&&"hidden"!==n.visibility&&"none"!==n.display})}function KG(e){return e.dataset.keyboardBeadId??null}function KX(e,t){let n=KG(e);n&&(t(n),e.focus({preventScroll:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}function KY({projectId:e,readOnly:t,selectedId:n,openId:r,selectIdAction:i,setViewAction:o,openDetailAction:a,openCreateAction:l,closeOverlaysAction:s,toggleThemeAction:c}){let[u,d]=G.useState(!1),f=G.useRef(0),[p,h]=G.useState({open:!1,page:"root",beadId:null,nonce:0}),m=G.useCallback((e="root",n)=>{t&&("status"===e||"priority"===e)||h(t=>({open:"root"!==e||!!n||!t.open,page:e,beadId:n??null,nonce:f.current+=1}))},[t]),g=G.useCallback(()=>{h(e=>({...e,open:!1})),d(!1),s()},[s]);return!function(e){let t=(0,J.useRouter)(),{data:n}=(0,uh.f)(),r=G.useMemo(()=>n?.projects??[],[n]),i=G.useRef(0),o=G.useCallback(n=>{if(0===r.length)return;let i=r.findIndex(t=>t.id===e.projectId),o=-1===i?0:(i+n+r.length)%r.length;t.push(`/p/${r[o].id}`)},[e.projectId,r,t]);G.useEffect(()=>{let t=t=>{var n,r;if(t.defaultPrevented)return;let a=1===t.key.length?t.key.toLowerCase():t.key;if(!t.repeat){if((t.metaKey||t.ctrlKey)&&!t.altKey&&"k"===a){let n=!!document.querySelector("[cmdk-root]");if(KZ()&&!n)return;t.preventDefault(),e.openPalette();return}if("Escape"===a){i.current=0,KZ()||e.closeOverlays();return}if(!((n=t.target)instanceof HTMLElement&&n.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||(r=t.target,r instanceof HTMLElement&&("Enter"===a||" "===a)&&r.closest("button, a, input, textarea, select")&&!r.matches(Kq))||KZ("y"===a))&&!t.metaKey&&!t.ctrlKey&&!t.altKey){if(i.current>Date.now()){let n;if(i.current=0,!KZ()&&((n=Do[a])?(e.selectId(null),e.setView(n),!0):"r"===a?(e.openPalette("projects"),!0):("["===a||"]"===a)&&(o("]"===a?1:-1),!0)))return void t.preventDefault()}if("g"===a){t.preventDefault(),i.current=Date.now()+900;return}((function(e,t){if("?"===e)t.openHelp();else if("/"===e)document.querySelector("input[data-search]")?.focus();else if("n"===e)t.readOnly||t.openCreate();else{if("t"!==e)return!1;t.toggleTheme()}return!0})(a,e)||function(e,t){if("j"===e||"k"===e)!function(e,t,n){let r=KV();if(0===r.length)return;let i=document.activeElement instanceof HTMLElement?r.indexOf(document.activeElement):-1,o=-1!==i?i:r.findIndex(e=>KG(e)===t),a=-1===o?1===e?0:r.length-1:o+e;KX(r[Math.max(0,Math.min(r.length-1,a))],n)}("j"===e?1:-1,t.selectedId,t.selectId);else{if("h"!==e&&"l"!==e)return!1;!function(e,t,n){let r=KV();if(0===r.length)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null,o=(i&&r.includes(i)?i:null)??r.find(e=>KG(e)===t)??r[0],a=o.getBoundingClientRect(),l=a.left+a.width/2,s=a.top+a.height/2,c=r.filter(e=>e!==o).map(e=>{let t=e.getBoundingClientRect(),n=t.left+t.width/2-l;return{element:e,dx:n,score:Math.abs(n)+2*Math.abs(t.top+t.height/2-s)}}).filter(({dx:t})=>1===e?t>8:t<-8).sort((e,t)=>e.score-t.score);c[0]&&KX(c[0].element,n)}("l"===e?1:-1,t.selectedId,t.selectId)}return!0}(a,e)||function(e,t){if(!["Enter","o","e","c","s","p","y"].includes(e))return!1;if(t.readOnly&&["e","c","s","p"].includes(e))return!0;let n="y"===e&&t.openId?t.openId:function(e,t){let n=KV(),r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=(r&&n.includes(r)?r:null)??n.find(t=>KG(t)===e)??n[0];if(!i)return null;let o=KG(i);return o!==e&&KX(i,t),o}(t.selectedId,t.selectId);return!!n&&("y"===e?f8(n):"Enter"===e||"o"===e?t.openDetail(n):"e"===e?t.openDetail(n,"edit"):"c"===e?t.openDetail(n,"close"):t.openPalette("s"===e?"status":"priority",n),!0)}(a,e))&&t.preventDefault()}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,o])}(G.useMemo(()=>({projectId:e,readOnly:t,selectedId:n,openId:r,selectId:i,setView:o,openDetail:a,openCreate:l,openPalette:m,openHelp:()=>d(!0),closeOverlays:g,toggleTheme:c}),[e,t,n,r,i,o,a,l,m,g,c])),G.useEffect(()=>{let e=()=>m();return window.addEventListener(eE,e),()=>window.removeEventListener(eE,e)},[m]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(KU,{open:p.open,onOpenChangeAction:e=>h(t=>({...t,open:e})),onViewAction:o,initialPage:p.page,initialBeadId:p.beadId},`${p.nonce}-${t?"ro":"rw"}`),(0,V.jsx)(FE,{open:u,onOpenChangeAction:d})]})}function KJ({projectId:e}){return!function(e){let{data:t}=ep(e),{beads:n,loading:r,error:i}=eu(),o=t?.items,a=G.useRef(null),l=G.useRef(null);G.useEffect(()=>{if(!o)return;let t=o[0]?.at??"";if(null===a.current){a.current=t;return}let n=a.current;a.current=t;let r=Fc();if(r.enabled)for(let t of o){if(t.at<=n)break;"agent"===t.origin&&(r.finished&&"closed"===t.action?Fu(`🤖 ${t.actor} finished ${t.issueId}`,t.title,e,t.issueId):r.blocked&&t.action.startsWith("marked Blocked")&&Fu(`⛔ ${t.issueId} is blocked`,t.title,e,t.issueId))}},[o,e]),G.useEffect(()=>{if(r||i)return;let t=new Set(n.filter(lP).map(e=>e.id));if(null===l.current){l.current=t;return}let o=l.current;l.current=t;let a=Fc();if(a.enabled&&a.escalation)for(let t of n.filter(lP))o.has(t.id)||Fu(`🙋 Needs you: ${t.id}`,t.title,e,t.id)},[n,i,r,e])}(e),null}let KQ=(0,l6.f)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]),K0=(0,l6.f)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);function K1({openId:e}){let t=(0,J.useSearchParams)();return G.useEffect(()=>{if(!e)return;let t=new URL(window.location.href);t.searchParams.has("bead")||(t.searchParams.set("bead",e),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`))},[e,t]),null}e.s(["AppShell",0,function({projectId:e}){let[t,n]=function(){let{enabled:e}=eT(),{searchParams:t,updateUrl:n}=eI(),r=t.get("view"),i=eO();return["string"==typeof r&&ev.includes(r)&&!(i&&ek(r))?r:e?"focus":"board",G.useCallback(e=>{n(t=>t.set("view",e))},[n])]}(),[r,i]=G.useState(!1),{toggle:o}=(0,eD.i)(),[a,l]=G.useState(()=>{let e=new URLSearchParams(window.location.search).get("bead");return e?[e]:[]}),s=a.length?a[a.length-1]:null,[c,u]=G.useState(null),d=G.useRef(0),[f,p]=G.useState(null),[h,m]=G.useState({open:!1,parent:""}),{data:g,isLoading:y,error:b}=(0,ee.f)({queryKey:ed(e),queryFn:()=>ei.k.list(e),refetchInterval:e=>e.state.data?.meta.pollIntervalMs??5e3}),{live:v}=function(e){let t=(0,et.d)(),[n,r]=G.useState(!1);return G.useEffect(()=>{if("demo"===e)return;let n=new EventSource(`/api/p/${encodeURIComponent(e)}/beads/stream`);return n.addEventListener("open",()=>r(!0)),n.addEventListener("error",()=>r(!1)),n.addEventListener("change",()=>{t.invalidateQueries({queryKey:ed(e)}),t.invalidateQueries({queryKey:ef(e)})}),()=>{r(!1),n.close()}},[e,t]),{live:n}}(e),x=G.useMemo(()=>g?.beads??[],[g]),w=G.useMemo(()=>(function(e){let t=new Map;for(let n of e)t.set(n.id,n);return t})(x),[x]),k=Fh(),_=k.data?.readOnly??!0,S=!y&&!b&&!!g,E=s&&S&&!w.has(s)?null:s,j=G.useRef(null);G.useEffect(()=>{if(S){if(!s||w.has(s)){j.current=null;return}j.current!==s&&(j.current=s,X.c.error(`Bead ${s} not found in this project`))}},[S,s,w]);let O=G.useCallback((e,t="view")=>{u(e),l([e]),p({id:e,action:_?"view":t,nonce:d.current+=1})},[_]);G.useEffect(()=>{let t=t=>{let n=t.detail;n?.projectId===e&&n.beadId&&(t.preventDefault(),O(n.beadId))};return window.addEventListener(Fl,t),()=>window.removeEventListener(Fl,t)},[e,O]);let N=G.useCallback(e=>{a[a.length-1]!==e&&(u(e),l(t=>{if(t[t.length-1]===e)return t;let n=[...t,e];return n.length>25?n.slice(n.length-25):n}),p({id:e,action:"view",nonce:d.current+=1}))},[a]),C=G.useCallback(()=>{l([]),p(null)},[]);G.useEffect(()=>{let e=()=>{let e=new URLSearchParams(window.location.search).get("bead");e!==s&&(l(e?[e]:[]),p(null),u(e))};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[s]),G.useEffect(()=>{let e=new URL(window.location.href);E?e.searchParams.set("bead",E):e.searchParams.delete("bead");let t=`${e.pathname}${e.search}${e.hash}`;t!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,"",t)},[E,s]);let A=G.useCallback(()=>{l(e=>{let t=e.slice(0,-1);for(;t.length&&!w.has(t[t.length-1]);)t.pop();return t}),u(null),p(null)},[w]),M=G.useCallback((e={})=>{_||m({open:!0,parent:e.parent??"",type:e.type})},[_]),[P,T]=G.useState(null),I=G.useRef(0),D=G.useCallback(()=>T(null),[]),z=G.useCallback(e=>{l([]),p(null),n("epics"),T({id:e,nonce:I.current+=1})},[n]),R=G.useCallback(()=>M(),[M]),L=G.useCallback(()=>{l([]),p(null),m(e=>({...e,open:!1}))},[]),$=b?b.message:void 0,B=G.useCallback(e=>{n(e),i(!1)},[n]);return G.useEffect(()=>{let e=window.matchMedia("(min-width: 48rem)"),t=e=>{e.matches&&i(!1)};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,V.jsxs)(ec,{value:{projectId:e,beads:x,index:w,meta:g?.meta,humanAllowlist:g?.meta?.humanAllowlist??[],readOnly:_,loading:y,error:$,selectedBeadId:c,selectBead:u,openDetail:O,pushDetail:N,openCreate:M,openEpic:z},children:[(0,V.jsxs)("div",{className:"flex h-full flex-col overflow-hidden bg-background text-foreground text-body",children:[(0,V.jsx)(Fk,{}),(0,V.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-[var(--surface)] px-3 py-2 md:hidden",children:[(0,V.jsxs)(Ka,{open:r,onOpenChange:i,children:[(0,V.jsxs)(Kl,{type:"button","aria-label":"Open navigation and project menu",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-[9px] border border-border bg-[var(--surface-2)] text-[var(--text-2)] hover:bg-[var(--surface-3)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)]",children:[(0,V.jsx)(KQ,{size:18,"aria-hidden":"true"}),(0,V.jsx)("span",{className:"sr-only",children:"Open navigation and project menu"})]}),(0,V.jsxs)(Ku,{side:"left",className:"w-[min(88vw,300px)] max-w-[88vw] gap-0 overflow-hidden border-r border-border bg-[var(--surface)] p-0",children:[(0,V.jsx)(Kd,{className:"sr-only",children:"Project and view navigation"}),(0,V.jsx)(Kf,{className:"sr-only",children:"Choose a project or review view."}),(0,V.jsx)(uR,{mobile:!0,view:t,onView:B,kind:g?.meta?.kind,projectId:e,live:v,onProjectNavigate:()=>i(!1)})]})]}),(0,V.jsx)("div",{className:"min-w-0 flex-1 truncate text-label font-semibold text-[var(--text)]",children:"Beadscope"}),(0,V.jsx)(er._,{size:"lg",label:"Search and commands",onClick:()=>window.dispatchEvent(new Event(eE)),className:"h-11 w-11 shrink-0",children:(0,V.jsx)(K0,{size:18,"aria-hidden":"true"})})]}),(0,V.jsxs)("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[(0,V.jsx)(uR,{view:t,onView:n,kind:g?.meta?.kind,projectId:e,live:v}),(0,V.jsxs)("main",{className:"relative flex min-w-0 flex-1 flex-col",children:[$&&"settings"!==t?(0,V.jsx)("div",{className:"flex flex-1 items-center justify-center p-8",children:(0,V.jsxs)("div",{className:"max-w-md rounded-lg border border-destructive/40 bg-destructive/5 p-6 text-center",children:[(0,V.jsx)("p",{className:"text-body font-medium text-destructive",children:"Couldn’t open this project"}),(0,V.jsx)("p",{className:"mt-2 text-body text-muted-foreground",children:$}),(0,V.jsx)(Y.default,{href:"/",className:"mt-4 inline-block rounded-md border px-3 py-1.5 text-body hover:bg-accent",children:"← Back to projects"})]})}):(0,V.jsxs)(V.Fragment,{children:["board"===t&&(0,V.jsx)(pd,{}),"list"===t&&(0,V.jsx)(pN,{}),"epics"===t&&(0,V.jsx)(pP,{focusEpic:P,onFocusHandledAction:D}),"focus"===t&&(0,V.jsx)(p_,{}),"graph"===t&&(0,V.jsx)(xP,{}),"insights"===t&&(0,V.jsx)(I6,{}),"activity"===t&&(0,V.jsx)(Dr,{}),"needsyou"===t&&(0,V.jsx)(B2,{}),"achievements"===t&&(0,V.jsx)(B6,{}),"publish"===t&&(0,V.jsx)(Fr,{}),"settings"===t&&(0,V.jsx)(FN,{})]}),(0,V.jsx)(KC,{openId:E,initialAction:f?.id===E?f.action:"view",actionNonce:f?.id===E?f.nonce:0,canGoBack:a.length>1,backTo:a.length>1?a[a.length-2]:null,onBack:A,onClose:C})]})]})]}),(0,V.jsx)(Kz,{open:h.open&&!_,parent:h.parent,type:h.type,onOpenChange:e=>m(t=>({...t,open:e}))}),(0,V.jsx)(KY,{projectId:e,readOnly:_,selectedId:c,openId:E&&w.has(E)?E:null,selectIdAction:u,setViewAction:n,openDetailAction:O,openCreateAction:R,closeOverlaysAction:L,toggleThemeAction:o}),(0,V.jsx)(KJ,{projectId:e}),(0,V.jsx)(G.Suspense,{fallback:null,children:(0,V.jsx)(K1,{openId:E})})]})}],48026)},78492,(e,t,n)=>{var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function l(e,t,n,r,o){if("function"!=typeof n)throw TypeError("The listener must be a function");var l=new a(n,r||e,o),s=i?i+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},c.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=Array(o);r<o;r++)a[r]=n[r].fn;return a},c.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,r,o,a){var l=i?i+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,o),!0;case 6:return u.fn.call(u.context,t,n,r,o,a),!0}for(c=1,s=Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var f,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!s)for(f=1,s=Array(d-1);f<d;f++)s[f-1]=arguments[f];u[c].fn.apply(u[c].context,s)}}return!0},c.prototype.on=function(e,t,n){return l(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return l(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||s(this,o);else{for(var l=0,c=[],u=a.length;l<u;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&c.push(a[l]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&s(this,t)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},4100,(e,t,n)=>{var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},s=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(t=arguments[f],null!=t)for(n in t)r=u(d,n),d!==(i=u(t,n))&&(h&&i&&(s(i)||(o=l(i)))?(o?(o=!1,a=r&&l(r)?r:[]):a=r&&s(r)?r:{},c(d,{name:n,newValue:e(h,a,i)})):void 0!==i&&c(d,{name:n,newValue:i}));return d}},26568,(e,t,n)=>{var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,o=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,u=1;function f(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function p(){var e={line:n,column:u};return function(t){return t.position=new h(e),g(o),t}}function h(e){this.start=e,this.end={line:n,column:u},this.source=t.source}function m(r){var i=Error(t.source+":"+n+":"+u+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=u,i.source=e,t.silent);else throw i}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}h.prototype.content=e,g(o);var v,x=[];for(y(x);v=function(){var e=p(),t=g(a);if(t){if(b(),!g(l))return m("property missing ':'");var n=g(s),i=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return g(c),i}}();)!1!==v&&(x.push(v),y(x));return x}},22016,(e,t,n)=>{e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return y},useLinkStatus:function(){return v}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let o=e.r(90809),a=e.r(18050),l=o._(e.r(71645)),s=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function y(t){var n;let r,i,o,[y,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),x=(0,l.useRef)(null),{href:w,as:k,children:_,prefetch:S=null,passHref:E,replace:j,shallow:O,scroll:N,onClick:C,onMouseEnter:A,onTouchStart:M,legacyBehavior:P=!1,onNavigate:T,transitionTypes:I,ref:D,unstable_dynamicOnHover:z,...R}=t;r=_,P&&("string"==typeof r||"number"==typeof r)&&(r=(0,a.jsx)("a",{children:r}));let L=l.default.useContext(c.AppRouterContext),$=!1!==S,B=!1===S?"none":!0===S?"full":"auto",F="none"!==B?"auto"===B?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,U="string"==typeof(n=k||w)?n:(0,s.formatUrl)(n);if(P){if(r?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");i=l.default.Children.only(r)}let H=P?i&&"object"==typeof i&&i.ref:D,K,W=l.default.useCallback(e=>(null!==L&&(x.current=(0,h.mountLinkInstance)(e,U,L,F,$,v,K)),()=>{x.current&&((0,h.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,h.unmountPrefetchableInstance)(e)}),[$,U,L,F,v,K]),q={ref:(0,u.useMergedRef)(W,H),onClick(t){P||"function"!=typeof C||C(t),P&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!L||t.defaultPrevented||function(t,n,r,i,o,a,l,s="none"){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(n)){i&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=e.r(32916);d(n,i?"replace":"push",!1===o?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,l,s)}}(t,U,x,j,N,T,I,B)},onMouseEnter(e){P||"function"!=typeof A||A(e),P&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),L&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===z)},onTouchStart:function(e){P||"function"!=typeof M||M(e),P&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),L&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===z)}};return(0,d.isAbsoluteUrl)(U)?q.href=U:P&&!E&&("a"!==i.type||"href"in i.props)||(q.href=(0,f.addBasePath)(U)),o=P?l.default.cloneElement(i,q):(0,a.jsx)("a",{...R,...q,children:r}),(0,a.jsx)(b.Provider,{value:y,children:o})}let b=(0,l.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,l.useContext)(b);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(71645);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=o(e,r)),t&&(i.current=o(t,r))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},95057,(e,t,n)=>{e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return s}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let o=e.r(90809)._(e.r(98183)),a=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:n}=e,r=e.protocol||"",i=e.pathname||"",l=e.hash||"",s=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),s&&"object"==typeof s&&(s=String(o.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||a.test(r))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${r}${c}${i}${u}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},73668,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return o}});let r=e.r(18967),i=e.r(52817);function o(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,i.hasBasePath)(n.pathname)}catch(e){return!1}}},18967,(e,t,n)=>{e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return o},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return k}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let o=["CLS","FCP","INP","LCP","TTFB"];function a(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function c(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`);return r}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},65156,(e,t,n)=>{var r=e.r(32189);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var l=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 l.name="Invariant Violation",l}}function t(){return e}e.isRequired=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:o,resetWarningCache:i};return n.PropTypes=n,n}},32189,(e,t,n)=>{t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},15888,(e,t,n)=>{var r,i=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case a:case s:case l:case p:case h:return e;default:switch(e=e&&e.$$typeof){case d:case u:case f:case g:case m:case c:return e;default:return t}}case o:return t}}}r=Symbol.for("react.module.reference"),n.ContextConsumer=u,n.ContextProvider=c,n.Element=i,n.ForwardRef=f,n.Fragment=a,n.Lazy=g,n.Memo=m,n.Portal=o,n.Profiler=s,n.StrictMode=l,n.Suspense=p,n.SuspenseList=h,n.isAsyncMode=function(){return!1},n.isConcurrentMode=function(){return!1},n.isContextConsumer=function(e){return b(e)===u},n.isContextProvider=function(e){return b(e)===c},n.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},n.isForwardRef=function(e){return b(e)===f},n.isFragment=function(e){return b(e)===a},n.isLazy=function(e){return b(e)===g},n.isMemo=function(e){return b(e)===m},n.isPortal=function(e){return b(e)===o},n.isProfiler=function(e){return b(e)===s},n.isStrictMode=function(e){return b(e)===l},n.isSuspense=function(e){return b(e)===p},n.isSuspenseList=function(e){return b(e)===h},n.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===s||e===l||e===p||e===h||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===f||e.$$typeof===r||void 0!==e.getModuleId)||!1},n.typeOf=b},79367,(e,t,n)=>{e.i(47167),t.exports=e.r(15888)},15511,(e,t,n)=>{var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),i=e.r(65185);function o(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}o.default=o,t.exports=o},65185,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,o=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||o.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(l,c):e.replace(a,c)).replace(i,s))}},70454,(e,t,n)=>{var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),o="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;o?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(26568))}],51655,(e,t,n)=>{!function(n){"use strict";var r,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},o=!0,a="[DecimalError] ",l=a+"Invalid argument: ",s=a+"Exponent out of range: ",c=Math.floor,u=Math.pow,d=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,f=c(1286742750677284.5),p={};function h(e,t){var n,r,i,a,l,s,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),o?S(t,f):t;if(c=e.d,u=t.d,l=e.e,i=t.e,c=c.slice(),a=l-i){for(a<0?(r=c,a=-a,s=u.length):(r=u,i=l,s=c.length),a>(s=(l=Math.ceil(f/7))>s?l+1:s+1)&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((s=c.length)-(a=u.length)<0&&(a=s,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/1e7|0,c[a]%=1e7;for(n&&(c.unshift(n),++i),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=i,o?S(t,f):t}function m(e,t,n){if(e!==~~e||e<t||e>n)throw Error(l+e)}function g(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=w(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=w(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}p.absoluteValue=p.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},p.comparedTo=p.cmp=function(e){var t,n,r,i;if(e=new this.constructor(e),this.s!==e.s)return this.s||-e.s;if(this.e!==e.e)return this.e>e.e^this.s<0?1:-1;for(r=this.d.length,t=0,n=r<(i=e.d.length)?r:i;t<n;++t)if(this.d[t]!==e.d[t])return this.d[t]>e.d[t]^this.s<0?1:-1;return r===i?0:r>i^this.s<0?1:-1},p.decimalPlaces=p.dp=function(){var e=this.d.length-1,t=(e-this.e)*7;if(e=this.d[e])for(;e%10==0;e/=10)t--;return t<0?0:t},p.dividedBy=p.div=function(e){return y(this,new this.constructor(e))},p.dividedToIntegerBy=p.idiv=function(e){var t=this.constructor;return S(y(this,new t(e),0,1),t.precision)},p.equals=p.eq=function(e){return!this.cmp(e)},p.exponent=function(){return v(this)},p.greaterThan=p.gt=function(e){return this.cmp(e)>0},p.greaterThanOrEqualTo=p.gte=function(e){return this.cmp(e)>=0},p.isInteger=p.isint=function(){return this.e>this.d.length-2},p.isNegative=p.isneg=function(){return this.s<0},p.isPositive=p.ispos=function(){return this.s>0},p.isZero=function(){return 0===this.s},p.lessThan=p.lt=function(e){return 0>this.cmp(e)},p.lessThanOrEqualTo=p.lte=function(e){return 1>this.cmp(e)},p.logarithm=p.log=function(e){var t,n=this.constructor,i=n.precision,l=i+5;if(void 0===e)e=new n(10);else if((e=new n(e)).s<1||e.eq(r))throw Error(a+"NaN");if(this.s<1)throw Error(a+(this.s?"NaN":"-Infinity"));return this.eq(r)?new n(0):(o=!1,t=y(k(this,l),k(e,l),l),o=!0,S(t,i))},p.minus=p.sub=function(e){return e=new this.constructor(e),this.s==e.s?E(this,e):h(this,(e.s=-e.s,e))},p.modulo=p.mod=function(e){var t,n=this.constructor,r=n.precision;if(!(e=new n(e)).s)throw Error(a+"NaN");return this.s?(o=!1,t=y(this,e,0,1).times(e),o=!0,this.minus(t)):S(new n(this),r)},p.naturalExponential=p.exp=function(){return b(this)},p.naturalLogarithm=p.ln=function(){return k(this)},p.negated=p.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},p.plus=p.add=function(e){return e=new this.constructor(e),this.s==e.s?h(this,e):E(this,(e.s=-e.s,e))},p.precision=p.sd=function(e){var t,n,r;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(l+e);if(t=v(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},p.squareRoot=p.sqrt=function(){var e,t,n,r,i,l,s,u=this.constructor;if(this.s<1){if(!this.s)return new u(0);throw Error(a+"NaN")}for(e=v(this),o=!1,0==(i=Math.sqrt(+this))||1/0==i?(((t=g(this.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),r=new u(t=1/0==i?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new u(i.toString()),i=s=(n=u.precision)+3;;)if(r=(l=r).plus(y(this,l,s+2)).times(.5),g(l.d).slice(0,s)===(t=g(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&"4999"==t){if(S(l,n+1,0),l.times(l).eq(this)){r=l;break}}else if("9999"!=t)break;s+=4}return o=!0,S(r,n)},p.times=p.mul=function(e){var t,n,r,i,a,l,s,c,u,d=this.constructor,f=this.d,p=(e=new d(e)).d;if(!this.s||!e.s)return new d(0);for(e.s*=this.s,n=this.e+e.e,(c=f.length)<(u=p.length)&&(a=f,f=p,p=a,l=c,c=u,u=l),a=[],r=l=c+u;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+p[r]*f[i-r-1]+t,a[i--]=s%1e7|0,t=s/1e7|0;a[i]=(a[i]+t)%1e7|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,o?S(e,d.precision):e},p.toDecimalPlaces=p.todp=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(m(e,0,1e9),void 0===t?t=r.rounding:m(t,0,8),S(n,e+v(n)+1,t))},p.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=j(r,!0):(m(e,0,1e9),void 0===t?t=i.rounding:m(t,0,8),n=j(r=S(new i(r),e+1,t),!0,e+1)),n},p.toFixed=function(e,t){var n,r,i=this.constructor;return void 0===e?j(this):(m(e,0,1e9),void 0===t?t=i.rounding:m(t,0,8),n=j((r=S(new i(this),e+v(this)+1,t)).abs(),!1,e+v(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},p.toInteger=p.toint=function(){var e=this.constructor;return S(new e(this),v(this)+1,e.rounding)},p.toNumber=function(){return+this},p.toPower=p.pow=function(e){var t,n,i,l,s,u,d=this,f=d.constructor,p=+(e=new f(e));if(!e.s)return new f(r);if(!(d=new f(d)).s){if(e.s<1)throw Error(a+"Infinity");return d}if(d.eq(r))return d;if(i=f.precision,e.eq(r))return S(d,i);if(u=(t=e.e)>=(n=e.d.length-1),s=d.s,u){if((n=p<0?-p:p)<=0x1fffffffffffff){for(l=new f(r),t=Math.ceil(i/7+4),o=!1;n%2&&O((l=l.times(d)).d,t),0!==(n=c(n/2));)O((d=d.times(d)).d,t);return o=!0,e.s<0?new f(r).div(l):S(l,i)}}else if(s<0)throw Error(a+"NaN");return s=s<0&&1&e.d[Math.max(t,n)]?-1:1,d.s=1,o=!1,l=e.times(k(d,i+12)),o=!0,(l=b(l)).s=s,l},p.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?(n=v(i),r=j(i,n<=o.toExpNeg||n>=o.toExpPos)):(m(e,1,1e9),void 0===t?t=o.rounding:m(t,0,8),n=v(i=S(new o(i),e,t)),r=j(i,e<=n||n<=o.toExpNeg,e)),r},p.toSignificantDigits=p.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(m(e,1,1e9),void 0===t?t=n.rounding:m(t,0,8)),S(new n(this),e,t)},p.toString=p.valueOf=p.val=p.toJSON=function(){var e=v(this),t=this.constructor;return j(this,e<=t.toExpNeg||e>=t.toExpPos)};var y=function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%1e7|0,r=n/1e7|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=1e7*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,l){var s,c,u,d,f,p,h,m,g,y,b,x,w,k,_,E,j,O,N=r.constructor,C=r.s==i.s?1:-1,A=r.d,M=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(a+"Division by zero");for(c=r.e-i.e,j=M.length,_=A.length,m=(h=new N(C)).d=[],u=0;M[u]==(A[u]||0);)++u;if(M[u]>(A[u]||0)&&--c,(x=null==o?o=N.precision:l?o+(v(r)-v(i))+1:o)<0)return new N(0);if(x=x/7+2|0,u=0,1==j)for(d=0,M=M[0],x++;(u<_||d)&&x--;u++)w=1e7*d+(A[u]||0),m[u]=w/M|0,d=w%M|0;else{for((d=1e7/(M[0]+1)|0)>1&&(M=e(M,d),A=e(A,d),j=M.length,_=A.length),k=j,y=(g=A.slice(0,j)).length;y<j;)g[y++]=0;(O=M.slice()).unshift(0),E=M[0],M[1]>=5e6&&++E;do d=0,(s=t(M,g,j,y))<0?(b=g[0],j!=y&&(b=1e7*b+(g[1]||0)),(d=b/E|0)>1?(d>=1e7&&(d=1e7-1),p=(f=e(M,d)).length,y=g.length,1==(s=t(f,g,p,y))&&(d--,n(f,j<p?O:M,p))):(0==d&&(s=d=1),f=M.slice()),(p=f.length)<y&&f.unshift(0),n(g,f,y),-1==s&&(y=g.length,(s=t(M,g,j,y))<1&&(d++,n(g,j<y?O:M,y))),y=g.length):0===s&&(d++,g=[0]),m[u++]=d,s&&g[0]?g[y++]=A[k]||0:(g=[A[k]],y=1);while((k++<_||void 0!==g[0])&&x--)}return m[0]||m.shift(),h.e=c,S(h,l?o+v(h)+1:o)}}();function b(e,t){var n,i,a,l,c,d=0,f=0,p=e.constructor,h=p.precision;if(v(e)>16)throw Error(s+v(e));if(!e.s)return new p(r);for(null==t?(o=!1,c=h):c=t,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(c+=Math.log(u(2,f))/Math.LN10*2+5|0,n=i=a=new p(r),p.precision=c;;){if(i=S(i.times(e),c),n=n.times(++d),g((l=a.plus(y(i,n,c))).d).slice(0,c)===g(a.d).slice(0,c)){for(;f--;)a=S(a.times(a),c);return p.precision=h,null==t?(o=!0,S(a,h)):a}a=l}}function v(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function x(e,t,n){if(t>e.LN10.sd())throw o=!0,n&&(e.precision=n),Error(a+"LN10 precision limit exceeded");return S(new e(e.LN10),t)}function w(e){for(var t="";e--;)t+="0";return t}function k(e,t){var n,i,l,s,c,u,d,f,p,h=1,m=e,b=m.d,w=m.constructor,_=w.precision;if(m.s<1)throw Error(a+(m.s?"NaN":"-Infinity"));if(m.eq(r))return new w(0);if(null==t?(o=!1,f=_):f=t,m.eq(10))return null==t&&(o=!0),x(w,f);if(w.precision=f+=10,i=(n=g(b)).charAt(0),!(15e14>Math.abs(s=v(m))))return d=x(w,f+2,_).times(s+""),m=k(new w(i+"."+n.slice(1)),f-10).plus(d),w.precision=_,null==t?(o=!0,S(m,_)):m;for(;i<7&&1!=i||1==i&&n.charAt(1)>3;)i=(n=g((m=m.times(e)).d)).charAt(0),h++;for(s=v(m),i>1?(m=new w("0."+n),s++):m=new w(i+"."+n.slice(1)),u=c=m=y(m.minus(r),m.plus(r),f),p=S(m.times(m),f),l=3;;){if(c=S(c.times(p),f),g((d=u.plus(y(c,new w(l),f))).d).slice(0,f)===g(u.d).slice(0,f))return u=u.times(2),0!==s&&(u=u.plus(x(w,f+2,_).times(s+""))),u=y(u,new w(h),f),w.precision=_,null==t?(o=!0,S(u,_)):u;u=d,l+=2}}function _(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(r,i)){if(i-=r,e.e=c((n=n-r-1)/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),o&&(e.e>f||e.e<-f))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function S(e,t,n){var r,i,a,l,d,p,h,m,g=e.d;for(l=1,a=g[0];a>=10;a/=10)l++;if((r=t-l)<0)r+=7,i=t,h=g[m=0];else{if((m=Math.ceil((r+1)/7))>=(a=g.length))return e;for(h=a=g[m],l=1;a>=10;a/=10)l++;r%=7,i=r-7+l}if(void 0!==n&&(d=h/(a=u(10,l-i-1))%10|0,p=t<0||void 0!==g[m+1]||h%a,p=n<4?(d||p)&&(0==n||n==(e.s<0?3:2)):d>5||5==d&&(4==n||p||6==n&&(r>0?i>0?h/u(10,l-i):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return p?(a=v(e),g.length=1,t=t-a-1,g[0]=u(10,(7-t%7)%7),e.e=c(-t/7)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=m,a=1,m--):(g.length=m+1,a=u(10,7-r),g[m]=i>0?(h/u(10,l-i)%u(10,i)|0)*a:0),p)for(;;)if(0==m){1e7==(g[0]+=a)&&(g[0]=1,++e.e);break}else{if(g[m]+=a,1e7!=g[m])break;g[m--]=0,a=1}for(r=g.length;0===g[--r];)g.pop();if(o&&(e.e>f||e.e<-f))throw Error(s+v(e));return e}function E(e,t){var n,r,i,a,l,s,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),o?S(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),l=u-r){for((d=l<0)?(n=c,l=-l,s=f.length):(n=f,r=u,s=c.length),l>(i=Math.max(Math.ceil(h/7),s)+2)&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for((d=(i=c.length)<(s=f.length))&&(s=i),i=0;i<s;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}l=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),s=c.length,i=f.length-s;i>0;--i)c[s++]=0;for(i=f.length;i>l;){if(c[--i]<f[i]){for(a=i;a&&0===c[--a];)c[a]=1e7-1;--c[a],c[i]+=1e7}c[i]-=f[i]}for(;0===c[--s];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=r,o?S(t,h):t):new p(0)}function j(e,t,n){var r,i=v(e),o=g(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+w(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+w(-i-1)+o,n&&(r=n-a)>0&&(o+=w(r))):i>=a?(o+=w(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+w(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=w(r))),e.s<0?"-"+o:o}function O(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!=typeof e)throw Error(a+"Object expected");var t,n,r,i=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if(void 0!==(r=e[n=i[t]]))if(c(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(l+n+": "+r);if(void 0!==(r=e[n="LN10"]))if(r==Math.LN10)this[n]=new this(r);else throw Error(l+n+": "+r);return this}if((i=function e(t){var n,r,i;function o(e){if(!(this instanceof o))return new o(e);if(this.constructor=o,e instanceof o){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(l+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return _(this,e.toString())}if("string"!=typeof e)throw Error(l+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,d.test(e))_(this,e);else throw Error(l+e)}if(o.prototype=p,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=e,o.config=o.set=N,void 0===t&&(t={}),t)for(n=0,i=["precision","rounding","toExpNeg","toExpPos","LN10"];n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(i)).default=i.Decimal=i,r=new i(1),"function"==typeof define&&define.amd){let t;e.r,void 0!==(t=i)&&e.v(t)}else t.exports?t.exports=i:(n||(n="u">typeof self&&self&&self.self==self?self:Function("return this")()),n.Decimal=i)}(e.e)},19173,(e,t,n)=>{class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function o(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}class a{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let l=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class s{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=l({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{s._collapse(e)}))}}class c extends s{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(e){return e?"string"==typeof e?e:e.source:null}function d(e){return h("(?=",e,")")}function f(e){return h("(?:",e,")*")}function p(e){return h("(?:",e,")?")}function h(...e){return e.map(e=>u(e)).join("")}function m(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>u(e)).join("|")+")"}function g(e){return RegExp(e.toString()+"|").exec("").length-1}let y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:t}){let n=0;return e.map(e=>{let t=n+=1,r=u(e),i="";for(;r.length>0;){let e=y.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}let v="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",S={begin:"\\\\[\\s\\S]",relevance:0},E=function(e,t,n={}){let r=o({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:h(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},j=E("//","$"),O=E("/\\*","\\*/"),N=E("#","$");var C=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[S]},BACKSLASH_ESCAPE:S,BINARY_NUMBER_MODE:{scope:"number",begin:_,relevance:0},BINARY_NUMBER_RE:_,COMMENT:E,C_BLOCK_COMMENT_MODE:O,C_LINE_COMMENT_MODE:j,C_NUMBER_MODE:{scope:"number",begin:k,relevance:0},C_NUMBER_RE:k,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:v,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+x,relevance:0},NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[S]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[S,{begin:/\[/,end:/\]/,relevance:0,contains:[S]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:v,relevance:0},UNDERSCORE_IDENT_RE:x,UNDERSCORE_TITLE_MODE:{scope:"title",begin:x,relevance:0}});function A(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function M(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function P(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function T(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function I(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function D(e,t){void 0===e.relevance&&(e.relevance=1)}let z=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=h(n.beforeMatch,d(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},R=["of","and","for","in","not","or","if","then","parent","list","value"],L={},$=e=>{console.error(e)},B=(e,...t)=>{console.log(`WARN: ${e}`,...t)},F=(e,t)=>{L[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),L[`${e}/${t}`]=!0)},U=Error();function H(e,t,{key:n}){let r=0,i=e[n],o={},a={};for(let e=1;e<=t.length;e++)a[e+r]=i[e],o[e+r]=!0,r+=g(t[e-1]);e[n]=a,e[n]._emit=o,e[n]._multi=!0}function K(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),U;if("object"!=typeof e.beginScope||null===e.beginScope)throw $("beginScope must be object"),U;H(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $("skip, excludeEnd, returnEnd not compatible with endScope: {}"),U;if("object"!=typeof e.endScope||null===e.endScope)throw $("endScope must be object"),U;H(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}class W extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let q=Symbol("nomatch"),Z=function(e){let t=Object.create(null),n=Object.create(null),a=[],l=!0,s="Could not find the language '{}', did you forget to load/include a language module?",y={disableAutodetect:!0,name:"Plain text",contains:[]},v={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function x(e){return v.noHighlightRe.test(e)}function w(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(F("10.7.0","highlight(lang, code, ...args) has been deprecated."),F("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);let o={code:r,language:i};L("before:highlight",o);let a=o.result?o.result:k(o.language,o.code,n);return a.code=o.code,L("after:highlight",a),a}function k(e,n,a,c){let d=Object.create(null);function f(){if(!N.keywords)return void A.addText(B);let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(B),n="";for(;t;){n+=B.substring(e,t.index);let r=S.case_insensitive?t[0].toLowerCase():t[0],i=N.keywords[r];if(i){let[e,o]=i;if(A.addText(n),n="",d[r]=(d[r]||0)+1,d[r]<=7&&(F+=o),e.startsWith("_"))n+=t[0];else{let n=S.classNameAliases[e]||e;h(t[0],n)}}else n+=t[0];e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(B)}n+=B.substring(e),A.addText(n)}function p(){null!=N.subLanguage?function(){if(""===B)return;let e=null;if("string"==typeof N.subLanguage){if(!t[N.subLanguage])return A.addText(B);e=k(N.subLanguage,B,!0,C[N.subLanguage]),C[N.subLanguage]=e._top}else e=_(B,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(F+=e.relevance),A.__addSublanguage(e._emitter,e.language)}():f(),B=""}function h(e,t){""!==e&&(A.startScope(t),A.addText(e),A.endScope())}function m(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=S.classNameAliases[e[n]]||e[n],i=t[n];r?h(i,r):(B=i,f(),B=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&A.openNode(S.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(B,S.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),B=""):e.beginScope._multi&&(m(e.beginScope,t),B="")),N=Object.create(e,{parent:{value:N}})}let x={};function w(t,i){let o=i&&i[0];if(B+=t,null==o)return p(),0;if("begin"===x.type&&"end"===i.type&&x.index===i.index&&""===o){if(B+=n.slice(i.index,i.index+1),!l){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=x.rule,t}return 1}if(x=i,"begin"===i.type){let e=i[0],t=i.rule,n=new r(t);for(let r of[t.__beforeBegin,t["on:begin"]])if(r&&(r(i,n),n.isMatchIgnored))return 0===N.matcher.regexIndex?(B+=e[0],1):(W=!0,0);return t.skip?B+=e:(t.excludeBegin&&(B+=e),p(),t.returnBegin||t.excludeBegin||(B=e)),y(t,i),t.returnBegin?0:e.length}if("illegal"!==i.type||a){if("end"===i.type){let e=function(e){let t=e[0],i=n.substring(e.index),o=function e(t,n,i){var o;let a,l=(o=t.endRe,(a=o&&o.exec(i))&&0===a.index);if(l){if(t["on:end"]){let e=new r(t);t["on:end"](n,e),e.isMatchIgnored&&(l=!1)}if(l){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(N,e,i);if(!o)return q;let a=N;N.endScope&&N.endScope._wrap?(p(),h(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(p(),m(N.endScope,e)):a.skip?B+=t:(a.returnEnd||a.excludeEnd||(B+=t),p(),a.excludeEnd&&(B=t));do N.scope&&A.closeNode(),N.skip||N.subLanguage||(F+=N.relevance),N=N.parent;while(N!==o.parent)return o.starts&&y(o.starts,e),a.returnEnd?0:t.length}(i);if(e!==q)return e}}else{let e=Error('Illegal lexeme "'+o+'" for mode "'+(N.scope||"<unnamed>")+'"');throw e.mode=N,e}if("illegal"===i.type&&""===o)return B+="\n",1;if(H>1e5&&H>3*i.index)throw Error("potential infinite loop, way more iterations than matches");return B+=o,o.length}let S=O(e);if(!S)throw $(s.replace("{}",e)),Error('Unknown language: "'+e+'"');let E=function(e){function t(t,n){return RegExp(u(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function n(i,a){let l;if(i.isCompiled)return i;[M,I,K,z].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[P,T,D].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),s=i.keywords.$pattern,delete i.keywords.$pattern),s=s||/\w+/,i.keywords&&(i.keywords=function e(t,n,r="keyword"){let i=Object.create(null);return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach(function(r){Object.assign(i,e(t[r],n,r))}),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var n,r,o;let a=t.split("|");i[a[0]]=[e,(n=a[0],(r=a[1])?Number(r):+(o=n,!R.includes(o.toLowerCase())))]})}}(i.keywords,e.case_insensitive)),i.keywordPatternRe=t(s,!0),a&&(i.begin||(i.begin=/\B|\b/),i.beginRe=t(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=t(i.end)),i.terminatorEnd=u(i.end)||"",i.endsWithParent&&a.terminatorEnd&&(i.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(i.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){var t;return((t="self"===e?i:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return o(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?o(t):t:o(t,{starts:t.starts?o(t.starts):null})})),i.contains.forEach(function(e){n(e,i)}),i.starts&&n(i.starts,a),l=new r,i.contains.forEach(e=>l.addRule(e.begin,{rule:e,type:"begin"})),i.terminatorEnd&&l.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&l.addRule(i.illegal,{type:"illegal"}),i.matcher=l,i}(e)}(S),j="",N=c||E,C={},A=new v.__emitter(v),L=[];for(let e=N;e!==S;e=e.parent)e.scope&&L.unshift(e.scope);L.forEach(e=>A.openNode(e));let B="",F=0,U=0,H=0,W=!1;try{if(S.__emitTokens)S.__emitTokens(n,A);else{for(N.matcher.considerAll();;){H++,W?W=!1:N.matcher.considerAll(),N.matcher.lastIndex=U;let e=N.matcher.exec(n);if(!e)break;let t=n.substring(U,e.index),r=w(t,e);U=e.index+r}w(n.substring(U))}return A.finalize(),j=A.toHTML(),{language:e,value:j,relevance:F,illegal:!1,_emitter:A,_top:N}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:i(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:U,context:n.slice(U-100,U+100),mode:t.mode,resultSoFar:j},_emitter:A};if(l)return{language:e,value:i(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:N};throw t}}function _(e,n){let r;n=n||v.languages||Object.keys(t);let o=((r={value:i(e),illegal:!1,relevance:0,_top:y,_emitter:new v.__emitter(v)})._emitter.addText(e),r),a=n.filter(O).filter(A).map(t=>k(t,e,!1));a.unshift(o);let[l,s]=a.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(O(e.language).supersetOf===t.language)return 1;else if(O(t.language).supersetOf===e.language)return -1}return 0});return l.secondBest=s,l}function S(e){var t;let r,i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=v.languageDetectRe.exec(t);if(n){let t=O(n[1]);return t||(B(s.replace("{}",n[1])),B("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>x(e)||O(e))}(e);if(x(i))return;if(L("before:highlightElement",{el:e,language:i}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(v.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),v.throwUnescapedHTML))throw new W("One of your code blocks includes unescaped HTML.",e.innerHTML);let o=e.textContent,a=i?w(o,{language:i,ignoreIllegals:!0}):_(o);e.innerHTML=a.value,e.dataset.highlighted="yes",t=a.language,r=i&&n[i]||t,e.classList.add("hljs"),e.classList.add(`language-${r}`),e.result={language:a.language,re:a.relevance,relevance:a.relevance},a.secondBest&&(e.secondBest={language:a.secondBest.language,relevance:a.secondBest.relevance}),L("after:highlightElement",{el:e,result:a,text:o})}let E=!1;function j(){if("loading"===document.readyState){E||window.addEventListener("DOMContentLoaded",function(){j()},!1),E=!0;return}document.querySelectorAll(v.cssSelector).forEach(S)}function O(e){return t[e=(e||"").toLowerCase()]||t[n[e]]}function N(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function A(e){let t=O(e);return t&&!t.disableAutodetect}function L(e,t){a.forEach(function(n){n[e]&&n[e](t)})}for(let r in Object.assign(e,{highlight:w,highlightAuto:_,highlightAll:j,highlightElement:S,highlightBlock:function(e){return F("10.7.0","highlightBlock will be removed entirely in v12.0"),F("10.7.0","Please use highlightElement now."),S(e)},configure:function(e){v=o(v,e)},initHighlighting:()=>{j(),F("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){j(),F("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if($("Language definition for '{}' could not be registered.".replace("{}",n)),l)$(e);else throw e;i=y}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})},unregisterLanguage:function(e){for(let r of(delete t[e],Object.keys(n)))n[r]===e&&delete n[r]},listLanguages:function(){return Object.keys(t)},getLanguage:O,registerAliases:N,autoDetection:A,inherit:o,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),a.push(e)},removePlugin:function(e){let t=a.indexOf(e);-1!==t&&a.splice(t,1)}}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString="11.11.1",e.regex={concat:h,lookahead:d,either:m,optional:p,anyNumberOfTimes:f},C)"object"==typeof C[r]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],i=typeof r;"object"!==i&&"function"!==i||Object.isFrozen(r)||e(r)}),t}(C[r]);return Object.assign(e,C),e},V=Z({});V.newInstance=()=>Z({}),t.exports=V,V.HighlightJS=V,V.default=V},1419,(e,t,n)=>{t.exports=e.r(41920)(e.r(39088),"DataView")},34421,(e,t,n)=>{var r=e.r(50514),i=e.r(97617),o=e.r(57412),a=e.r(23592),l=e.r(39004);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=l,t.exports=s},29039,(e,t,n)=>{var r=e.r(65742),i=e.r(19206),o=e.r(67763),a=e.r(23407),l=e.r(53833);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=l,t.exports=s},87362,(e,t,n)=>{t.exports=e.r(41920)(e.r(39088),"Map")},87547,(e,t,n)=>{var r=e.r(48994),i=e.r(96768),o=e.r(29932),a=e.r(92647),l=e.r(46644);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=l,t.exports=s},2419,(e,t,n)=>{t.exports=e.r(41920)(e.r(39088),"Promise")},6966,(e,t,n)=>{t.exports=e.r(41920)(e.r(39088),"Set")},27493,(e,t,n)=>{var r=e.r(87547),i=e.r(21274),o=e.r(39805);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},1551,(e,t,n)=>{var r=e.r(29039),i=e.r(5400),o=e.r(86238),a=e.r(57831),l=e.r(77802),s=e.r(20517);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=l,c.prototype.set=s,t.exports=c},30353,(e,t,n)=>{t.exports=e.r(39088).Symbol},63750,(e,t,n)=>{t.exports=e.r(39088).Uint8Array},73895,(e,t,n)=>{t.exports=e.r(41920)(e.r(39088),"WeakMap")},87160,(e,t,n)=>{t.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},38199,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}},36100,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},46515,(e,t,n)=>{var r=e.r(49719);t.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},29584,(e,t,n)=>{t.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},58877,(e,t,n)=>{var r=e.r(55803),i=e.r(73250),o=e.r(45350),a=e.r(56956),l=e.r(66397),s=e.r(3023),c=Object.prototype.hasOwnProperty;t.exports=function(e,t){var n=o(e),u=!n&&i(e),d=!n&&!u&&a(e),f=!n&&!u&&!d&&s(e),p=n||u||d||f,h=p?r(e.length,String):[],m=h.length;for(var g in e)(t||c.call(e,g))&&!(p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,m)))&&h.push(g);return h}},92708,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},69102,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},51477,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},58672,(e,t,n)=>{t.exports=function(e){return e.split("")}},34314,(e,t,n)=>{var r=e.r(25172);t.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},74548,(e,t,n)=>{var r=e.r(24251);t.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},53587,(e,t,n)=>{var r=e.r(63799);t.exports=e.r(73554)(r)},8088,(e,t,n)=>{var r=e.r(53587);t.exports=function(e,t){var n=!0;return r(e,function(e,r,i){return n=!!t(e,r,i)}),n}},41015,(e,t,n)=>{var r=e.r(61884);t.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],l=t(a);if(null!=l&&(void 0===s?l==l&&!r(l):n(l,s)))var s=l,c=a}return c}},56445,(e,t,n)=>{t.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return -1}},41891,(e,t,n)=>{var r=e.r(69102),i=e.r(33803);t.exports=function e(t,n,o,a,l){var s=-1,c=t.length;for(o||(o=i),l||(l=[]);++s<c;){var u=t[s];n>0&&o(u)?n>1?e(u,n-1,o,a,l):r(l,u):a||(l[l.length]=u)}return l}},98728,(e,t,n)=>{t.exports=e.r(72385)()},63799,(e,t,n)=>{var r=e.r(98728),i=e.r(33679);t.exports=function(e,t){return e&&r(e,t,i)}},33141,(e,t,n)=>{var r=e.r(86287),i=e.r(2054);t.exports=function(e,t){t=r(t,e);for(var n=0,o=t.length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},23403,(e,t,n)=>{var r=e.r(69102),i=e.r(45350);t.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},77684,(e,t,n)=>{var r=e.r(30353),i=e.r(43436),o=e.r(5089),a=r?r.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},80957,(e,t,n)=>{t.exports=function(e,t){return e>t}},40688,(e,t,n)=>{t.exports=function(e,t){return null!=e&&t in Object(e)}},49719,(e,t,n)=>{var r=e.r(56445),i=e.r(4078),o=e.r(1987);t.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},66645,(e,t,n)=>{var r=e.r(77684),i=e.r(77289);t.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},21885,(e,t,n)=>{var r=e.r(78353),i=e.r(77289);t.exports=function e(t,n,o,a,l){return t===n||(null!=t&&null!=n&&(i(t)||i(n))?r(t,n,o,a,e,l):t!=t&&n!=n)}},78353,(e,t,n)=>{var r=e.r(1551),i=e.r(6856),o=e.r(78012),a=e.r(30698),l=e.r(67426),s=e.r(45350),c=e.r(56956),u=e.r(3023),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(e,t,n,m,g,y){var b=s(e),v=s(t),x=b?f:l(e),w=v?f:l(t);x=x==d?p:x,w=w==d?p:w;var k=x==p,_=w==p,S=x==w;if(S&&c(e)){if(!c(t))return!1;b=!0,k=!1}if(S&&!k)return y||(y=new r),b||u(e)?i(e,t,n,m,g,y):o(e,t,x,n,m,g,y);if(!(1&n)){var E=k&&h.call(e,"__wrapped__"),j=_&&h.call(t,"__wrapped__");if(E||j){var O=E?e.value():e,N=j?t.value():t;return y||(y=new r),g(O,N,n,m,y)}}return!!S&&(y||(y=new r),a(e,t,n,m,g,y))}},48299,(e,t,n)=>{var r=e.r(1551),i=e.r(21885);t.exports=function(e,t,n,o){var a=n.length,l=a,s=!o;if(null==e)return!l;for(e=Object(e);a--;){var c=n[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<l;){var u=(c=n[a])[0],d=e[u],f=c[1];if(s&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(o)var h=o(d,f,u,e,t,p);if(!(void 0===h?i(f,d,3,o,p):h))return!1}}return!0}},4078,(e,t,n)=>{t.exports=function(e){return e!=e}},54368,(e,t,n)=>{var r=e.r(71223),i=e.r(69553),o=e.r(12447),a=e.r(76366),l=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:l).test(a(e))}},76602,(e,t,n)=>{var r=e.r(77684),i=e.r(98376),o=e.r(77289),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},66305,(e,t,n)=>{var r=e.r(23426),i=e.r(72298),o=e.r(53336),a=e.r(45350),l=e.r(33906);t.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):l(e)}},48477,(e,t,n)=>{var r=e.r(63996),i=e.r(42369),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},98128,(e,t,n)=>{t.exports=function(e,t){return e<t}},7073,(e,t,n)=>{var r=e.r(53587),i=e.r(51095);t.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,function(e,r,i){o[++n]=t(e,r,i)}),o}},23426,(e,t,n)=>{var r=e.r(48299),i=e.r(41903),o=e.r(65570);t.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},72298,(e,t,n)=>{var r=e.r(21885),i=e.r(82820),o=e.r(2816),a=e.r(9903),l=e.r(15782),s=e.r(65570),c=e.r(2054);t.exports=function(e,t){return a(e)&&l(t)?s(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},28138,(e,t,n)=>{var r=e.r(92708),i=e.r(33141),o=e.r(66305),a=e.r(7073),l=e.r(83629),s=e.r(33999),c=e.r(58322),u=e.r(53336),d=e.r(45350);t.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;return t=r(t,s(o)),l(a(e,function(e,n,i){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,n)})}},1079,(e,t,n)=>{t.exports=function(e){return function(t){return null==t?void 0:t[e]}}},30970,(e,t,n)=>{var r=e.r(33141);t.exports=function(e){return function(t){return r(t,e)}}},93440,(e,t,n)=>{var r=Math.ceil,i=Math.max;t.exports=function(e,t,n,o){for(var a=-1,l=i(r((t-e)/(n||1)),0),s=Array(l);l--;)s[o?l:++a]=e,e+=n;return s}},95059,(e,t,n)=>{var r=e.r(53336),i=e.r(72953),o=e.r(84665);t.exports=function(e,t){return o(i(e,t,r),e+"")}},1647,(e,t,n)=>{var r=e.r(56751),i=e.r(24251),o=e.r(53336);t.exports=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o},95014,(e,t,n)=>{t.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}},49379,(e,t,n)=>{var r=e.r(53587);t.exports=function(e,t){var n;return r(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}},83629,(e,t,n)=>{t.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},55803,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},72537,(e,t,n)=>{var r=e.r(30353),i=e.r(92708),o=e.r(45350),a=e.r(61884),l=r?r.prototype:void 0,s=l?l.toString:void 0;t.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return s?s.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},30364,(e,t,n)=>{var r=e.r(48891),i=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},33999,(e,t,n)=>{t.exports=function(e){return function(t){return e(t)}}},10339,(e,t,n)=>{var r=e.r(27493),i=e.r(46515),o=e.r(29584),a=e.r(15262),l=e.r(8484),s=e.r(99850);t.exports=function(e,t,n){var c=-1,u=i,d=e.length,f=!0,p=[],h=p;if(n)f=!1,u=o;else if(d>=200){var m=t?null:l(e);if(m)return s(m);f=!1,u=a,h=new r}else h=t?[]:p;t:for(;++c<d;){var g=e[c],y=t?t(g):g;if(g=n||0!==g?g:0,f&&y==y){for(var b=h.length;b--;)if(h[b]===y)continue t;t&&h.push(y),p.push(g)}else u(h,y,n)||(h!==p&&h.push(y),p.push(g))}return p}},15262,(e,t,n)=>{t.exports=function(e,t){return e.has(t)}},86287,(e,t,n)=>{var r=e.r(45350),i=e.r(9903),o=e.r(2677),a=e.r(2922);t.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},84357,(e,t,n)=>{var r=e.r(95014);t.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},4886,(e,t,n)=>{var r=e.r(61884);t.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),l=void 0!==t,s=null===t,c=t==t,u=r(t);if(!s&&!u&&!a&&e>t||a&&l&&c&&!s&&!u||i&&l&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&n&&o&&!i&&!a||s&&n&&o||!l&&o||!c)return -1}return 0}},58322,(e,t,n)=>{var r=e.r(4886);t.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,l=o.length,s=n.length;++i<l;){var c=r(o[i],a[i]);if(c){if(i>=s)return c;return c*("desc"==n[i]?-1:1)}}return e.index-t.index}},53789,(e,t,n)=>{t.exports=e.r(39088)["__core-js_shared__"]},73554,(e,t,n)=>{var r=e.r(51095);t.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,l=Object(n);(t?a--:++a<o)&&!1!==i(l[a],a,l););return n}}},72385,(e,t,n)=>{t.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),l=a.length;l--;){var s=a[e?l:++i];if(!1===n(o[s],s,o))break}return t}}},29821,(e,t,n)=>{var r=e.r(84357),i=e.r(79589),o=e.r(34170),a=e.r(2922);t.exports=function(e){return function(t){var n=i(t=a(t))?o(t):void 0,l=n?n[0]:t.charAt(0),s=n?r(n,1).join(""):t.slice(1);return l[e]()+s}}},95200,(e,t,n)=>{var r=e.r(66305),i=e.r(51095),o=e.r(33679);t.exports=function(e){return function(t,n,a){var l=Object(t);if(!i(t)){var s=r(n,3);t=o(t),n=function(e){return s(l[e],e,l)}}var c=e(t,n,a);return c>-1?l[s?t[c]:c]:void 0}}},69523,(e,t,n)=>{var r=e.r(93440),i=e.r(70237),o=e.r(82560);t.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},8484,(e,t,n)=>{var r=e.r(6966),i=e.r(91692),o=e.r(99850);t.exports=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i},24251,(e,t,n)=>{var r=e.r(41920);t.exports=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},6856,(e,t,n)=>{var r=e.r(27493),i=e.r(51477),o=e.r(15262);t.exports=function(e,t,n,a,l,s){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h<u;){var y=e[h],b=t[h];if(a)var v=c?a(b,y,h,t,e,s):a(y,b,h,e,t,s);if(void 0!==v){if(v)continue;m=!1;break}if(g){if(!i(t,function(e,t){if(!o(g,t)&&(y===e||l(y,e,n,a,s)))return g.push(t)})){m=!1;break}}else if(!(y===b||l(y,b,n,a,s))){m=!1;break}}return s.delete(e),s.delete(t),m}},78012,(e,t,n)=>{var r=e.r(30353),i=e.r(63750),o=e.r(25172),a=e.r(6856),l=e.r(75331),s=e.r(99850),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;t.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=l;case"[object Set]":var h=1&r;if(p||(p=s),e.size!=t.size&&!h)break;var m=f.get(e);if(m)return m==t;r|=2,f.set(e,t);var g=a(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},30698,(e,t,n)=>{var r=e.r(13370),i=Object.prototype.hasOwnProperty;t.exports=function(e,t,n,o,a,l){var s=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!s)return!1;for(var d=u;d--;){var f=c[d];if(!(s?f in t:i.call(t,f)))return!1}var p=l.get(e),h=l.get(t);if(p&&h)return p==t&&h==e;var m=!0;l.set(e,t),l.set(t,e);for(var g=s;++d<u;){var y=e[f=c[d]],b=t[f];if(o)var v=s?o(b,y,f,t,e,l):o(y,b,f,e,t,l);if(!(void 0===v?y===b||a(y,b,n,o,l):v)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(m=!1)}return l.delete(e),l.delete(t),m}},236,(e,t,n)=>{t.exports=e.g&&e.g.Object===Object&&e.g},13370,(e,t,n)=>{var r=e.r(23403),i=e.r(17332),o=e.r(33679);t.exports=function(e){return r(e,o,i)}},87994,(e,t,n)=>{var r=e.r(24053);t.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},41903,(e,t,n)=>{var r=e.r(15782),i=e.r(33679);t.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},41920,(e,t,n)=>{var r=e.r(54368),i=e.r(63958);t.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},62413,(e,t,n)=>{t.exports=e.r(25717)(Object.getPrototypeOf,Object)},43436,(e,t,n)=>{var r=e.r(30353),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,l=r?r.toStringTag:void 0;t.exports=function(e){var t=o.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[l]=n:delete e[l]),i}},17332,(e,t,n)=>{var r=e.r(36100),i=e.r(45159),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return null==e?[]:r(a(e=Object(e)),function(t){return o.call(e,t)})}:i},67426,(e,t,n)=>{var r=e.r(1419),i=e.r(87362),o=e.r(2419),a=e.r(6966),l=e.r(73895),s=e.r(77684),c=e.r(76366),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=c(r),g=c(i),y=c(o),b=c(a),v=c(l),x=s;(r&&x(new r(new ArrayBuffer(1)))!=h||i&&x(new i)!=u||o&&x(o.resolve())!=d||a&&x(new a)!=f||l&&x(new l)!=p)&&(x=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return h;case g:return u;case y:return d;case b:return f;case v:return p}return t}),t.exports=x},63958,(e,t,n)=>{t.exports=function(e,t){return null==e?void 0:e[t]}},15359,(e,t,n)=>{var r=e.r(86287),i=e.r(73250),o=e.r(45350),a=e.r(66397),l=e.r(98376),s=e.r(2054);t.exports=function(e,t,n){t=r(t,e);for(var c=-1,u=t.length,d=!1;++c<u;){var f=s(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&l(u)&&a(f,u)&&(o(e)||i(e))}},79589,(e,t,n)=>{var r=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(e){return r.test(e)}},50514,(e,t,n)=>{var r=e.r(32760);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},97617,(e,t,n)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},57412,(e,t,n)=>{var r=e.r(32760),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},23592,(e,t,n)=>{var r=e.r(32760),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},39004,(e,t,n)=>{var r=e.r(32760);t.exports=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},33803,(e,t,n)=>{var r=e.r(30353),i=e.r(73250),o=e.r(45350),a=r?r.isConcatSpreadable:void 0;t.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},66397,(e,t,n)=>{var r=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<t}},70237,(e,t,n)=>{var r=e.r(25172),i=e.r(51095),o=e.r(66397),a=e.r(12447);t.exports=function(e,t,n){if(!a(n))return!1;var l=typeof t;return("number"==l?!!(i(n)&&o(t,n.length)):"string"==l&&t in n)&&r(n[t],e)}},9903,(e,t,n)=>{var r=e.r(45350),i=e.r(61884),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},24053,(e,t,n)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},69553,(e,t,n)=>{var r,i=e.r(53789),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!o&&o in e}},63996,(e,t,n)=>{var r=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},15782,(e,t,n)=>{var r=e.r(12447);t.exports=function(e){return e==e&&!r(e)}},65742,(e,t,n)=>{t.exports=function(){this.__data__=[],this.size=0}},19206,(e,t,n)=>{var r=e.r(34314),i=Array.prototype.splice;t.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},67763,(e,t,n)=>{var r=e.r(34314);t.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},23407,(e,t,n)=>{var r=e.r(34314);t.exports=function(e){return r(this.__data__,e)>-1}},53833,(e,t,n)=>{var r=e.r(34314);t.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},48994,(e,t,n)=>{var r=e.r(34421),i=e.r(29039),o=e.r(87362);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},96768,(e,t,n)=>{var r=e.r(87994);t.exports=function(e){var t=r(this,e).delete(e);return this.size-=!!t,t}},29932,(e,t,n)=>{var r=e.r(87994);t.exports=function(e){return r(this,e).get(e)}},92647,(e,t,n)=>{var r=e.r(87994);t.exports=function(e){return r(this,e).has(e)}},46644,(e,t,n)=>{var r=e.r(87994);t.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=+(n.size!=i),this}},75331,(e,t,n)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},65570,(e,t,n)=>{t.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},88832,(e,t,n)=>{var r=e.r(57588);t.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},32760,(e,t,n)=>{t.exports=e.r(41920)(Object,"create")},42369,(e,t,n)=>{t.exports=e.r(25717)(Object.keys,Object)},80156,(e,t,n)=>{var r=e.r(236),i=n&&!n.nodeType&&n,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process;t.exports=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return a&&a.binding&&a.binding("util")}catch(e){}}()},5089,(e,t,n)=>{var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}},25717,(e,t,n)=>{t.exports=function(e,t){return function(n){return e(t(n))}}},72953,(e,t,n)=>{var r=e.r(87160),i=Math.max;t.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,l=i(o.length-t,0),s=Array(l);++a<l;)s[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(s),r(e,this,c)}}},39088,(e,t,n)=>{var r=e.r(236),i="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||i||Function("return this")()},21274,(e,t,n)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},39805,(e,t,n)=>{t.exports=function(e){return this.__data__.has(e)}},99850,(e,t,n)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},84665,(e,t,n)=>{var r=e.r(1647);t.exports=e.r(51994)(r)},51994,(e,t,n)=>{var r=Date.now;t.exports=function(e){var t=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},5400,(e,t,n)=>{var r=e.r(29039);t.exports=function(){this.__data__=new r,this.size=0}},86238,(e,t,n)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},57831,(e,t,n)=>{t.exports=function(e){return this.__data__.get(e)}},77802,(e,t,n)=>{t.exports=function(e){return this.__data__.has(e)}},20517,(e,t,n)=>{var r=e.r(29039),i=e.r(87362),o=e.r(87547);t.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},1987,(e,t,n)=>{t.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1}},34170,(e,t,n)=>{var r=e.r(58672),i=e.r(79589),o=e.r(95365);t.exports=function(e){return i(e)?o(e):r(e)}},2677,(e,t,n)=>{var r=e.r(88832),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g;t.exports=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)}),t})},2054,(e,t,n)=>{var r=e.r(61884);t.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},76366,(e,t,n)=>{var r=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},48891,(e,t,n)=>{var r=/\s/;t.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},95365,(e,t,n)=>{var r="\\ud800-\\udfff",i="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",a="[^"+r+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+i+"|"+o+")?",u="[\\ufe0e\\ufe0f]?",d="(?:\\u200d(?:"+[a,l,s].join("|")+")"+u+c+")*",f=RegExp(o+"(?="+o+")|"+("(?:"+[a+i+"?",i,l,s,"["+r+"]"].join("|"))+")"+(u+c+d),"g");t.exports=function(e){return e.match(f)||[]}},56751,(e,t,n)=>{t.exports=function(e){return function(){return e}}},74009,(e,t,n)=>{var r=e.r(12447),i=e.r(31926),o=e.r(73759),a=Math.max,l=Math.min;t.exports=function(e,t,n){var s,c,u,d,f,p,h=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=s,r=c;return s=c=void 0,h=t,d=e.apply(r,n)}function v(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,o=i();if(v(o))return w(o);f=setTimeout(x,(e=o-p,n=o-h,r=t-e,g?l(r,u-n):r))}function w(e){return(f=void 0,y&&s)?b(e):(s=c=void 0,d)}function k(){var e,n=i(),r=v(n);if(s=arguments,c=this,p=n,r){if(void 0===f)return h=e=p,f=setTimeout(x,t),m?b(e):d;if(g)return clearTimeout(f),f=setTimeout(x,t),b(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?a(o(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=c=f=void 0},k.flush=function(){return void 0===f?d:w(i())},k}},25172,(e,t,n)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}},26063,(e,t,n)=>{var r=e.r(38199),i=e.r(8088),o=e.r(66305),a=e.r(45350),l=e.r(70237);t.exports=function(e,t,n){var s=a(e)?r:i;return n&&l(e,t,n)&&(t=void 0),s(e,o(t,3))}},60191,(e,t,n)=>{t.exports=e.r(95200)(e.r(26965))},26965,(e,t,n)=>{var r=e.r(56445),i=e.r(66305),o=e.r(4653),a=Math.max;t.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return -1;var s=null==n?0:o(n);return s<0&&(s=a(l+s,0)),r(e,i(t,3),s)}},33303,(e,t,n)=>{var r=e.r(41891),i=e.r(10632);t.exports=function(e,t){return r(i(e,t),1)}},82820,(e,t,n)=>{var r=e.r(33141);t.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},2816,(e,t,n)=>{var r=e.r(40688),i=e.r(15359);t.exports=function(e,t){return null!=e&&i(e,t,r)}},53336,(e,t,n)=>{t.exports=function(e){return e}},73250,(e,t,n)=>{var r=e.r(66645),i=e.r(77289),o=Object.prototype,a=o.hasOwnProperty,l=o.propertyIsEnumerable;t.exports=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!l.call(e,"callee")}},45350,(e,t,n)=>{t.exports=Array.isArray},51095,(e,t,n)=>{var r=e.r(71223),i=e.r(98376);t.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},20164,(e,t,n)=>{var r=e.r(77684),i=e.r(77289);t.exports=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==r(e)}},56956,(e,t,n)=>{var r=e.r(39088),i=e.r(24013),o=n&&!n.nodeType&&n,a=o&&t&&!t.nodeType&&t,l=a&&a.exports===o?r.Buffer:void 0;t.exports=(l?l.isBuffer:void 0)||i},98892,(e,t,n)=>{var r=e.r(21885);t.exports=function(e,t){return r(e,t)}},71223,(e,t,n)=>{var r=e.r(77684),i=e.r(12447);t.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},98376,(e,t,n)=>{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},78948,(e,t,n)=>{var r=e.r(94241);t.exports=function(e){return r(e)&&e!=+e}},3945,(e,t,n)=>{t.exports=function(e){return null==e}},94241,(e,t,n)=>{var r=e.r(77684),i=e.r(77289);t.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},12447,(e,t,n)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},77289,(e,t,n)=>{t.exports=function(e){return null!=e&&"object"==typeof e}},1320,(e,t,n)=>{var r=e.r(77684),i=e.r(62413),o=e.r(77289),a=Object.prototype,l=Function.prototype.toString,s=a.hasOwnProperty,c=l.call(Object);t.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},85845,(e,t,n)=>{var r=e.r(77684),i=e.r(45350),o=e.r(77289);t.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},61884,(e,t,n)=>{var r=e.r(77684),i=e.r(77289);t.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},3023,(e,t,n)=>{var r=e.r(76602),i=e.r(33999),o=e.r(80156),a=o&&o.isTypedArray;t.exports=a?i(a):r},33679,(e,t,n)=>{var r=e.r(58877),i=e.r(48477),o=e.r(51095);t.exports=function(e){return o(e)?r(e):i(e)}},4879,(e,t,n)=>{t.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},10632,(e,t,n)=>{var r=e.r(92708),i=e.r(66305),o=e.r(7073),a=e.r(45350);t.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},60793,(e,t,n)=>{var r=e.r(74548),i=e.r(63799),o=e.r(66305);t.exports=function(e,t){var n={};return t=o(t,3),i(e,function(e,i,o){r(n,i,t(e,i,o))}),n}},86966,(e,t,n)=>{var r=e.r(41015),i=e.r(80957),o=e.r(53336);t.exports=function(e){return e&&e.length?r(e,o,i):void 0}},57588,(e,t,n)=>{var r=e.r(87547);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},12393,(e,t,n)=>{var r=e.r(41015),i=e.r(98128),o=e.r(53336);t.exports=function(e){return e&&e.length?r(e,o,i):void 0}},91692,(e,t,n)=>{t.exports=function(){}},31926,(e,t,n)=>{var r=e.r(39088);t.exports=function(){return r.Date.now()}},33906,(e,t,n)=>{var r=e.r(1079),i=e.r(30970),o=e.r(9903),a=e.r(2054);t.exports=function(e){return o(e)?r(a(e)):i(e)}},44950,(e,t,n)=>{t.exports=e.r(69523)()},88099,(e,t,n)=>{var r=e.r(51477),i=e.r(66305),o=e.r(49379),a=e.r(45350),l=e.r(70237);t.exports=function(e,t,n){var s=a(e)?r:o;return n&&l(e,t,n)&&(t=void 0),s(e,i(t,3))}},31195,(e,t,n)=>{var r=e.r(41891),i=e.r(28138),o=e.r(95059),a=e.r(70237);t.exports=o(function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])})},45159,(e,t,n)=>{t.exports=function(){return[]}},24013,(e,t,n)=>{t.exports=function(){return!1}},24283,(e,t,n)=>{var r=e.r(74009),i=e.r(12447);t.exports=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:o,maxWait:t,trailing:a})}},82560,(e,t,n)=>{var r=e.r(73759);t.exports=function(e){return e?1/0===(e=r(e))||-1/0===e?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},4653,(e,t,n)=>{var r=e.r(82560);t.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},73759,(e,t,n)=>{var r=e.r(30364),i=e.r(12447),o=e.r(61884),a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(o(e))return 0/0;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):a.test(e)?0/0:+e}},2922,(e,t,n)=>{var r=e.r(72537);t.exports=function(e){return null==e?"":r(e)}},74010,(e,t,n)=>{var r=e.r(66305),i=e.r(10339);t.exports=function(e,t){return e&&e.length?i(e,r(t,2)):[]}},32241,(e,t,n)=>{t.exports=e.r(29821)("toUpperCase")},45009,(e,t,n)=>{e.i(47167),t.exports=e.r(65156)()}]);
|