@ohif/ui 3.13.0-beta.132 → 3.13.0-beta.134

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.
@@ -1834,7 +1834,7 @@ fn main(
1834
1834
  flex-direction:column;
1835
1835
  flex:0 1 auto;
1836
1836
  min-width:0;
1837
- `,this.dom.appendChild(this.metricsColumn),this.dom.appendChild(this.bindingsColumn)}isMemoryAvailable(){return void 0!==performance.memory}addPanel(e,t){((e===ey8.RENDER_MODES?this.bindingsColumn:this.metricsColumn)??this.dom).appendChild(t.dom),this.panels.set(e,t)}startLoop(){let e=()=>{this.update(),this.animationFrameId=requestAnimationFrame(e)};this.animationFrameId=requestAnimationFrame(e)}stopLoop(){null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}updateStats(){this.frameCount++;let e=performance.now(),t=e-this.startTime,r=this.panels.get(ey8.MS);if(r&&r.update(t,200),e>=this.lastUpdateTime+1e3){let t=1e3*this.frameCount/(e-this.lastUpdateTime),r=this.panels.get(ey8.FPS);r&&r.update(t,300),this.lastUpdateTime=e,this.frameCount=0,this.updateMemoryPanel(),this.updateRenderModesPanel()}return e}updateRenderModesPanel(){let e=this.panels.get(ey8.RENDER_MODES);if(!(e instanceof ehc))return;let t=[];for(let e of FR())if(e&&!e.hasBeenDestroyed)for(let r of e.getViewports()){let n=r._debug?.renderModes;t.push({renderingEngineId:e.id,viewportId:r.id,viewportType:r.type,bindings:this.getViewportBindingDebugEntries(r,n??{})})}e.setContent(t)}getViewportBindingDebugEntries(e,t){let r=e.getActors?.()??[],n=e.getSourceDataId?.(),a=Object.entries(t);return a.length?a.map(([t,a])=>{var i,o;let s=ehb(e,t,n),l="source"===s?e.getDefaultActor?.():(i=r,o=t,i.find(e=>e.uid===o||e.representationUID===o||e.referencedId===o));return{actorUID:l?.uid,dataId:t,referencedId:l?.referencedId,renderMode:a,role:s,...ehw(l)}}):r.map(t=>{let r=t.representationUID??t.uid??"";return{actorUID:t.uid,dataId:r,referencedId:t.referencedId,renderMode:"-",role:ehb(e,r,n),...ehw(t)}})}updateMemoryPanel(){let e=this.panels.get(ey8.MEMORY);if(!e)return;let t=performance;if(t.memory){let r=t.memory.usedJSHeapSize/1048576,n=t.memory.jsHeapSizeLimit/1048576;e.update(r,n)}}attachDragHandlers(){this.dom?.addEventListener("pointerdown",this.handlePointerDown)}detachDragHandlers(){this.dom?.removeEventListener("pointerdown",this.handlePointerDown),window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp),window.removeEventListener("pointercancel",this.handlePointerUp)}onPointerDown(e){if(!this.dom||0!==e.button)return;this.dragPointerId=e.pointerId;let t=this.dom.getBoundingClientRect();this.dragOffsetX=e.clientX-t.left,this.dragOffsetY=e.clientY-t.top,this.setPosition(t.left,t.top),window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp),window.addEventListener("pointercancel",this.handlePointerUp),e.preventDefault()}onPointerMove(e){this.dragPointerId===e.pointerId&&this.dom&&this.setPosition(e.clientX-this.dragOffsetX,e.clientY-this.dragOffsetY)}onPointerUp(e){if(this.dragPointerId!==e.pointerId||!this.dom)return;this.dragPointerId=null,window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp),window.removeEventListener("pointercancel",this.handlePointerUp);let t=this.dom.getBoundingClientRect();this.savePosition(t.left,t.top)}setPosition(e,t){if(!this.dom)return;let r=this.clampToViewport(e,t);this.dom.style.left=`${r.left}px`,this.dom.style.top=`${r.top}px`,this.dom.style.right="auto",this.dom.style.bottom="auto"}clampToViewport(e,t){if(!this.dom)return{left:e,top:t};let r=this.dom.offsetWidth,n=this.dom.offsetHeight;return{left:Math.min(Math.max(0,e),Math.max(0,window.innerWidth-r)),top:Math.min(Math.max(0,t),Math.max(0,window.innerHeight-n))}}restorePosition(){let e=this.readSavedPosition();e&&this.setPosition(e.left,e.top)}readSavedPosition(){try{let e=window.localStorage.getItem(ehu);if(!e)return null;let t=JSON.parse(e);if("number"!=typeof t?.left||"number"!=typeof t?.top||!Number.isFinite(t.left)||!Number.isFinite(t.top))return null;return{left:t.left,top:t.top}}catch{return null}}savePosition(e,t){try{window.localStorage.setItem(ehu,JSON.stringify({left:e,top:t}))}catch{}}}function ehb(e,t,r){let n=e.getDisplaySetRole?.(t);return"source"===n||"overlay"===n?n:r&&t===r?"source":"data"}function ehw(e){let t=e?.actor?.getMapper?.()?.getInputData?.();if(!t)return{};try{let e=t.getPointData?.()?.getScalars?.();if(e?.getDataType){let t=e.getNumberOfComponents?.()??1,r=t>1?e.getRange?.(0):e.getRange?.();return{scalarType:e.getDataType(),scalarRange:ehx(r),numberOfComponents:t}}let r=t.getScalarData?.();if(r?.constructor?.name){let e=Number.isFinite(t.minPixelValue)&&Number.isFinite(t.maxPixelValue)?[t.minPixelValue,t.maxPixelValue]:void 0;return{scalarType:r.constructor.name,scalarRange:ehx(e)}}}catch{}return{}}function ehx(e){if(e&&!(e.length<2)&&Number.isFinite(e[0])&&Number.isFinite(e[1]))return[e[0],e[1]]}ehv.instance=null;let ehC=ehv.getInstance();class ehk{constructor(e){throw this._needsRender=new Set,this._animationFrameSet=!1,this._animationFrameHandle=null,this.renderFrameOfReference=e=>{let t=this._getViewportsAsArray().map(t=>{if(t.getFrameOfReferenceUID()===e)return t.id});this.renderViewports(t)},this.id=e||F2(),this.useCPURendering=BI(),(e=>{FO[e.id]=e})(this),Error("@cornerstonejs/core is not initialized, run init() first")}enableElement(e){let t=this._normalizeViewportInputEntry(e);this._throwIfDestroyed();let{element:r,viewportId:n}=t;if(!r)throw Error("No element provided");this.getViewport(n)&&this.disableElement(n);let{type:a}=t;eho(a)?this.addCustomViewport(t):this.enableVTKjsDrivenViewport(t);let i=GK(r),{background:o}=t.defaultOptions;this.fillCanvasWithBackgroundColor(i,o)}disableElement(e){this._throwIfDestroyed();let t=this.getViewport(e);t?(this._resetViewport(t),!eho(t.type)&&this.offscreenMultiRenderWindow&&this.offscreenMultiRenderWindow.removeRenderer(e),this._removeViewport(e),t.isDisabled=!0,this._needsRender.delete(e),this.getViewports().length||this._clearAnimationFrame()):console.warn(`viewport ${e} does not exist`)}disableViewport(e){this.disableElement(e)}setViewports(e){let t=this._normalizeViewportInputEntries(e);this._throwIfDestroyed(),this._reset();let r=[],n=[];t.forEach(e=>{eho(e.type)?n.push(e):r.push(e)}),this.setVtkjsDrivenViewports(r),this.setCustomViewports(n),t.forEach(e=>{let t=GK(e.element),{background:r}=e.defaultOptions;this.fillCanvasWithBackgroundColor(t,r)})}resize(e=!0,t=!0){this._throwIfDestroyed();let r=this._getViewportsAsArray(),n=[],a=[];r.forEach(e=>{ehs(e)?a.push(e):n.push(e)}),n.length&&this._resizeVTKViewports(n,t,e),a.length&&this._resizeUsingCustomResizeHandler(a,t,e)}getViewport(e){return this._viewports?.get(e)}getViewports(){return this._throwIfDestroyed(),this._getViewportsAsArray()}render(){let e=this.getViewports().map(e=>e.id);this._setViewportsToBeRenderedNextFrame(e)}renderViewports(e){this._setViewportsToBeRenderedNextFrame(e)}renderViewport(e){this._setViewportsToBeRenderedNextFrame([e])}destroy(){let e;if(this.hasBeenDestroyed)return;ehC.cleanup();let t=this._getViewportsAsArray();this._reset(),this.offscreenMultiRenderWindow&&(t.forEach(e=>{this.offscreenMultiRenderWindow&&!ehs(e)&&this.offscreenMultiRenderWindow.getRenderer(e.id)&&this.offscreenMultiRenderWindow.removeRenderer(e.id)}),this.offscreenMultiRenderWindow.delete(),delete this.offscreenMultiRenderWindow),e=this.id,delete FO[e],this.hasBeenDestroyed=!0}fillCanvasWithBackgroundColor(e,t){let r=e.getContext("2d");r.fillStyle=t?Array.isArray(t)?`rgb(${t.map(e=>Math.round(255*e)).join(",")})`:t:"black",r.fillRect(0,0,e.width,e.height)}_normalizeViewportInputEntry(e){let t=e.type,{type:r}=e,{defaultOptions:n}=e;if(BP()){let e=ehk.NEXT_TYPE_REMAP[r];e&&(r=e)}let a=n;return a&&0!==Object.keys(a).length||(a={background:[0,0,0],orientation:null,displayArea:null},t===Nq.ORTHOGRAPHIC&&(a={...a,orientation:NQ.AXIAL})),{...e,requestedType:t!==r||BP()?t:void 0,type:r,defaultOptions:a}}_normalizeViewportInputEntries(e){let t=[];return e.forEach(e=>{t.push(this._normalizeViewportInputEntry(e))}),t}_resizeUsingCustomResizeHandler(e,t=!0,r=!0){e.forEach(e=>{e.resizeForRenderingEngine({keepCamera:t})}),r&&this.render()}_removeViewport(e){this.getViewport(e)?this._viewports.delete(e):console.warn(`viewport ${e} does not exist`)}addCustomViewport(e){let{element:t,viewportId:r,type:n,defaultOptions:a}=e;t.tabIndex=-1;let i=GK(t),{clientWidth:o,clientHeight:s}=i;(i.width!==o||i.height!==s)&&(i.width=o,i.height=s);let l={id:r,renderingEngineId:this.id,element:t,type:n,canvas:i,sx:0,sy:0,sWidth:o,sHeight:s,defaultOptions:a||{}},u=new(ehi(e))(l);u.requestedType=n,this._viewports.set(r,u);let d={element:t,viewportId:r,renderingEngineId:this.id};Bh(Bc,NH.ELEMENT_ENABLED,d)}getRenderer(e){return this.offscreenMultiRenderWindow.getRenderer(e)}getOffscreenMultiRenderWindow(e){if(!this.offscreenMultiRenderWindow)throw Error("Offscreen multi render window is not available.");return this.offscreenMultiRenderWindow}setCustomViewports(e){e.forEach(e=>{this.addCustomViewport(e)})}_getViewportsAsArray(){return Array.from(this._viewports.values())}_setViewportsToBeRenderedNextFrame(e){e.forEach(e=>{this._needsRender.add(e);let t=this._viewports.get(e);t&&(t.viewportStatus=Fw.NEEDS_RENDER)}),this._render()}_render(){this._needsRender.size>0&&!this._animationFrameSet&&(this._animationFrameHandle=window.requestAnimationFrame(this._renderFlaggedViewports),this._animationFrameSet=!0)}_resetViewport(e){let t=this.id,{element:r,canvas:n,id:a}=e;e.removeWidgets(),Bh(Bc,NH.ELEMENT_DISABLED,{element:r,viewportId:a,renderingEngineId:t}),e.destroy?.(),r.removeAttribute("data-viewport-uid"),r.removeAttribute("data-rendering-engine-uid"),n.getContext("2d").clearRect(0,0,n.width,n.height)}_clearAnimationFrame(){window.cancelAnimationFrame(this._animationFrameHandle),this._needsRender.clear(),this._animationFrameSet=!1,this._animationFrameHandle=null}_reset(){this._getViewportsAsArray().forEach(e=>{this._resetViewport(e)}),this._clearAnimationFrame(),this._viewports=new Map}_throwIfDestroyed(){if(this.hasBeenDestroyed)throw Error("this.destroy() has been manually called to free up memory, can not longer use this instance. Instead make a new one.")}}ehk.NEXT_TYPE_REMAP={[Nq.STACK]:Nq.PLANAR_NEXT,[Nq.ORTHOGRAPHIC]:Nq.PLANAR_NEXT,[Nq.VIDEO]:Nq.VIDEO_NEXT,[Nq.WHOLE_SLIDE]:Nq.WHOLE_SLIDE_NEXT,[Nq.ECG]:Nq.ECG_NEXT,[Nq.VOLUME_3D]:Nq.VOLUME_3D_NEXT},(eyh=ey6||(ey6={}))[eyh.None=0]="None",eyh[eyh.Capture=1]="Capture",eyh[eyh.Bubble=2]="Bubble",Symbol("LastRuntimeId");let ehM=VG;function ehS(e){return Array.isArray(e)?e:[e]}new class{constructor(e="Tools",t=50){this.position=-1,this.redoAvailable=0,this.undoAvailable=0,this.ring=[],this.isRecordingGrouped=!1,this.label=e,this._size=t}get size(){return this._size}set size(e){this.ring=Array(e),this._size=e,this.position=-1,this.redoAvailable=0,this.undoAvailable=0}get canUndo(){return this.undoAvailable>0}get canRedo(){return this.redoAvailable>0}undo(e=1){for(;e>0&&this.undoAvailable>0;){for(let e of ehS(this.ring[this.position]).reverse())e.restoreMemo(!0),this.dispatchHistoryEvent({item:e,isUndo:!0});e--,this.redoAvailable++,this.undoAvailable--,this.position=(this.position-1+this.size)%this.size}}undoIf(e){return!!(this.undoAvailable>0&&e(this.ring[this.position]))&&(this.undo(),!0)}dispatchHistoryEvent({item:e,isUndo:t}){e.id&&Bc.dispatchEvent(new CustomEvent(t?"CORNERSTONE_TOOLS_HISTORY_UNDO":"CORNERSTONE_TOOLS_HISTORY_REDO",{detail:{isUndo:t,id:e.id,operationType:e.operationType||"annotation",memo:e}}))}redo(e=1){for(;e>0&&this.redoAvailable>0;){let t=(this.position+1)%this.size;for(let e of ehS(this.ring[t]).reverse())e.restoreMemo(!1),this.dispatchHistoryEvent({item:e,isUndo:!1});e--,this.position=t,this.undoAvailable++,this.redoAvailable--}}initializeGroupItem(){this.redoAvailable=0,this.undoAvailable<this._size&&this.undoAvailable++,this.position=(this.position+1)%this._size,this.ring[this.position]=[]}startGroupRecording(){this.isRecordingGrouped=!0,this.initializeGroupItem()}rollbackUnusedGroupItem(){this.ring[this.position]=void 0,this.position=(this.position-1)%this._size,this.undoAvailable--}endGroupRecording(){this.isRecordingGrouped=!1;let e=this.ring[this.position];Array.isArray(e)&&0===e.length&&this.rollbackUnusedGroupItem()}pushGrouped(e){let t=this.ring[this.position];if(Array.isArray(t))return t.push(e),e;throw Error("Last item should be an array for grouped memos.")}push(e){if(!e)return;let t=e.restoreMemo?e:e.createMemo?.();if(t)return this.isRecordingGrouped?this.pushGrouped(t):(this.redoAvailable=0,this.undoAvailable<this._size&&this.undoAvailable++,this.position=(this.position+1)%this._size,this.ring[this.position]=t,t)}};let ehE={},ehT={add:(e,t)=>{let[r,n]=e,a=`${r}_${n}`;ehE[a]||(ehE[a]={}),ehE[a]=t},get:(e,t,r)=>{if("spatialRegistrationModule"!==e)return;let n=`${t}_${r}`;if(ehE[n])return ehE[n];let a=`${r}_${t}`;if(ehE[a])return Lv.mat4.invert(Lv.mat4.create(),ehE[a])}};HR(ehT.get.bind(ehT));let{Cc:ehI,VD:ehP,lJ:eh_}=Z,ehD=new F5("imageRetrievalPool");ehD.setMaxSimultaneousRequests(NG.Interaction,200),ehD.setMaxSimultaneousRequests(NG.Thumbnail,200),ehD.setMaxSimultaneousRequests(NG.Prefetch,200),ehD.grabDelay=0;let ehO=Symbol("DefaultSettings"),ehA=Symbol("RuntimeSettings"),ehR=Symbol("ObjectSettingsMap"),ehL=Symbol("Dictionary");class ehN{constructor(e){const t=Object.create(e instanceof ehN&&ehL in e?e[ehL]:null);Object.seal(Object.defineProperty(this,ehL,{value:t}))}set(e,t){return ehF(this[ehL],e,t,null)}get(e){var t;return t=this[ehL],t[e]}unset(e){return function(e,t){if(t.endsWith(".")){let r=0,n=t.slice(0,-1),a=0===n.length;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(a||i.startsWith(t)||i===n)&&(delete e[i],++r);return r>0}return delete e[t]}(this[ehL],e+"")}forEach(e){ehV(this[ehL],e)}extend(){return new ehN(this)}import(e){ehB(e)&&Object.keys(e).forEach(t=>{ehF(this[ehL],t,e[t],null)})}dump(){let e={};return ehV(this[ehL],(t,r)=>{void 0!==r&&function e(t,r,n){let a=r.indexOf(".");if(a>=0){let i=r.slice(0,a),o=t[i];if("object"!=typeof o||null===o){let e=o;o={},void 0!==e&&(o[""]=e),t[i]=o}e(o,r.slice(a+1,r.length),n)}else t[r]=n}(e,t,r)}),e}static assert(e){return e instanceof ehN?e:ehN.getRuntimeSettings()}static getDefaultSettings(e=null){let t=ehN[ehO];if(t instanceof ehN||(t=new ehN,ehN[ehO]=t),e){let r={};return t.forEach(n=>{n.startsWith(e)&&(r[n.split(`${e}.`)[1]]=t.get(n))}),r}return t}static getRuntimeSettings(){let e=ehN[ehA];return e instanceof ehN||(e=new ehN(ehN.getDefaultSettings()),ehN[ehA]=e),e}static getObjectSettings(e,t){let r=null;if(e instanceof ehN)r=e;else if("object"==typeof e&&null!==e){let n=ehN[ehR];n instanceof WeakMap||(n=new WeakMap,ehN[ehR]=n),(r=n.get(e))instanceof ehN||(r=new ehN(ehN.assert(ehN.getObjectSettings(t))),n.set(e,r))}return r}static extendRuntimeSettings(){return ehN.getRuntimeSettings().extend()}}function ehV(e,t){for(let r in e)t(r,e[r])}function ehF(e,t,r,n){if(function(e){let t,r,n;if("string"!=typeof e||(t=e.length-1)<0)return!1;for(n=-1;(r=e.indexOf(".",n+1))>=0;){if(r-n<2||r===t)return!1;n=r}return!0}(t)){if(ehB(r)){let i;var a=n instanceof WeakSet?n:new WeakSet;if(a.has(r))return ehF(e,t,null,a);for(let n in a.add(r),i=0,r)Object.prototype.hasOwnProperty.call(r,n)&&!ehF(e,0===n.length?t:`${t}.${n}`,r[n],a)&&++i;return a.delete(r),0===i}return e[t]=r,!0}return!1}function ehB(e){if("object"==typeof e&&null!==e){let t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t)return!0}return!1}function ehj(e,t,r){let{PaletteColorLookupTableUID:n}=e;if(void 0!==e[t]||void 0!==n)return function(e,t){let r=t[0]||65536,n=t[2];if(!e)return;let a=e=>{let t=e.buffer||e,a=t.byteLength===2*r||n>8?new Uint16Array(t):new Uint8Array(t),i=[];for(let e=0;e<r;e++)i[e]=a[e];return i};if(e.palette)return e.palette;if(e.InlineBinary)try{let t=Uint8Array.from(atob(e.InlineBinary),e=>e.charCodeAt(0));return e.palette=a(t)}catch(t){console.log("Couldn't decode",e.InlineBinary,t);return}let i=Array.isArray(e)?e[0]:e;return i instanceof ArrayBuffer?e.palette=a(i):e.retrieveBulkData?e.retrieveBulkData().then(t=>e.palette=a(t)):void console.error(`No data found for ${e} palette`)}(e[t],e[r])}function ehW(e,t,r){if(e[r])return e[r];let n=Object.create(e);return Object.defineProperty(e,r,{value:n,writable:!1,enumerable:!1}),t&&[...t?Object.values(t).filter(Boolean).map(e=>e[0]).filter(e=>"object"==typeof e):[]].forEach(e=>{e.SOPInstanceUID||Object.entries(e).forEach(([e,t])=>{n[e]=t})}),n}ehN.getDefaultSettings().set("useCursors",!0);let{ZX:ehU,Cc:ehz}=et,{nw:ehH}=Z,ehG=new class{constructor(){this.imageURIToUIDs=new Map,this.customMetadata=new Map}addImageIdToUIDs(e,t){if(!e)throw Error("MetadataProvider::Empty imageId");let r=Lw(e);this.imageURIToUIDs.set(r,t)}addCustomMetadata(e,t,r){let n=Lw(e);this.customMetadata.has(t)||this.customMetadata.set(t,{}),this.customMetadata.get(t)[n]=r}_getInstance(e){if(!e)throw Error("MetadataProvider::Empty imageId");let t=this.getUIDsFromImageID(e);if(!t)return;let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a,frameNumber:i}=t,o=RV.getInstance(r,n,a);if(!o)return;let s=i&&((e,t)=>{let{PerFrameFunctionalGroupsSequence:r,SharedFunctionalGroupsSequence:n,NumberOfFrames:a,ImageType:i}=t;if(a<2)return t;t.ImageType=Array.isArray(i)&&i||"string"==typeof i&&i.split("\\")||i;let o=Number.parseInt(e||1),s=t.DetectorInformationSequence&&(!t.ImagePositionPatient||!t.ImageOrientationPatient);if(r&&n||s||a>1){!t.ImageOrientationPatient&&t.DetectorInformationSequence&&(t.ImageOrientationPatient=t.DetectorInformationSequence[0].ImageOrientationPatient);let e=t.ImagePositionPatient;if(!t.ImagePositionPatient&&t.DetectorInformationSequence){let r=t.DetectorInformationSequence[0].ImagePositionPatient,n=t.ImageOrientationPatient;r=r?.map(e=>Number(e)),n=n?.map(e=>Number(e));let a=Number(t.SpacingBetweenSlices);if(n&&a){let t=Lv.vec3.fromValues(n[0],n[1],n[2]),i=Lv.vec3.fromValues(n[3],n[4],n[5]),s=Lv.vec3.cross(Lv.vec3.create(),t,i),l=Lv.vec3.scaleAndAdd(Lv.vec3.create(),r,s,a*(o-1));e=[l[0],l[1],l[2]]}}t._parentInstance||Object.defineProperty(t,"_parentInstance",{value:{...t},enumerable:!1,writable:!1,configurable:!1});let a=ehW(t._parentInstance,n?.[0],"_shared"),i=ehW(a,r?.[o-1],o);return i.ImagePositionPatient=e??i.ImagePositionPatient??[0,0,o],Object.defineProperty(i,"frameNumber",{value:o,writable:!0,enumerable:!1,configurable:!0}),i}if(t.GridFrameOffsetVector){t._parentInstance||Object.defineProperty(t,"_parentInstance",{value:{...t},enumerable:!1,writable:!1,configurable:!1});let e=ehW(t._parentInstance,n?.[0],"_shared"),a=ehW(e,r?.[o-1],o),i=a.ImagePositionPatient?.map(Number),s=a.ImageOrientationPatient?.map(Number),l=Number(t.GridFrameOffsetVector[o-1]);if(i&&s&&!Number.isNaN(l)){let e=Lv.vec3.fromValues(s[0],s[1],s[2]),t=Lv.vec3.fromValues(s[3],s[4],s[5]),r=Lv.vec3.cross(Lv.vec3.create(),e,t),n=Lv.vec3.scaleAndAdd(Lv.vec3.create(),Lv.vec3.fromValues(...i),r,l);a.ImagePositionPatient=[n[0],n[1],n[2]]}return Object.defineProperty(a,"frameNumber",{value:o,writable:!0,enumerable:!1,configurable:!0}),a}return t})(i,o)||o;return s&&Object.defineProperty(s,"imageId",{value:e,writable:!0,enumerable:!1,configurable:!0}),s}get(e,t,r={fallback:!1}){if(Array.isArray(t))return;let n=this._getInstance(t);if(e===ehK)return n;if(this.customMetadata.has(e)){let r=this.customMetadata.get(e),n=Lw(t);if(r[n])return r[n]}return this.getTagFromInstance(e,n,r)}getTag(e,t,r){return this.get(e,t,r)}getInstance(e){return this.get(ehK,e)}getTagFromInstance(e,t,r={fallback:!1}){if(t)return t[e]?t[e]:this._getCornerstoneDICOMImageLoaderTag(e,t)}addHandler(e,t){eh$[e]=t}_getCornerstoneDICOMImageLoaderTag(e,t){let r=eh$[e]?.(t);if(r)return r;switch(e){case ehq.GENERAL_SERIES_MODULE:r={modality:t.Modality,seriesInstanceUID:t.SeriesInstanceUID,seriesNumber:Ly(t.SeriesNumber),studyInstanceUID:t.StudyInstanceUID,seriesDescription:t.SeriesDescription,seriesDate:t.SeriesDate,seriesTime:t.SeriesTime};break;case ehq.PATIENT_STUDY_MODULE:r={patientAge:t.PatientAge,patientSize:t.PatientSize,patientWeight:t.PatientWeight};break;case ehq.PATIENT_DEMOGRAPHIC_MODULE:r={patientSex:t.PatientSex};break;case ehq.IMAGE_PIXEL_MODULE:r={samplesPerPixel:Ly(t.SamplesPerPixel),photometricInterpretation:t.PhotometricInterpretation,rows:Ly(t.Rows),columns:Ly(t.Columns),bitsAllocated:Ly(t.BitsAllocated),bitsStored:Ly(t.BitsStored),highBit:Ly(t.HighBit),pixelRepresentation:Ly(t.PixelRepresentation),planarConfiguration:Ly(t.PlanarConfiguration),pixelAspectRatio:Ly(t.PixelAspectRatio),smallestPixelValue:Ly(t.SmallestPixelValue),largestPixelValue:Ly(t.LargestPixelValue),redPaletteColorLookupTableDescriptor:Ly(t.RedPaletteColorLookupTableDescriptor),greenPaletteColorLookupTableDescriptor:Ly(t.GreenPaletteColorLookupTableDescriptor),bluePaletteColorLookupTableDescriptor:Ly(t.BluePaletteColorLookupTableDescriptor),redPaletteColorLookupTableData:ehj(t,"RedPaletteColorLookupTableData","RedPaletteColorLookupTableDescriptor"),greenPaletteColorLookupTableData:ehj(t,"GreenPaletteColorLookupTableData","GreenPaletteColorLookupTableDescriptor"),bluePaletteColorLookupTableData:ehj(t,"BluePaletteColorLookupTableData","BluePaletteColorLookupTableDescriptor")};break;case ehq.VOI_LUT_MODULE:let{WindowCenter:n,WindowWidth:a,VOILUTFunction:i}=t;if(null==n||null==a)return;let o=Array.isArray(n)?n:[n],s=Array.isArray(a)?a:[a];r={windowCenter:Ly(o),windowWidth:Ly(s),voiLUTFunction:i};break;case ehq.MODALITY_LUT_MODULE:let{RescaleIntercept:l,RescaleSlope:u}=t;if(null==l||null==u)return;r={rescaleIntercept:Ly(t.RescaleIntercept),rescaleSlope:Ly(t.RescaleSlope),rescaleType:t.RescaleType};break;case ehq.SOP_COMMON_MODULE:r={sopClassUID:t.SOPClassUID,sopInstanceUID:t.SOPInstanceUID};break;case ehq.PET_IMAGE_MODULE:r={frameReferenceTime:t.FrameReferenceTime,actualFrameDuration:t.ActualFrameDuration};break;case ehq.PET_ISOTOPE_MODULE:let{RadiopharmaceuticalInformationSequence:d}=t;if(d){let{RadiopharmaceuticalStartTime:e,RadionuclideTotalDose:t,RadionuclideHalfLife:n}=Array.isArray(d)?d[0]:d;r={radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:Nz().parseTM(e),radionuclideTotalDose:t,radionuclideHalfLife:n}}}break;case ehq.OVERLAY_PLANE_MODULE:let c=[];for(let e=0;e<=30;e+=2){let r=`60${e.toString(16)}`;3===r.length&&(r=`600${e.toString(16)}`);let n=t[`${r}3000`];if(!n)continue;let a=`${r}0010`,i=`${r}0011`,o=`${r}0040`,s=`${r}0050`,l=`${r}0022`,u=`${r}1500`,d=`${r}1301`,h=`${r}1302`,p=`${r}1303`,m=t[s],f=0;f=t[a]instanceof Array?new Uint16Array(t[a][0])[0]:t[a];let g=0;g=t[i]instanceof Array?new Uint16Array(t[i][0])[0]:t[i];let y=0,v=0;if(1===m.length){let e=new Int16Array(m[0]);y=e[0],v=e[1]}else y=m[0],v=m[1];let b={rows:f,columns:g,type:t[o],x:y,y:v,pixelData:n,description:t[l],label:t[u],roiArea:t[d],roiMean:t[h],roiStandardDeviation:t[p]};c.push(b)}r={overlays:c};break;case ehq.PATIENT_MODULE:r={patientName:t.PatientName,patientId:t.PatientID,patientSex:t.PatientSex,patientBirthDate:t.PatientBirthDate,issuerOfPatientId:t.IssuerOfPatientID,otherPatientIDsSequence:t.OtherPatientIDsSequence};break;case ehq.GENERAL_IMAGE_MODULE:r={sopInstanceUID:t.SOPInstanceUID,instanceNumber:Ly(t.InstanceNumber),lossyImageCompression:t.LossyImageCompression,lossyImageCompressionRatio:t.LossyImageCompressionRatio,lossyImageCompressionMethod:t.LossyImageCompressionMethod};break;case ehq.GENERAL_STUDY_MODULE:r={studyDescription:t.StudyDescription,studyInstanceUID:t.StudyInstanceUID,studyDate:t.StudyDate,studyTime:t.StudyTime,accessionNumber:t.AccessionNumber,studyId:t.StudyID};break;case ehq.CINE_MODULE:r={frameTime:t.FrameTime,numberOfFrames:t.NumberOfFrames?Number(t.NumberOfFrames):1};break;case ehq.PET_SERIES_MODULE:r={correctedImage:t.CorrectedImage,units:t.Units,decayCorrection:t.DecayCorrection};break;case ehq.CALIBRATION_MODULE:r={sequenceOfUltrasoundRegions:t.SequenceOfUltrasoundRegions?.map(e=>({regionSpatialFormat:e.RegionSpatialFormat,regionDataType:e.RegionDataType,regionFlags:e.RegionFlags,regionLocationMinX0:e.RegionLocationMinX0,regionLocationMinY0:e.RegionLocationMinY0,regionLocationMaxX1:e.RegionLocationMaxX1,regionLocationMaxY1:e.RegionLocationMaxY1,referencePixelX0:e.ReferencePixelX0,referencePixelY0:e.ReferencePixelY0,referencePixelPhysicalValueX:e.ReferencePixelPhysicalValueX,referencePixelPhysicalValueY:e.ReferencePixelPhysicalValueY,physicalUnitsXDirection:e.PhysicalUnitsXDirection,physicalUnitsYDirection:e.PhysicalUnitsYDirection,physicalDeltaX:e.PhysicalDeltaX,physicalDeltaY:e.PhysicalDeltaY}))};break;case"temporalPositionIdentifier":r={temporalPositionIdentifier:t.TemporalPositionIdentifier};break;default:return}return r}getUIDsFromImageID(e){if(e.startsWith("wadors:")){let t=e.split("/studies/")[1].split("/");return{StudyInstanceUID:t[0],SeriesInstanceUID:t[2],SOPInstanceUID:t[4],frameNumber:t[6]}}if(e.includes("?requestType=WADO")){let t=Lu.parse(e),r=t.frameNumber||t.frame;return{StudyInstanceUID:t.studyUID,SeriesInstanceUID:t.seriesUID,SOPInstanceUID:t.objectUID,frameNumber:r}}let t=Lw(e),r=this.imageURIToUIDs.get(t);if(!r)return;let n=ehH(e)?.framesString||r.frameNumber||"1";return{...r,frameNumber:n}}};RV.setMetaDataProvider(ehG);let ehq={GENERAL_SERIES_MODULE:"generalSeriesModule",PATIENT_STUDY_MODULE:"patientStudyModule",IMAGE_PIXEL_MODULE:"imagePixelModule",VOI_LUT_MODULE:"voiLutModule",MODALITY_LUT_MODULE:"modalityLutModule",SOP_COMMON_MODULE:"sopCommonModule",PET_IMAGE_MODULE:"petImageModule",PET_ISOTOPE_MODULE:"petIsotopeModule",PET_SERIES_MODULE:"petSeriesModule",OVERLAY_PLANE_MODULE:"overlayPlaneModule",PATIENT_DEMOGRAPHIC_MODULE:"patientDemographicModule",PATIENT_MODULE:"patientModule",GENERAL_IMAGE_MODULE:"generalImageModule",GENERAL_STUDY_MODULE:"generalStudyModule",CINE_MODULE:"cineModule",CALIBRATION_MODULE:"calibrationModule"},eh$={frameModule:e=>{let{frameNumber:t=1,numberOfFrames:r=1,SOPClassUID:n,SOPInstanceUID:a,SeriesInstanceUID:i,StudyInstanceUID:o}=e;return{frameNumber:t,numberOfFrames:r,sopClassUID:n,sopInstanceUID:a,seriesInstanceUID:i,studyInstanceUID:o}},imagePlaneModule:e=>{let t,r,n,a,i,{ImageOrientationPatient:o,ImagePositionPatient:s}=e,{PixelSpacing:l,type:u}=ehz(e)||{},d=!1,c=!1,h=!1;l?([t,r]=l,ehM.get("calibratedPixelSpacing",e.imageId)||ehU.add(e.imageId,{rowPixelSpacing:parseFloat(l[0]),columnPixelSpacing:parseFloat(l[1]),type:u})):(t=r=1,d=!0),o?(n=Ly(o.slice(0,3)),a=Ly(o.slice(3,6)),i=Ly(o)):(n=[1,0,0],a=[0,1,0],i=[1,0,0,0,1,0],d=!0,c=!0,h=!0);let p=Ly(s)||[0,0,0];return s||(d=!0),{frameOfReferenceUID:e.FrameOfReferenceUID,rows:Ly(e.Rows),columns:Ly(e.Columns),spacingBetweenSlices:Ly(e.SpacingBetweenSlices),imageOrientationPatient:i,rowCosines:n,isDefaultValueSetForRowCosine:c,columnCosines:a,isDefaultValueSetForColumnCosine:h,imagePositionPatient:p,sliceThickness:Ly(e.SliceThickness),sliceLocation:Ly(e.SliceLocation),pixelSpacing:Ly(l||1),rowPixelSpacing:t?Ly(t):null,columnPixelSpacing:r?Ly(r):null,usingDefaultValues:d}}},ehK="instance";u(6642),{...Lh,defaults:{hotkeyBindings:NB}};let ehY={activeViewportId:null,layout:{numRows:0,numCols:0,layoutType:"grid"},isHangingProtocolLayout:!1,viewports:new Map(Object.entries({default:{viewportId:"default",displaySetInstanceUIDs:[],isReady:!1,viewportOptions:{viewportId:"default"},displaySetSelectors:[],displaySetOptions:[{}],x:0,y:0,width:100,height:100,viewportLabel:null}}))};function ehZ(){return(ehZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}ei().any,ei().instanceOf(R6).isRequired,(0,ed.createContext)(null).Consumer;let ehX=(e,t,r)=>{if(!e)return;let n=e.getBoundingClientRect();n.bottom>window.innerHeight&&(t.y=t.y-n.height),n.right>window.innerWidth&&(t.x=t.x-n.width),r(t)};function ehJ(e){var t=null;return function(){return null==t&&(t=e()),t}}(0,ed.forwardRef)(({id:e,isOpen:t,title:r,content:n,contentProps:a,isDraggable:i,shouldCloseOnEsc:o=!1,shouldCloseOnOverlayClick:s=!1,showOverlay:l=!0,defaultPosition:u,onClose:d,unstyled:c,containerClassName:h},p)=>{let[m,f]=(0,ed.useState)(u),[g,y]=(0,ed.useState)(null);(0,ed.useImperativeHandle)(p,()=>({updatePosition:e=>{ehX(g,e,f)}}),[]),(0,ed.useEffect)(()=>{f(u)},[u]);let[v,b]=(0,ed.useState)(u?"invisible":"visible"),w=(0,ed.useCallback)(e=>{e&&(y(e),ehX(e,u,f),b("visible"))},[u]);return eh().createElement(ie,{open:t,modal:!1,onOpenChange:t=>{t||d(e)},isDraggable:i,shouldCloseOnEsc:o,shouldCloseOnOverlayClick:s,showOverlay:l},eh().createElement(ir,{ref:w,className:t_(c?"p-0":"",h,v),unstyled:c,style:{...m?{position:"fixed",left:`${m.x}px`,top:`${m.y}px`,transform:"translate(0, 0)",margin:0,animation:"none",transition:"none"}:{}}},!c&&eh().createElement(ia,null,r&&eh().createElement(ii,null,r)),eh().createElement(n,ehZ({},a,{hide:()=>d(e)}))))}).displayName="ManagedDialog",ei().oneOfType([ei().arrayOf(ei().node),ei().node]).isRequired,ei().shape({setServiceImplementation:ei().func}),(0,ed.createContext)({user:null,enabled:!1}).Consumer,ei().any,ei().shape({setServiceImplementation:ei().func}).isRequired;var ehQ=function(){var e;function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.entered=[],this.isNodeInDocument=e}return e=[{key:"enter",value:function(e){var t,r,n,a,i,o=this,s=this.entered.length;return this.entered=(t=this.entered.filter(function(t){return o.isNodeInDocument(t)&&(!t.contains||t.contains(e))}),r=[e],n=new Set,a=function(e){return n.add(e)},t.forEach(a),r.forEach(a),i=[],n.forEach(function(e){return i.push(e)}),i),0===s&&this.entered.length>0}},{key:"leave",value:function(e){var t,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),t.filter(function(t){return t!==e})),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),eh0=ehJ(function(){return/firefox/i.test(navigator.userAgent)}),eh1=ehJ(function(){return!!window.safari}),eh2=function(){var e;function t(e,r){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");for(var n,a,i,o=e.length,s=[],l=0;l<o;l++)s.push(l);s.sort(function(t,r){return e[t]<e[r]?-1:1});for(var u=[],d=[],c=[],h=0;h<o-1;h++)n=e[h+1]-e[h],a=r[h+1]-r[h],d.push(n),u.push(a),c.push(a/n);for(var p=[c[0]],m=0;m<d.length-1;m++){var f=c[m],g=c[m+1];if(f*g<=0)p.push(0);else{n=d[m];var y=d[m+1],v=n+y;p.push(3*v/((v+y)/f+(v+n)/g))}}p.push(c[c.length-1]);for(var b=[],w=[],x=0;x<p.length-1;x++){i=c[x];var C=p[x],k=1/d[x],M=C+p[x+1]-i-i;b.push((i-C-M)*k),w.push(M*k*k)}this.xs=e,this.ys=r,this.c1s=p,this.c2s=b,this.c3s=w}return e=[{key:"interpolate",value:function(e){var t,r=this.xs,n=this.ys,a=this.c1s,i=this.c2s,o=this.c3s,s=r.length-1;if(e===r[s])return n[s];for(var l=0,u=o.length-1;l<=u;){var d=r[t=Math.floor(.5*(l+u))];if(d<e)l=t+1;else{if(!(d>e))return n[t];u=t-1}}var c=e-r[s=Math.max(0,u)],h=c*c;return n[s]+a[s]*c+i[s]*h+o[s]*c*h}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function eh5(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function eh3(e){return{x:e.clientX,y:e.clientY}}var eh4="__NATIVE_FILE__",eh8="__NATIVE_URL__",eh6="__NATIVE_TEXT__",eh9="__NATIVE_HTML__";function eh7(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},"");return null!=n?n:r}function epe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ept=(epe(ey9={},eh4,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),epe(ey9,eh9,{exposeProperties:{html:function(e,t){return eh7(e,t,"")}},matchesTypes:["Html","text/html"]}),epe(ey9,eh8,{exposeProperties:{urls:function(e,t){return eh7(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),epe(ey9,eh6,{exposeProperties:{text:function(e,t){return eh7(e,t,"")}},matchesTypes:["Text","text/plain"]}),ey9),epr=function(){var e;function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.config=e,this.item={},this.initializeExposedProperties()}return e=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach(function(n){r[n]={value:t.config.exposeProperties[n](e,t.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function epn(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(ept).filter(function(e){return ept[e].matchesTypes.some(function(e){return t.indexOf(e)>-1})})[0]||null}var epa=function(){var e;function t(e,r){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.ownerDocument=null,this.globalContext=e,this.optionsArgs=r}return e=[{key:"window",get:function(){return this.globalContext?this.globalContext:"u">typeof window?window:void 0}},{key:"document",get:function(){var e;return null!=(e=this.globalContext)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null==(e=this.optionsArgs)?void 0:e.rootElement)||this.window}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function epi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function epo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?epi(Object(r),!0).forEach(function(t){var n,a,i;n=e,a=t,i=r[t],a in n?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):epi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eps(){return(eps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function epl(){return(epl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}"u">typeof window&&("ontouchstart"in window||navigator.maxTouchPoints),ei().any,[...[JSON.parse('{"name":"orchid","label":"Tonal: Orchid","cssVars":{"dark":{"highlight":"292 75% 62%","neutral":"270 18% 55%","neutral-light":"275 35% 75%","neutral-dark":"268 20% 24%","background":"270 45% 6%","foreground":"280 15% 96%","card":"268 40% 10%","card-foreground":"280 15% 96%","popover":"264 48% 13%","popover-foreground":"280 15% 96%","primary":"270 85% 65%","primary-foreground":"0 0% 98%","secondary":"268 45% 32%","secondary-foreground":"275 45% 88%","muted":"268 40% 10%","muted-foreground":"272 30% 60%","accent":"268 50% 20%","accent-foreground":"280 15% 96%","destructive":"0 65% 40%","destructive-foreground":"0 0% 98%","border":"268 30% 18%","input":"268 40% 25%","ring":"270 80% 60%"}}}'),JSON.parse('{"name":"arctic","label":"Tonal: Arctic","cssVars":{"dark":{"highlight":"173 81% 52%","neutral":"185 20% 55%","neutral-light":"180 40% 78%","neutral-dark":"190 18% 22%","background":"0 0% 0%","foreground":"180 10% 97%","card":"203 39% 9%","card-foreground":"180 10% 97%","popover":"202 54% 11%","popover-foreground":"180 10% 97%","primary":"175 85% 42%","primary-foreground":"185 50% 8%","secondary":"180 45% 28%","secondary-foreground":"175 50% 88%","muted":"203 39% 9%","muted-foreground":"185 30% 60%","accent":"185 55% 18%","accent-foreground":"180 10% 97%","destructive":"0 65% 35%","destructive-foreground":"0 0% 98%","border":"190 25% 17%","input":"223 40% 24%","ring":"175 85% 42%"}}}'),JSON.parse('{"name":"verdant","label":"Tonal: Verdant","cssVars":{"dark":{"highlight":"152 79% 52%","neutral":"150 15% 52%","neutral-light":"145 30% 72%","neutral-dark":"155 18% 24%","background":"155 40% 5%","foreground":"140 15% 95%","card":"152 35% 9%","card-foreground":"140 15% 95%","popover":"167 65% 10%","popover-foreground":"140 15% 95%","primary":"152 75% 40%","primary-foreground":"155 50% 8%","secondary":"150 40% 26%","secondary-foreground":"145 40% 85%","muted":"152 35% 9%","muted-foreground":"148 25% 55%","accent":"150 45% 16%","accent-foreground":"140 15% 95%","destructive":"0 65% 38%","destructive-foreground":"0 0% 98%","border":"150 25% 16%","input":"150 35% 22%","ring":"152 75% 40%"}}}'),JSON.parse('{"name":"midnight","label":"Neutral: Midnight","cssVars":{"dark":{"highlight":"188 90% 58%","neutral":"213 22% 59%","neutral-light":"214 69% 81%","neutral-dark":"214 16% 21%","background":"240 15% 3%","foreground":"0 0% 99%","card":"240 12% 8%","card-foreground":"0 0% 99%","popover":"225 45% 13%","popover-foreground":"0 0% 99%","primary":"210 100% 62%","primary-foreground":"0 0% 99%","secondary":"215 55% 32%","secondary-foreground":"200 60% 88%","muted":"240 12% 8%","muted-foreground":"210 40% 70%","accent":"220 65% 20%","accent-foreground":"0 0% 99%","destructive":"0 70% 35%","destructive-foreground":"0 0% 99%","border":"240 10% 18%","input":"225 35% 24%","ring":"210 100% 62%"}}}'),JSON.parse('{"name":"slate","label":"Neutral: Slate","cssVars":{"dark":{"highlight":"217 97% 52%","neutral":"0 0% 55%","neutral-light":"0 0% 75%","neutral-dark":"0 0% 25%","background":"0 0% 0%","foreground":"0 0% 96%","card":"0 0% 7%","card-foreground":"0 0% 96%","popover":"0 0% 9%","popover-foreground":"0 0% 96%","primary":"230 75% 55%","primary-foreground":"0 0% 98%","secondary":"0 0% 25%","secondary-foreground":"0 0% 85%","muted":"0 0% 7%","muted-foreground":"0 0% 60%","accent":"0 0% 18%","accent-foreground":"0 0% 96%","destructive":"0 65% 40%","destructive-foreground":"0 0% 98%","border":"0 0% 18%","input":"0 0% 22%","ring":"215 75% 55%"}}}'),JSON.parse('{"name":"deep","label":"Neutral: Deep","cssVars":{"dark":{"highlight":"184 53% 54%","neutral":"215 15% 50%","neutral-light":"210 20% 68%","neutral-dark":"220 18% 22%","background":"0 0% 0%","foreground":"215 15% 82%","card":"218 25% 5%","card-foreground":"215 15% 82%","popover":"215 30% 8%","popover-foreground":"215 15% 82%","primary":"200 43% 48%","primary-foreground":"210 20% 92%","secondary":"218 30% 18%","secondary-foreground":"215 25% 75%","muted":"214 28% 5%","muted-foreground":"215 18% 48%","accent":"216 32% 12%","accent-foreground":"215 15% 82%","destructive":"0 50% 35%","destructive-foreground":"0 15% 90%","border":"218 22% 10%","input":"216 28% 15%","ring":"215 45% 42%"}}}')].map(e=>e.name)],ei().string,ei().node,ei().bool,ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("bg-card text-card-foreground border-input rounded-lg border shadow",e)},t))).displayName="Card",ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("flex flex-col space-y-1.5 p-6",e)},t))).displayName="CardHeader",ed.forwardRef(({className:e,...t},r)=>ed.createElement("h3",eps({ref:r,className:t_("font-semibold leading-none tracking-tight",e)},t))).displayName="CardTitle",ed.forwardRef(({className:e,...t},r)=>ed.createElement("p",eps({ref:r,className:t_("text-muted-foreground text-base",e)},t))).displayName="CardDescription",ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("p-6 pt-0",e)},t))).displayName="CardContent",ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("flex items-center p-6 pt-0",e)},t))).displayName="CardFooter";let epu=ed.forwardRef(({className:e,containerClassName:t,noScroll:r=!1,...n},a)=>ed.createElement("div",{className:t_("relative w-full",!r&&"overflow-auto",t)},ed.createElement("table",epl({ref:a,className:t_("caption-bottom text-muted-foreground w-full text-base",e)},n))));epu.displayName="Table";let epd=ed.forwardRef(({className:e,...t},r)=>ed.createElement("thead",epl({ref:r,className:t_("border-input/50 [&_tr]:border-b",e)},t)));epd.displayName="TableHeader";let epc=ed.forwardRef(({className:e,...t},r)=>ed.createElement("tbody",epl({ref:r,className:t_("[&_tr:last-child]:border-0",e)},t)));epc.displayName="TableBody",ed.forwardRef(({className:e,...t},r)=>ed.createElement("tfoot",epl({ref:r,className:t_("bg-muted border-input/50 border-t [&>tr]:last:border-b-0",e)},t))).displayName="TableFooter";let eph=ed.forwardRef(({className:e,...t},r)=>ed.createElement("tr",epl({ref:r,className:t_("hover:bg-muted text-muted-foreground hover:text-highlight hover:[&>td]:text-highlight hover:[&>th]:text-highlight","data-[state=selected]:bg-popover data-[state=selected]:hover:bg-popover","data-[state=selected]:text-foreground data-[state=selected]:[&>td]:text-foreground data-[state=selected]:[&>th]:text-foreground","data-[state=selected]:hover:text-foreground data-[state=selected]:hover:[&>td]:text-foreground data-[state=selected]:hover:[&>th]:text-foreground","border-input/50 border-b transition-colors",e)},t)));eph.displayName="TableRow";let epp=ed.forwardRef(({className:e,...t},r)=>ed.createElement("th",epl({ref:r,className:t_("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e)},t)));epp.displayName="TableHead";let epm=ed.forwardRef(({className:e,...t},r)=>ed.createElement("td",epl({ref:r,className:t_("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e)},t)));epm.displayName="TableCell",ed.forwardRef(({className:e,...t},r)=>ed.createElement("caption",epl({ref:r,className:t_("text-muted-foreground mt-4 text-base",e)},t))).displayName="TableCaption",ei().string,ei().func.isRequired,ei().array,ei().node;ei().string,ei().string,ei().string,ei().string,ei().string,ei().string,ei().string,ei().string,ei().bool,ei().object,ei().func.isRequired,ei().func,ei().shape({label:ei().string.isRequired,studyDate:ei().string.isRequired,seriesDescription:ei().string.isRequired,patientInformation:ei().shape({patientName:ei().string,patientSex:ei().string,patientAge:ei().string,MRN:ei().string,thickness:ei().string,thicknessUnits:ei().string,spacing:ei().string,scanner:ei().string})}).isRequired,ei().func.isRequired;ei().func.isRequired,ei().string,ei().node.isRequired,ei().string,ei().bool.isRequired,ei().string.isRequired,ei().func.isRequired,ei().func.isRequired,ei().func,ei().object;let epf=((eyp={})[eyp.topLeft=0]="topLeft",eyp[eyp.topRight=1]="topRight",eyp[eyp.bottomLeft=2]="bottomLeft",eyp[eyp.bottomRight=3]="bottomRight",eyp[eyp.topMiddle=4]="topMiddle",eyp[eyp.bottomMiddle=5]="bottomMiddle",eyp[eyp.leftMiddle=6]="leftMiddle",eyp[eyp.rightMiddle=7]="rightMiddle",eyp),epg="pointer-events-auto flex items-center";epf.topLeft,em()(epg,"absolute top-[4px] left-[0px] pl-[4px]"),epf.topRight,em()(epg,"absolute top-[4px] right-viewport-scrollbar"),epf.bottomLeft,em()(epg,"absolute bottom-[3px] left-[0px] pl-[4px]"),epf.bottomRight,em()(epg,"absolute bottom-[3px] right-viewport-scrollbar"),epf.topMiddle,em()(epg,"absolute top-[25px] left-1/2 -translate-x-1/2"),epf.bottomMiddle,em()(epg,"absolute bottom-[3px] left-1/2 -translate-x-1/2"),epf.leftMiddle,em()(epg,"absolute left-[20px] top-[calc(50%+2px)] -translate-y-1/2 pl-[4px]"),epf.rightMiddle,em()(epg,"absolute top-1/2 -translate-y-1/2 right-viewport-scrollbar");function epy(){return(epy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}ei().node,ei().node,ei().node,ei().node,ei().string,ei().string,ei().number.isRequired,ei().number.isRequired,ei().string,ei().arrayOf(ei().node).isRequired,eh().forwardRef(({className:e,children:t,...r},n)=>eh().createElement("div",epy({ref:n,className:t_("flex items-center",e)},r),t)).displayName="ToolButtonList",eh().forwardRef(({className:e,children:t,tooltip:r,disabledText:n,disabled:a,...i},o)=>{let s=r||n,l=eh().createElement("div",epy({ref:o,className:t_("flex items-center",e)},i),t);return s?eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("span",null,l)),eh().createElement(IP,{side:"bottom"},r&&eh().createElement("div",null,r),n&&a&&eh().createElement("div",{className:"text-muted-foreground"},n))):l}).displayName="ToolButtonListDefault",eh().forwardRef(({children:e,className:t,...r},n)=>eh().createElement(_1,r,eh().createElement(_5,{asChild:!0},eh().createElement(rM,{variant:"ghost",size:"icon",className:t_("text-foreground/80 hover:bg-background hover:text-highlight border-primary","inline-flex h-10 w-5 items-center justify-center","!rounded-tr-lg !rounded-br-lg !rounded-tl-none !rounded-bl-none","bg-transparent",t)},eh().createElement(hO.ByName,{name:"chevron-down",className:"text-primary h-5 w-5"}))),eh().createElement(Do,{ref:n,side:"bottom",align:"start",alignOffset:-40},e))).displayName="ToolButtonListDropDown",eh().forwardRef(({className:e,children:t,icon:r,disabledText:n,tooltip:a,disabled:i,...o},s)=>{let l=a||("string"==typeof t?t:void 0),u=eh().createElement(Ds,epy({ref:s,className:t_("flex items-center space-x-2",e),disabled:i},o),r&&eh().createElement(hO.ByName,{name:r||"MissingIcon",className:"h-6 w-6"}),t);return i?eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("span",null,u)),eh().createElement(IP,{side:"bottom"},l&&eh().createElement("div",null,l),n&&i&&eh().createElement("div",{className:"text-muted-foreground"},n))):u}).displayName="ToolButtonListItem",eh().forwardRef(({className:e,...t},r)=>eh().createElement("div",epy({ref:r,className:t_("bg-primary h-5 w-px self-center",e)},t))).displayName="ToolButtonListDivider";let epv=(0,ed.createContext)(void 0),epb=()=>{let e=(0,ed.useContext)(epv);if(void 0===e)throw Error("useLayoutSelector must be used within a LayoutSelector component");return e},epw=({onSelectionChange:e,onSelection:t=e=>{},onSelectionPreset:r=e=>{},children:n,open:a,onOpenChange:i,tooltipDisabled:o})=>{let[s,l]=(0,ed.useState)(!1),u=void 0!==a,d=u?a:s,c=u?i:l,h=(0,ed.useCallback)(r=>{t(r),e&&e(r,!1),c(!1)},[t,e,c]),p=(0,ed.useCallback)(t=>{r(t),e&&e(t,!0),c(!1)},[r,e,c]);return eh().createElement(epv.Provider,{value:{isOpen:d,setIsOpen:c,onSelection:h,onSelectionPreset:p}},eh().createElement(hB,{open:d,onOpenChange:c},n))};function epx(e,t){return"function"==typeof e?e(t):e}function epC(e,t){return r=>{t.setState(t=>({...t,[e]:epx(r,t[e])}))}}function epk(e){return e instanceof Function}function epM(e,t,r){let n,a=[];return i=>{let o,s;r.key&&r.debug&&(o=Date.now());let l=e(i);if(!(l.length!==a.length||l.some((e,t)=>a[t]!==e)))return n;if(a=l,r.key&&r.debug&&(s=Date.now()),n=t(...l),null==r||null==r.onChange||r.onChange(n),r.key&&r.debug&&null!=r&&r.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-s)*100)/100,n=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} /${a(e,5)} ms`,`
1837
+ `,this.dom.appendChild(this.metricsColumn),this.dom.appendChild(this.bindingsColumn)}isMemoryAvailable(){return void 0!==performance.memory}addPanel(e,t){((e===ey8.RENDER_MODES?this.bindingsColumn:this.metricsColumn)??this.dom).appendChild(t.dom),this.panels.set(e,t)}startLoop(){let e=()=>{this.update(),this.animationFrameId=requestAnimationFrame(e)};this.animationFrameId=requestAnimationFrame(e)}stopLoop(){null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}updateStats(){this.frameCount++;let e=performance.now(),t=e-this.startTime,r=this.panels.get(ey8.MS);if(r&&r.update(t,200),e>=this.lastUpdateTime+1e3){let t=1e3*this.frameCount/(e-this.lastUpdateTime),r=this.panels.get(ey8.FPS);r&&r.update(t,300),this.lastUpdateTime=e,this.frameCount=0,this.updateMemoryPanel(),this.updateRenderModesPanel()}return e}updateRenderModesPanel(){let e=this.panels.get(ey8.RENDER_MODES);if(!(e instanceof ehc))return;let t=[];for(let e of FR())if(e&&!e.hasBeenDestroyed)for(let r of e.getViewports()){let n=r._debug?.renderModes;t.push({renderingEngineId:e.id,viewportId:r.id,viewportType:r.type,bindings:this.getViewportBindingDebugEntries(r,n??{})})}e.setContent(t)}getViewportBindingDebugEntries(e,t){let r=e.getActors?.()??[],n=e.getSourceDataId?.(),a=Object.entries(t);return a.length?a.map(([t,a])=>{var i,o;let s=ehb(e,t,n),l="source"===s?e.getDefaultActor?.():(i=r,o=t,i.find(e=>e.uid===o||e.representationUID===o||e.referencedId===o));return{actorUID:l?.uid,dataId:t,referencedId:l?.referencedId,renderMode:a,role:s,...ehw(l)}}):r.map(t=>{let r=t.representationUID??t.uid??"";return{actorUID:t.uid,dataId:r,referencedId:t.referencedId,renderMode:"-",role:ehb(e,r,n),...ehw(t)}})}updateMemoryPanel(){let e=this.panels.get(ey8.MEMORY);if(!e)return;let t=performance;if(t.memory){let r=t.memory.usedJSHeapSize/1048576,n=t.memory.jsHeapSizeLimit/1048576;e.update(r,n)}}attachDragHandlers(){this.dom?.addEventListener("pointerdown",this.handlePointerDown)}detachDragHandlers(){this.dom?.removeEventListener("pointerdown",this.handlePointerDown),window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp),window.removeEventListener("pointercancel",this.handlePointerUp)}onPointerDown(e){if(!this.dom||0!==e.button)return;this.dragPointerId=e.pointerId;let t=this.dom.getBoundingClientRect();this.dragOffsetX=e.clientX-t.left,this.dragOffsetY=e.clientY-t.top,this.setPosition(t.left,t.top),window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp),window.addEventListener("pointercancel",this.handlePointerUp),e.preventDefault()}onPointerMove(e){this.dragPointerId===e.pointerId&&this.dom&&this.setPosition(e.clientX-this.dragOffsetX,e.clientY-this.dragOffsetY)}onPointerUp(e){if(this.dragPointerId!==e.pointerId||!this.dom)return;this.dragPointerId=null,window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp),window.removeEventListener("pointercancel",this.handlePointerUp);let t=this.dom.getBoundingClientRect();this.savePosition(t.left,t.top)}setPosition(e,t){if(!this.dom)return;let r=this.clampToViewport(e,t);this.dom.style.left=`${r.left}px`,this.dom.style.top=`${r.top}px`,this.dom.style.right="auto",this.dom.style.bottom="auto"}clampToViewport(e,t){if(!this.dom)return{left:e,top:t};let r=this.dom.offsetWidth,n=this.dom.offsetHeight;return{left:Math.min(Math.max(0,e),Math.max(0,window.innerWidth-r)),top:Math.min(Math.max(0,t),Math.max(0,window.innerHeight-n))}}restorePosition(){let e=this.readSavedPosition();e&&this.setPosition(e.left,e.top)}readSavedPosition(){try{let e=window.localStorage.getItem(ehu);if(!e)return null;let t=JSON.parse(e);if("number"!=typeof t?.left||"number"!=typeof t?.top||!Number.isFinite(t.left)||!Number.isFinite(t.top))return null;return{left:t.left,top:t.top}}catch{return null}}savePosition(e,t){try{window.localStorage.setItem(ehu,JSON.stringify({left:e,top:t}))}catch{}}}function ehb(e,t,r){let n=e.getDisplaySetRole?.(t);return"source"===n||"overlay"===n?n:r&&t===r?"source":"data"}function ehw(e){let t=e?.actor?.getMapper?.()?.getInputData?.();if(!t)return{};try{let e=t.getPointData?.()?.getScalars?.();if(e?.getDataType){let t=e.getNumberOfComponents?.()??1,r=t>1?e.getRange?.(0):e.getRange?.();return{scalarType:e.getDataType(),scalarRange:ehx(r),numberOfComponents:t}}let r=t.getScalarData?.();if(r?.constructor?.name){let e=Number.isFinite(t.minPixelValue)&&Number.isFinite(t.maxPixelValue)?[t.minPixelValue,t.maxPixelValue]:void 0;return{scalarType:r.constructor.name,scalarRange:ehx(e)}}}catch{}return{}}function ehx(e){if(e&&!(e.length<2)&&Number.isFinite(e[0])&&Number.isFinite(e[1]))return[e[0],e[1]]}ehv.instance=null;let ehC=ehv.getInstance();class ehk{constructor(e){throw this._needsRender=new Set,this._animationFrameSet=!1,this._animationFrameHandle=null,this.renderFrameOfReference=e=>{let t=this._getViewportsAsArray().map(t=>{if(t.getFrameOfReferenceUID()===e)return t.id});this.renderViewports(t)},this.id=e||F2(),this.useCPURendering=BI(),(e=>{FO[e.id]=e})(this),Error("@cornerstonejs/core is not initialized, run init() first")}enableElement(e){let t=this._normalizeViewportInputEntry(e);this._throwIfDestroyed();let{element:r,viewportId:n}=t;if(!r)throw Error("No element provided");this.getViewport(n)&&this.disableElement(n);let{type:a}=t;eho(a)?this.addCustomViewport(t):this.enableVTKjsDrivenViewport(t);let i=GK(r),{background:o}=t.defaultOptions;this.fillCanvasWithBackgroundColor(i,o)}disableElement(e){this._throwIfDestroyed();let t=this.getViewport(e);t?(this._resetViewport(t),!eho(t.type)&&this.offscreenMultiRenderWindow&&this.offscreenMultiRenderWindow.removeRenderer(e),this._removeViewport(e),t.isDisabled=!0,this._needsRender.delete(e),this.getViewports().length||this._clearAnimationFrame()):console.warn(`viewport ${e} does not exist`)}disableViewport(e){this.disableElement(e)}setViewports(e){let t=this._normalizeViewportInputEntries(e);this._throwIfDestroyed(),this._reset();let r=[],n=[];t.forEach(e=>{eho(e.type)?n.push(e):r.push(e)}),this.setVtkjsDrivenViewports(r),this.setCustomViewports(n),t.forEach(e=>{let t=GK(e.element),{background:r}=e.defaultOptions;this.fillCanvasWithBackgroundColor(t,r)})}resize(e=!0,t=!0){this._throwIfDestroyed();let r=this._getViewportsAsArray(),n=[],a=[];r.forEach(e=>{ehs(e)?a.push(e):n.push(e)}),n.length&&this._resizeVTKViewports(n,t,e),a.length&&this._resizeUsingCustomResizeHandler(a,t,e)}getViewport(e){return this._viewports?.get(e)}getViewports(){return this._throwIfDestroyed(),this._getViewportsAsArray()}render(){let e=this.getViewports().map(e=>e.id);this._setViewportsToBeRenderedNextFrame(e)}renderViewports(e){this._setViewportsToBeRenderedNextFrame(e)}renderViewport(e){this._setViewportsToBeRenderedNextFrame([e])}destroy(){let e;if(this.hasBeenDestroyed)return;ehC.cleanup();let t=this._getViewportsAsArray();this._reset(),this.offscreenMultiRenderWindow&&(t.forEach(e=>{this.offscreenMultiRenderWindow&&!ehs(e)&&this.offscreenMultiRenderWindow.getRenderer(e.id)&&this.offscreenMultiRenderWindow.removeRenderer(e.id)}),this.offscreenMultiRenderWindow.delete(),delete this.offscreenMultiRenderWindow),e=this.id,delete FO[e],this.hasBeenDestroyed=!0}fillCanvasWithBackgroundColor(e,t){let r=e.getContext("2d");r.fillStyle=t?Array.isArray(t)?`rgb(${t.map(e=>Math.round(255*e)).join(",")})`:t:"black",r.fillRect(0,0,e.width,e.height)}_normalizeViewportInputEntry(e){let t=e.type,{type:r}=e,{defaultOptions:n}=e;if(BP()){let e=ehk.NEXT_TYPE_REMAP[r];e&&(r=e)}let a=n;return a&&0!==Object.keys(a).length||(a={background:[0,0,0],orientation:null,displayArea:null},t===Nq.ORTHOGRAPHIC&&(a={...a,orientation:NQ.AXIAL})),{...e,requestedType:t!==r||BP()?t:void 0,type:r,defaultOptions:a}}_normalizeViewportInputEntries(e){let t=[];return e.forEach(e=>{t.push(this._normalizeViewportInputEntry(e))}),t}_resizeUsingCustomResizeHandler(e,t=!0,r=!0){e.forEach(e=>{e.resizeForRenderingEngine({keepCamera:t})}),r&&this.render()}_removeViewport(e){this.getViewport(e)?this._viewports.delete(e):console.warn(`viewport ${e} does not exist`)}addCustomViewport(e){let{element:t,viewportId:r,type:n,defaultOptions:a}=e;t.tabIndex=-1;let i=GK(t),{clientWidth:o,clientHeight:s}=i;(i.width!==o||i.height!==s)&&(i.width=o,i.height=s);let l={id:r,renderingEngineId:this.id,element:t,type:n,canvas:i,sx:0,sy:0,sWidth:o,sHeight:s,defaultOptions:a||{}},u=new(ehi(e))(l);u.requestedType=n,this._viewports.set(r,u);let d={element:t,viewportId:r,renderingEngineId:this.id};Bh(Bc,NH.ELEMENT_ENABLED,d)}getRenderer(e){return this.offscreenMultiRenderWindow.getRenderer(e)}getOffscreenMultiRenderWindow(e){if(!this.offscreenMultiRenderWindow)throw Error("Offscreen multi render window is not available.");return this.offscreenMultiRenderWindow}setCustomViewports(e){e.forEach(e=>{this.addCustomViewport(e)})}_getViewportsAsArray(){return Array.from(this._viewports.values())}_setViewportsToBeRenderedNextFrame(e){e.forEach(e=>{this._needsRender.add(e);let t=this._viewports.get(e);t&&(t.viewportStatus=Fw.NEEDS_RENDER)}),this._render()}_render(){this._needsRender.size>0&&!this._animationFrameSet&&(this._animationFrameHandle=window.requestAnimationFrame(this._renderFlaggedViewports),this._animationFrameSet=!0)}_resetViewport(e){let t=this.id,{element:r,canvas:n,id:a}=e;e.removeWidgets(),Bh(Bc,NH.ELEMENT_DISABLED,{element:r,viewportId:a,renderingEngineId:t}),e.destroy?.(),r.removeAttribute("data-viewport-uid"),r.removeAttribute("data-rendering-engine-uid"),n.getContext("2d").clearRect(0,0,n.width,n.height)}_clearAnimationFrame(){window.cancelAnimationFrame(this._animationFrameHandle),this._needsRender.clear(),this._animationFrameSet=!1,this._animationFrameHandle=null}_reset(){this._getViewportsAsArray().forEach(e=>{this._resetViewport(e)}),this._clearAnimationFrame(),this._viewports=new Map}_throwIfDestroyed(){if(this.hasBeenDestroyed)throw Error("this.destroy() has been manually called to free up memory, can not longer use this instance. Instead make a new one.")}}ehk.NEXT_TYPE_REMAP={[Nq.STACK]:Nq.PLANAR_NEXT,[Nq.ORTHOGRAPHIC]:Nq.PLANAR_NEXT,[Nq.VIDEO]:Nq.VIDEO_NEXT,[Nq.WHOLE_SLIDE]:Nq.WHOLE_SLIDE_NEXT,[Nq.ECG]:Nq.ECG_NEXT,[Nq.VOLUME_3D]:Nq.VOLUME_3D_NEXT},(eyh=ey6||(ey6={}))[eyh.None=0]="None",eyh[eyh.Capture=1]="Capture",eyh[eyh.Bubble=2]="Bubble",Symbol("LastRuntimeId");let ehM=VG;function ehS(e){return Array.isArray(e)?e:[e]}new class{constructor(e="Tools",t=50){this.position=-1,this.redoAvailable=0,this.undoAvailable=0,this.ring=[],this.isRecordingGrouped=!1,this.label=e,this._size=t}get size(){return this._size}set size(e){this.ring=Array(e),this._size=e,this.position=-1,this.redoAvailable=0,this.undoAvailable=0}get canUndo(){return this.undoAvailable>0}get canRedo(){return this.redoAvailable>0}undo(e=1){for(;e>0&&this.undoAvailable>0;){for(let e of ehS(this.ring[this.position]).reverse())e.restoreMemo(!0),this.dispatchHistoryEvent({item:e,isUndo:!0});e--,this.redoAvailable++,this.undoAvailable--,this.position=(this.position-1+this.size)%this.size}}undoIf(e){return!!(this.undoAvailable>0&&e(this.ring[this.position]))&&(this.undo(),!0)}dispatchHistoryEvent({item:e,isUndo:t}){e.id&&Bc.dispatchEvent(new CustomEvent(t?"CORNERSTONE_TOOLS_HISTORY_UNDO":"CORNERSTONE_TOOLS_HISTORY_REDO",{detail:{isUndo:t,id:e.id,operationType:e.operationType||"annotation",memo:e}}))}redo(e=1){for(;e>0&&this.redoAvailable>0;){let t=(this.position+1)%this.size;for(let e of ehS(this.ring[t]).reverse())e.restoreMemo(!1),this.dispatchHistoryEvent({item:e,isUndo:!1});e--,this.position=t,this.undoAvailable++,this.redoAvailable--}}initializeGroupItem(){this.redoAvailable=0,this.undoAvailable<this._size&&this.undoAvailable++,this.position=(this.position+1)%this._size,this.ring[this.position]=[]}startGroupRecording(){this.isRecordingGrouped=!0,this.initializeGroupItem()}rollbackUnusedGroupItem(){this.ring[this.position]=void 0,this.position=(this.position-1)%this._size,this.undoAvailable--}endGroupRecording(){this.isRecordingGrouped=!1;let e=this.ring[this.position];Array.isArray(e)&&0===e.length&&this.rollbackUnusedGroupItem()}pushGrouped(e){let t=this.ring[this.position];if(Array.isArray(t))return t.push(e),e;throw Error("Last item should be an array for grouped memos.")}push(e){if(!e)return;let t=e.restoreMemo?e:e.createMemo?.();if(t)return this.isRecordingGrouped?this.pushGrouped(t):(this.redoAvailable=0,this.undoAvailable<this._size&&this.undoAvailable++,this.position=(this.position+1)%this._size,this.ring[this.position]=t,t)}replaceCurrentMemo(e,t){if(!e||0===this.undoAvailable)return!1;let r=this.ring[this.position],n=ehS(r).findIndex(t);if(-1===n)return!1;let a=e.restoreMemo?e:e.createMemo?.();return!!a&&(Array.isArray(r)?r[n]=a:this.ring[this.position]=a,!0)}};let ehE={},ehT={add:(e,t)=>{let[r,n]=e,a=`${r}_${n}`;ehE[a]||(ehE[a]={}),ehE[a]=t},get:(e,t,r)=>{if("spatialRegistrationModule"!==e)return;let n=`${t}_${r}`;if(ehE[n])return ehE[n];let a=`${r}_${t}`;if(ehE[a])return Lv.mat4.invert(Lv.mat4.create(),ehE[a])}};HR(ehT.get.bind(ehT));let{Cc:ehI,VD:ehP,lJ:eh_}=Z,ehD=new F5("imageRetrievalPool");ehD.setMaxSimultaneousRequests(NG.Interaction,200),ehD.setMaxSimultaneousRequests(NG.Thumbnail,200),ehD.setMaxSimultaneousRequests(NG.Prefetch,200),ehD.grabDelay=0;let ehO=Symbol("DefaultSettings"),ehA=Symbol("RuntimeSettings"),ehR=Symbol("ObjectSettingsMap"),ehL=Symbol("Dictionary");class ehN{constructor(e){const t=Object.create(e instanceof ehN&&ehL in e?e[ehL]:null);Object.seal(Object.defineProperty(this,ehL,{value:t}))}set(e,t){return ehF(this[ehL],e,t,null)}get(e){var t;return t=this[ehL],t[e]}unset(e){return function(e,t){if(t.endsWith(".")){let r=0,n=t.slice(0,-1),a=0===n.length;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(a||i.startsWith(t)||i===n)&&(delete e[i],++r);return r>0}return delete e[t]}(this[ehL],e+"")}forEach(e){ehV(this[ehL],e)}extend(){return new ehN(this)}import(e){ehB(e)&&Object.keys(e).forEach(t=>{ehF(this[ehL],t,e[t],null)})}dump(){let e={};return ehV(this[ehL],(t,r)=>{void 0!==r&&function e(t,r,n){let a=r.indexOf(".");if(a>=0){let i=r.slice(0,a),o=t[i];if("object"!=typeof o||null===o){let e=o;o={},void 0!==e&&(o[""]=e),t[i]=o}e(o,r.slice(a+1,r.length),n)}else t[r]=n}(e,t,r)}),e}static assert(e){return e instanceof ehN?e:ehN.getRuntimeSettings()}static getDefaultSettings(e=null){let t=ehN[ehO];if(t instanceof ehN||(t=new ehN,ehN[ehO]=t),e){let r={};return t.forEach(n=>{n.startsWith(e)&&(r[n.split(`${e}.`)[1]]=t.get(n))}),r}return t}static getRuntimeSettings(){let e=ehN[ehA];return e instanceof ehN||(e=new ehN(ehN.getDefaultSettings()),ehN[ehA]=e),e}static getObjectSettings(e,t){let r=null;if(e instanceof ehN)r=e;else if("object"==typeof e&&null!==e){let n=ehN[ehR];n instanceof WeakMap||(n=new WeakMap,ehN[ehR]=n),(r=n.get(e))instanceof ehN||(r=new ehN(ehN.assert(ehN.getObjectSettings(t))),n.set(e,r))}return r}static extendRuntimeSettings(){return ehN.getRuntimeSettings().extend()}}function ehV(e,t){for(let r in e)t(r,e[r])}function ehF(e,t,r,n){if(function(e){let t,r,n;if("string"!=typeof e||(t=e.length-1)<0)return!1;for(n=-1;(r=e.indexOf(".",n+1))>=0;){if(r-n<2||r===t)return!1;n=r}return!0}(t)){if(ehB(r)){let i;var a=n instanceof WeakSet?n:new WeakSet;if(a.has(r))return ehF(e,t,null,a);for(let n in a.add(r),i=0,r)Object.prototype.hasOwnProperty.call(r,n)&&!ehF(e,0===n.length?t:`${t}.${n}`,r[n],a)&&++i;return a.delete(r),0===i}return e[t]=r,!0}return!1}function ehB(e){if("object"==typeof e&&null!==e){let t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t)return!0}return!1}function ehj(e,t,r){let{PaletteColorLookupTableUID:n}=e;if(void 0!==e[t]||void 0!==n)return function(e,t){let r=t[0]||65536,n=t[2];if(!e)return;let a=e=>{let t=e.buffer||e,a=t.byteLength===2*r||n>8?new Uint16Array(t):new Uint8Array(t),i=[];for(let e=0;e<r;e++)i[e]=a[e];return i};if(e.palette)return e.palette;if(e.InlineBinary)try{let t=Uint8Array.from(atob(e.InlineBinary),e=>e.charCodeAt(0));return e.palette=a(t)}catch(t){console.log("Couldn't decode",e.InlineBinary,t);return}let i=Array.isArray(e)?e[0]:e;return i instanceof ArrayBuffer?e.palette=a(i):e.retrieveBulkData?e.retrieveBulkData().then(t=>e.palette=a(t)):void console.error(`No data found for ${e} palette`)}(e[t],e[r])}function ehW(e,t,r){if(e[r])return e[r];let n=Object.create(e);return Object.defineProperty(e,r,{value:n,writable:!1,enumerable:!1}),t&&[...t?Object.values(t).filter(Boolean).map(e=>e[0]).filter(e=>"object"==typeof e):[]].forEach(e=>{e.SOPInstanceUID||Object.entries(e).forEach(([e,t])=>{n[e]=t})}),n}ehN.getDefaultSettings().set("useCursors",!0);let{ZX:ehU,Cc:ehz}=et,{nw:ehH}=Z,ehG=new class{constructor(){this.imageURIToUIDs=new Map,this.customMetadata=new Map}addImageIdToUIDs(e,t){if(!e)throw Error("MetadataProvider::Empty imageId");let r=Lw(e);this.imageURIToUIDs.set(r,t)}addCustomMetadata(e,t,r){let n=Lw(e);this.customMetadata.has(t)||this.customMetadata.set(t,{}),this.customMetadata.get(t)[n]=r}_getInstance(e){if(!e)throw Error("MetadataProvider::Empty imageId");let t=this.getUIDsFromImageID(e);if(!t)return;let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a,frameNumber:i}=t,o=RV.getInstance(r,n,a);if(!o)return;let s=i&&((e,t)=>{let{PerFrameFunctionalGroupsSequence:r,SharedFunctionalGroupsSequence:n,NumberOfFrames:a,ImageType:i}=t;if(a<2)return t;t.ImageType=Array.isArray(i)&&i||"string"==typeof i&&i.split("\\")||i;let o=Number.parseInt(e||1),s=t.DetectorInformationSequence&&(!t.ImagePositionPatient||!t.ImageOrientationPatient);if(r&&n||s||a>1){!t.ImageOrientationPatient&&t.DetectorInformationSequence&&(t.ImageOrientationPatient=t.DetectorInformationSequence[0].ImageOrientationPatient);let e=t.ImagePositionPatient;if(!t.ImagePositionPatient&&t.DetectorInformationSequence){let r=t.DetectorInformationSequence[0].ImagePositionPatient,n=t.ImageOrientationPatient;r=r?.map(e=>Number(e)),n=n?.map(e=>Number(e));let a=Number(t.SpacingBetweenSlices);if(n&&a){let t=Lv.vec3.fromValues(n[0],n[1],n[2]),i=Lv.vec3.fromValues(n[3],n[4],n[5]),s=Lv.vec3.cross(Lv.vec3.create(),t,i),l=Lv.vec3.scaleAndAdd(Lv.vec3.create(),r,s,a*(o-1));e=[l[0],l[1],l[2]]}}t._parentInstance||Object.defineProperty(t,"_parentInstance",{value:{...t},enumerable:!1,writable:!1,configurable:!1});let a=ehW(t._parentInstance,n?.[0],"_shared"),i=ehW(a,r?.[o-1],o);return i.ImagePositionPatient=e??i.ImagePositionPatient??[0,0,o],Object.defineProperty(i,"frameNumber",{value:o,writable:!0,enumerable:!1,configurable:!0}),i}if(t.GridFrameOffsetVector){t._parentInstance||Object.defineProperty(t,"_parentInstance",{value:{...t},enumerable:!1,writable:!1,configurable:!1});let e=ehW(t._parentInstance,n?.[0],"_shared"),a=ehW(e,r?.[o-1],o),i=a.ImagePositionPatient?.map(Number),s=a.ImageOrientationPatient?.map(Number),l=Number(t.GridFrameOffsetVector[o-1]);if(i&&s&&!Number.isNaN(l)){let e=Lv.vec3.fromValues(s[0],s[1],s[2]),t=Lv.vec3.fromValues(s[3],s[4],s[5]),r=Lv.vec3.cross(Lv.vec3.create(),e,t),n=Lv.vec3.scaleAndAdd(Lv.vec3.create(),Lv.vec3.fromValues(...i),r,l);a.ImagePositionPatient=[n[0],n[1],n[2]]}return Object.defineProperty(a,"frameNumber",{value:o,writable:!0,enumerable:!1,configurable:!0}),a}return t})(i,o)||o;return s&&Object.defineProperty(s,"imageId",{value:e,writable:!0,enumerable:!1,configurable:!0}),s}get(e,t,r={fallback:!1}){if(Array.isArray(t))return;let n=this._getInstance(t);if(e===ehK)return n;if(this.customMetadata.has(e)){let r=this.customMetadata.get(e),n=Lw(t);if(r[n])return r[n]}return this.getTagFromInstance(e,n,r)}getTag(e,t,r){return this.get(e,t,r)}getInstance(e){return this.get(ehK,e)}getTagFromInstance(e,t,r={fallback:!1}){if(t)return t[e]?t[e]:this._getCornerstoneDICOMImageLoaderTag(e,t)}addHandler(e,t){eh$[e]=t}_getCornerstoneDICOMImageLoaderTag(e,t){let r=eh$[e]?.(t);if(r)return r;switch(e){case ehq.GENERAL_SERIES_MODULE:r={modality:t.Modality,seriesInstanceUID:t.SeriesInstanceUID,seriesNumber:Ly(t.SeriesNumber),studyInstanceUID:t.StudyInstanceUID,seriesDescription:t.SeriesDescription,seriesDate:t.SeriesDate,seriesTime:t.SeriesTime};break;case ehq.PATIENT_STUDY_MODULE:r={patientAge:t.PatientAge,patientSize:t.PatientSize,patientWeight:t.PatientWeight};break;case ehq.PATIENT_DEMOGRAPHIC_MODULE:r={patientSex:t.PatientSex};break;case ehq.IMAGE_PIXEL_MODULE:r={samplesPerPixel:Ly(t.SamplesPerPixel),photometricInterpretation:t.PhotometricInterpretation,rows:Ly(t.Rows),columns:Ly(t.Columns),bitsAllocated:Ly(t.BitsAllocated),bitsStored:Ly(t.BitsStored),highBit:Ly(t.HighBit),pixelRepresentation:Ly(t.PixelRepresentation),planarConfiguration:Ly(t.PlanarConfiguration),pixelAspectRatio:Ly(t.PixelAspectRatio),smallestPixelValue:Ly(t.SmallestPixelValue),largestPixelValue:Ly(t.LargestPixelValue),redPaletteColorLookupTableDescriptor:Ly(t.RedPaletteColorLookupTableDescriptor),greenPaletteColorLookupTableDescriptor:Ly(t.GreenPaletteColorLookupTableDescriptor),bluePaletteColorLookupTableDescriptor:Ly(t.BluePaletteColorLookupTableDescriptor),redPaletteColorLookupTableData:ehj(t,"RedPaletteColorLookupTableData","RedPaletteColorLookupTableDescriptor"),greenPaletteColorLookupTableData:ehj(t,"GreenPaletteColorLookupTableData","GreenPaletteColorLookupTableDescriptor"),bluePaletteColorLookupTableData:ehj(t,"BluePaletteColorLookupTableData","BluePaletteColorLookupTableDescriptor")};break;case ehq.VOI_LUT_MODULE:let{WindowCenter:n,WindowWidth:a,VOILUTFunction:i}=t;if(null==n||null==a)return;let o=Array.isArray(n)?n:[n],s=Array.isArray(a)?a:[a];r={windowCenter:Ly(o),windowWidth:Ly(s),voiLUTFunction:i};break;case ehq.MODALITY_LUT_MODULE:let{RescaleIntercept:l,RescaleSlope:u}=t;if(null==l||null==u)return;r={rescaleIntercept:Ly(t.RescaleIntercept),rescaleSlope:Ly(t.RescaleSlope),rescaleType:t.RescaleType};break;case ehq.SOP_COMMON_MODULE:r={sopClassUID:t.SOPClassUID,sopInstanceUID:t.SOPInstanceUID};break;case ehq.PET_IMAGE_MODULE:r={frameReferenceTime:t.FrameReferenceTime,actualFrameDuration:t.ActualFrameDuration};break;case ehq.PET_ISOTOPE_MODULE:let{RadiopharmaceuticalInformationSequence:d}=t;if(d){let{RadiopharmaceuticalStartTime:e,RadionuclideTotalDose:t,RadionuclideHalfLife:n}=Array.isArray(d)?d[0]:d;r={radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:Nz().parseTM(e),radionuclideTotalDose:t,radionuclideHalfLife:n}}}break;case ehq.OVERLAY_PLANE_MODULE:let c=[];for(let e=0;e<=30;e+=2){let r=`60${e.toString(16)}`;3===r.length&&(r=`600${e.toString(16)}`);let n=t[`${r}3000`];if(!n)continue;let a=`${r}0010`,i=`${r}0011`,o=`${r}0040`,s=`${r}0050`,l=`${r}0022`,u=`${r}1500`,d=`${r}1301`,h=`${r}1302`,p=`${r}1303`,m=t[s],f=0;f=t[a]instanceof Array?new Uint16Array(t[a][0])[0]:t[a];let g=0;g=t[i]instanceof Array?new Uint16Array(t[i][0])[0]:t[i];let y=0,v=0;if(1===m.length){let e=new Int16Array(m[0]);y=e[0],v=e[1]}else y=m[0],v=m[1];let b={rows:f,columns:g,type:t[o],x:y,y:v,pixelData:n,description:t[l],label:t[u],roiArea:t[d],roiMean:t[h],roiStandardDeviation:t[p]};c.push(b)}r={overlays:c};break;case ehq.PATIENT_MODULE:r={patientName:t.PatientName,patientId:t.PatientID,patientSex:t.PatientSex,patientBirthDate:t.PatientBirthDate,issuerOfPatientId:t.IssuerOfPatientID,otherPatientIDsSequence:t.OtherPatientIDsSequence};break;case ehq.GENERAL_IMAGE_MODULE:r={sopInstanceUID:t.SOPInstanceUID,instanceNumber:Ly(t.InstanceNumber),lossyImageCompression:t.LossyImageCompression,lossyImageCompressionRatio:t.LossyImageCompressionRatio,lossyImageCompressionMethod:t.LossyImageCompressionMethod};break;case ehq.GENERAL_STUDY_MODULE:r={studyDescription:t.StudyDescription,studyInstanceUID:t.StudyInstanceUID,studyDate:t.StudyDate,studyTime:t.StudyTime,accessionNumber:t.AccessionNumber,studyId:t.StudyID};break;case ehq.CINE_MODULE:r={frameTime:t.FrameTime,numberOfFrames:t.NumberOfFrames?Number(t.NumberOfFrames):1};break;case ehq.PET_SERIES_MODULE:r={correctedImage:t.CorrectedImage,units:t.Units,decayCorrection:t.DecayCorrection};break;case ehq.CALIBRATION_MODULE:r={sequenceOfUltrasoundRegions:t.SequenceOfUltrasoundRegions?.map(e=>({regionSpatialFormat:e.RegionSpatialFormat,regionDataType:e.RegionDataType,regionFlags:e.RegionFlags,regionLocationMinX0:e.RegionLocationMinX0,regionLocationMinY0:e.RegionLocationMinY0,regionLocationMaxX1:e.RegionLocationMaxX1,regionLocationMaxY1:e.RegionLocationMaxY1,referencePixelX0:e.ReferencePixelX0,referencePixelY0:e.ReferencePixelY0,referencePixelPhysicalValueX:e.ReferencePixelPhysicalValueX,referencePixelPhysicalValueY:e.ReferencePixelPhysicalValueY,physicalUnitsXDirection:e.PhysicalUnitsXDirection,physicalUnitsYDirection:e.PhysicalUnitsYDirection,physicalDeltaX:e.PhysicalDeltaX,physicalDeltaY:e.PhysicalDeltaY}))};break;case"temporalPositionIdentifier":r={temporalPositionIdentifier:t.TemporalPositionIdentifier};break;default:return}return r}getUIDsFromImageID(e){if(e.startsWith("wadors:")){let t=e.split("/studies/")[1].split("/");return{StudyInstanceUID:t[0],SeriesInstanceUID:t[2],SOPInstanceUID:t[4],frameNumber:t[6]}}if(e.includes("?requestType=WADO")){let t=Lu.parse(e),r=t.frameNumber||t.frame;return{StudyInstanceUID:t.studyUID,SeriesInstanceUID:t.seriesUID,SOPInstanceUID:t.objectUID,frameNumber:r}}let t=Lw(e),r=this.imageURIToUIDs.get(t);if(!r)return;let n=ehH(e)?.framesString||r.frameNumber||"1";return{...r,frameNumber:n}}};RV.setMetaDataProvider(ehG);let ehq={GENERAL_SERIES_MODULE:"generalSeriesModule",PATIENT_STUDY_MODULE:"patientStudyModule",IMAGE_PIXEL_MODULE:"imagePixelModule",VOI_LUT_MODULE:"voiLutModule",MODALITY_LUT_MODULE:"modalityLutModule",SOP_COMMON_MODULE:"sopCommonModule",PET_IMAGE_MODULE:"petImageModule",PET_ISOTOPE_MODULE:"petIsotopeModule",PET_SERIES_MODULE:"petSeriesModule",OVERLAY_PLANE_MODULE:"overlayPlaneModule",PATIENT_DEMOGRAPHIC_MODULE:"patientDemographicModule",PATIENT_MODULE:"patientModule",GENERAL_IMAGE_MODULE:"generalImageModule",GENERAL_STUDY_MODULE:"generalStudyModule",CINE_MODULE:"cineModule",CALIBRATION_MODULE:"calibrationModule"},eh$={frameModule:e=>{let{frameNumber:t=1,numberOfFrames:r=1,SOPClassUID:n,SOPInstanceUID:a,SeriesInstanceUID:i,StudyInstanceUID:o}=e;return{frameNumber:t,numberOfFrames:r,sopClassUID:n,sopInstanceUID:a,seriesInstanceUID:i,studyInstanceUID:o}},imagePlaneModule:e=>{let t,r,n,a,i,{ImageOrientationPatient:o,ImagePositionPatient:s}=e,{PixelSpacing:l,type:u}=ehz(e)||{},d=!1,c=!1,h=!1;l?([t,r]=l,ehM.get("calibratedPixelSpacing",e.imageId)||ehU.add(e.imageId,{rowPixelSpacing:parseFloat(l[0]),columnPixelSpacing:parseFloat(l[1]),type:u})):(t=r=1,d=!0),o?(n=Ly(o.slice(0,3)),a=Ly(o.slice(3,6)),i=Ly(o)):(n=[1,0,0],a=[0,1,0],i=[1,0,0,0,1,0],d=!0,c=!0,h=!0);let p=Ly(s)||[0,0,0];return s||(d=!0),{frameOfReferenceUID:e.FrameOfReferenceUID,rows:Ly(e.Rows),columns:Ly(e.Columns),spacingBetweenSlices:Ly(e.SpacingBetweenSlices),imageOrientationPatient:i,rowCosines:n,isDefaultValueSetForRowCosine:c,columnCosines:a,isDefaultValueSetForColumnCosine:h,imagePositionPatient:p,sliceThickness:Ly(e.SliceThickness),sliceLocation:Ly(e.SliceLocation),pixelSpacing:Ly(l||1),rowPixelSpacing:t?Ly(t):null,columnPixelSpacing:r?Ly(r):null,usingDefaultValues:d}}},ehK="instance";u(6642),{...Lh,defaults:{hotkeyBindings:NB}};let ehY={activeViewportId:null,layout:{numRows:0,numCols:0,layoutType:"grid"},isHangingProtocolLayout:!1,viewports:new Map(Object.entries({default:{viewportId:"default",displaySetInstanceUIDs:[],isReady:!1,viewportOptions:{viewportId:"default"},displaySetSelectors:[],displaySetOptions:[{}],x:0,y:0,width:100,height:100,viewportLabel:null}}))};function ehZ(){return(ehZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}ei().any,ei().instanceOf(R6).isRequired,(0,ed.createContext)(null).Consumer;let ehX=(e,t,r)=>{if(!e)return;let n=e.getBoundingClientRect();n.bottom>window.innerHeight&&(t.y=t.y-n.height),n.right>window.innerWidth&&(t.x=t.x-n.width),r(t)};function ehJ(e){var t=null;return function(){return null==t&&(t=e()),t}}(0,ed.forwardRef)(({id:e,isOpen:t,title:r,content:n,contentProps:a,isDraggable:i,shouldCloseOnEsc:o=!1,shouldCloseOnOverlayClick:s=!1,showOverlay:l=!0,defaultPosition:u,onClose:d,unstyled:c,containerClassName:h},p)=>{let[m,f]=(0,ed.useState)(u),[g,y]=(0,ed.useState)(null);(0,ed.useImperativeHandle)(p,()=>({updatePosition:e=>{ehX(g,e,f)}}),[]),(0,ed.useEffect)(()=>{f(u)},[u]);let[v,b]=(0,ed.useState)(u?"invisible":"visible"),w=(0,ed.useCallback)(e=>{e&&(y(e),ehX(e,u,f),b("visible"))},[u]);return eh().createElement(ie,{open:t,modal:!1,onOpenChange:t=>{t||d(e)},isDraggable:i,shouldCloseOnEsc:o,shouldCloseOnOverlayClick:s,showOverlay:l},eh().createElement(ir,{ref:w,className:t_(c?"p-0":"",h,v),unstyled:c,style:{...m?{position:"fixed",left:`${m.x}px`,top:`${m.y}px`,transform:"translate(0, 0)",margin:0,animation:"none",transition:"none"}:{}}},!c&&eh().createElement(ia,null,r&&eh().createElement(ii,null,r)),eh().createElement(n,ehZ({},a,{hide:()=>d(e)}))))}).displayName="ManagedDialog",ei().oneOfType([ei().arrayOf(ei().node),ei().node]).isRequired,ei().shape({setServiceImplementation:ei().func}),(0,ed.createContext)({user:null,enabled:!1}).Consumer,ei().any,ei().shape({setServiceImplementation:ei().func}).isRequired;var ehQ=function(){var e;function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.entered=[],this.isNodeInDocument=e}return e=[{key:"enter",value:function(e){var t,r,n,a,i,o=this,s=this.entered.length;return this.entered=(t=this.entered.filter(function(t){return o.isNodeInDocument(t)&&(!t.contains||t.contains(e))}),r=[e],n=new Set,a=function(e){return n.add(e)},t.forEach(a),r.forEach(a),i=[],n.forEach(function(e){return i.push(e)}),i),0===s&&this.entered.length>0}},{key:"leave",value:function(e){var t,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),t.filter(function(t){return t!==e})),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),eh0=ehJ(function(){return/firefox/i.test(navigator.userAgent)}),eh1=ehJ(function(){return!!window.safari}),eh2=function(){var e;function t(e,r){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");for(var n,a,i,o=e.length,s=[],l=0;l<o;l++)s.push(l);s.sort(function(t,r){return e[t]<e[r]?-1:1});for(var u=[],d=[],c=[],h=0;h<o-1;h++)n=e[h+1]-e[h],a=r[h+1]-r[h],d.push(n),u.push(a),c.push(a/n);for(var p=[c[0]],m=0;m<d.length-1;m++){var f=c[m],g=c[m+1];if(f*g<=0)p.push(0);else{n=d[m];var y=d[m+1],v=n+y;p.push(3*v/((v+y)/f+(v+n)/g))}}p.push(c[c.length-1]);for(var b=[],w=[],x=0;x<p.length-1;x++){i=c[x];var C=p[x],k=1/d[x],M=C+p[x+1]-i-i;b.push((i-C-M)*k),w.push(M*k*k)}this.xs=e,this.ys=r,this.c1s=p,this.c2s=b,this.c3s=w}return e=[{key:"interpolate",value:function(e){var t,r=this.xs,n=this.ys,a=this.c1s,i=this.c2s,o=this.c3s,s=r.length-1;if(e===r[s])return n[s];for(var l=0,u=o.length-1;l<=u;){var d=r[t=Math.floor(.5*(l+u))];if(d<e)l=t+1;else{if(!(d>e))return n[t];u=t-1}}var c=e-r[s=Math.max(0,u)],h=c*c;return n[s]+a[s]*c+i[s]*h+o[s]*c*h}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function eh5(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function eh3(e){return{x:e.clientX,y:e.clientY}}var eh4="__NATIVE_FILE__",eh8="__NATIVE_URL__",eh6="__NATIVE_TEXT__",eh9="__NATIVE_HTML__";function eh7(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},"");return null!=n?n:r}function epe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ept=(epe(ey9={},eh4,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),epe(ey9,eh9,{exposeProperties:{html:function(e,t){return eh7(e,t,"")}},matchesTypes:["Html","text/html"]}),epe(ey9,eh8,{exposeProperties:{urls:function(e,t){return eh7(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),epe(ey9,eh6,{exposeProperties:{text:function(e,t){return eh7(e,t,"")}},matchesTypes:["Text","text/plain"]}),ey9),epr=function(){var e;function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.config=e,this.item={},this.initializeExposedProperties()}return e=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach(function(n){r[n]={value:t.config.exposeProperties[n](e,t.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function epn(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(ept).filter(function(e){return ept[e].matchesTypes.some(function(e){return t.indexOf(e)>-1})})[0]||null}var epa=function(){var e;function t(e,r){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.ownerDocument=null,this.globalContext=e,this.optionsArgs=r}return e=[{key:"window",get:function(){return this.globalContext?this.globalContext:"u">typeof window?window:void 0}},{key:"document",get:function(){var e;return null!=(e=this.globalContext)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null==(e=this.optionsArgs)?void 0:e.rootElement)||this.window}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function epi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function epo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?epi(Object(r),!0).forEach(function(t){var n,a,i;n=e,a=t,i=r[t],a in n?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):epi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eps(){return(eps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function epl(){return(epl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}"u">typeof window&&("ontouchstart"in window||navigator.maxTouchPoints),ei().any,[...[JSON.parse('{"name":"orchid","label":"Tonal: Orchid","cssVars":{"dark":{"highlight":"292 75% 62%","neutral":"270 18% 55%","neutral-light":"275 35% 75%","neutral-dark":"268 20% 24%","background":"270 45% 6%","foreground":"280 15% 96%","card":"268 40% 10%","card-foreground":"280 15% 96%","popover":"264 48% 13%","popover-foreground":"280 15% 96%","primary":"270 85% 65%","primary-foreground":"0 0% 98%","secondary":"268 45% 32%","secondary-foreground":"275 45% 88%","muted":"268 40% 10%","muted-foreground":"272 30% 60%","accent":"268 50% 20%","accent-foreground":"280 15% 96%","destructive":"0 65% 40%","destructive-foreground":"0 0% 98%","border":"268 30% 18%","input":"268 40% 25%","ring":"270 80% 60%"}}}'),JSON.parse('{"name":"arctic","label":"Tonal: Arctic","cssVars":{"dark":{"highlight":"173 81% 52%","neutral":"185 20% 55%","neutral-light":"180 40% 78%","neutral-dark":"190 18% 22%","background":"0 0% 0%","foreground":"180 10% 97%","card":"203 39% 9%","card-foreground":"180 10% 97%","popover":"202 54% 11%","popover-foreground":"180 10% 97%","primary":"175 85% 42%","primary-foreground":"185 50% 8%","secondary":"180 45% 28%","secondary-foreground":"175 50% 88%","muted":"203 39% 9%","muted-foreground":"185 30% 60%","accent":"185 55% 18%","accent-foreground":"180 10% 97%","destructive":"0 65% 35%","destructive-foreground":"0 0% 98%","border":"190 25% 17%","input":"223 40% 24%","ring":"175 85% 42%"}}}'),JSON.parse('{"name":"verdant","label":"Tonal: Verdant","cssVars":{"dark":{"highlight":"152 79% 52%","neutral":"150 15% 52%","neutral-light":"145 30% 72%","neutral-dark":"155 18% 24%","background":"155 40% 5%","foreground":"140 15% 95%","card":"152 35% 9%","card-foreground":"140 15% 95%","popover":"167 65% 10%","popover-foreground":"140 15% 95%","primary":"152 75% 40%","primary-foreground":"155 50% 8%","secondary":"150 40% 26%","secondary-foreground":"145 40% 85%","muted":"152 35% 9%","muted-foreground":"148 25% 55%","accent":"150 45% 16%","accent-foreground":"140 15% 95%","destructive":"0 65% 38%","destructive-foreground":"0 0% 98%","border":"150 25% 16%","input":"150 35% 22%","ring":"152 75% 40%"}}}'),JSON.parse('{"name":"midnight","label":"Neutral: Midnight","cssVars":{"dark":{"highlight":"188 90% 58%","neutral":"213 22% 59%","neutral-light":"214 69% 81%","neutral-dark":"214 16% 21%","background":"240 15% 3%","foreground":"0 0% 99%","card":"240 12% 8%","card-foreground":"0 0% 99%","popover":"225 45% 13%","popover-foreground":"0 0% 99%","primary":"210 100% 62%","primary-foreground":"0 0% 99%","secondary":"215 55% 32%","secondary-foreground":"200 60% 88%","muted":"240 12% 8%","muted-foreground":"210 40% 70%","accent":"220 65% 20%","accent-foreground":"0 0% 99%","destructive":"0 70% 35%","destructive-foreground":"0 0% 99%","border":"240 10% 18%","input":"225 35% 24%","ring":"210 100% 62%"}}}'),JSON.parse('{"name":"slate","label":"Neutral: Slate","cssVars":{"dark":{"highlight":"217 97% 52%","neutral":"0 0% 55%","neutral-light":"0 0% 75%","neutral-dark":"0 0% 25%","background":"0 0% 0%","foreground":"0 0% 96%","card":"0 0% 7%","card-foreground":"0 0% 96%","popover":"0 0% 9%","popover-foreground":"0 0% 96%","primary":"230 75% 55%","primary-foreground":"0 0% 98%","secondary":"0 0% 25%","secondary-foreground":"0 0% 85%","muted":"0 0% 7%","muted-foreground":"0 0% 60%","accent":"0 0% 18%","accent-foreground":"0 0% 96%","destructive":"0 65% 40%","destructive-foreground":"0 0% 98%","border":"0 0% 18%","input":"0 0% 22%","ring":"215 75% 55%"}}}'),JSON.parse('{"name":"deep","label":"Neutral: Deep","cssVars":{"dark":{"highlight":"184 53% 54%","neutral":"215 15% 50%","neutral-light":"210 20% 68%","neutral-dark":"220 18% 22%","background":"0 0% 0%","foreground":"215 15% 82%","card":"218 25% 5%","card-foreground":"215 15% 82%","popover":"215 30% 8%","popover-foreground":"215 15% 82%","primary":"200 43% 48%","primary-foreground":"210 20% 92%","secondary":"218 30% 18%","secondary-foreground":"215 25% 75%","muted":"214 28% 5%","muted-foreground":"215 18% 48%","accent":"216 32% 12%","accent-foreground":"215 15% 82%","destructive":"0 50% 35%","destructive-foreground":"0 15% 90%","border":"218 22% 10%","input":"216 28% 15%","ring":"215 45% 42%"}}}')].map(e=>e.name)],ei().string,ei().node,ei().bool,ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("bg-card text-card-foreground border-input rounded-lg border shadow",e)},t))).displayName="Card",ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("flex flex-col space-y-1.5 p-6",e)},t))).displayName="CardHeader",ed.forwardRef(({className:e,...t},r)=>ed.createElement("h3",eps({ref:r,className:t_("font-semibold leading-none tracking-tight",e)},t))).displayName="CardTitle",ed.forwardRef(({className:e,...t},r)=>ed.createElement("p",eps({ref:r,className:t_("text-muted-foreground text-base",e)},t))).displayName="CardDescription",ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("p-6 pt-0",e)},t))).displayName="CardContent",ed.forwardRef(({className:e,...t},r)=>ed.createElement("div",eps({ref:r,className:t_("flex items-center p-6 pt-0",e)},t))).displayName="CardFooter";let epu=ed.forwardRef(({className:e,containerClassName:t,noScroll:r=!1,...n},a)=>ed.createElement("div",{className:t_("relative w-full",!r&&"overflow-auto",t)},ed.createElement("table",epl({ref:a,className:t_("caption-bottom text-muted-foreground w-full text-base",e)},n))));epu.displayName="Table";let epd=ed.forwardRef(({className:e,...t},r)=>ed.createElement("thead",epl({ref:r,className:t_("border-input/50 [&_tr]:border-b",e)},t)));epd.displayName="TableHeader";let epc=ed.forwardRef(({className:e,...t},r)=>ed.createElement("tbody",epl({ref:r,className:t_("[&_tr:last-child]:border-0",e)},t)));epc.displayName="TableBody",ed.forwardRef(({className:e,...t},r)=>ed.createElement("tfoot",epl({ref:r,className:t_("bg-muted border-input/50 border-t [&>tr]:last:border-b-0",e)},t))).displayName="TableFooter";let eph=ed.forwardRef(({className:e,...t},r)=>ed.createElement("tr",epl({ref:r,className:t_("hover:bg-muted text-muted-foreground hover:text-highlight hover:[&>td]:text-highlight hover:[&>th]:text-highlight","data-[state=selected]:bg-popover data-[state=selected]:hover:bg-popover","data-[state=selected]:text-foreground data-[state=selected]:[&>td]:text-foreground data-[state=selected]:[&>th]:text-foreground","data-[state=selected]:hover:text-foreground data-[state=selected]:hover:[&>td]:text-foreground data-[state=selected]:hover:[&>th]:text-foreground","border-input/50 border-b transition-colors",e)},t)));eph.displayName="TableRow";let epp=ed.forwardRef(({className:e,...t},r)=>ed.createElement("th",epl({ref:r,className:t_("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e)},t)));epp.displayName="TableHead";let epm=ed.forwardRef(({className:e,...t},r)=>ed.createElement("td",epl({ref:r,className:t_("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e)},t)));epm.displayName="TableCell",ed.forwardRef(({className:e,...t},r)=>ed.createElement("caption",epl({ref:r,className:t_("text-muted-foreground mt-4 text-base",e)},t))).displayName="TableCaption",ei().string,ei().func.isRequired,ei().array,ei().node;ei().string,ei().string,ei().string,ei().string,ei().string,ei().string,ei().string,ei().string,ei().bool,ei().object,ei().func.isRequired,ei().func,ei().shape({label:ei().string.isRequired,studyDate:ei().string.isRequired,seriesDescription:ei().string.isRequired,patientInformation:ei().shape({patientName:ei().string,patientSex:ei().string,patientAge:ei().string,MRN:ei().string,thickness:ei().string,thicknessUnits:ei().string,spacing:ei().string,scanner:ei().string})}).isRequired,ei().func.isRequired;ei().func.isRequired,ei().string,ei().node.isRequired,ei().string,ei().bool.isRequired,ei().string.isRequired,ei().func.isRequired,ei().func.isRequired,ei().func,ei().object;let epf=((eyp={})[eyp.topLeft=0]="topLeft",eyp[eyp.topRight=1]="topRight",eyp[eyp.bottomLeft=2]="bottomLeft",eyp[eyp.bottomRight=3]="bottomRight",eyp[eyp.topMiddle=4]="topMiddle",eyp[eyp.bottomMiddle=5]="bottomMiddle",eyp[eyp.leftMiddle=6]="leftMiddle",eyp[eyp.rightMiddle=7]="rightMiddle",eyp),epg="pointer-events-auto flex items-center";epf.topLeft,em()(epg,"absolute top-[4px] left-[0px] pl-[4px]"),epf.topRight,em()(epg,"absolute top-[4px] right-viewport-scrollbar"),epf.bottomLeft,em()(epg,"absolute bottom-[3px] left-[0px] pl-[4px]"),epf.bottomRight,em()(epg,"absolute bottom-[3px] right-viewport-scrollbar"),epf.topMiddle,em()(epg,"absolute top-[25px] left-1/2 -translate-x-1/2"),epf.bottomMiddle,em()(epg,"absolute bottom-[3px] left-1/2 -translate-x-1/2"),epf.leftMiddle,em()(epg,"absolute left-[20px] top-[calc(50%+2px)] -translate-y-1/2 pl-[4px]"),epf.rightMiddle,em()(epg,"absolute top-1/2 -translate-y-1/2 right-viewport-scrollbar");function epy(){return(epy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}ei().node,ei().node,ei().node,ei().node,ei().string,ei().string,ei().number.isRequired,ei().number.isRequired,ei().string,ei().arrayOf(ei().node).isRequired,eh().forwardRef(({className:e,children:t,...r},n)=>eh().createElement("div",epy({ref:n,className:t_("flex items-center",e)},r),t)).displayName="ToolButtonList",eh().forwardRef(({className:e,children:t,tooltip:r,disabledText:n,disabled:a,...i},o)=>{let s=r||n,l=eh().createElement("div",epy({ref:o,className:t_("flex items-center",e)},i),t);return s?eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("span",null,l)),eh().createElement(IP,{side:"bottom"},r&&eh().createElement("div",null,r),n&&a&&eh().createElement("div",{className:"text-muted-foreground"},n))):l}).displayName="ToolButtonListDefault",eh().forwardRef(({children:e,className:t,...r},n)=>eh().createElement(_1,r,eh().createElement(_5,{asChild:!0},eh().createElement(rM,{variant:"ghost",size:"icon",className:t_("text-foreground/80 hover:bg-background hover:text-highlight border-primary","inline-flex h-10 w-5 items-center justify-center","!rounded-tr-lg !rounded-br-lg !rounded-tl-none !rounded-bl-none","bg-transparent",t)},eh().createElement(hO.ByName,{name:"chevron-down",className:"text-primary h-5 w-5"}))),eh().createElement(Do,{ref:n,side:"bottom",align:"start",alignOffset:-40},e))).displayName="ToolButtonListDropDown",eh().forwardRef(({className:e,children:t,icon:r,disabledText:n,tooltip:a,disabled:i,...o},s)=>{let l=a||("string"==typeof t?t:void 0),u=eh().createElement(Ds,epy({ref:s,className:t_("flex items-center space-x-2",e),disabled:i},o),r&&eh().createElement(hO.ByName,{name:r||"MissingIcon",className:"h-6 w-6"}),t);return i?eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("span",null,u)),eh().createElement(IP,{side:"bottom"},l&&eh().createElement("div",null,l),n&&i&&eh().createElement("div",{className:"text-muted-foreground"},n))):u}).displayName="ToolButtonListItem",eh().forwardRef(({className:e,...t},r)=>eh().createElement("div",epy({ref:r,className:t_("bg-primary h-5 w-px self-center",e)},t))).displayName="ToolButtonListDivider";let epv=(0,ed.createContext)(void 0),epb=()=>{let e=(0,ed.useContext)(epv);if(void 0===e)throw Error("useLayoutSelector must be used within a LayoutSelector component");return e},epw=({onSelectionChange:e,onSelection:t=e=>{},onSelectionPreset:r=e=>{},children:n,open:a,onOpenChange:i,tooltipDisabled:o})=>{let[s,l]=(0,ed.useState)(!1),u=void 0!==a,d=u?a:s,c=u?i:l,h=(0,ed.useCallback)(r=>{t(r),e&&e(r,!1),c(!1)},[t,e,c]),p=(0,ed.useCallback)(t=>{r(t),e&&e(t,!0),c(!1)},[r,e,c]);return eh().createElement(epv.Provider,{value:{isOpen:d,setIsOpen:c,onSelection:h,onSelectionPreset:p}},eh().createElement(hB,{open:d,onOpenChange:c},n))};function epx(e,t){return"function"==typeof e?e(t):e}function epC(e,t){return r=>{t.setState(t=>({...t,[e]:epx(r,t[e])}))}}function epk(e){return e instanceof Function}function epM(e,t,r){let n,a=[];return i=>{let o,s;r.key&&r.debug&&(o=Date.now());let l=e(i);if(!(l.length!==a.length||l.some((e,t)=>a[t]!==e)))return n;if(a=l,r.key&&r.debug&&(s=Date.now()),n=t(...l),null==r||null==r.onChange||r.onChange(n),r.key&&r.debug&&null!=r&&r.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-s)*100)/100,n=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} /${a(e,5)} ms`,`
1838
1838
  font-size: .6rem;
1839
1839
  font-weight: bold;
1840
1840
  color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==r?void 0:r.key)}return n}}function epS(e,t,r,n){return{debug:()=>{var r;return null!=(r=null==e?void 0:e.debugAll)?r:e[t]},key:!1,onChange:n}}epw.Trigger=({children:e,className:t,tooltip:r="Change layout",disabled:n=!1,disabledText:a})=>{let{isOpen:i}=epb(),o=r||n&&a,s=eh().createElement(rM,{className:t_("inline-flex h-10 w-10 items-center justify-center !rounded-lg",n?"text-foreground/80 hover:bg-muted hover:text-highlight cursor-not-allowed opacity-40":i?"bg-background text-foreground/80":"text-foreground/80 hover:bg-background hover:text-highlight bg-transparent",t),variant:"ghost",size:"icon","aria-label":r,disabled:n},eh().createElement(hO.ByName,{name:"tool-layout",className:"h-7 w-7"}));return e?eh().createElement(hU,{asChild:!0,className:t},e):!i&&o?eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement(hU,{asChild:!0},eh().createElement("span",{"data-cy":"layout-button"},s))),eh().createElement(IP,{side:"bottom"},r&&eh().createElement("div",null,r),n&&a&&eh().createElement("div",{className:"text-muted-foreground"},a))):eh().createElement(hU,{asChild:!0},eh().createElement("span",{"data-cy":"layout-button"},s))},epw.Content=({children:e,className:t,align:r="center",sideOffset:n=8})=>eh().createElement(h2,{align:r,sideOffset:n,className:t_("w-auto rounded-lg border-none p-0 shadow-lg",t)},eh().createElement("div",{className:"flex"},e)),epw.PresetSection=({children:e,title:t,className:r})=>eh().createElement("div",{className:t_("flex flex-col gap-2",r)},eh().createElement("div",{className:"text-muted-foreground text-xs"},t),eh().Children.count(e)>0&&eh().createElement("div",{className:t_("common"===t.toLowerCase()?"flex gap-2":"flex flex-col gap-0")},e)),epw.Preset=({title:e,icon:t,commandOptions:r,disabled:n=!1,className:a,isPreset:i=!1,iconSize:o})=>{let{onSelection:s,onSelectionPreset:l}=epb();return eh().createElement("div",{className:t_("group cursor-pointer rounded transition","hover:bg-accent flex items-center gap-2 p-1.5",n&&"pointer-events-none opacity-50",a),onClick:()=>{n||(i?l(r):s(r))},"data-cy":e},eh().createElement("div",{className:"flex-shrink-0"},eh().createElement(hO.ByName,{name:t,className:t_("group-hover:text-primary",o)})),e&&eh().createElement("div",{className:"text-foreground text-base"},e))},epw.GridSelector=({rows:e=3,columns:t=4,className:r})=>{let[n,a]=(0,ed.useState)(void 0),{onSelection:i}=epb(),o=void 0!==n?n%t:-1,s=void 0!==n?Math.floor(n/t):-1;return eh().createElement("div",{className:t_(r),style:{display:"grid",gridTemplateColumns:`repeat(${t}, 20px)`,gridTemplateRows:`repeat(${e}, 20px)`,gap:"2px"}},Array.from(Array(e*t).keys()).map(e=>eh().createElement("div",{key:e,className:t_("cursor-pointer",(e=>{if(void 0===n)return!1;let r=Math.floor(e/t);return e%t<=o&&r<=s})(e)?"bg-primary":"bg-accent"),"data-cy":`Layout-${e%t}-${Math.floor(e/t)}`,onClick:()=>{i({numRows:Math.floor(e/t)+1,numCols:e%t+1})},onMouseEnter:()=>a(e),onMouseLeave:()=>a(void 0)})))},epw.Divider=({className:e})=>eh().createElement("div",{className:t_("h-px bg-background",e)}),epw.HelpText=({children:e,className:t})=>eh().createElement("p",{className:t_("text-muted-foreground text-xs leading-tight",t)},e),epw.propTypes={onSelectionChange:ea.func,onSelection:ea.func,onSelectionPreset:ea.func,children:ea.node.isRequired,open:ea.bool,onOpenChange:ea.func,tooltipDisabled:ea.bool};let epE="debugHeaders";function epT(e,t,r){var n;let a={id:null!=(n=r.id)?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=r=>{r.subHeaders&&r.subHeaders.length&&r.subHeaders.map(t),e.push(r)};return t(a),e},getContext:()=>({table:e,header:a,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(a,e)}),a}function epI(e,t,r,n){var a,i;let o=0,s=function(e,t){void 0===t&&(t=1),o=Math.max(o,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var r;null!=(r=e.columns)&&r.length&&s(e.columns,t+1)},0)};s(e);let l=[],u=(e,t)=>{let a={depth:t,id:[n,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach(e=>{let o,s=[...i].reverse()[0],l=e.column.depth===a.depth,u=!1;if(l&&e.column.parent?o=e.column.parent:(o=e.column,u=!0),s&&(null==s?void 0:s.column)===o)s.subHeaders.push(e);else{let a=epT(r,o,{id:[n,t,o.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter(e=>e.column===o).length}`:void 0,depth:t,index:i.length});a.subHeaders.push(e),i.push(a)}a.headers.push(e),e.headerGroup=a}),l.push(a),t>0&&u(i,t-1)};u(t.map((e,t)=>epT(r,e,{depth:o,index:t})),o-1),l.reverse();let d=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,r=0,n=[0];return e.subHeaders&&e.subHeaders.length?(n=[],d(e.subHeaders).forEach(e=>{let{colSpan:r,rowSpan:a}=e;t+=r,n.push(a)})):t=1,r+=Math.min(...n),e.colSpan=t,e.rowSpan=r,{colSpan:t,rowSpan:r}});return d(null!=(a=null==(i=l[0])?void 0:i.headers)?a:[]),l}let epP=(e,t,r,n,a,i,o)=>{let s={id:t,index:n,original:r,depth:a,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let r=e.getColumn(t);if(null!=r&&r.accessorFn)return s._valuesCache[t]=r.accessorFn(s.original,n),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let r=e.getColumn(t);if(null!=r&&r.accessorFn)return r.columnDef.getUniqueValues?s._uniqueValuesCache[t]=r.columnDef.getUniqueValues(s.original,n):s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]},renderValue:t=>{var r;return null!=(r=s.getValue(t))?r:e.options.renderFallbackValue},subRows:null!=i?i:[],getLeafRows:()=>{var e,t;let r,n;return e=s.subRows,t=e=>e.subRows,r=[],(n=e=>{e.forEach(e=>{r.push(e);let a=t(e);null!=a&&a.length&&n(a)})})(e),r},getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let r=t.getParentRow();if(!r)break;e.push(r),t=r}return e.reverse()},getAllCells:epM(()=>[e.getAllLeafColumns()],t=>t.map(t=>{var r;let n;return r=t.id,n={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(r),renderValue:()=>{var t;return null!=(t=n.getValue())?t:e.options.renderFallbackValue},getContext:epM(()=>[e,t,s,n],(e,t,r,n)=>({table:e,column:t,row:r,cell:n,getValue:n.getValue,renderValue:n.renderValue}),epS(e.options,"debugCells","cell.getContext"))},e._features.forEach(r=>{null==r.createCell||r.createCell(n,t,s,e)},{}),n}),epS(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:epM(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),epS(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){let r=e._features[t];null==r||null==r.createRow||r.createRow(s,e)}return s},ep_=(e,t,r)=>{var n,a;let i=null==r||null==(n=r.toString())?void 0:n.toLowerCase();return!!(null==(a=e.getValue(t))||null==(a=a.toString())||null==(a=a.toLowerCase())?void 0:a.includes(i))};ep_.autoRemove=e=>epj(e);let epD=(e,t,r)=>{var n;return!!(null==(n=e.getValue(t))||null==(n=n.toString())?void 0:n.includes(r))};epD.autoRemove=e=>epj(e);let epO=(e,t,r)=>{var n;return(null==(n=e.getValue(t))||null==(n=n.toString())?void 0:n.toLowerCase())===(null==r?void 0:r.toLowerCase())};epO.autoRemove=e=>epj(e);let epA=(e,t,r)=>{var n;return null==(n=e.getValue(t))?void 0:n.includes(r)};epA.autoRemove=e=>epj(e);let epR=(e,t,r)=>!r.some(r=>{var n;return!(null!=(n=e.getValue(t))&&n.includes(r))});epR.autoRemove=e=>epj(e)||!(null!=e&&e.length);let epL=(e,t,r)=>r.some(r=>{var n;return null==(n=e.getValue(t))?void 0:n.includes(r)});epL.autoRemove=e=>epj(e)||!(null!=e&&e.length);let epN=(e,t,r)=>e.getValue(t)===r;epN.autoRemove=e=>epj(e);let epV=(e,t,r)=>e.getValue(t)==r;epV.autoRemove=e=>epj(e);let epF=(e,t,r)=>{let[n,a]=r,i=e.getValue(t);return i>=n&&i<=a};epF.resolveFilterValue=e=>{let[t,r]=e,n="number"!=typeof t?parseFloat(t):t,a="number"!=typeof r?parseFloat(r):r,i=null===t||Number.isNaN(n)?-1/0:n,o=null===r||Number.isNaN(a)?1/0:a;if(i>o){let e=i;i=o,o=e}return[i,o]},epF.autoRemove=e=>epj(e)||epj(e[0])&&epj(e[1]);let epB={includesString:ep_,includesStringSensitive:epD,equalsString:epO,arrIncludes:epA,arrIncludesAll:epR,arrIncludesSome:epL,equals:epN,weakEquals:epV,inNumberRange:epF};function epj(e){return null==e||""===e}function epW(e,t,r){return!!e&&!!e.autoRemove&&e.autoRemove(t,r)||void 0===t||"string"==typeof t&&!t}let epU={sum:(e,t,r)=>r.reduce((t,r)=>{let n=r.getValue(e);return t+("number"==typeof n?n:0)},0),min:(e,t,r)=>{let n;return r.forEach(t=>{let r=t.getValue(e);null!=r&&(n>r||void 0===n&&r>=r)&&(n=r)}),n},max:(e,t,r)=>{let n;return r.forEach(t=>{let r=t.getValue(e);null!=r&&(n<r||void 0===n&&r>=r)&&(n=r)}),n},extent:(e,t,r)=>{let n,a;return r.forEach(t=>{let r=t.getValue(e);null!=r&&(void 0===n?r>=r&&(n=a=r):(n>r&&(n=r),a<r&&(a=r)))}),[n,a]},mean:(e,t)=>{let r=0,n=0;if(t.forEach(t=>{let a=t.getValue(e);null!=a&&(a*=1)>=a&&(++r,n+=a)}),r)return n/r},median:(e,t)=>{if(!t.length)return;let r=t.map(t=>t.getValue(e));if(!(Array.isArray(r)&&r.every(e=>"number"==typeof e)))return;if(1===r.length)return r[0];let n=Math.floor(r.length/2),a=r.sort((e,t)=>e-t);return r.length%2!=0?a[n]:(a[n-1]+a[n])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},epz=()=>({left:[],right:[]}),epH={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},epG=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),epq=null;function ep$(e){return"touchstart"===e.type}function epK(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let epY=()=>({pageIndex:0,pageSize:10}),epZ=()=>({top:[],bottom:[]}),epX=(e,t,r,n,a)=>{var i;let o=a.getRow(t,!0);r?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],n&&null!=(i=o.subRows)&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>epX(e,t.id,r,n,a))};function epJ(e,t){let r=e.getState().rowSelection,n=[],a={},i=function(e,t){return e.map(e=>{var t;let o=epQ(e,r);if(o&&(n.push(e),a[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),o)return e}).filter(Boolean)};return{rows:i(t.rows),flatRows:n,rowsById:a}}function epQ(e,t){var r;return null!=(r=t[e.id])&&r}function ep0(e,t,r){var n;if(!(null!=(n=e.subRows)&&n.length))return!1;let a=!0,i=!1;return e.subRows.forEach(e=>{if((!i||a)&&(e.getCanSelect()&&(epQ(e,t)?i=!0:a=!1),e.subRows&&e.subRows.length)){let r=ep0(e,t);"all"===r?i=!0:("some"===r&&(i=!0),a=!1)}}),a?"all":!!i&&"some"}let ep1=/([0-9]+)/gm;function ep2(e,t){return e===t?0:e>t?1:-1}function ep5(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function ep3(e,t){let r=e.split(ep1).filter(Boolean),n=t.split(ep1).filter(Boolean);for(;r.length&&n.length;){let e=r.shift(),t=n.shift(),a=parseInt(e,10),i=parseInt(t,10),o=[a,i].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(o[1]))return isNaN(a)?-1:1;if(a>i)return 1;if(i>a)return -1}return r.length-n.length}let ep4={alphanumeric:(e,t,r)=>ep3(ep5(e.getValue(r)).toLowerCase(),ep5(t.getValue(r)).toLowerCase()),alphanumericCaseSensitive:(e,t,r)=>ep3(ep5(e.getValue(r)),ep5(t.getValue(r))),text:(e,t,r)=>ep2(ep5(e.getValue(r)).toLowerCase(),ep5(t.getValue(r)).toLowerCase()),textCaseSensitive:(e,t,r)=>ep2(ep5(e.getValue(r)),ep5(t.getValue(r))),datetime:(e,t,r)=>{let n=e.getValue(r),a=t.getValue(r);return n>a?1:n<a?-1:0},basic:(e,t,r)=>ep2(e.getValue(r),t.getValue(r))},ep8=[{createTable:e=>{e.getHeaderGroups=epM(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,a)=>{var i,o;let s=null!=(i=null==n?void 0:n.map(e=>r.find(t=>t.id===e)).filter(Boolean))?i:[],l=null!=(o=null==a?void 0:a.map(e=>r.find(t=>t.id===e)).filter(Boolean))?o:[];return epI(t,[...s,...r.filter(e=>!(null!=n&&n.includes(e.id))&&!(null!=a&&a.includes(e.id))),...l],e)},epS(e.options,epE,"getHeaderGroups")),e.getCenterHeaderGroups=epM(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,a)=>epI(t,r=r.filter(e=>!(null!=n&&n.includes(e.id))&&!(null!=a&&a.includes(e.id))),e,"center"),epS(e.options,epE,"getCenterHeaderGroups")),e.getLeftHeaderGroups=epM(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,n)=>{var a;return epI(t,null!=(a=null==n?void 0:n.map(e=>r.find(t=>t.id===e)).filter(Boolean))?a:[],e,"left")},epS(e.options,epE,"getLeftHeaderGroups")),e.getRightHeaderGroups=epM(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,n)=>{var a;return epI(t,null!=(a=null==n?void 0:n.map(e=>r.find(t=>t.id===e)).filter(Boolean))?a:[],e,"right")},epS(e.options,epE,"getRightHeaderGroups")),e.getFooterGroups=epM(()=>[e.getHeaderGroups()],e=>[...e].reverse(),epS(e.options,epE,"getFooterGroups")),e.getLeftFooterGroups=epM(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),epS(e.options,epE,"getLeftFooterGroups")),e.getCenterFooterGroups=epM(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),epS(e.options,epE,"getCenterFooterGroups")),e.getRightFooterGroups=epM(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),epS(e.options,epE,"getRightFooterGroups")),e.getFlatHeaders=epM(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),epS(e.options,epE,"getFlatHeaders")),e.getLeftFlatHeaders=epM(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),epS(e.options,epE,"getLeftFlatHeaders")),e.getCenterFlatHeaders=epM(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),epS(e.options,epE,"getCenterFlatHeaders")),e.getRightFlatHeaders=epM(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),epS(e.options,epE,"getRightFlatHeaders")),e.getCenterLeafHeaders=epM(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),epS(e.options,epE,"getCenterLeafHeaders")),e.getLeftLeafHeaders=epM(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),epS(e.options,epE,"getLeftLeafHeaders")),e.getRightLeafHeaders=epM(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),epS(e.options,epE,"getRightLeafHeaders")),e.getLeafHeaders=epM(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,r)=>{var n,a,i,o,s,l;return[...null!=(n=null==(a=e[0])?void 0:a.headers)?n:[],...null!=(i=null==(o=t[0])?void 0:o.headers)?i:[],...null!=(s=null==(l=r[0])?void 0:l.headers)?s:[]].map(e=>e.getLeafHeaders()).flat()},epS(e.options,epE,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:epC("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=r?r:!e.getIsVisible()}))},e.getIsVisible=()=>{var r,n;let a=e.columns;return null==(r=a.length?a.some(e=>e.getIsVisible()):null==(n=t.getState().columnVisibility)?void 0:n[e.id])||r},e.getCanHide=()=>{var r,n;return(null==(r=e.columnDef.enableHiding)||r)&&(null==(n=t.options.enableHiding)||n)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=epM(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),epS(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=epM(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,r)=>[...e,...t,...r],epS(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,r)=>epM(()=>[r(),r().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),epS(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var r;e.setColumnVisibility(t?{}:null!=(r=e.initialState.columnVisibility)?r:{})},e.toggleAllColumnsVisible=t=>{var r;t=null!=(r=t)?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,r)=>({...e,[r.id]:t||!(null!=r.getCanHide&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var r;e.toggleAllColumnsVisible(null==(r=t.target)?void 0:r.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:epC("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=epM(e=>[epK(t,e)],t=>t.findIndex(t=>t.id===e.id),epS(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var n;return(null==(n=epK(t,r)[0])?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;let a=epK(t,r);return(null==(n=a[a.length-1])?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:null!=(r=e.initialState.columnOrder)?r:[])},e._getOrderColumnsFn=epM(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,r)=>n=>{let a=[];if(null!=e&&e.length){let t=[...e],r=[...n];for(;r.length&&t.length;){let e=t.shift(),n=r.findIndex(t=>t.id===e);n>-1&&a.push(r.splice(n,1)[0])}a=[...a,...r]}else a=n;var i=a;if(!(null!=t&&t.length)||!r)return i;let o=i.filter(e=>!t.includes(e.id));return"remove"===r?o:[...t.map(e=>i.find(t=>t.id===e)).filter(Boolean),...o]},epS(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:epz(),...e}),getDefaultOptions:e=>({onColumnPinningChange:epC("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{let n=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,a,i,o,s,l;return"right"===r?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter(e=>!(null!=n&&n.includes(e))),right:[...(null!=(o=null==e?void 0:e.right)?o:[]).filter(e=>!(null!=n&&n.includes(e))),...n]}:"left"===r?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=n&&n.includes(e))),...n],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=n&&n.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=n&&n.includes(e))),right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=n&&n.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var r,n,a;return(null==(r=e.columnDef.enablePinning)||r)&&(null==(n=null!=(a=t.options.enableColumnPinning)?a:t.options.enablePinning)||n)}),e.getIsPinned=()=>{let r=e.getLeafColumns().map(e=>e.id),{left:n,right:a}=t.getState().columnPinning,i=r.some(e=>null==n?void 0:n.includes(e)),o=r.some(e=>null==a?void 0:a.includes(e));return i?"left":!!o&&"right"},e.getPinnedIndex=()=>{var r,n;let a=e.getIsPinned();return a?null!=(r=null==(n=t.getState().columnPinning)||null==(n=n[a])?void 0:n.indexOf(e.id))?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=epM(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,r)=>{let n=[...null!=t?t:[],...null!=r?r:[]];return e.filter(e=>!n.includes(e.column.id))},epS(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=epM(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),epS(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=epM(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),epS(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?epz():null!=(r=null==(n=e.initialState)?void 0:n.columnPinning)?r:epz())},e.getIsSomeColumnsPinned=t=>{var r,n,a;let i=e.getState().columnPinning;return t?!!(null==(r=i[t])?void 0:r.length):!!((null==(n=i.left)?void 0:n.length)||(null==(a=i.right)?void 0:a.length))},e.getLeftLeafColumns=epM(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),epS(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=epM(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),epS(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=epM(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,r)=>{let n=[...null!=t?t:[],...null!=r?r:[]];return e.filter(e=>!n.includes(e.id))},epS(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:epC("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let r=t.getCoreRowModel().flatRows[0],n=null==r?void 0:r.getValue(e.id);return"string"==typeof n?epB.includesString:"number"==typeof n?epB.inNumberRange:"boolean"==typeof n||null!==n&&"object"==typeof n?epB.equals:Array.isArray(n)?epB.arrIncludes:epB.weakEquals},e.getFilterFn=()=>{var r,n;return epk(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(r=null==(n=t.options.filterFns)?void 0:n[e.columnDef.filterFn])?r:epB[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,a;return(null==(r=e.columnDef.enableColumnFilter)||r)&&(null==(n=t.options.enableColumnFilters)||n)&&(null==(a=t.options.enableFilters)||a)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return null==(r=t.getState().columnFilters)||null==(r=r.find(t=>t.id===e.id))?void 0:r.value},e.getFilterIndex=()=>{var r,n;return null!=(r=null==(n=t.getState().columnFilters)?void 0:n.findIndex(t=>t.id===e.id))?r:-1},e.setFilterValue=r=>{t.setColumnFilters(t=>{var n,a;let i=e.getFilterFn(),o=null==t?void 0:t.find(t=>t.id===e.id),s=epx(r,o?o.value:void 0);if(epW(i,s,e))return null!=(n=null==t?void 0:t.filter(t=>t.id!==e.id))?n:[];let l={id:e.id,value:s};return o?null!=(a=null==t?void 0:t.map(t=>t.id===e.id?l:t))?a:[]:null!=t&&t.length?[...t,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let r=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var n;return null==(n=epx(t,e))?void 0:n.filter(e=>{let t=r.find(t=>t.id===e.id);return!(t&&epW(t.getFilterFn(),e.value,t))&&!0})})},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.columnFilters)?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:epC("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;let n=null==(r=e.getCoreRowModel().flatRows[0])||null==(r=r._getAllCellsByColumnId()[t.id])?void 0:r.getValue();return"string"==typeof n||"number"==typeof n}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,a,i;return(null==(r=e.columnDef.enableGlobalFilter)||r)&&(null==(n=t.options.enableGlobalFilter)||n)&&(null==(a=t.options.enableFilters)||a)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>epB.includesString,e.getGlobalFilterFn=()=>{var t,r;let{globalFilterFn:n}=e.options;return epk(n)?n:"auto"===n?e.getGlobalAutoFilterFn():null!=(t=null==(r=e.options.filterFns)?void 0:r[n])?t:epB[n]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:epC("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let r=t.getFilteredRowModel().flatRows.slice(10),n=!1;for(let t of r){let r=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(r))return ep4.datetime;if("string"==typeof r&&(n=!0,r.split(ep1).length>1))return ep4.alphanumeric}return n?ep4.text:ep4.basic},e.getAutoSortDir=()=>{let r=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==r?void 0:r.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw Error();return epk(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(r=null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])?r:ep4[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{let a=e.getNextSortingOrder(),i=null!=r;t.setSorting(o=>{let s,l=null==o?void 0:o.find(t=>t.id===e.id),u=null==o?void 0:o.findIndex(t=>t.id===e.id),d=[],c=i?r:"desc"===a;if("toggle"!=(s=null!=o&&o.length&&e.getCanMultiSort()&&n?l?"toggle":"add":null!=o&&o.length&&u!==o.length-1?"replace":l?"toggle":"replace")||i||a||(s="remove"),"add"===s){var h;(d=[...o,{id:e.id,desc:c}]).splice(0,d.length-(null!=(h=t.options.maxMultiSortColCount)?h:Number.MAX_SAFE_INTEGER))}else d="toggle"===s?o.map(t=>t.id===e.id?{...t,desc:c}:t):"remove"===s?o.filter(t=>t.id!==e.id):[{id:e.id,desc:c}];return d})},e.getFirstSortDir=()=>{var r,n;return(null!=(r=null!=(n=e.columnDef.sortDescFirst)?n:t.options.sortDescFirst)?r:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=r=>{var n,a;let i=e.getFirstSortDir(),o=e.getIsSorted();return o?(o===i||null!=(n=t.options.enableSortingRemoval)&&!n||!!r&&null!=(a=t.options.enableMultiRemove)&&!a)&&("desc"===o?"asc":"desc"):i},e.getCanSort=()=>{var r,n;return(null==(r=e.columnDef.enableSorting)||r)&&(null==(n=t.options.enableSorting)||n)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return null!=(r=null!=(n=e.columnDef.enableMultiSort)?n:t.options.enableMultiSort)?r:!!e.accessorFn},e.getIsSorted=()=>{var r;let n=null==(r=t.getState().sorting)?void 0:r.find(t=>t.id===e.id);return!!n&&(n.desc?"desc":"asc")},e.getSortIndex=()=>{var r,n;return null!=(r=null==(n=t.getState().sorting)?void 0:n.findIndex(t=>t.id===e.id))?r:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let r=e.getCanSort();return n=>{r&&(null==n.persist||n.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(n))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.sorting)?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return null!=(t=null==(r=e.getValue())||null==r.toString?void 0:r.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:epC("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var r,n;return(null==(r=e.columnDef.enableGrouping)||r)&&(null==(n=t.options.enableGrouping)||n)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return null==(r=t.getState().grouping)?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return null==(r=t.getState().grouping)?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let r=t.getCoreRowModel().flatRows[0],n=null==r?void 0:r.getValue(e.id);return"number"==typeof n?epU.sum:"[object Date]"===Object.prototype.toString.call(n)?epU.extent:void 0},e.getAggregationFn=()=>{var r,n;if(!e)throw Error();return epk(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(r=null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])?r:epU[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.grouping)?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];let n=t.getColumn(r);return null!=n&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=r.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:epC("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,a;if(!t)return void e._queue(()=>{t=!0});if(null!=(n=null!=(a=e.options.autoResetAll)?a:e.options.autoResetExpanded)?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var r,n;e.setExpanded(t?{}:null!=(r=null==(n=e.initialState)?void 0:n.expanded)?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let r=e.split(".");t=Math.max(t,r.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded(n=>{var a;let i=!0===n||!!(null!=n&&n[e.id]),o={};if(!0===n?Object.keys(t.getRowModel().rowsById).forEach(e=>{o[e]=!0}):o=n,r=null!=(a=r)?a:!i,!i&&r)return{...o,[e.id]:!0};if(i&&!r){let{[e.id]:t,...r}=o;return r}return n})},e.getIsExpanded=()=>{var r;let n=t.getState().expanded;return!!(null!=(r=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?r:!0===n||(null==n?void 0:n[e.id]))},e.getCanExpand=()=>{var r,n,a;return null!=(r=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?r:(null==(n=t.options.enableExpanding)||n)&&!!(null!=(a=e.subRows)&&a.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)r=(n=t.getRow(n.parentId,!0)).getIsExpanded();return r},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...epY(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:epC("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,a;if(!t)return void e._queue(()=>{t=!0});if(null!=(n=null!=(a=e.options.autoResetAll)?a:e.options.autoResetPageIndex)?n:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>epx(t,e)),e.resetPagination=t=>{var r;e.setPagination(t?epY():null!=(r=e.initialState.pagination)?r:epY())},e.setPageIndex=t=>{e.setPagination(r=>{let n=epx(t,r.pageIndex);return n=Math.max(0,Math.min(n,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...r,pageIndex:n}})},e.resetPageIndex=t=>{var r,n;e.setPageIndex(t?0:null!=(r=null==(n=e.initialState)||null==(n=n.pagination)?void 0:n.pageIndex)?r:0)},e.resetPageSize=t=>{var r,n;e.setPageSize(t?10:null!=(r=null==(n=e.initialState)||null==(n=n.pagination)?void 0:n.pageSize)?r:10)},e.setPageSize=t=>{e.setPagination(e=>{let r=Math.max(1,epx(t,e.pageSize)),n=Math.floor(e.pageSize*e.pageIndex/r);return{...e,pageIndex:n,pageSize:r}})},e.setPageCount=t=>e.setPagination(r=>{var n;let a=epx(t,null!=(n=e.options.pageCount)?n:-1);return"number"==typeof a&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=epM(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},epS(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,r=e.getPageCount();return -1===r||0!==r&&t<r-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:epZ(),...e}),getDefaultOptions:e=>({onRowPinningChange:epC("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,a)=>{let i=n?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=new Set([...a?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...i]);t.setRowPinning(e=>{var t,n,a,i,s,l;return"bottom"===r?{top:(null!=(a=null==e?void 0:e.top)?a:[]).filter(e=>!(null!=o&&o.has(e))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=o&&o.has(e))),...Array.from(o)]}:"top"===r?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=o&&o.has(e))),...Array.from(o)],bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=o&&o.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=o&&o.has(e))),bottom:(null!=(n=null==e?void 0:e.bottom)?n:[]).filter(e=>!(null!=o&&o.has(e)))}})},e.getCanPin=()=>{var r;let{enableRowPinning:n,enablePinning:a}=t.options;return"function"==typeof n?n(e):null==(r=null!=n?n:a)||r},e.getIsPinned=()=>{let r=[e.id],{top:n,bottom:a}=t.getState().rowPinning,i=r.some(e=>null==n?void 0:n.includes(e)),o=r.some(e=>null==a?void 0:a.includes(e));return i?"top":!!o&&"bottom"},e.getPinnedIndex=()=>{var r,n;let a=e.getIsPinned();if(!a)return -1;let i=null==(r="top"===a?t.getTopRows():t.getBottomRows())?void 0:r.map(e=>{let{id:t}=e;return t});return null!=(n=null==i?void 0:i.indexOf(e.id))?n:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?epZ():null!=(r=null==(n=e.initialState)?void 0:n.rowPinning)?r:epZ())},e.getIsSomeRowsPinned=t=>{var r,n,a;let i=e.getState().rowPinning;return t?!!(null==(r=i[t])?void 0:r.length):!!((null==(n=i.top)?void 0:n.length)||(null==(a=i.bottom)?void 0:a.length))},e._getPinnedRows=(t,r,n)=>{var a;return(null==(a=e.options.keepPinnedRows)||a?(null!=r?r:[]).map(t=>{let r=e.getRow(t,!0);return r.getIsAllParentsExpanded()?r:null}):(null!=r?r:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:n}))},e.getTopRows=epM(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),epS(e.options,"debugRows","getTopRows")),e.getBottomRows=epM(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),epS(e.options,"debugRows","getBottomRows")),e.getCenterRows=epM(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,r)=>{let n=new Set([...null!=t?t:[],...null!=r?r:[]]);return e.filter(e=>!n.has(e.id))},epS(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:epC("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:null!=(r=e.initialState.rowSelection)?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let n={...r},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(e=>{e.getCanSelect()&&(n[e.id]=!0)}):a.forEach(e=>{delete n[e.id]}),n})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{let n=void 0!==t?t:!e.getIsAllPageRowsSelected(),a={...r};return e.getRowModel().rows.forEach(t=>{epX(a,t.id,n,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=epM(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?epJ(e,r):{rows:[],flatRows:[],rowsById:{}},epS(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=epM(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?epJ(e,r):{rows:[],flatRows:[],rowsById:{}},epS(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=epM(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?epJ(e,r):{rows:[],flatRows:[],rowsById:{}},epS(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState(),n=!!(t.length&&Object.keys(r).length);return n&&t.some(e=>e.getCanSelect()&&!r[e.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:r}=e.getState(),n=!!t.length;return n&&t.some(e=>!r[e.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;let r=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{let a=e.getIsSelected();t.setRowSelection(i=>{var o;if(r=void 0!==r?r:!a,e.getCanSelect()&&a===r)return i;let s={...i};return epX(s,e.id,r,null==(o=null==n?void 0:n.selectChildren)||o,t),s})},e.getIsSelected=()=>{let{rowSelection:r}=t.getState();return epQ(e,r)},e.getIsSomeSelected=()=>{let{rowSelection:r}=t.getState();return"some"===ep0(e,r)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:r}=t.getState();return"all"===ep0(e,r)},e.getCanSelect=()=>{var r;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(r=t.options.enableRowSelection)||r},e.getCanSelectSubRows=()=>{var r;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(r=t.options.enableSubRowSelection)||r},e.getCanMultiSelect=()=>{var r;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(r=t.options.enableMultiRowSelection)||r},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return r=>{var n;t&&e.toggleSelected(null==(n=r.target)?void 0:n.checked)}}}},{getDefaultColumnDef:()=>epH,getInitialState:e=>({columnSizing:{},columnSizingInfo:epG(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:epC("columnSizing",e),onColumnSizingInfoChange:epC("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,a;let i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(r=e.columnDef.minSize)?r:epH.minSize,null!=(n=null!=i?i:e.columnDef.size)?n:epH.size),null!=(a=e.columnDef.maxSize)?a:epH.maxSize)},e.getStart=epM(e=>[e,epK(t,e),t.getState().columnSizing],(t,r)=>r.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),epS(t.options,"debugColumns","getStart")),e.getAfter=epM(e=>[e,epK(t,e),t.getState().columnSizing],(t,r)=>r.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),epS(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:r,...n}=t;return n})},e.getCanResize=()=>{var r,n;return(null==(r=e.columnDef.enableResizing)||r)&&(null==(n=t.options.enableColumnResizing)||n)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,r=e=>{if(e.subHeaders.length)e.subHeaders.forEach(r);else{var n;t+=null!=(n=e.column.getSize())?n:0}};return r(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=r=>{let n=t.getColumn(e.column.id),a=null==n?void 0:n.getCanResize();return i=>{if(!n||!a||(null==i.persist||i.persist(),ep$(i)&&i.touches&&i.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[n.id,n.getSize()]],l=ep$(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(e,r)=>{"number"==typeof r&&(t.setColumnSizingInfo(e=>{var n,a;let i="rtl"===t.options.columnResizeDirection?-1:1,o=(r-(null!=(n=null==e?void 0:e.startOffset)?n:0))*i,s=Math.max(o/(null!=(a=null==e?void 0:e.startSize)?a:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,r]=e;u[t]=Math.round(100*Math.max(r+r*s,0))/100}),{...e,deltaOffset:o,deltaPercentage:s}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},c=e=>{d("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=r||("u">typeof document?document:null),p={moveHandler:e=>d("move",e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",p.moveHandler),null==h||h.removeEventListener("mouseup",p.upHandler),c(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d("move",e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",m.moveHandler),null==h||h.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(null==(t=e.touches[0])?void 0:t.clientX)}},f=!!function(){if("boolean"==typeof epq)return epq;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return epq=e}()&&{passive:!1};ep$(i)?(null==h||h.addEventListener("touchmove",m.moveHandler,f),null==h||h.addEventListener("touchend",m.upHandler,f)):(null==h||h.addEventListener("mousemove",p.moveHandler,f),null==h||h.addEventListener("mouseup",p.upHandler,f)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:null!=(r=e.initialState.columnSizing)?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?epG():null!=(r=e.initialState.columnSizingInfo)?r:epG())},e.getTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getHeaderGroups()[0])?void 0:r.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getLeftHeaderGroups()[0])?void 0:r.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getCenterHeaderGroups()[0])?void 0:r.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getRightHeaderGroups()[0])?void 0:r.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}];function ep6(e,t){var r,n,a;let i;return e?"function"==typeof(n=r=e)&&(i=Object.getPrototypeOf(n)).prototype&&i.prototype.isReactComponent||"function"==typeof r||"object"==typeof(a=r)&&"symbol"==typeof a.$$typeof&&["react.memo","react.forward_ref"].includes(a.$$typeof.description)?ed.createElement(e,t):e:null}let ep9=(0,ed.createContext)(null);function ep7(){let e=(0,ed.useContext)(ep9);if(!e)throw Error("useDataTable must be used within a <DataTable> provider");return e}let eme=(0,ed.createContext)(null);function emt(){let e=(0,ed.useContext)(eme);if(!e)throw Error("useResponsiveColumns/useUnfitColumnIds must be used within a <ResponsiveColumnsProvider>");return e}function emr({children:e}){let[t,r]=(0,ed.useState)(()=>new Set),n=(0,ed.useMemo)(()=>({unfitColumnIds:t,setUnfitColumnIds:r}),[t]);return eh().createElement(eme.Provider,{value:n},e)}let emn=ed.createContext(null),ema=Symbol("ActionOverlayCell.Value"),emi=Symbol("ActionOverlayCell.Overlay");function emo({cell:e,children:t}){let r=e.row.getIsSelected(),n=e.column.columnDef.meta??void 0,a=n?.align??"right",i=null,o=null;return ed.Children.forEach(t,e=>{if(ed.isValidElement(e)){let t=e.type?._type;t===ema?i=e:t===emi&&(o=e)}}),ed.createElement(emn.Provider,{value:{isActive:r,computedAlign:"left"===a?"start":"center"===a?"center":"end",cell:e}},ed.createElement("div",{className:"relative"},i,o))}function ems({children:e}){let t=ed.useContext(emn);if(!t)throw Error("ActionOverlayCell.Value must be used within ActionOverlayCell");let{isActive:r,computedAlign:n}=t;return ed.createElement("div",{className:`transition-opacity ${"end"===n?"text-right":"center"===n?"text-center":""} ${r?"invisible opacity-0":"group-hover:invisible group-hover:opacity-0 group-hover:text-transparent"}`},e)}function eml({children:e}){let t=ed.useContext(emn);if(!t)throw Error("ActionOverlayCell.Overlay must be used within ActionOverlayCell");let{isActive:r,computedAlign:n,cell:a}=t;return ed.createElement("div",{className:`absolute z-10 flex items-center ${"center"===n?"inset-y-0 inset-x-0 justify-center px-2":"start"===n?"inset-y-0 left-0 px-2":"inset-y-0 right-0 px-2"} ${r?"bg-popover opacity-100":"opacity-0 group-hover:bg-muted group-hover:opacity-100"}`,onMouseDown:e=>{e.stopPropagation(),a.row.getIsSelected()||a.row.toggleSelected(!0)},onPointerDown:e=>{e.stopPropagation(),a.row.getIsSelected()||a.row.toggleSelected(!0)}},e)}function emu({excludeColumnIds:e=[],renderFilterCell:t}){let{table:r}=ep7(),n=r.getVisibleLeafColumns();return ed.createElement(eph,{"data-filter-row":!0,className:"hover:bg-transparent"},n.map(n=>{let a=n.id,i=r.getColumn(a)?.getFilterValue(),o=e=>r.getColumn(a)?.setFilterValue(e);if(e?.includes(a))return ed.createElement(epm,{key:a});let s=t?.({columnId:a,value:i,setValue:o});return s?ed.createElement(epm,{key:a},s):ed.createElement(epm,{key:a},ed.createElement(M_,{value:i??"",onChange:e=>o(e.target.value),className:"h-7 w-full"}))}))}function emd(){return(emd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function emc(){let{table:e}=ep7();return eh().createElement(epd,null,e.getHeaderGroups().map(e=>eh().createElement(eph,{key:e.id},e.headers.map(e=>{let t=e.column.columnDef.meta??void 0,r=t?.headerClassName??"",n=e.column.getIsSorted();return eh().createElement(epp,{key:e.id,className:t_("bg-muted",r),"aria-sort":"asc"===n?"ascending":"desc"===n?"descending":"none"},e.isPlaceholder?null:ep6(e.column.columnDef.header,e.getContext()))}))))}function emh({rowProps:e,emptyMessage:t,isLoading:r,loadingComponent:n}){let{t:a}=eA("DataTable"),i=t??a("No results."),{table:o}=ep7(),s="function"==typeof o.getPaginationRowModel?o.getPaginationRowModel().rows:o.getRowModel().rows;return s.length?eh().createElement(eh().Fragment,null,s.map(t=>{let r=e?.render?.(t);return r||eh().createElement(eph,emd({key:t.id,"data-state":t.getIsSelected()?"selected":void 0,className:e?.className?"function"==typeof e.className?e.className(t):e.className:""},e?.onClick&&{onClick:()=>e.onClick(t)},e?.onDoubleClick&&{onDoubleClick:()=>e.onDoubleClick(t)},{"aria-selected":t.getIsSelected()}),t.getVisibleCells().map(e=>{let t=e.column.columnDef.meta?.cellClassName??"";return eh().createElement(epm,{key:e.id,className:t},ep6(e.column.columnDef.cell,e.getContext()))}))})):r&&n?eh().createElement(eph,{className:"hover:bg-transparent hover:text-inherit hover:[&>td]:text-inherit hover:[&>th]:text-inherit"},eh().createElement(epm,{colSpan:o.getAllLeafColumns().length},eh().createElement("div",{className:"flex h-full w-full items-center justify-center"},n))):eh().createElement(eph,{className:"hover:bg-transparent hover:text-inherit hover:[&>td]:text-inherit hover:[&>th]:text-inherit"},eh().createElement(epm,{colSpan:o.getAllLeafColumns().length,className:"!pt-10 text-center align-text-top"},i))}ems._type=ema,eml._type=emi,emo.Value=ems,emo.Overlay=eml;let emp=Object.assign(function({data:e,columns:t,getRowId:r,initialVisibility:n={},sorting:a=[],pagination:i={pageIndex:0,pageSize:50},filters:o=[],onSortingChange:s,onPaginationChange:l,onFiltersChange:u,manualFiltering:d=!1,enforceSingleSelection:c=!0,onSelectionChange:h,children:p}){let[m,f]=(0,ed.useState)(n),[g,y]=(0,ed.useState)({}),v=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=ed.useState(()=>({current:function(e){var t,r;let n=[...ep8,...null!=(t=e._features)?t:[]],a={_features:n},i=a._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(a)),{}),o={...null!=(r=e.initialState)?r:{}};a._features.forEach(e=>{var t;o=null!=(t=null==e.getInitialState?void 0:e.getInitialState(o))?t:o});let s=[],l=!1,u={_features:n,options:{...i,...e},initialState:o,_queue:e=>{s.push(e),l||(l=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();l=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{a.setState(a.initialState)},setOptions:e=>{var t;t=epx(e,a.options),a.options=a.options.mergeOptions?a.options.mergeOptions(i,t):{...i,...t}},getState:()=>a.options.state,setState:e=>{null==a.options.onStateChange||a.options.onStateChange(e)},_getRowId:(e,t,r)=>{var n;return null!=(n=null==a.options.getRowId?void 0:a.options.getRowId(e,t,r))?n:`${r?[r.id,t].join("."):t}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?a.getPrePaginationRowModel():a.getRowModel()).rowsById[e];if(!r&&!(r=a.getCoreRowModel().rowsById[e]))throw Error();return r},_getDefaultColumnDef:epM(()=>[a.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,r;return null!=(t=null==(r=e.renderValue())||null==r.toString?void 0:r.toString())?t:null},...a._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},epS(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>a.options.columns,getAllColumns:epM(()=>[a._getColumnDefs()],e=>{let t=function(e,r,n){return void 0===n&&(n=0),e.map(e=>{let i=function(e,t,r,n){var a,i;let o,s={...e._getDefaultColumnDef(),...t},l=s.accessorKey,u=null!=(a=null!=(i=s.id)?i:l?"function"==typeof String.prototype.replaceAll?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)?a:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?o=s.accessorFn:l&&(o=l.includes(".")?e=>{let t=e;for(let e of l.split(".")){var r;t=null==(r=t)?void 0:r[e]}return t}:e=>e[s.accessorKey]),!u)throw Error();let d={id:`${String(u)}`,accessorFn:o,parent:n,depth:r,columnDef:s,columns:[],getFlatColumns:epM(()=>[!0],()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},epS(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:epM(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=d.columns)&&t.length?e(d.columns.flatMap(e=>e.getLeafColumns())):[d]},epS(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(d,e);return d}(a,e,n,r);return i.columns=e.columns?t(e.columns,i,n+1):[],i})};return t(e)},epS(e,"debugColumns","getAllColumns")),getAllFlatColumns:epM(()=>[a.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),epS(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:epM(()=>[a.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),epS(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:epM(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),epS(e,"debugColumns","getAllLeafColumns")),getColumn:e=>a._getAllFlatColumnsById()[e]};Object.assign(a,u);for(let e=0;e<a._features.length;e++){let t=a._features[e];null==t||null==t.createTable||t.createTable(a)}return a}(t)})),[n,a]=ed.useState(()=>r.current.initialState);return r.current.setOptions(t=>({...t,...e,state:{...n,...e.state},onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}})),r.current}({data:e,columns:t,state:{sorting:a,columnVisibility:m,rowSelection:g,columnFilters:o,pagination:i},onSortingChange:s,onColumnVisibilityChange:f,onRowSelectionChange:y,onColumnFiltersChange:u,onPaginationChange:l,getCoreRowModel:e=>epM(()=>[e.options.data],t=>{let r={rows:[],flatRows:[],rowsById:{}},n=function(t,a,i){void 0===a&&(a=0);let o=[];for(let l=0;l<t.length;l++){let u=epP(e,e._getRowId(t[l],l,i),t[l],l,a,void 0,null==i?void 0:i.id);if(r.flatRows.push(u),r.rowsById[u.id]=u,o.push(u),e.options.getSubRows){var s;u.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=u.originalSubRows)&&s.length&&(u.subRows=n(u.originalSubRows,a+1,u))}}return o};return r.rows=n(t),r},epS(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>epM(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(null!=t&&t.length))return r;let n=e.getState().sorting,a=[],i=n.filter(t=>{var r;return null==(r=e.getColumn(t.id))?void 0:r.getCanSort()}),o={};i.forEach(t=>{let r=e.getColumn(t.id);r&&(o[t.id]={sortUndefined:r.columnDef.sortUndefined,invertSorting:r.columnDef.invertSorting,sortingFn:r.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<i.length;n+=1){var r;let a=i[n],s=o[a.id],l=s.sortUndefined,u=null!=(r=null==a?void 0:a.desc)&&r,d=0;if(l){let r=e.getValue(a.id),n=t.getValue(a.id),i=void 0===r,o=void 0===n;if(i||o){if("first"===l)return i?-1:1;if("last"===l)return i?1:-1;d=i&&o?0:i?l:-l}}if(0===d&&(d=s.sortingFn(e,t,a.id)),0!==d)return u&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index}),t.forEach(e=>{var t;a.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(r.rows),flatRows:a,rowsById:r.rowsById}},epS(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getFilteredRowModel:d?void 0:e=>epM(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,n)=>{var a,i,o,s,l,u,d,c,h,p;let m,f,g,y,v,b,w,x,C,k;if(!t.rows.length||!(null!=r&&r.length)&&!n){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let M=[],S=[];(null!=r?r:[]).forEach(t=>{var r;let n=e.getColumn(t.id);if(!n)return;let a=n.getFilterFn();a&&M.push({id:t.id,filterFn:a,resolvedValue:null!=(r=null==a.resolveFilterValue?void 0:a.resolveFilterValue(t.value))?r:t.value})});let E=(null!=r?r:[]).map(e=>e.id),T=e.getGlobalFilterFn(),I=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());n&&T&&I.length&&(E.push("__global__"),I.forEach(e=>{var t;S.push({id:e.id,filterFn:T,resolvedValue:null!=(t=null==T.resolveFilterValue?void 0:T.resolveFilterValue(n))?t:n})}));for(let e=0;e<t.flatRows.length;e++){let r=t.flatRows[e];if(r.columnFilters={},M.length)for(let e=0;e<M.length;e++){let t=(m=M[e]).id;r.columnFilters[t]=m.filterFn(r,t,m.resolvedValue,e=>{r.columnFiltersMeta[t]=e})}if(S.length){for(let e=0;e<S.length;e++){let t=(f=S[e]).id;if(f.filterFn(r,t,f.resolvedValue,e=>{r.columnFiltersMeta[t]=e})){r.columnFilters.__global__=!0;break}}!0!==r.columnFilters.__global__&&(r.columnFilters.__global__=!1)}}return a=t.rows,i=e=>{for(let t=0;t<E.length;t++)if(!1===e.columnFilters[E[t]])return!1;return!0},e.options.filterFromLeafRows?(o=a,s=i,g=[],y={},v=null!=(u=(l=e).options.maxLeafRowFilterDepth)?u:100,{rows:(b=function(e,t){void 0===t&&(t=0);let r=[];for(let a=0;a<e.length;a++){var n;let i=e[a],o=epP(l,i.id,i.original,i.index,i.depth,void 0,i.parentId);if(o.columnFilters=i.columnFilters,null!=(n=i.subRows)&&n.length&&t<v){if(o.subRows=b(i.subRows,t+1),s(i=o)&&!o.subRows.length||s(i)||o.subRows.length){r.push(i),y[i.id]=i,g.push(i);continue}}else s(i=o)&&(r.push(i),y[i.id]=i,g.push(i))}return r})(o),flatRows:g,rowsById:y}):(d=a,c=i,w=[],x={},C=null!=(p=(h=e).options.maxLeafRowFilterDepth)?p:100,{rows:(k=function(e,t){void 0===t&&(t=0);let r=[];for(let a=0;a<e.length;a++){let i=e[a];if(c(i)){var n;if(null!=(n=i.subRows)&&n.length&&t<C){let e=epP(h,i.id,i.original,i.index,i.depth,void 0,i.parentId);e.subRows=k(i.subRows,t+1),i=e}r.push(i),w.push(i),x[i.id]=i}}return r})(d),flatRows:w,rowsById:x})},epS(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:e=>epM(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,r)=>{let n;if(!r.rows.length)return r;let{pageSize:a,pageIndex:i}=t,{rows:o,flatRows:s,rowsById:l}=r,u=a*i;if(o=o.slice(u,u+a),e.options.paginateExpandedRows)n={rows:o,flatRows:s,rowsById:l};else{var d;let e,t;d={rows:o,flatRows:s,rowsById:l},e=[],t=r=>{var n;e.push(r),null!=(n=r.subRows)&&n.length&&r.getIsExpanded()&&r.subRows.forEach(t)},d.rows.forEach(t),n={rows:e,flatRows:d.flatRows,rowsById:d.rowsById}}n.flatRows=[];let c=e=>{n.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return n.rows.forEach(c),n},epS(e.options,"debugTable","getPaginationRowModel")),manualFiltering:d,enableRowSelection:!0,enableMultiRowSelection:!c,getRowId:r,autoResetPageIndex:!1}),b=(0,ed.useRef)(o),w=(0,ed.useRef)(a),x=(0,ed.useRef)(i);return(0,ed.useEffect)(()=>{let e=o!==b.current,t=a!==w.current,r=i!==x.current;b.current=o,w.current=a,x.current=i,(e||t)&&!r&&l&&l(e=>({...e,pageIndex:0}))},[o,a,i,l]),(0,ed.useEffect)(()=>{let e=Object.keys(g);if(0===e.length)return;let t=new Set(v.getPaginationRowModel().rows.map(e=>e.id));e.every(e=>t.has(e))||y(e=>{let r={};for(let n of Object.keys(e))t.has(n)&&(r[n]=e[n]);return r})},[o,a,i,e,v,g]),(0,ed.useEffect)(()=>{h&&h(v.getSelectedRowModel().rows.map(e=>e.original))},[g,h,v]),eh().createElement(ep9.Provider,{value:{table:v}},eh().createElement(emr,null,p))},{Toolbar:function({children:e}){return ed.createElement("div",{className:"relative flex items-center justify-center py-4"},e)},Title:function({children:e}){return ed.createElement("div",{className:"text-primary text-[20px] font-medium"},e)},Pagination:function(){let{table:e}=ep7(),{pageIndex:t,pageSize:r}=e.getState().pagination??{pageIndex:0,pageSize:50},n=e.getFilteredRowModel().rows.length,a=Math.min(n,(t+1)*r),i=e.getCanPreviousPage(),o=e.getCanNextPage();return ed.createElement("div",{className:"mr-2 flex items-center gap-0.5"},ed.createElement(_1,null,ed.createElement(_5,{asChild:!0},ed.createElement(rM,{variant:"ghost",size:"sm",className:"text-primary/80 px-2 text-sm leading-tight","aria-label":"Rows per page"},`${0===n?0:t*r+1}-${a} of ${n}`)),ed.createElement(Do,{align:"start"},[25,50,100].map(t=>ed.createElement(Ds,{key:t,onSelect:r=>{r.preventDefault(),e.setPageSize(t)},className:"flex items-center gap-[2px]"},ed.createElement(hO.Checked,{className:`h-6 w-6 ${r===t?"":"invisible"}`}),t," per page")))),ed.createElement(rM,{variant:"ghost",size:"icon","aria-label":"Previous page",onClick:()=>e.previousPage(),disabled:!i,className:"ml-1"},ed.createElement(hO.ChevronLeft,{className:"h-3 w-3"})),ed.createElement(rM,{variant:"ghost",size:"icon","aria-label":"Next page",onClick:()=>e.nextPage(),disabled:!o},ed.createElement(hO.ChevronRight,{className:"h-3 w-3"})))},ViewOptions:function({buttonText:e="View"}){let{t}=eA("DataTable"),{table:r}=ep7(),n=emt().unfitColumnIds,a=r.getAllColumns().filter(e=>e.getCanHide());return ed.createElement(_1,null,ed.createElement(_5,{asChild:!0},ed.createElement(rM,{variant:"ghost",size:"sm",className:"gap-1 text-sm"},e,ed.createElement(hO.ChevronDown,{className:"h-2 w-2"}))),ed.createElement(Do,{align:"end"},a.map(e=>{let r=e.columnDef.meta??void 0,a=r?.label??e.id,i=!e.getIsVisible()&&n.has(e.id),o=ed.createElement(Dl,{checked:e.getIsVisible(),disabled:i,onCheckedChange:t=>e.toggleVisibility(!!t),className:"capitalize"},a);return i?ed.createElement(Ip,{key:e.id},ed.createElement(If,{asChild:!0},ed.createElement("span",null,o)),ed.createElement(IP,{side:"left"},t("Not enough room to display this column"))):ed.createElement(ed.Fragment,{key:e.id},o)})))},Table:function({children:e,className:t,tableClassName:r}){let{table:n}=ep7(),a=(0,ed.useRef)(null);!function(e,t){let{setUnfitColumnIds:r}=emt(),n=(0,ed.useRef)({}),a=(0,ed.useRef)(new Set),i=(0,ed.useRef)(new Set),o=e.getAllLeafColumns(),s=(0,ed.useMemo)(()=>o.map(e=>{let t=e.columnDef.meta??void 0,r="number"==typeof t?.minWidth?t.minWidth:0,n=!1!==e.columnDef.enableHiding,a="number"==typeof t?.priority;return{id:e.id,minWidth:r,priority:a?t.priority:0,alwaysVisible:!n||!a}}),[o]),l=(0,ed.useMemo)(()=>s.filter(e=>!e.alwaysVisible).sort((e,t)=>t.priority-e.priority||e.minWidth-t.minWidth),[s]),u=(0,ed.useRef)(!0),d=(0,ed.useCallback)(t=>{if(0===l.length)return;if(u.current)n.current={...e.getState().columnVisibility},u.current=!1;else{let t=e.getState().columnVisibility,r=n.current;for(let e of l){let n=!1!==t[e.id];n!==(!1!==r[e.id])&&(n?a.current.delete(e.id):a.current.add(e.id))}}let o=t;for(let e of s)e.alwaysVisible&&(o-=e.minWidth);let d=n.current,{hiddenIds:c,unfitIds:h}=function(e,t,r,n){let a=new Set,i=new Set,o=0,s=!1;for(let l of e){let e=12*!!n(l.id),u=!s&&o+l.minWidth+e<=t;if(r(l.id)){a.add(l.id),u||i.add(l.id);continue}if(!u){a.add(l.id),i.add(l.id),s=!0;continue}o+=l.minWidth}return{hiddenIds:a,unfitIds:i}}(l,o,e=>a.current.has(e),e=>!1===d[e]),p={};for(let e of l)p[e.id]=!c.has(e.id);let m=e.getState().columnVisibility,f=!1;for(let e of Object.keys(p))if(!1!==m[e]!=(!1!==p[e])){f=!0;break}n.current=p,f&&e.setColumnVisibility(e=>({...e,...p}));let g=i.current;i.current=h,!function(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(g,h)&&r(h)},[e,s,l,r]);(0,ed.useEffect)(()=>{let e=t.current;if(!e||0===l.length)return;d(e.clientWidth);let r=new ResizeObserver(e=>{for(let t of e)d(t.contentRect.width)});return r.observe(e),()=>r.disconnect()},[d,t,l]);let c=(0,ed.useRef)(!1),h=e.getState().columnVisibility;(0,ed.useEffect)(()=>{if(!c.current){c.current=!0;return}let e=t.current;e&&0!==l.length&&d(e.clientWidth)},[h,d,t,l])}(n,a);let i=0===("function"==typeof n.getPaginationRowModel?n.getPaginationRowModel().rows:n.getRowModel().rows).length,o=(0,ed.useCallback)(()=>eh().createElement("colgroup",null,n.getVisibleLeafColumns().map(e=>{let t=e.columnDef.meta??void 0,r=t?.minWidth;return r?eh().createElement("col",{key:e.id,style:{width:"number"==typeof r?`${r}px`:r}}):eh().createElement("col",{key:e.id})})),[n]),s=null,l=null,u=null;return ed.Children.forEach(e,e=>{(0,ed.isValidElement)(e)&&(e.type===emc&&(s=e),e.type===emu&&(l=e),e.type===emh&&(u=e))}),eh().createElement("div",{ref:a,className:t_("border-input/50 min-h-0 flex-1 rounded-md border",t)},eh().createElement("div",{className:"flex h-full flex-col"},eh().createElement("div",{className:"border-input/50 shrink-0 border-b"},eh().createElement(epu,{className:t_("table-fixed",r),containerClassName:"overflow-x-hidden",noScroll:!0},o(),s,eh().createElement(epc,null,l))),eh().createElement("div",{className:"min-h-0 flex-1"},eh().createElement(EU,{className:t_("h-full",i&&"[&>div>div]:!h-full")},eh().createElement(epu,{className:t_("h-full table-fixed",r),containerClassName:"h-full",noScroll:!0},o(),eh().createElement(epc,null,u))))))},Header:emc,FilterRow:emu,Body:emh,ColumnHeader:function({column:e}){let t=e.columnDef.meta??void 0,r=t?.headerContent??t?.label??e.id,n=t?.align??"left",a=e.getCanSort(),i=e.getIsSorted(),o="asc"===i?hO.SortingNewAscending:"desc"===i?hO.SortingNewDescending:hO.SortingNew,s=t?.label??e.id;return ed.createElement("div",{className:`flex w-full items-center gap-1 ${"right"===n?"justify-end":"center"===n?"justify-center":"justify-start"}`},"string"==typeof r?ed.createElement("span",null,r):r,a&&ed.createElement(rM,{variant:"ghost",size:"sm",onClick:()=>e.toggleSorting("asc"===i),"aria-label":`Sort ${s}`,className:"px-1"},ed.createElement(o,{className:"h-4 w-2.5","aria-hidden":"true"})))},ActionOverlayCell:emo});try{window.__reactRouterVersion="6"}catch(e){}ed.startTransition,rS.flushSync,ed.useId,"u">typeof window&&void 0!==window.document&&window.document.createElement,(eym=ey7||(ey7={})).UseScrollRestoration="useScrollRestoration",eym.UseSubmit="useSubmit",eym.UseSubmitFetcher="useSubmitFetcher",eym.UseFetcher="useFetcher",eym.useViewTransitionState="useViewTransitionState",(eyf=eve||(eve={})).UseFetcher="useFetcher",eyf.UseFetchers="useFetchers",eyf.UseScrollRestoration="useScrollRestoration";let emm=ed.createContext(void 0);function emf({loadedModes:e,dataPath:t,preserveQueryParameters:r,children:n}){let a=function(){let{isDataRoute:e}=ed.useContext(AM);return e?function(){let e,t,r,n,{router:a}=(AT.UseNavigateStable,(e=ed.useContext(Ax))||Af(!1),e),i=(AI.UseNavigateStable,(n=((t=ed.useContext(AM))||Af(!1),r=t).matches[r.matches.length-1]).route.id||Af(!1),n.route.id),o=ed.useRef(!1);return AE(()=>{o.current=!0}),ed.useCallback(function(e,t){void 0===t&&(t={}),o.current&&("number"==typeof e?a.navigate(e):a.navigate(e,Aw({fromRouteId:i},t)))},[a,i])}():function(){var e,t;let r;AS()||Af(!1);let n=ed.useContext(Ax),{basename:a,future:i,navigator:o}=ed.useContext(AC),{matches:s}=ed.useContext(AM),{pathname:l}=(AS()||Af(!1),ed.useContext(Ak).location),u=JSON.stringify((e=s,t=i.v7_relativeSplatPath,r=e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0),t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase))),d=ed.useRef(!1);return AE(()=>{d.current=!0}),ed.useCallback(function(e,t){if(void 0===t&&(t={}),!d.current)return;if("number"==typeof e)return void o.go(e);let r=function(e,t,r,n){let a,i;void 0===n&&(n=!1),"string"==typeof e?a=Ag(e):(Af(!(a=Am({},e)).pathname||!a.pathname.includes("?"),Ab("?","pathname","search",a)),Af(!a.pathname||!a.pathname.includes("#"),Ab("#","pathname","hash",a)),Af(!a.search||!a.search.includes("#"),Ab("#","search","hash",a)));let o=""===e||""===a.pathname,s=o?"/":a.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t){let r,n,a;void 0===t&&(t="/");let{pathname:i,search:o="",hash:s=""}="string"==typeof e?Ag(e):e;if(i){let e;if(e=i,Ay.test(e))r=i;else{if(i.includes("//")){var l="Pathnames cannot have embedded double slashes - normalizing "+i+" -> "+(i=i.replace(/\/\/+/g,"/"));"u">typeof console&&console.warn(l);try{throw Error(l)}catch(e){}}r=i.startsWith("/")?Av(i.substring(1),"/"):Av(i,t)}}else r=t;return{pathname:r,search:(n=o)&&"?"!==n?n.startsWith("?")?n:"?"+n:"",hash:(a=s)&&"#"!==a?a.startsWith("#")?a:"#"+a:""}}(a,i),u=s&&"/"!==s&&s.endsWith("/"),d=(o||"."===s)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}(e,JSON.parse(u),l,"path"===t.relative);null==n&&"/"!==a&&(r.pathname="/"===r.pathname?a:[a,r.pathname].join("/").replace(/\/\/+/g,"/")),(t.replace?o.replace:o.push)(r,t.state,t)},[a,o,u,l,n])}()}(),[i,o]=function(e){let t="studyList.defaultWorkflow",[r,n]=ed.useState(null);return ed.useEffect(()=>{try{if("u">typeof window){let r=window.localStorage.getItem(t);null!=r&&(!e||e.includes(r)?n(r):n(null))}}catch{}},[e]),[r,ed.useCallback(r=>{n(r);try{"u">typeof window&&(null==r?window.localStorage.removeItem(t):(!e||e.includes(r))&&window.localStorage.setItem(t,r))}catch{}},[e])]}(ed.useMemo(()=>e.filter(e=>!e.hide&&e.displayName).map(e=>e.id),[e])),s=i??void 0,l=ed.useCallback(e=>{o(e??null)},[o]),u=ed.useMemo(()=>{let n=[];for(let i of e){if(i.hide||!i.displayName)continue;let e=i.id===s,o={get id(){return i.id},get displayName(){return i.displayName},launchWithStudy:e=>{if(!e.studyInstanceUid)return void console.warn("Cannot launch workflow: study has no studyInstanceUid");let n=new URLSearchParams;n.append("StudyInstanceUIDs",e.studyInstanceUid),r(n),a(`${i.routeName}${t||""}?${n.toString()}`)},isApplicableToStudy:e=>{if(!i.isValidMode)return!0;let t=String(e.modalities??"").replaceAll("/","\\");return!0===i.isValidMode({modalities:t,study:e}).valid},get isDefault(){return e}};n.push(o)}return n},[e,s,t,a,r]),d=ed.useCallback(e=>u.filter(t=>t.isApplicableToStudy(e)),[u]),c=ed.useCallback(e=>d(e).find(e=>e.isDefault),[d]),h=ed.useMemo(()=>({workflows:u,getWorkflowsForStudy:d,getDefaultWorkflowForStudy:c,defaultWorkflowId:s,setDefaultWorkflowId:l}),[u,d,c,s,l]);return ed.createElement(emm.Provider,{value:h},n)}function emg(){let e=ed.useContext(emm);if(!e)throw Error("useWorkflows must be used within <WorkflowsProvider>");return e}function emy({studyRow:e,align:t="end"}){let[r,n]=ed.useState(!1),{getWorkflowsForStudy:a}=emg(),i=a(e);return ed.createElement(_1,{open:r,onOpenChange:n},ed.createElement(Iu,{delayDuration:200},ed.createElement(Ip,null,ed.createElement(If,{asChild:!0},ed.createElement(_5,{asChild:!0},ed.createElement(rM,{size:"icon",variant:"ghost","aria-expanded":r,"aria-haspopup":"menu","aria-label":"Action Menu",className:"bg-primary/20 text-primary hover:bg-primary/30 mt-1 h-6 w-6 transition-opacity"},ed.createElement(hO.More,{className:"h-6 w-6"})))),ed.createElement(IP,{side:"bottom"},"Action Menu"))),ed.createElement(Do,{align:t,onClick:e=>e.stopPropagation()},ed.createElement("div",{className:"text-muted-foreground border-input my-1.5 mx-1 border-b py-1 pl-1 pr-4 text-sm"},"Launch Workflow:"),i.map(t=>ed.createElement(Ds,{key:t.id,onSelect:r=>{r.preventDefault(),t.launchWithStudy(e)},className:t.isDefault?"font-semibold":void 0,"aria-current":t.isDefault?"true":void 0},t.isDefault?"✓ ":null,t.displayName))))}function emv({cell:e}){let t=e.row.original;return ed.createElement(emp.ActionOverlayCell,{cell:e},ed.createElement(emp.ActionOverlayCell.Overlay,null,ed.createElement("div",{onClick:e=>e.stopPropagation()},ed.createElement(emy,{studyRow:t}))))}function emb(e){return String(e??"").toUpperCase().split(/[\s,\/\\]+/).filter(Boolean)}let emw="patient",emx="studyDateTime",emC="modalities",emk="description",emM="accession",emS="instances",emE="actions",emT=[{id:emw,accessorFn:e=>e.patientName??"",header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>ed.createElement("div",{className:"truncate"},e.getValue(emw)),meta:{label:"Patient",headerClassName:"min-w-[165px]",cellClassName:"min-w-[165px]",minWidth:165,priority:100}},{id:"mrn",accessorFn:e=>e.mrn??"",header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>ed.createElement("div",{className:"truncate"},e.getValue("mrn")),meta:{label:"MRN",headerClassName:"min-w-[120px]",cellClassName:"min-w-[120px]",minWidth:120,priority:20}},{id:emx,accessorFn:e=>{let t=function(e,t={}){let{strFormat:r,fallbackFormat:n="MMM D, YYYY",invalidFallback:a}=t;if(!e)return a??"";let i=r??rs.t("Common:localDateFormat",n),o=rs.language||"en",s=tO()(e,["YYYYMMDD","YYYY.MM.DD"],!0);return s.isValid()?s.locale(o).format(i):a??tO()(e).locale(o).format(i)}(e.date??"",{fallbackFormat:"MMM-DD-YYYY",invalidFallback:""});if(!t)return"";let r=function(e,t={}){let{strFormat:r,fallbackFormat:n="hh:mm A",invalidFallback:a}=t;if(!e)return a??"";let i=r??rs.t("Common:localTimeFormat",n),o=rs.language||"en",s=tO()(e,["HH","HHmm","HHmmss","HHmmss.SSS"],!0);return s.isValid()?s.locale(o).format(i):a??""}(e.time??"",{invalidFallback:""});return r?`${t} ${r}`:t},filterFn:(e,t,r)=>{let n=r&&"object"==typeof r?r:void 0,a=n?.startDate,i=n?.endDate;if(!a&&!i)return!0;let o=String(e.original.date??"").replace(/\D/g,"");return!!o&&(!a||!(o<a))&&(!i||!(o>i))},header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>ed.createElement("div",{className:"truncate"},e.getValue(emx)),sortingFn:(e,t)=>{let r=e.original,n=t.original;return rl(r.date??"",r.time??"")-rl(n.date??"",n.time??"")},meta:{label:"Study Date",headerClassName:"min-w-[195px]",cellClassName:"min-w-[195px]",minWidth:195,priority:70}},{id:emC,accessorFn:e=>e.modalities??"",header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>ed.createElement("div",{className:"truncate"},e.getValue(emC)),filterFn:(e,t,r)=>{let n=Array.isArray(r)?r:[];if(!n.length)return!0;let a=new Set(emb(String(e.getValue(t)??"")));return n.some(e=>a.has(String(e).toUpperCase()))},meta:{label:"Modalities",headerClassName:"min-w-[97px]",cellClassName:"min-w-[97px]",minWidth:97,priority:60}},{id:emk,accessorFn:e=>e.description??"",header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>{let t=e.getValue(emk);return ed.createElement("div",{className:t?"":"text-muted-foreground/40"},t||"No Description")},meta:{label:"Description",headerClassName:"min-w-[290px]",cellClassName:"min-w-[290px]",minWidth:290,priority:90}},{id:emM,accessorFn:e=>e.accession??"",header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>ed.createElement("div",{className:"truncate"},e.getValue(emM)),meta:{label:"Accession",headerClassName:"min-w-[140px]",cellClassName:"min-w-[140px]",minWidth:140,priority:30}},{id:emS,accessorFn:e=>Number(e.instances??0),header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:e})=>{let t=e.getValue(emS);return ed.createElement("div",{className:"text-right"},t)},sortingFn:(e,t,r)=>e.getValue(r)-t.getValue(r),meta:{label:"Instances",headerContent:ed.createElement(hO.Series,{className:"text-muted-foreground h-4 w-4 shrink-0","aria-hidden":"true"}),align:"right",headerClassName:"min-w-[45px]",cellClassName:"min-w-[45px] overflow-hidden",minWidth:45,priority:50}},{id:emE,header:()=>null,enableSorting:!1,enableHiding:!1,cell:({cell:e})=>ed.createElement(emv,{cell:e}),meta:{headerClassName:"w-[56px] min-w-[56px] max-w-[56px]",cellClassName:"w-[56px] min-w-[56px] max-w-[56px] overflow-visible",minWidth:56}}],emI=ed.createContext(null);function emP(){let e=ed.useContext(emI);if(!e)throw Error("SettingsPopover subcomponents must be used within <SettingsPopover>");return e}function em_(e){return null}function emD({children:e}){let[t,r]=ed.useState(!1),n=ed.useCallback(()=>r(!1),[]),a=ed.Children.toArray(e),i=null,o=null;for(let e of a)ed.isValidElement(e)&&e.type===em_?i=e.props.children:ed.isValidElement(e)&&e.type===emO&&(o=e);if(!i)throw Error("<SettingsPopover.Trigger> is required as a direct child of <SettingsPopover>.");if(!o)throw Error("<SettingsPopover.Content> is required as a direct child of <SettingsPopover>.");return ed.createElement(hB,{open:t,onOpenChange:r},ed.createElement(hU,{asChild:!0},i),ed.createElement(emI.Provider,{value:{close:n}},o))}function emO({children:e}){return ed.createElement(h2,{align:"end",sideOffset:8,className:"w-[315px] p-4",onOpenAutoFocus:e=>e.preventDefault()},e)}em_.displayName="SettingsPopover.Trigger",emD.displayName="SettingsPopover";let emA=Object.assign(emD,{Trigger:em_,Content:emO,Workflow:function(){let{close:e}=emP(),{workflows:t,defaultWorkflowId:r,setDefaultWorkflowId:n}=emg(),a=ed.useId(),i="__NO_DEFAULT__";return ed.createElement("div",{className:"mt-0 flex items-center gap-3"},ed.createElement(E2,{htmlFor:a,className:"whitespace-nowrap"},"Default Workflow"),ed.createElement("div",{className:"min-w-0 flex-1"},ed.createElement(si,{value:r??void 0,onValueChange:t=>{t===i?n():n(t),e()}},ed.createElement(sY,{id:a,className:"w-full"},ed.createElement(su,{placeholder:"Select Workflow"})),ed.createElement(sJ,{onPointerDown:e=>e.stopPropagation()},t.map(e=>ed.createElement(sQ,{key:e.id,value:e.id},e.displayName)),ed.createElement(s0,null),ed.createElement(sQ,{value:i},"No Default")))))},Divider:function(){return ed.createElement("div",{className:"bg-muted -mx-2 my-3 h-px"})},Item:function({children:e,onClick:t}){let{close:r}=emP();return ed.createElement(rM,{variant:"ghost",size:"default",onClick:()=>{t?.(),r()},className:"h-7 w-full justify-start"},e)}}),emR="notApplicable",emL=ed.createContext(null);function emN(){let e=ed.useContext(emL);if(!e)throw Error("PreviewPatientSummary.* components must be used within <PreviewPatientSummary>");return e}let emV=Object.assign(function({data:e,className:t,children:r}){let n=e??null,a=ed.useMemo(()=>({data:n}),[n]);return ed.createElement(emL.Provider,{value:a},ed.createElement("div",{className:t_("flex w-full flex-col gap-1",t)},r))},{Patient:function({className:e}={}){let{data:t}=emN(),r=t?.patientName,n=t?.mrn,a=r??"Select a study",i="string"==typeof r||"number"==typeof r?String(r):void 0,o=null!=n&&""!==n,s="string"==typeof n||"number"==typeof n?String(n):void 0;return ed.createElement("div",{className:t_("bg-muted flex items-center gap-3 rounded-lg px-4 py-3",e)},ed.createElement("div",{className:"text-primary shrink-0","aria-hidden":!0,style:{width:33,height:33}},ed.createElement(hO.PatientStudyList,null)),ed.createElement("div",{className:"flex h-[38px] min-w-0 flex-col justify-center gap-px"},ed.createElement("span",{className:"text-foreground truncate text-lg font-medium leading-tight",title:i},a),o&&ed.createElement("span",{className:"text-muted-foreground truncate text-lg leading-tight",title:s},n)))},Workflows:function({className:e}={}){let{data:t}=emN(),{workflows:r,getWorkflowsForStudy:n,getDefaultWorkflowForStudy:a,setDefaultWorkflowId:i}=emg(),o=ed.useMemo(()=>t?n(t):r,[t,r,n]),s=ed.useMemo(()=>t?a(t):r.find(e=>e.isDefault),[t,r,a]),l=ed.useMemo(()=>s?o.filter(e=>e.displayName!==s.displayName):o,[o,s]),u=e=>{if(!t)return;let r=o.find(t=>t.displayName===e);r?.launchWithStudy(t)};return ed.createElement("div",{className:t_("border-border/50 bg-muted w-full rounded-lg px-4 py-3 text-left transition",e)},ed.createElement("div",{className:"flex w-full items-center justify-between"},ed.createElement("span",{className:"text-foreground text-base font-medium leading-tight"},"Launch workflow"),ed.createElement("span",{className:"text-primary shrink-0 -translate-y-0.5","aria-hidden":!0,style:{width:18,height:18}},ed.createElement(hO.Info,null))),s&&ed.createElement("div",{className:"mt-2 flex flex-wrap items-center gap-0",role:"status","aria-live":"polite"},ed.createElement(rM,{variant:"ghost",size:"sm",className:"bg-primary/20 text-primary ring-primary ring-offset-background ml-1 mb-1 h-6 w-32 overflow-hidden ring-1 ring-offset-2",onClick:()=>u(s.displayName),title:s.displayName},ed.createElement("span",{className:"truncate"},s.displayName)),ed.createElement(rM,{type:"button",variant:"ghost",size:"icon","aria-label":"Clear default mode",className:"text-primary focus-visible:ring-ring focus-visible:ring-offset-background ml-1.5 mb-1 opacity-70 transition hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2",onClick:()=>{i()}},ed.createElement(rB,{className:"text-primary h-3.5 w-3.5","aria-hidden":!0}),ed.createElement("span",{className:"sr-only"},"Clear default mode"))),s&&t&&l.length>0&&ed.createElement("div",{className:"text-muted-foreground mt-2 text-sm"},"Other Available Workflows"),t&&l.length>0&&ed.createElement("div",{className:"mt-2 flex flex-wrap items-center gap-0"},l.map(e=>ed.createElement(rM,{key:e.displayName,variant:"ghost",size:"sm",className:"bg-primary/20 ml-1 mb-1 h-6 w-32 overflow-hidden",onClick:()=>u(e.displayName),title:e.displayName},ed.createElement("span",{className:"truncate"},e.displayName)))))}});function emF({series:e,onSeriesClick:t}){return ed.createElement("div",{className:"w-full px-2"},ed.createElement(epu,{noScroll:!0},ed.createElement(epd,null,ed.createElement(eph,{className:"hover:bg-transparent"},ed.createElement(epp,{className:"pl-0 text-base font-normal"},ed.createElement("span",{className:"text-foreground"},"Modality"),ed.createElement("span",{className:"text-muted-foreground"}," / Series")),ed.createElement(epp,{className:"text-foreground w-8 pr-0 text-right text-base font-normal"},ed.createElement(hO.Series,{className:"ml-auto h-4 w-4"})))),ed.createElement(epc,null,e.map((e,t)=>{let r=e.seriesInstanceUid||e.SeriesInstanceUID||String(t),n=String(e.modality||e.Modality||"").toUpperCase(),a=e.description||e.SeriesDescription||"",i=e.numSeriesInstances??e.numInstances??0;return ed.createElement(eph,{key:r,className:"hover:text-muted-foreground cursor-default hover:bg-transparent"},ed.createElement(epm,{className:"pl-0 text-base"},ed.createElement("div",{className:"flex items-center gap-2"},ed.createElement("span",{className:"text-foreground font-normal"},n),ed.createElement("span",{className:"font-normal"},a))),ed.createElement(epm,{className:"w-8 pr-0 text-right text-base"},i))}))))}function emB({study:e,series:t=[],seriesView:r="all",onThumbnailImageError:n}){let a="all"===r,[i,o]=ed.useState("thumbnails"),s=a?i:r,l=t.filter(e=>e.thumbnailStatus?.status!==emR),u=t.filter(e=>e.thumbnailStatus?.status===emR);return e?ed.createElement(Iu,{delayDuration:200},ed.createElement("div",{className:"flex h-full min-h-0 w-full flex-col gap-3"},ed.createElement(emV,{data:e},ed.createElement(emV.Patient,null),ed.createElement(emV.Workflows,null)),ed.createElement("div",{className:"text-muted-foreground flex h-5 w-full items-center justify-between gap-1 px-2 text-base"},ed.createElement("span",{className:"leading-tight"},t?.length?e?.description||"No Description":"No Series"),a&&ed.createElement(S8,{type:"single",value:i,onValueChange:e=>e&&o(e)},ed.createElement(S6,{value:"thumbnails","aria-label":"Thumbnail view",className:"text-primary"},ed.createElement(hO.ThumbnailView,null)),ed.createElement(S6,{value:"list","aria-label":"List view",className:"text-primary"},ed.createElement(hO.ListView,null)))),ed.createElement(EU,{className:"h-full min-h-0 w-full flex-1"},"thumbnails"===s?ed.createElement("div",{className:"flex flex-col"},l.length>0&&ed.createElement("div",{className:"grid grid-cols-[repeat(auto-fit,_minmax(0,135px))] place-items-start gap-[4px] pr-2"},l.map((e,t)=>{let r=e.seriesInstanceUid||e.SeriesInstanceUID||String(t),a=e.thumbnailStatus,i=a?.status==="ready"?a.src:void 0;return ed.createElement(PK,{key:`series-imaging-${r}`,displaySetInstanceUID:`series-${r}`,imageSrc:i,onImageLoadError:()=>n?.(r),imageAltText:e.description||e.SeriesDescription||"",description:e.description||e.SeriesDescription||"(empty)",seriesNumber:e.seriesNumber??e.SeriesNumber??"",numInstances:e.numSeriesInstances??e.numInstances??0,modality:e.modality||e.Modality||"",isActive:!1,onClick:()=>{},onDoubleClick:()=>{},isDraggable:!1,viewPreset:"thumbnails",thumbnailType:"thumbnail"},a?.status==="notAvailable"&&ed.createElement("div",{className:"bg-muted/50 flex h-full w-full items-center justify-center rounded"},ed.createElement(hO.SeriesPlaceholder,{className:"text-muted-foreground h-[40px] w-[60px] opacity-50"})))})),u.length>0&&ed.createElement("div",{className:"mt-1 grid grid-cols-[repeat(auto-fit,_minmax(0,275px))] place-items-start gap-[2px] pr-2"},u.map((e,t)=>{let r=e.seriesInstanceUid||e.SeriesInstanceUID||String(t);return ed.createElement(PK,{key:`series-non-imaging-${r}`,displaySetInstanceUID:`series-${r}`,imageAltText:e.description||e.SeriesDescription||"",description:e.description||e.SeriesDescription||"(empty)",seriesNumber:e.seriesNumber??e.SeriesNumber??"",numInstances:e.numSeriesInstances??e.numInstances??0,modality:e.modality||e.Modality||"",isActive:!1,onClick:()=>{},onDoubleClick:()=>{},isDraggable:!1,viewPreset:"list",thumbnailType:"thumbnailNoImage"})}))):ed.createElement(emF,{series:t})))):ed.createElement(emV,null,ed.createElement(emV.Patient,null),ed.createElement(emV.Workflows,null))}function emj({children:e}){return ed.createElement("div",{className:"z-10 mt-5 mr-5 flex items-center justify-end gap-1"},e)}function emW({children:e}){let t=null,r=null;if(ed.Children.forEach(e,e=>{if(ed.isValidElement(e)){let n=e.type;if(n===emj)t=e;else if(n===emB){if(r)throw Error("PreviewContainer can only contain one PreviewContent.");r=e}else throw Error("PreviewContainer can only contain PreviewHeader and PreviewContent.")}}),!r)throw Error("PreviewContainer must contain PreviewContent.");return ed.createElement("div",{className:"bg-background relative flex h-full w-full flex-col"},t,ed.createElement("div",{className:"direction-y flex min-h-0 flex-1 pr-3 pb-3 pt-[15px]"},r))}function emU({columns:e,data:t,title:r,initialVisibility:n={},sorting:a,pagination:i,filters:o,onSortingChange:s,onPaginationChange:l,onFiltersChange:u,enforceSingleSelection:d=!0,showColumnVisibility:c=!0,tableClassName:h,onSelectionChange:p,toolbarLeftComponent:m,toolbarRightActionsComponent:f,toolbarRightComponent:g,isLoading:y,loadingComponent:v,manualFiltering:b,onStudyDoubleClick:w}){return eh().createElement(emp,{data:t,columns:e,getRowId:e=>e.studyInstanceUid,initialVisibility:n,sorting:a,pagination:i,filters:o,onSortingChange:s,onPaginationChange:l,onFiltersChange:u,manualFiltering:b,enforceSingleSelection:d,onSelectionChange:p},eh().createElement(emz,{title:r,showColumnVisibility:c,tableClassName:h,toolbarLeftComponent:m,toolbarRightActionsComponent:f,toolbarRightComponent:g,isLoading:y,loadingComponent:v,onStudyDoubleClick:w}))}function emz({title:e,showColumnVisibility:t,tableClassName:r,toolbarLeftComponent:n,toolbarRightActionsComponent:a,toolbarRightComponent:i,isLoading:o,loadingComponent:s,onStudyDoubleClick:l}){let{t:u}=eA("StudyList"),{table:d}=ep7(),c=(0,ed.useMemo)(()=>Array.from(new Set((d.options?.data??[]).flatMap(e=>emb(String(e.modalities??""))))).sort(),[d.options?.data]),{getDefaultWorkflowForStudy:h,getWorkflowsForStudy:p}=emg();return eh().createElement("div",{className:"flex h-full flex-col"},(t||e)&&eh().createElement(emp.Toolbar,null,eh().createElement("div",{className:"absolute left-0"},n),e?eh().createElement(emp.Title,null,e):null,eh().createElement("div",{className:"absolute right-0 flex items-center"},a,a&&eh().createElement("div",{className:"bg-input mx-2 h-4 w-px"}),eh().createElement(emp.Pagination,null),t&&eh().createElement(emp.ViewOptions,null),i)),eh().createElement(emp.Table,{tableClassName:r},eh().createElement(emp.Header,null),eh().createElement(emp.FilterRow,{excludeColumnIds:[emS],renderFilterCell:({columnId:e,value:t,setValue:r})=>{if(e===emE)return eh().createElement("div",{className:"text-right"},eh().createElement(rM,{variant:"ghost",size:"sm",onClick:()=>d.setColumnFilters([]),"aria-label":"Reset filters"},"Reset"));if(e===emx){let e=t&&"object"==typeof t?t:{},n=e.startDate??"",a=e.endDate??"";return eh().createElement(Se,{id:emx,startDate:n,endDate:a,onChange:e=>{let t={...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}};r(Object.keys(t).length>0?t:void 0)}})}if(e===emC){let e=Array.isArray(t)?t:[];return eh().createElement(EJ,{options:c,value:e,onChange:e=>r(e)},eh().createElement(EJ.Field,null,eh().createElement(EJ.Summary,null),eh().createElement(EJ.Input,{ariaLabel:"Filter Modalities",placeholder:""})),eh().createElement(EJ.Content,{fitToContent:!0,maxWidth:185},eh().createElement(EJ.Options,null)))}return null}}),eh().createElement(emp.Body,{emptyMessage:u("No studies available"),isLoading:o,loadingComponent:s,rowProps:{className:"group cursor-pointer",onClick:e=>{let t=e.original;l||p(t).length>0?e.getIsSelected()||e.toggleSelected(!0):e.toggleSelected()},onDoubleClick:e=>{let t=e.original,r=p(t),n=h(t);if(e.getIsSelected()||e.toggleSelected(!0),l)return void l(t,{defaultWorkflow:n,workflows:r});let a=n??r[0];a?.launchWithStudy(t)}}})))}emW.displayName="PreviewContainer";let emH=ed.createContext(void 0);function emG(){let e=ed.useContext(emH);if(!e)throw Error("useLayout must be used within <StudyList>");return e}function emq({isPreviewOpen:e,onIsPreviewOpenChange:t,defaultPreviewSizePercent:r,minPreviewSizePercent:n=15,className:a,loadedModes:i=[],preserveQueryParameters:o,dataPath:s,children:l}){let u=null,d=null;if(ed.Children.forEach(l,e=>{if(ed.isValidElement(e)){let t=e.type;if(t===em$){if(u)throw Error("StudyList can only contain one Table component.");u=e}else if(t===emK){if(d)throw Error("StudyList can only contain one Preview component.");d=e}else throw Error("StudyList can only contain Table and Preview components.")}}),!u)throw Error("StudyList must contain a Table component.");let c=ed.useCallback(()=>t(!0),[t]),h=ed.useCallback(()=>t(!1),[t]),p=ed.useMemo(()=>({isPreviewOpen:e,openPreview:c,closePreview:h,defaultPreviewSizePercent:r,minPreviewSizePercent:n}),[e,c,h,r,n]);return ed.createElement(emf,{loadedModes:i,preserveQueryParameters:o,dataPath:s},ed.createElement(emH.Provider,{value:p},ed.createElement(mr,{direction:"horizontal",className:a??"h-full w-full"},u,d)))}function em$({columns:e,data:t,title:r,initialVisibility:n,enforceSingleSelection:a,showColumnVisibility:i,tableClassName:o,onSelectionChange:s,onSortingChange:l,onPaginationChange:u,onFiltersChange:d,manualFiltering:c,sorting:h,pagination:p,filters:m,toolbarLeftComponent:f,toolbarRightComponent:g,toolbarRightActionsComponent:y,isLoading:v,loadingComponent:b,onStudyDoubleClick:w,children:x}){let{defaultPreviewSizePercent:C}=emG(),k=x||ed.createElement("div",{className:"flex h-full min-h-0 w-full flex-col px-3 pb-3 pt-0"},ed.createElement("div",{className:"min-h-0 flex-1"},ed.createElement("div",{className:"h-full rounded-md px-2 pb-2 pt-0"},ed.createElement(emU,{columns:e,data:t,title:r,initialVisibility:n,enforceSingleSelection:a,showColumnVisibility:i,tableClassName:o,onSelectionChange:s,toolbarLeftComponent:f,toolbarRightComponent:g,toolbarRightActionsComponent:y,onSortingChange:l,onPaginationChange:u,onFiltersChange:d,manualFiltering:c,sorting:h,pagination:p,filters:m,isLoading:v,loadingComponent:b,onStudyDoubleClick:w}))));return ed.createElement(pa,{defaultSize:100-C},k)}function emK({minSizePercent:e,children:t}){let{isPreviewOpen:r,defaultPreviewSizePercent:n,minPreviewSizePercent:a}=emG();return r?ed.createElement(ed.Fragment,null,ed.createElement(mn,null),ed.createElement(pa,{defaultSize:n,minSize:e??a},t)):null}emq.displayName="Layout";let emY=Object.assign(emq,{Table:em$,Preview:emK});function emZ({className:e,"aria-label":t,shouldShow:r,onClick:n,defaultAriaLabel:a}){return r?ed.createElement(rM,{variant:"ghost",size:"icon","aria-label":t??a,onClick:n,className:e},ed.createElement(hO.PanelRight,{"aria-hidden":"true",className:"text-primary h-4 w-4"})):null}Object.assign(emY,{Table:emY.Table,Preview:emY.Preview,SettingsPopover:emA,PreviewContainer:emW,PreviewHeader:emj,PreviewContent:emB,WorkflowsProvider:emf,OpenPreviewButton:function({className:e,"aria-label":t="Open preview"}){let{isPreviewOpen:r,openPreview:n}=emG();return ed.createElement(emZ,{className:e,"aria-label":t,shouldShow:!r,onClick:n,defaultAriaLabel:"Open preview"})},ClosePreviewButton:function({className:e,"aria-label":t="Close preview"}){let{isPreviewOpen:r,closePreview:n}=emG();return ed.createElement(emZ,{className:e,"aria-label":t,shouldShow:r,onClick:n,defaultAriaLabel:"Close preview"})},defaultColumns:emT,textColumn:function(e,t,r){return{id:e,accessorFn:t=>t[e]??"",header:({column:e})=>ed.createElement(emp.ColumnHeader,{column:e}),cell:({row:t})=>ed.createElement("div",{className:"truncate"},t.getValue(e)),meta:{label:t,minWidth:120,...r}}}});let emX=eh().forwardRef(({number:e,title:t,colorHex:r,details:n,onSelect:a,isLocked:i,onToggleVisibility:o,onToggleLocked:s,onRename:l,onDelete:u,onColor:d,onCopy:c,isSelected:h=!1,isSecondarySelected:p=!1,isVisible:m=!0,disableEditing:f=!1,className:g,children:y},v)=>{let{t:b}=eA("DataRow"),[w,x]=(0,ed.useState)(!1),C=t?.length>25,k=eh().Children.toArray(y).filter(e=>eh().isValidElement(e)&&e.type&&e.type.displayName?.startsWith("DataRow.Status")),M=(e,t)=>{switch(t.stopPropagation(),e){case"Rename":l(t);break;case"Copy":c?.(t);break;case"Lock":s(t);break;case"Delete":u(t);break;case"Color":d(t)}},S=(e,t=0)=>{let r,n=" ".repeat(t);if(""===e)return eh().createElement("div",{key:`empty-${t}`,className:"h-2","data-cy":"data-row-detail-line-empty"});let a=((r=document.createElement("textarea")).innerHTML=e,r.value);return eh().createElement("div",{key:a,className:"whitespace-pre-wrap","data-cy":"data-row-detail-line"},n,eh().createElement("span",{className:"font-medium"},a))},E=(e,t)=>{let r=e.slice(0,4),n=e.slice(4);return eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("div",{className:"cursor-help","data-cy":`data-row-details-${t}`},eh().createElement("div",{className:"flex flex-col space-y-1"},r.map((e,t)=>S(e,+!!e.startsWith(" ")))),n.length>0&&eh().createElement("div",{className:"text-muted-foreground mt-1 flex items-center text-sm"},eh().createElement("span",null,"..."),eh().createElement(hO.Info,{className:"mr-1 h-5 w-5"})))),eh().createElement(IP,{side:"right",align:"start",className:"max-w-md"},eh().createElement("div",{className:"text-secondary-foreground flex flex-col space-y-1 text-sm leading-normal"},e.map((e,t)=>S(e,+!!e.startsWith(" "))))))};return eh().createElement("div",{ref:v,className:t_("flex flex-col",!m&&"opacity-60",g)},eh().createElement("div",{className:`flex items-center ${h?"bg-popover":"bg-muted"} group relative cursor-pointer`,onClick:a,"data-cy":"data-row"},p&&eh().createElement("div",{className:"bg-primary/20 pointer-events-none absolute inset-0"}),eh().createElement("div",{className:"bg-primary/20 pointer-events-none absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100"}),null!==e&&eh().createElement("div",{className:`flex h-7 max-h-7 w-7 flex-shrink-0 items-center justify-center rounded-l border-r border-background text-base ${h?"bg-highlight text-black":"bg-muted text-muted-foreground"} overflow-hidden`},e),null===e&&eh().createElement("div",{className:"ml-1 h-7"}),r&&eh().createElement("div",{className:"flex h-7 w-5 items-center justify-center"},eh().createElement("span",{className:"ml-2 h-2 w-2 rounded-full",style:{backgroundColor:r},"data-cy":"data-row-colorhex"})),eh().createElement("div",{className:"ml-2 flex-1 overflow-hidden"},C?eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("span",{"data-cy":"data-row-title",className:`cursor-default text-base ${h?"text-highlight":"text-muted-foreground"} [overflow:hidden] [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]`},t)),eh().createElement(IP,{side:"top",align:"center"},t)):eh().createElement("span",{"data-cy":"data-row-title",className:`text-base ${h?"text-highlight":"text-muted-foreground"} [overflow:hidden] [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]`},t)),eh().createElement("div",{className:"relative ml-2 flex items-center space-x-1"},eh().createElement(rM,{size:"icon",variant:"ghost",className:`h-6 w-6 transition-opacity ${h||!m?"opacity-100":"opacity-0 group-hover:opacity-100"}`,"aria-label":b(m?"Hide":"Show"),dataCY:"data-row-visibility-toggle",onClick:e=>{e.stopPropagation(),o(e)}},m?eh().createElement(hO.Hide,{className:"h-6 w-6"}):eh().createElement(hO.Show,{className:"h-6 w-6"})),i&&!f&&eh().createElement(hO.Lock,{className:"text-muted-foreground h-6 w-6"}),k,f&&eh().createElement("div",{className:"h-6 w-6"}),!f&&eh().createElement(_1,{onOpenChange:e=>x(e)},eh().createElement(_5,{asChild:!0},eh().createElement(rM,{size:"icon",variant:"ghost",className:`h-6 w-6 transition-opacity ${h||w?"opacity-100":"opacity-0 group-hover:opacity-100"}`,"aria-label":"Actions",dataCY:"actionsMenuTrigger",onClick:e=>e.stopPropagation()},eh().createElement(hO.More,{className:"h-6 w-6"}))),eh().createElement(Do,{align:"end",onCloseAutoFocus:e=>e.preventDefault()},eh().createElement(eh().Fragment,null,eh().createElement(Ds,{onClick:e=>M("Rename",e)},eh().createElement(hO.Rename,{className:"text-foreground"}),eh().createElement("span",{className:"pl-2","data-cy":"Rename"},b("Rename"))),c&&eh().createElement(Ds,{onClick:e=>M("Copy",e)},eh().createElement(hO.Copy,{className:"text-foreground"}),eh().createElement("span",{className:"pl-2","data-cy":"Duplicate"},b("Duplicate"))),eh().createElement(Ds,{onClick:e=>M("Delete",e)},eh().createElement(hO.Delete,{className:"text-foreground"}),eh().createElement("span",{className:"pl-2","data-cy":"Delete"},b("Delete"))),d&&eh().createElement(Ds,{onClick:e=>M("Color",e)},eh().createElement(hO.ColorChange,{className:"text-foreground"}),eh().createElement("span",{className:"pl-2","data-cy":"Change Color"},b("Change Color"))),eh().createElement(Ds,{onClick:e=>M("Lock",e)},eh().createElement(hO.Lock,{className:"text-foreground"}),eh().createElement("span",{className:"pl-2","data-cy":"LockToggle"},b(i?"Unlock":"Lock")))))))),n&&(n.primary?.length>0||n.secondary?.length>0)&&eh().createElement("div",{className:"ml-7 px-2 py-2","data-cy":"data-row-details"},eh().createElement("div",{className:"text-secondary-foreground flex items-center gap-1 text-base leading-normal"},n.primary?.length>0&&E(n.primary,"primary"),n.secondary?.length>0&&eh().createElement("div",{className:"text-muted-foreground ml-auto text-sm"},E(n.secondary,"secondary")))))});emX.displayName="DataRow";let emJ=({tooltip:e,icon:t,defaultTooltip:r})=>eh().createElement(Ip,null,eh().createElement(If,{asChild:!0},eh().createElement("div",{className:"flex h-6 w-6 items-center justify-center"},t)),eh().createElement(IP,{side:"bottom"},eh().createElement("div",null,e||r))),emQ=({children:e})=>eh().createElement(eh().Fragment,null,e),em0=({tooltip:e})=>eh().createElement(emJ,{tooltip:e,icon:eh().createElement(hO.ByName,{name:"status-alert",className:"h-4 w-4 text-yellow-500"}),defaultTooltip:"Warning"}),em1=({tooltip:e})=>eh().createElement(emJ,{tooltip:e,icon:eh().createElement(hO.Checked,{className:"h-4 w-4 text-green-500"}),defaultTooltip:"Success"}),em2=({tooltip:e})=>eh().createElement(emJ,{tooltip:e,icon:eh().createElement(hO.ByName,{name:"status-error",className:"h-4 w-4 text-red-500"}),defaultTooltip:"Error"}),em5=({tooltip:e})=>eh().createElement(emJ,{tooltip:e,icon:eh().createElement(hO.Info,{className:"text-primary h-4 w-4"}),defaultTooltip:"Info"});emQ.displayName="DataRow.Status",em0.displayName="DataRow.Status.Warning",em1.displayName="DataRow.Status.Success",em2.displayName="DataRow.Status.Error",em5.displayName="DataRow.Status.Info",emQ.Warning=em0,emQ.Success=em1,emQ.Error=em2,emQ.Info=em5;let em3=emX;em3.Status=emQ;let[em4,em8]=function(e,t){let r=ed.createContext(t);function n(e){let{children:t,...n}=e,a=ed.useMemo(()=>n,Object.values(n));return ed.createElement(r.Provider,{value:a},t)}return r.displayName=`${e}Context`,n.displayName=`${e}Provider`,[n,function(n){let a=ed.useContext(r);if(a)return a;if(t)return t;throw Error(`${n} must be rendered inside of a ${e} component.`)}]}("MeasurementTable",{data:[],isExpanded:!0}),em6=({data:e=[],onAction:t,isExpanded:r=!0,title:n,children:a,disableEditing:i=!1})=>{let{t:o}=eA("MeasurementTable"),s=e.length;return eh().createElement(em4,{data:e,onAction:t,isExpanded:r,disableEditing:i},eh().createElement(Dd,{defaultOpen:!0},eh().createElement(Dd.Header,{key:"measurementTableHeader",className:"bg-popover"},eh().createElement("span",null,`${o(n)} (${s})`)),eh().createElement(Dd.Content,{key:"measurementTableContent"},a)))},em9=({item:e,index:t})=>{let{onAction:r,isExpanded:n,disableEditing:a}=em8("MeasurementTable.Row"),{uid:i}=e;return eh().createElement("div",{"data-cy":`measurement-table-row-${t}`},eh().createElement(em3,{key:e.uid,description:e.label,number:t+1,title:e.label,colorHex:e.colorHex,isSelected:e.isSelected,details:e.displayText,onDelete:e=>r(e,"removeMeasurement",i),onSelect:e=>r(e,"jumpToMeasurement",i),onRename:e=>r(e,"renameMeasurement",i),onToggleVisibility:e=>r(e,"toggleVisibilityMeasurement",i),onToggleLocked:e=>r(e,"toggleLockMeasurement",i),onColor:e=>r(e,"changeMeasurementColor",i),disableEditing:a,isVisible:e.isVisible,isLocked:e.isLocked},e.isUnmapped&&eh().createElement(em3.Status.Warning,{tooltip:e.statusTooltip})))};em6.Header=({children:e})=>eh().createElement("div",{className:"measurement-table-header"},e),em6.Body=()=>{let{data:e}=em8("MeasurementTable.Body");return e&&0!==e.length?eh().createElement("div",{className:"measurement-table-body space-y-px"},e.map((e,t)=>eh().createElement(em9,{key:e.uid,item:e,index:t}))):eh().createElement("div",{className:"text-highlight mb-1 flex flex-1 items-center px-2 py-2 text-base"},eA("MeasurementTable").t("No tracked measurements"))},em6.Footer=({children:e})=>eh().createElement("div",{className:"measurement-table-footer"},e),em6.Row=em9,u(3236);var em7="http://www.w3.org/1999/xhtml";let efe={svg:"http://www.w3.org/2000/svg",xhtml:em7,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function eft(e){var t=e+="",r=t.indexOf(":");return r>=0&&"xmlns"!==(t=e.slice(0,r))&&(e=e.slice(r+1)),efe.hasOwnProperty(t)?{space:efe[t],local:e}:e}function efr(e){var t=eft(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===em7&&t.documentElement.namespaceURI===em7?t.createElement(e):t.createElementNS(r,e)}})(t)}function efn(){}function efa(e){return null==e?efn:function(){return this.querySelector(e)}}function efi(){return[]}function efo(e){return null==e?efi:function(){return this.querySelectorAll(e)}}function efs(e){return function(){return this.matches(e)}}function efl(e){return function(t){return t.matches(e)}}var efu=Array.prototype.find;function efd(){return this.firstElementChild}var efc=Array.prototype.filter;function efh(){return Array.from(this.children)}function efp(e){return Array(e.length)}function efm(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function eff(e,t,r,n,a,i){for(var o,s=0,l=t.length,u=i.length;s<u;++s)(o=t[s])?(o.__data__=i[s],n[s]=o):r[s]=new efm(e,i[s]);for(;s<l;++s)(o=t[s])&&(a[s]=o)}function efg(e,t,r,n,a,i,o){var s,l,u,d=new Map,c=t.length,h=i.length,p=Array(c);for(s=0;s<c;++s)(l=t[s])&&(p[s]=u=o.call(l,l.__data__,s,t)+"",d.has(u)?a[s]=l:d.set(u,l));for(s=0;s<h;++s)u=o.call(e,i[s],s,i)+"",(l=d.get(u))?(n[s]=l,l.__data__=i[s],d.delete(u)):r[s]=new efm(e,i[s]);for(s=0;s<c;++s)(l=t[s])&&d.get(p[s])===l&&(a[s]=l)}function efy(e){return e.__data__}function efv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function efb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function efw(e,t){return e.style.getPropertyValue(t)||efb(e).getComputedStyle(e,null).getPropertyValue(t)}function efx(e){return e.trim().split(/^|\s+/)}function efC(e){return e.classList||new efk(e)}function efk(e){this._node=e,this._names=efx(e.getAttribute("class")||"")}function efM(e,t){for(var r=efC(e),n=-1,a=t.length;++n<a;)r.add(t[n])}function efS(e,t){for(var r=efC(e),n=-1,a=t.length;++n<a;)r.remove(t[n])}function efE(){this.textContent=""}function efT(){this.innerHTML=""}function efI(){this.nextSibling&&this.parentNode.appendChild(this)}function efP(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ef_(){return null}function efD(){var e=this.parentNode;e&&e.removeChild(this)}function efO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function efA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function efR(e){return function(){var t=this.__on;if(t){for(var r,n=0,a=-1,i=t.length;n<i;++n)(r=t[n],e.type&&r.type!==e.type||r.name!==e.name)?t[++a]=r:this.removeEventListener(r.type,r.listener,r.options);++a?t.length=a:delete this.__on}}}function efL(e,t,r){return function(){var n,a=this.__on,i=function(e){t.call(this,e,this.__data__)};if(a){for(var o=0,s=a.length;o<s;++o)if((n=a[o]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),n.value=t;return}}this.addEventListener(e.type,i,r),n={type:e.type,name:e.name,value:t,listener:i,options:r},a?a.push(n):this.__on=[n]}}function efN(e,t,r){var n=efb(e),a=n.CustomEvent;"function"==typeof a?a=new a(t,r):(a=n.document.createEvent("Event"),r?(a.initEvent(t,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}efm.prototype={constructor:efm,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)}},efk.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 efV=[null];function efF(e,t){this._groups=e,this._parents=t}function efB(){return new efF([[document.documentElement]],efV)}function efj(e){return"string"==typeof e?new efF([[document.querySelector(e)]],[document.documentElement]):new efF([[e]],efV)}efF.prototype=efB.prototype={constructor:efF,select:function(e){"function"!=typeof e&&(e=efa(e));for(var t=this._groups,r=t.length,n=Array(r),a=0;a<r;++a)for(var i,o,s=t[a],l=s.length,u=n[a]=Array(l),d=0;d<l;++d)(i=s[d])&&(o=e.call(i,i.__data__,d,s))&&("__data__"in i&&(o.__data__=i.__data__),u[d]=o);return new efF(n,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=efo(e);for(var r=this._groups,n=r.length,a=[],i=[],o=0;o<n;++o)for(var s,l=r[o],u=l.length,d=0;d<u;++d)(s=l[d])&&(a.push(e.call(s,s.__data__,d,l)),i.push(s));return new efF(a,i)},selectChild:function(e){var t;return this.select(null==e?efd:(t="function"==typeof e?e:efl(e),function(){return efu.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?efh:(t="function"==typeof e?e:efl(e),function(){return efc.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=efs(e));for(var t=this._groups,r=t.length,n=Array(r),a=0;a<r;++a)for(var i,o=t[a],s=o.length,l=n[a]=[],u=0;u<s;++u)(i=o[u])&&e.call(i,i.__data__,u,o)&&l.push(i);return new efF(n,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,efy);var r=t?efg:eff,n=this._parents,a=this._groups;"function"!=typeof e&&(v=e,e=function(){return v});for(var i=a.length,o=Array(i),s=Array(i),l=Array(i),u=0;u<i;++u){var d=n[u],c=a[u],h=c.length,p="object"==typeof(y=e.call(d,d&&d.__data__,u,n))&&"length"in y?y:Array.from(y),m=p.length,f=s[u]=Array(m),g=o[u]=Array(m);r(d,c,f,g,l[u]=Array(h),p,t);for(var y,v,b,w,x=0,C=0;x<m;++x)if(b=f[x]){for(x>=C&&(C=x+1);!(w=g[C])&&++C<m;);b._next=w||null}}return(o=new efF(o,n))._enter=s,o._exit=l,o},enter:function(){return new efF(this._enter||this._groups.map(efp),this._parents)},exit:function(){return new efF(this._exit||this._groups.map(efp),this._parents)},join:function(e,t,r){var n=this.enter(),a=this,i=this.exit();return"function"==typeof e?(n=e(n))&&(n=n.selection()):n=n.append(e+""),null!=t&&(a=t(a))&&(a=a.selection()),null==r?i.remove():r(i),n&&a?n.merge(a).order():a},merge:function(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,a=r.length,i=n.length,o=Math.min(a,i),s=Array(a),l=0;l<o;++l)for(var u,d=r[l],c=n[l],h=d.length,p=s[l]=Array(h),m=0;m<h;++m)(u=d[m]||c[m])&&(p[m]=u);for(;l<a;++l)s[l]=r[l];return new efF(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n,a=e[t],i=a.length-1,o=a[i];--i>=0;)(n=a[i])&&(o&&4^n.compareDocumentPosition(o)&&o.parentNode.insertBefore(n,o),o=n);return this},sort:function(e){function t(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}e||(e=efv);for(var r=this._groups,n=r.length,a=Array(n),i=0;i<n;++i){for(var o,s=r[i],l=s.length,u=a[i]=Array(l),d=0;d<l;++d)(o=s[d])&&(u[d]=o);u.sort(t)}return new efF(a,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,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length;a<i;++a){var o=n[a];if(o)return o}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,r=0,n=t.length;r<n;++r)for(var a,i=t[r],o=0,s=i.length;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this},attr:function(e,t){var r=eft(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==t?r.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?r.local?function(e,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}:function(e,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttribute(e):this.setAttribute(e,r)}}:r.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(r,t))},style:function(e,t,r){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,r){return function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}:function(e,t,r){return function(){this.style.setProperty(e,t,r)}})(e,t,null==r?"":r)):efw(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 r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var r=efx(e+"");if(arguments.length<2){for(var n=efC(this.node()),a=-1,i=r.length;++a<i;)if(!n.contains(r[a]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?efM:efS)(this,e)}}:t?function(e){return function(){efM(this,e)}}:function(e){return function(){efS(this,e)}})(r,t))},text:function(e){return arguments.length?this.each(null==e?efE:("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?efT:("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(efI)},lower:function(){return this.each(efP)},append:function(e){var t="function"==typeof e?e:efr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var r="function"==typeof e?e:efr(e),n=null==t?ef_:"function"==typeof t?t:efa(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})},remove:function(){return this.each(efD)},clone:function(e){return this.select(e?efA:efO)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,r){var n,a,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}}),o=i.length;if(arguments.length<2){var s=this.node().__on;if(s){for(var l,u=0,d=s.length;u<d;++u)for(n=0,l=s[u];n<o;++n)if((a=i[n]).type===l.type&&a.name===l.name)return l.value}return}for(s=t?efL:efR,n=0;n<o;++n)this.each(s(i[n],t,r));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return efN(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return efN(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n,a=e[t],i=0,o=a.length;i<o;++i)(n=a[i])&&(yield n)}};var efW=0;function efU(){this._="@"+(++efW).toString(36)}function efz(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 r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,[(n=n.matrixTransform(t.getScreenCTM().inverse())).x,n.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}function efH(e){for(var t=e.length/6|0,r=Array(t),n=0;n<t;)r[n]="#"+e.slice(6*n,6*++n);return r}efU.prototype=(function(){return new efU}).prototype={constructor:efU,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}},efH("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),efH("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),efH("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),efH("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),efH("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),efH("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),efH("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),efH("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");efH("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");efH("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),efH("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");let efG=e=>eoT(e[e.length-1]);function efq(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}function ef$(e){return function(){return e}}efG([,,,].concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(efH)),efG([,,,].concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(efH)),efG([,,,].concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(efH)),efG([,,,].concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(efH)),efG([,,,].concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(efH)),efG([,,,].concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(efH)),efG([,,,].concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(efH)),efG([,,,].concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(efH)),efG([,,,].concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(efH)),efG([,,,].concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(efH)),efG([,,,].concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(efH)),efG([,,,].concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(efH)),efG([,,,].concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(efH)),efG([,,,].concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(efH)),efG([,,,].concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(efH)),efG([,,,].concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(efH)),efG([,,,].concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(efH)),efG([,,,].concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(efH)),efG([,,,].concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(efH)),efG([,,,].concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(efH)),efG([,,,].concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(efH)),efG([,,,].concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(efH)),efG([,,,].concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(efH)),efG([,,,].concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(efH)),efG([,,,].concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(efH)),efG([,,,].concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(efH)),efG([,,,].concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(efH)),eoH(eov(300,.5,0),eov(-240,.5,1)),eoH(eov(-100,.75,.35),eov(80,1.5,.8)),eoH(eov(260,.75,.35),eov(80,1.5,.8)),eov(),eiJ(),efq(efH("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),efq(efH("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),efq(efH("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),efq(efH("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));let efK=Math.cos,efY=Math.sin,efZ=Math.sqrt,efX=Math.PI,efJ=2*efX,efQ=Math.PI,ef0=2*efQ,ef1=ef0-1e-6;function ef2(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class ef5{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?ef2:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return ef2;let r=10**t;return function(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=Math.round(arguments[t]*r)/r+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,r,n){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(e,t,r,n,a,i){this._append`C${+e},${+t},${+r},${+n},${this._x1=+a},${this._y1=+i}`}arcTo(e,t,r,n,a){if(e*=1,t*=1,r*=1,n*=1,(a*=1)<0)throw Error(`negative radius: ${a}`);let i=this._x1,o=this._y1,s=r-e,l=n-t,u=i-e,d=o-t,c=u*u+d*d;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(c>1e-6)if(Math.abs(d*s-l*u)>1e-6&&a){let h=r-i,p=n-o,m=s*s+l*l,f=Math.sqrt(m),g=Math.sqrt(c),y=a*Math.tan((efQ-Math.acos((m+c-(h*h+p*p))/(2*f*g)))/2),v=y/g,b=y/f;Math.abs(v-1)>1e-6&&this._append`L${e+v*u},${t+v*d}`,this._append`A${a},${a},0,0,${+(d*h>u*p)},${this._x1=e+b*s},${this._y1=t+b*l}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,r,n,a,i){if(e*=1,t*=1,r*=1,i=!!i,r<0)throw Error(`negative radius: ${r}`);let o=r*Math.cos(n),s=r*Math.sin(n),l=e+o,u=t+s,d=1^i,c=i?n-a:a-n;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-u)>1e-6)&&this._append`L${l},${u}`,r&&(c<0&&(c=c%ef0+ef0),c>ef1?this._append`A${r},${r},0,1,${d},${e-o},${t-s}A${r},${r},0,1,${d},${this._x1=l},${this._y1=u}`:c>1e-6&&this._append`A${r},${r},0,${+(c>=efQ)},${d},${this._x1=e+r*Math.cos(a)},${this._y1=t+r*Math.sin(a)}`)}rect(e,t,r,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r*=1}v${+n}h${-r}Z`}toString(){return this._}}function ef3(e){this._context=e}function ef4(e){return new ef3(e)}function ef8(e){return e[0]}function ef6(e){return e[1]}function ef9(e,t){let r;var n=ef$(!0),a=null,i=ef4,o=null,s=(r=3,l.digits=function(e){if(!arguments.length)return r;if(null==e)r=null;else{let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);r=t}return l},()=>new ef5(r));function l(r){var l,u,d,c,h=(r="object"==typeof(l=r)&&"length"in l?l:Array.from(l)).length,p=!1;for(null==a&&(o=i(c=s())),u=0;u<=h;++u)!(u<h&&n(d=r[u],u,r))===p&&((p=!p)?o.lineStart():o.lineEnd()),p&&o.point(+e(d,u,r),+t(d,u,r));if(c)return o=null,c+""||null}return e="function"==typeof e?e:void 0===e?ef8:ef$(e),t="function"==typeof t?t:void 0===t?ef6:ef$(t),l.x=function(t){return arguments.length?(e="function"==typeof t?t:ef$(+t),l):e},l.y=function(e){return arguments.length?(t="function"==typeof e?e:ef$(+e),l):t},l.defined=function(e){return arguments.length?(n="function"==typeof e?e:ef$(!!e),l):n},l.curve=function(e){return arguments.length?(i=e,null!=a&&(o=i(a)),l):i},l.context=function(e){return arguments.length?(null==e?a=o=null:o=i(a=e),l):a},l}function ef7(e){this._curve=e}function ege(){}function egt(e,t,r){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+r)/6)}function egr(e){this._context=e}function egn(e,t){this._basis=new egr(e),this._beta=t}function ega(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function egi(e,t){this._context=e,this._k=(1-t)/6}function ego(e,t){this._context=e,this._k=(1-t)/6}function egs(e,t){this._context=e,this._k=(1-t)/6}function egl(e,t,r){var n=e._x1,a=e._y1,i=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,a=(a*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>1e-12){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*u+e._x1*e._l23_2a-t*e._l12_2a)/d,o=(o*u+e._y1*e._l23_2a-r*e._l12_2a)/d}e._context.bezierCurveTo(n,a,i,o,e._x2,e._y2)}function egu(e,t){this._context=e,this._alpha=t}function egd(e,t){this._context=e,this._alpha=t}function egc(e,t){this._context=e,this._alpha=t}ef5.prototype,Array.prototype.slice,ef3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},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)}}},egE=ef4,ef7.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),-(t*Math.cos(e)))}},efZ(3),efZ(1/3),efY(efX/10),efY(7*efX/10),efY(efJ/10),efK(efJ/10),efZ(3),efZ(3),efZ(3),efZ(12),egr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:egt(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:egt(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},egn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,a=e[0],i=t[0],o=e[r]-a,s=t[r]-i,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(a+n*o),this._beta*t[l]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},function e(t){function r(e){return 1===t?new egr(e):new egn(e,t)}return r.beta=function(t){return e(+t)},r}(.85),egi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ega(this,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,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ega(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return new egi(e,t)}return r.tension=function(t){return e(+t)},r}(0),ego.prototype={areaStart:ege,areaEnd:ege,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ega(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return new ego(e,t)}return r.tension=function(t){return e(+t)},r}(0),egs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,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,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ega(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return new egs(e,t)}return r.tension=function(t){return e(+t)},r}(0),egu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e*=1,t*=1,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}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;default:egl(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return t?new egu(e,t):new egi(e,0)}return r.alpha=function(t){return e(+t)},r}(.5),egd.prototype={areaStart:ege,areaEnd:ege,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e*=1,t*=1,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:egl(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return t?new egd(e,t):new ego(e,0)}return r.alpha=function(t){return e(+t)},r}(.5),egc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=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){if(e*=1,t*=1,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:egl(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return t?new egc(e,t):new egs(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function egh(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0);return((i<0?-1:1)+(o<0?-1:1))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs((i*a+o*n)/(n+a)))||0}function egp(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function egm(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function egf(e){this._context=e}function egg(e){this._context=e}egf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:egm(this,this._t0,egp(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;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,egm(this,egp(this,r=egh(this,e,t)),r);break;default:egm(this,this._t0,r=egh(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},((function(e){this._context=new egg(e)}).prototype=Object.create(egf.prototype)).point=function(e,t){egf.prototype.point.call(this,t,e)},egg.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,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};let egy=(e,t,r,n,a,i)=>{let o=r.scale(a),s=n.scale(i);e.call(o),t.call(s)},egv=(e,t=[],r)=>{let n=e.select(".line");t&&t.length>0&&n.datum(t),n.attr("d",r)},egb=(e,t=[],r,n)=>{e.selectAll(".dot").data(t).attr("cx",r).attr("cy",n)};var egw={value:()=>{}};function egx(){for(var e,t=0,r=arguments.length,n={};t<r;++t){if(!(e=arguments[t]+"")||e in n||/[\s.]/.test(e))throw Error("illegal type: "+e);n[e]=[]}return new egC(n)}function egC(e){this._=e}function egk(e,t,r){for(var n=0,a=e.length;n<a;++n)if(e[n].name===t){e[n]=egw,e=e.slice(0,n).concat(e.slice(n+1));break}return null!=r&&e.push({name:t,value:r}),e}egC.prototype=egx.prototype={constructor:egC,on:function(e,t){var r,n=this._,a=(e+"").trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");if(r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,o=a.length;if(arguments.length<2){for(;++i<o;)if((r=(e=a[i]).type)&&(r=function(e,t){for(var r,n=0,a=e.length;n<a;++n)if((r=e[n]).name===t)return r.value}(n[r],e.name)))return r;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<o;)if(r=(e=a[i]).type)n[r]=egk(n[r],e.name,t);else if(null==t)for(r in n)n[r]=egk(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new egC(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var r,n,a=Array(r),i=0;i<r;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(n=this._[e],i=0,r=n.length;i<r;++i)n[i].value.apply(t,a)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var n=this._[e],a=0,i=n.length;a<i;++a)n[a].value.apply(t,r)}};let egM={capture:!0,passive:!1};function egS(e){e.preventDefault(),e.stopImmediatePropagation()}(function(e,{sourceEvent:t,subject:r,target:n,identifier:a,active:i,x:o,y:s,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}).prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var egE,egT,egI,egP,eg_,egD,egO,egA,egR,egL,egN,egV,egF,egB,egj,egW,egU,egz,egH,egG,egq,eg$,egK,egY,egZ,egX,egJ,egQ,eg0,eg1,eg2,eg5,eg3,eg4,eg8,eg6,eg9,eg7,eye,eyt,eyr,eyn,eya,eyi,eyo,eys,eyl,eyu,eyd,eyc,eyh,eyp,eym,eyf,eyg,eyy,eyv,eyb,eyw,eyx,eyC,eyk,eyM,eyS,eyE,eyT,eyI,eyP,ey_,eyD,eyO,eyA,eyR,eyL,eyN,eyV,eyF,eyB,eyj,eyW,eyU,eyz,eyH,eyG,eyq,ey$,eyK,eyY,eyZ,eyX,eyJ,eyQ,ey0,ey1,ey2,ey5,ey3,ey4,ey8,ey6,ey9,ey7,eve,evt,evr,evn=0,eva=0,evi=0,evo=0,evs=0,evl=0,evu="object"==typeof performance&&performance.now?performance:Date,evd="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function evc(){return evs||(evd(evh),evs=evu.now()+evl)}function evh(){evs=0}function evp(){this._call=this._time=this._next=null}function evm(e,t,r){var n=new evp;return n.restart(e,t,r),n}function evf(){evs=(evo=evu.now())+evl,evn=eva=0;try{evc(),++evn;for(var e,t=evt;t;)(e=evs-t._time)>=0&&t._call.call(void 0,e),t=t._next;--evn}finally{evn=0,function(){for(var e,t,r=evt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:evt=t);evr=e,evy(n)}(),evs=0}}function evg(){var e=evu.now(),t=e-evo;t>1e3&&(evl-=t,evo=e)}function evy(e){!evn&&(eva&&(eva=clearTimeout(eva)),e-evs>24?(e<1/0&&(eva=setTimeout(evf,e-evu.now()-evl)),evi&&(evi=clearInterval(evi))):(evi||(evo=evu.now(),evi=setInterval(evg,1e3)),evn=1,evd(evf)))}function evv(e,t,r){var n=new evp;return t=null==t?0:+t,n.restart(r=>{n.stop(),e(r+t)},t,r),n}evp.prototype=evm.prototype={constructor:evp,restart:function(e,t,r){if("function"!=typeof e)throw TypeError("callback is not a function");r=(null==r?evc():+r)+(null==t?0:+t),this._next||evr===this||(evr?evr._next=this:evt=this,evr=this),this._call=e,this._time=r,evy()},stop:function(){this._call&&(this._call=null,this._time=1/0,evy())}};var evb=egx("start","end","cancel","interrupt"),evw=[];function evx(e,t,r,n,a,i){var o=e.__transition;if(o){if(r in o)return}else e.__transition={};!function(e,t,r){var n,a=e.__transition;function i(l){var u,d,c,h;if(1!==r.state)return s();for(u in a)if((h=a[u]).name===r.name){if(3===h.state)return evv(i);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete a[u]):+u<t&&(h.state=6,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete a[u])}if(evv(function(){3===r.state&&(r.state=4,r.timer.restart(o,r.delay,r.time),o(l))}),r.state=2,r.on.call("start",e,e.__data__,r.index,r.group),2===r.state){for(r.state=3,n=Array(c=r.tween.length),u=0,d=-1;u<c;++u)(h=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(n[++d]=h);n.length=d+1}}function o(t){for(var a=t<r.duration?r.ease.call(null,t/r.duration):(r.timer.restart(s),r.state=5,1),i=-1,o=n.length;++i<o;)n[i].call(e,a);5===r.state&&(r.on.call("end",e,e.__data__,r.index,r.group),s())}function s(){for(var n in r.state=6,r.timer.stop(),delete a[t],a)return;delete e.__transition}a[t]=r,r.timer=evm(function(e){r.state=1,r.timer.restart(i,r.delay,r.time),r.delay<=e&&i(e-r.delay)},0,r.time)}(e,r,{name:t,index:n,group:a,on:evb,tween:evw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function evC(e,t){var r=evM(e,t);if(r.state>0)throw Error("too late; already scheduled");return r}function evk(e,t){var r=evM(e,t);if(r.state>3)throw Error("too late; already running");return r}function evM(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw Error("transition not found");return r}function evS(e,t){var r,n,a,i=e.__transition,o=!0;if(i){for(a in t=null==t?null:t+"",i){if((r=i[a]).name!==t){o=!1;continue}n=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete i[a]}o&&delete e.__transition}}function evE(e,t,r){var n=e._id;return e.each(function(){var e=evk(this,n);(e.value||(e.value={}))[t]=r.apply(this,arguments)}),function(e){return evM(e,n).value[t]}}function evT(e,t){var r;return("number"==typeof t?eoI:t instanceof eiK?eoS:(r=eiK(t))?(t=r,eoS):eoD)(e,t)}var evI=efB.prototype.constructor;function evP(e){return function(){this.style.removeProperty(e)}}var ev_=0;function evD(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}var evO=efB.prototype;function evA(e){return(Math.pow(2,-10*e)-9765625e-10)*1.0009775171065494}evD.prototype=(function(e){return efB().transition(e)}).prototype={constructor:evD,select:function(e){var t=this._name,r=this._id;"function"!=typeof e&&(e=efa(e));for(var n=this._groups,a=n.length,i=Array(a),o=0;o<a;++o)for(var s,l,u=n[o],d=u.length,c=i[o]=Array(d),h=0;h<d;++h)(s=u[h])&&(l=e.call(s,s.__data__,h,u))&&("__data__"in s&&(l.__data__=s.__data__),c[h]=l,evx(c[h],t,r,h,c,evM(s,r)));return new evD(i,this._parents,t,r)},selectAll:function(e){var t=this._name,r=this._id;"function"!=typeof e&&(e=efo(e));for(var n=this._groups,a=n.length,i=[],o=[],s=0;s<a;++s)for(var l,u=n[s],d=u.length,c=0;c<d;++c)if(l=u[c]){for(var h,p=e.call(l,l.__data__,c,u),m=evM(l,r),f=0,g=p.length;f<g;++f)(h=p[f])&&evx(h,t,r,f,p,m);i.push(p),o.push(l)}return new evD(i,o,t,r)},selectChild:evO.selectChild,selectChildren:evO.selectChildren,filter:function(e){"function"!=typeof e&&(e=efs(e));for(var t=this._groups,r=t.length,n=Array(r),a=0;a<r;++a)for(var i,o=t[a],s=o.length,l=n[a]=[],u=0;u<s;++u)(i=o[u])&&e.call(i,i.__data__,u,o)&&l.push(i);return new evD(n,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,r=e._groups,n=t.length,a=r.length,i=Math.min(n,a),o=Array(n),s=0;s<i;++s)for(var l,u=t[s],d=r[s],c=u.length,h=o[s]=Array(c),p=0;p<c;++p)(l=u[p]||d[p])&&(h[p]=l);for(;s<n;++s)o[s]=t[s];return new evD(o,this._parents,this._name,this._id)},selection:function(){return new evI(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,r=++ev_,n=this._groups,a=n.length,i=0;i<a;++i)for(var o,s=n[i],l=s.length,u=0;u<l;++u)if(o=s[u]){var d=evM(o,t);evx(o,e,r,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new evD(n,this._parents,e,r)},call:evO.call,nodes:evO.nodes,node:evO.node,size:evO.size,empty:evO.empty,each:evO.each,on:function(e,t){var r,n,a,i,o,s,l=this._id;return arguments.length<2?evM(this.node(),l).on.on(e):this.each((r=l,n=e,a=t,s=(n+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?evC:evk,function(){var e=s(this,r),t=e.on;t!==i&&(o=(i=t).copy()).on(n,a),e.on=o}))},attr:function(e,t){var r=eft(e),n="transform"===r?eoF:evT;return this.attrTween(e,"function"==typeof t?(r.local?function(e,t,r){var n,a,i;return function(){var o,s,l=r(this);return null==l?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:o===n&&s===a?i:(a=s,i=t(n=o,l))}}:function(e,t,r){var n,a,i;return function(){var o,s,l=r(this);return null==l?void this.removeAttribute(e):(o=this.getAttribute(e))===(s=l+"")?null:o===n&&s===a?i:(a=s,i=t(n=o,l))}})(r,n,evE(this,"attr."+e,t)):null==t?(r.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(r):(r.local?function(e,t,r){var n,a,i=r+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===n?a:a=t(n=o,r)}}:function(e,t,r){var n,a,i=r+"";return function(){var o=this.getAttribute(e);return o===i?null:o===n?a:a=t(n=o,r)}})(r,n,t))},attrTween:function(e,t){var r="attr."+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();var n=eft(e);return this.tween(r,(n.local?function(e,t){var r,n;function a(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&function(t){this.setAttributeNS(e.space,e.local,a.call(this,t))}),r}return a._value=t,a}:function(e,t){var r,n;function a(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&function(t){this.setAttribute(e,a.call(this,t))}),r}return a._value=t,a})(n,t))},style:function(e,t,r){var n,a,i,o,s,l,u,d,c,h,p,m,f,g,y,v,b,w,x,C,k,M="transform"==(e+="")?eoV:evT;return null==t?this.styleTween(e,(n=e,function(){var e=efw(this,n),t=(this.style.removeProperty(n),efw(this,n));return e===t?null:e===a&&t===i?o:o=M(a=e,i=t)})).on("end.style."+e,evP(e)):"function"==typeof t?this.styleTween(e,(s=e,l=evE(this,"style."+e,t),function(){var e=efw(this,s),t=l(this),r=t+"";return null==t&&(this.style.removeProperty(s),r=t=efw(this,s)),e===r?null:e===u&&r===d?c:(d=r,c=M(u=e,t))})).each((h=this._id,b="end."+(v="style."+(p=e)),function(){var e=evk(this,h),t=e.on,r=null==e.value[v]?y||(y=evP(p)):void 0;(t!==m||g!==r)&&(f=(m=t).copy()).on(b,g=r),e.on=f})):this.styleTween(e,(w=e,k=t+"",function(){var e=efw(this,w);return e===k?null:e===x?C:C=M(x=e,t)}),r).on("end.style."+e,null)},styleTween:function(e,t,r){var n="style."+(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();return this.tween(n,function(e,t,r){var n,a;function i(){var i=t.apply(this,arguments);return i!==a&&(n=(a=i)&&function(t){this.style.setProperty(e,i.call(this,t),r)}),n}return i._value=t,i}(e,t,null==r?"":r))},text:function(e){var t,r;return this.tween("text","function"==typeof e?(t=evE(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(r=null==e?"":e+"",function(){this.textContent=r}))},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,r;function n(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&function(e){this.textContent=n.call(this,e)}),t}return n._value=e,n}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n,a=evM(this.node(),r).tween,i=0,o=a.length;i<o;++i)if((n=a[i]).name===e)return n.value;return null}return this.each((null==t?function(e,t){var r,n;return function(){var a=evk(this,e),i=a.tween;if(i!==r){n=r=i;for(var o=0,s=n.length;o<s;++o)if(n[o].name===t){(n=n.slice()).splice(o,1);break}}a.tween=n}}:function(e,t,r){var n,a;if("function"!=typeof r)throw Error();return function(){var i=evk(this,e),o=i.tween;if(o!==n){a=(n=o).slice();for(var s={name:t,value:r},l=0,u=a.length;l<u;++l)if(a[l].name===t){a[l]=s;break}l===u&&a.push(s)}i.tween=a}})(r,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){evC(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){evC(this,e).delay=t}})(t,e)):evM(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){evk(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){evk(this,e).duration=t}})(t,e)):evM(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(){evk(this,e).ease=t}}(t,e)):evM(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var r=e.apply(this,arguments);if("function"!=typeof r)throw Error();evk(this,t).ease=r}))},end:function(){var e,t,r=this,n=r._id,a=r.size();return new Promise(function(i,o){var s={value:o},l={value:function(){0==--a&&i()}};r.each(function(){var r=evk(this,n),a=r.on;a!==e&&((t=(e=a).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),r.on=t}),0===a&&i()})},[Symbol.iterator]:evO[Symbol.iterator]},!function e(t){function r(e){return Math.pow(e,t)}return t*=1,r.exponent=e,r}(3),function e(t){function r(e){return 1-Math.pow(1-e,t)}return t*=1,r.exponent=e,r}(3),function e(t){function r(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t*=1,r.exponent=e,r}(3),!function e(t){function r(e){return(e*=1)*e*(t*(e-1)+e)}return t*=1,r.overshoot=e,r}(1.70158),function e(t){function r(e){return--e*e*((e+1)*t+e)+1}return t*=1,r.overshoot=e,r}(1.70158),function e(t){function r(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t*=1,r.overshoot=e,r}(1.70158);var evR=2*Math.PI;!function e(t,r){var n=Math.asin(1/(t=Math.max(1,t)))*(r/=evR);function a(e){return t*evA(- --e)*Math.sin((n-e)/r)}return a.amplitude=function(t){return e(t,r*evR)},a.period=function(r){return e(t,r)},a}(1,.3),function e(t,r){var n=Math.asin(1/(t=Math.max(1,t)))*(r/=evR);function a(e){return 1-t*evA(e*=1)*Math.sin((e+n)/r)}return a.amplitude=function(t){return e(t,r*evR)},a.period=function(r){return e(t,r)},a}(1,.3),function e(t,r){var n=Math.asin(1/(t=Math.max(1,t)))*(r/=evR);function a(e){return((e=2*e-1)<0?t*evA(-e)*Math.sin((n-e)/r):2-t*evA(e)*Math.sin((n+e)/r))/2}return a.amplitude=function(t){return e(t,r*evR)},a.period=function(r){return e(t,r)},a}(1,.3);var evL={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};efB.prototype.interrupt=function(e){return this.each(function(){evS(this,e)})},efB.prototype.transition=function(e){var t,r;e instanceof evD?(t=e._id,e=e._name):(t=++ev_,(r=evL).time=evc(),e=null==e?null:e+"");for(var n=this._groups,a=n.length,i=0;i<a;++i)for(var o,s=n[i],l=s.length,u=0;u<l;++u)(o=s[u])&&evx(o,e,t,u,s,r||function(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return r}(o,t));return new evD(n,this._parents,e,t)};let evN=e=>()=>e;function evV(e,{sourceEvent:t,target:r,transform:n,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:a}})}function evF(e,t,r){this.k=e,this.x=t,this.y=r}evF.prototype={constructor:evF,scale:function(e){return 1===e?this:new evF(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new evF(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 evB=new evF(1,0,0);function evj(e){e.stopImmediatePropagation()}function evW(e){e.preventDefault(),e.stopImmediatePropagation()}function evU(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function evz(){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 evH(){return this.__zoom||evB}function evG(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function evq(){return navigator.maxTouchPoints||"ontouchstart"in this}function ev$(e,t,r){var n=e.invertX(t[0][0])-r[0][0],a=e.invertX(t[1][0])-r[1][0],i=e.invertY(t[0][1])-r[0][1],o=e.invertY(t[1][1])-r[1][1];return e.translate(a>n?(n+a)/2:Math.min(0,n)||Math.max(0,a),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}evF.prototype;let evK=["wheel.zoom","mousedown.zoom","dblclick.zoom","touchstart.zoom","touchmove.zoom","touchend.zoom touchcancel.zoom"],evY={"dblclick.zoom":(e,t)=>{evZ(e,t)}},evZ=(e,t)=>{e&&e.transition().duration(750).call(t.transform,evB)},evX=(function(){var e,t,r,n=evU,a=evz,i=ev$,o=evG,s=evq,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,c=eoj,h=egx("start","zoom","end"),p=0,m=10;function f(e){e.property("__zoom",evH).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new evF(t,e.x,e.y)}function y(e,t,r){var n=t[0]-r[0]*e.k,a=t[1]-r[1]*e.k;return n===e.x&&a===e.y?e:new evF(e.k,n,a)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,r,n){e.on("start.zoom",function(){w(this,arguments).event(n).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(n).end()}).tween("zoom",function(){var e=arguments,i=w(this,e).event(n),o=a.apply(this,e),s=null==r?v(o):"function"==typeof r?r.apply(this,e):r,l=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),u=this.__zoom,d="function"==typeof t?t.apply(this,e):t,h=c(u.invert(s).concat(l/u.k),d.invert(s).concat(l/d.k));return function(e){if(1===e)e=d;else{var t=h(e),r=l/t[2];e=new evF(r,s[0]-t[0]*r,s[1]-t[1]*r)}i.zoom(null,e)}})}function w(e,t,r){return!r&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=a.apply(e,t),this.taps=0}function C(e,...t){if(n.apply(this,arguments)){var r=w(this,t).event(e),a=this.__zoom,s=Math.max(l[0],Math.min(l[1],a.k*Math.pow(2,o.apply(this,arguments)))),d=efz(e);if(r.wheel)(r.mouse[0][0]!==d[0]||r.mouse[0][1]!==d[1])&&(r.mouse[1]=a.invert(r.mouse[0]=d)),clearTimeout(r.wheel);else{if(a.k===s)return;r.mouse=[d,a.invert(d)],evS(this),r.start()}evW(e),r.wheel=setTimeout(function(){r.wheel=null,r.end()},150),r.zoom("mouse",i(y(g(a,s),r.mouse[0],r.mouse[1]),r.extent,u))}}function k(e,...t){if(!r&&n.apply(this,arguments)){var a,o,s,l=e.currentTarget,d=w(this,t,!0).event(e),c=efj(e.view).on("mousemove.zoom",function(e){if(evW(e),!d.moved){var t=e.clientX-m,r=e.clientY-f;d.moved=t*t+r*r>p}d.event(e).zoom("mouse",i(y(d.that.__zoom,d.mouse[0]=efz(e,l),d.mouse[1]),d.extent,u))},!0).on("mouseup.zoom",function(e){var t,r,n,a;c.on("mousemove.zoom mouseup.zoom",null),t=e.view,r=d.moved,n=t.document.documentElement,a=efj(t).on("dragstart.drag",null),r&&(a.on("click.drag",egS,egM),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect),evW(e),d.event(e).end()},!0),h=efz(e,l),m=e.clientX,f=e.clientY;o=(a=e.view).document.documentElement,s=efj(a).on("dragstart.drag",egS,egM),"onselectstart"in o?s.on("selectstart.drag",egS,egM):(o.__noselect=o.style.MozUserSelect,o.style.MozUserSelect="none"),evj(e),d.mouse=[h,this.__zoom.invert(h)],evS(this),d.start()}}function M(e,...t){if(n.apply(this,arguments)){var r=this.__zoom,o=efz(e.changedTouches?e.changedTouches[0]:e,this),s=r.invert(o),l=r.k*(e.shiftKey?.5:2),c=i(y(g(r,l),o,s),a.apply(this,t),u);evW(e),d>0?efj(this).transition().duration(d).call(b,c,o,e):efj(this).call(f.transform,c,o,e)}}function S(r,...a){if(n.apply(this,arguments)){var i,o,s,l,u=r.touches,d=u.length,c=w(this,a,r.changedTouches.length===d).event(r);for(evj(r),o=0;o<d;++o)l=[l=efz(s=u[o],this),this.__zoom.invert(l),s.identifier],c.touch0?c.touch1||c.touch0[2]===l[2]||(c.touch1=l,c.taps=0):(c.touch0=l,i=!0,c.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(c.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),evS(this),c.start())}}function E(e,...t){if(this.__zooming){var r,n,a,o,s=w(this,t).event(e),l=e.changedTouches,d=l.length;for(evW(e),r=0;r<d;++r)a=efz(n=l[r],this),s.touch0&&s.touch0[2]===n.identifier?s.touch0[0]=a:s.touch1&&s.touch1[2]===n.identifier&&(s.touch1[0]=a);if(n=s.that.__zoom,s.touch1){var c=s.touch0[0],h=s.touch0[1],p=s.touch1[0],m=s.touch1[1],f=(f=p[0]-c[0])*f+(f=p[1]-c[1])*f,v=(v=m[0]-h[0])*v+(v=m[1]-h[1])*v;n=g(n,Math.sqrt(f/v)),a=[(c[0]+p[0])/2,(c[1]+p[1])/2],o=[(h[0]+m[0])/2,(h[1]+m[1])/2]}else{if(!s.touch0)return;a=s.touch0[0],o=s.touch0[1]}s.zoom("touch",i(y(n,a,o),s.extent,u))}}function T(e,...n){if(this.__zooming){var a,i,o=w(this,n).event(e),s=e.changedTouches,l=s.length;for(evj(e),r&&clearTimeout(r),r=setTimeout(function(){r=null},500),a=0;a<l;++a)i=s[a],o.touch0&&o.touch0[2]===i.identifier?delete o.touch0:o.touch1&&o.touch1[2]===i.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(i=efz(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<m)){var u=efj(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return f.transform=function(e,t,r,n){var a=e.selection?e.selection():e;a.property("__zoom",evH),e!==a?b(e,t,r,n):a.interrupt().each(function(){w(this,arguments).event(n).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},f.scaleBy=function(e,t,r,n){f.scaleTo(e,function(){var e=this.__zoom.k,r="function"==typeof t?t.apply(this,arguments):t;return e*r},r,n)},f.scaleTo=function(e,t,r,n){f.transform(e,function(){var e=a.apply(this,arguments),n=this.__zoom,o=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r,s=n.invert(o),l="function"==typeof t?t.apply(this,arguments):t;return i(y(g(n,l),o,s),e,u)},r,n)},f.translateBy=function(e,t,r,n){f.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof r?r.apply(this,arguments):r),a.apply(this,arguments),u)},null,n)},f.translateTo=function(e,t,r,n,o){f.transform(e,function(){var e=a.apply(this,arguments),o=this.__zoom,s=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n;return i(evB.translate(s[0],s[1]).scale(o.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof r?-r.apply(this,arguments):-r),e,u)},n,o)},x.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=efj(this.that).datum();h.call(e,this.that,new evV(e,{sourceEvent:this.sourceEvent,target:f,type:e,transform:this.that.__zoom,dispatch:h}),t)}},f.wheelDelta=function(e){return arguments.length?(o="function"==typeof e?e:evN(+e),f):o},f.filter=function(e){return arguments.length?(n="function"==typeof e?e:evN(!!e),f):n},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:evN(!!e),f):s},f.extent=function(e){return arguments.length?(a="function"==typeof e?e:evN([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),f):a},f.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],f):[l[0],l[1]]},f.translateExtent=function(e){return arguments.length?(u[0][0]=+e[0][0],u[1][0]=+e[1][0],u[0][1]=+e[0][1],u[1][1]=+e[1][1],f):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},f.constrain=function(e){return arguments.length?(i=e,f):i},f.duration=function(e){return arguments.length?(d=+e,f):d},f.interpolate=function(e){return arguments.length?(c=e,f):c},f.on=function(){var e=h.on.apply(h,arguments);return e===h?f:e},f.clickDistance=function(e){return arguments.length?(p=(e*=1)*e,f):Math.sqrt(p)},f.tapDistance=function(e){return arguments.length?(m=+e,f):m},f})().scaleExtent([1,20]),evJ={bindMouseEvents:(e,t,r,n,a,i,o,s,l,u)=>{e&&(evX.on("zoom",function(d){let c=d.transform.rescaleX(n),h=d.transform.rescaleY(a);egy(t,r,i,o,c,h),u.forEach((t,r)=>{let n=e.select(`#series_${r}`),a=ef9().x(s(c)).y(l(h));egv(n,t,a),egb(n,t,s(c),l(h))})}),function(){for(let t of evK)e.on(t,null)}(),function(){for(let t of Object.keys(evY))e.call(evX).on(t,evY[t].bind(void 0,e,evX))}())},external:{resetZoom:e=>{evZ(e,evX)}}},{external:{resetZoom:evQ}}=evJ;ei().string,ei().number,ei().number,ei().bool,ei().bool,ei().bool,ei().number,ei().bool,ei().string,ei().string;let ev0=((I={}).NeverShowDialog="never",I.AlwaysShowDialog="always",I.ShowOnceAndConfigure="configure",I);ei().shape({option:ei().oneOf(Object.values(ev0)).isRequired,days:ei().number});let ev1=new Map;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?Array.from(ev1.keys()).forEach(e=>{window.sessionStorage.removeItem(e)}):Array.from(ev1.keys()).forEach(e=>{window.sessionStorage.setItem(e,ev1.get(e))})});let ev2=({className:e=""})=>{let{t}=eA("StudyList");return eh().createElement("div",{className:em()("inline-flex flex-col items-center",e)},eh().createElement(hO.Magnifier,{className:"mb-4"}),eh().createElement(eX,{className:"text-primary-light",variant:"h5"},t("No studies available")))};ev2.propTypes={className:ei().string};let ev5=ev2,ev3={};function ev4(e,t){ev3[e]&&console.warn(`Icon ${e} already exists.`),ev3[e]=t}function ev8(e,t){let r=ev3[e];return e&&r?"string"==typeof r&&r.endsWith(".png")?eh().createElement("img",{src:r,...t}):eh().createElement(r,t):eh().createElement("div",null,"Missing Icon "+e)}let ev6=({name:e,...t})=>eh().createElement(eh().Fragment,null,ev8(e,{...t}));ev6.propTypes={name:ei().string.isRequired,className:ei().string};let ev9=ev6,ev7={descending:()=>eh().createElement(hO.SortingDescending,{className:"text-primary-main mx-2 w-2"}),ascending:()=>eh().createElement(hO.SortingAscending,{className:"text-primary-main mx-2 w-2"}),none:()=>eh().createElement(hO.Sorting,{className:"text-primary-main mx-2 w-2"})},ebe=({label:e,isSortable:t,sortDirection:r,onLabelClick:n,className:a="",children:i})=>{let o=e=>{t&&n(e)};return eh().createElement("label",{className:em()("flex flex-col flex-1 text-white text-lg pl-1 select-none",a)},eh().createElement("span",{role:"button",className:"flex flex-row items-center cursor-pointer focus:outline-none",onClick:o,onKeyDown:o,tabIndex:"0"},e,t&&ev7[r]()),eh().createElement("span",null,i))};ebe.propTypes={label:ei().string.isRequired,isSortable:ei().bool.isRequired,sortDirection:ei().oneOf(["ascending","descending","none"]).isRequired,onLabelClick:ei().func.isRequired,className:ei().string,children:ei().node};let ebt=ebe,ebr=({id:e,label:t,isSortable:r,sortDirection:n,onLabelClick:a=()=>{},value:i={},onChange:o})=>{let{startDate:s,endDate:l}=i;return eh().createElement(ebt,{label:t,isSortable:r,sortDirection:n,onLabelClick:e=>{e.preventDefault(),a(e)},className:"xl:min-w-[284px]"},eh().createElement("div",{className:"relative xl:max-w-[246px]"},eh().createElement(Se,{className:"mt-2 [&_input]:h-[34px] [&_input]:py-2 [&_input]:px-3",id:e,startDate:s,endDate:l,onChange:o})))};ebr.propTypes={id:ei().string,label:ei().string.isRequired,isSortable:ei().bool.isRequired,sortDirection:ei().oneOf(["ascending","descending","none"]).isRequired,onLabelClick:ei().func.isRequired,value:ei().shape({startDate:ei().string,endDate:ei().string}),onChange:ei().func.isRequired};let ebn=ebr;function eba(e){return({1:"w-1/24",2:"w-2/24",3:"w-3/24",4:"w-4/24",5:"w-5/24",6:"w-6/24",7:"w-7/24",8:"w-8/24",9:"w-9/24",10:"w-10/24",11:"w-11/24",12:"w-12/24",13:"w-13/24",14:"w-14/24",15:"w-15/24",16:"w-16/24",17:"w-17/24",18:"w-18/24",19:"w-19/24",20:"w-20/24",21:"w-21/24",22:"w-22/24",23:"w-23/24",24:"w-24/24"})[e]}function ebi(){return(ebi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let ebo=({children:e,className:t,text:r,...n})=>eh().createElement("label",ebi({className:em()("",t)},n),r,e);function ebs(){return(ebs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}ebo.propTypes={children:ei().node};let ebl={true:"bg-transparent",false:"bg-black"},ebu={true:"input-small",false:""},ebd=({id:e,label:t,containerClassName:r="",labelClassName:n="",className:a="",transparent:i=!1,smallInput:o=!1,type:s="text",value:l,onChange:u,onFocus:d,autoFocus:c,onKeyPress:h,onKeyDown:p,readOnly:m,disabled:f,labelChildren:g,...y})=>eh().createElement("div",{className:em()("flex flex-1 flex-col",r)},eh().createElement(ebo,{className:n,text:t,children:g}),eh().createElement("input",ebs({"data-cy":`input-${e}`,className:em()(t&&"mt-2",a,"shadow transition duration-300 appearance-none border border-inputfield-main focus:border-inputfield-focus focus:outline-none disabled:border-inputfield-disabled rounded w-full py-2 px-3 text-sm text-white placeholder-inputfield-placeholder leading-tight",ebl[i],ebu[o],{"cursor-not-allowed":f}),disabled:f,readOnly:m,autoFocus:c,type:s,value:l,onChange:u,onFocus:d,onKeyPress:h,onKeyDown:p},y)));ebd.propTypes={id:ei().string,label:ei().string,containerClassName:ei().string,labelClassName:ei().string,className:ei().string,transparent:ei().bool,smallInput:ei().bool,type:ei().string,value:ei().any,onChange:ei().func,onFocus:ei().func,autoFocus:ei().bool,readOnly:ei().bool,onKeyPress:ei().func,onKeyDown:ei().func,disabled:ei().bool,labelChildren:ei().node};let ebc=({id:e,label:t,isSortable:r=!1,sortDirection:n="none",onLabelClick:a=()=>{},value:i="",onChange:o})=>eh().createElement(ebt,{label:t,isSortable:r,sortDirection:n,onLabelClick:a},eh().createElement(ebd,{id:e,className:"mt-2",type:"text",containerClassName:"mr-2",value:i,onChange:e=>{o(e.target.value)}}));ebc.propTypes={id:ei().string,label:ei().string.isRequired,isSortable:ei().bool,sortDirection:ei().oneOf(["ascending","descending","none"]),onLabelClick:ei().func,value:ei().any,onChange:ei().func.isRequired};let ebh=ebc;function ebp(e){return(ebp="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 ebm(e){var t=function(e,t){if("object"!=ebp(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ebp(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ebp(t)?t:t+""}function ebf(e,t,r){return(t=ebm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ebg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eby(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ebg(Object(r),!0).forEach(function(t){ebf(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ebg(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ebv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ebb(e,t){if(e){if("string"==typeof e)return ebv(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ebv(e,t):void 0}}function ebw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}(e,t)||ebb(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 ebx(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var ebC=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function ebk(){return(ebk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function ebM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ebm(n.key),n)}}function ebS(e,t){return(ebS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ebE(e){return(ebE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ebT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ebT=function(){return!!e})()}function ebI(e){return function(e){if(Array.isArray(e))return ebv(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ebb(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.")}()}var ebP=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t));var t,r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),eb_="-ms-",ebD="-moz-",ebO="-webkit-",ebA="comm",ebR="rule",ebL="decl",ebN="@keyframes",ebV=Math.abs,ebF=String.fromCharCode,ebB=Object.assign;function ebj(e,t,r){return e.replace(t,r)}function ebW(e,t){return e.indexOf(t)}function ebU(e,t){return 0|e.charCodeAt(t)}function ebz(e,t,r){return e.slice(t,r)}function ebH(e){return e.length}function ebG(e,t){return t.push(e),e}var ebq=1,eb$=1,ebK=0,ebY=0,ebZ=0,ebX="";function ebJ(e,t,r,n,a,i,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:ebq,column:eb$,length:o,return:""}}function ebQ(e,t){return ebB(ebJ("",null,null,"",null,null,0),e,{length:-e.length},t)}function eb0(){return ebZ=ebY<ebK?ebU(ebX,ebY++):0,eb$++,10===ebZ&&(eb$=1,ebq++),ebZ}function eb1(){return ebU(ebX,ebY)}function eb2(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function eb5(e){return ebq=eb$=1,ebK=ebH(ebX=e),ebY=0,[]}function eb3(e){var t,r;return(t=ebY-1,r=function e(t){for(;eb0();)switch(ebZ){case t:return ebY;case 34:case 39:34!==t&&39!==t&&e(ebZ);break;case 40:41===t&&e(t);break;case 92:eb0()}return ebY}(91===e?e+2:40===e?e+1:e),ebz(ebX,t,r)).trim()}function eb4(e,t,r,n,a,i,o,s,l,u,d){for(var c=a-1,h=0===a?i:[""],p=h.length,m=0,f=0,g=0;m<n;++m)for(var y=0,v=ebz(e,c+1,c=ebV(f=o[m])),b=e;y<p;++y)(b=(f>0?h[y]+" "+v:ebj(v,/&\f/g,h[y])).trim())&&(l[g++]=b);return ebJ(e,t,r,0===a?ebR:s,l,u,d)}function eb8(e,t,r,n){return ebJ(e,t,r,ebL,ebz(e,0,n),ebz(e,n+1,-1),n)}function eb6(e,t){for(var r="",n=e.length,a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function eb9(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ebL:return e.return=e.return||e.value;case ebA:return"";case ebN:return e.return=e.value+"{"+eb6(e.children,n)+"}";case ebR:e.value=e.props.join(",")}return ebH(r=eb6(e.children,n))?e.return=e.value+"{"+r+"}":""}var eb7=function(e,t,r){for(var n=0,a=0;n=a,a=eb1(),38===n&&12===a&&(t[r]=1),!eb2(a);)eb0();return ebz(ebX,e,ebY)},ewe=function(e,t){var r=-1,n=44;do switch(eb2(n)){case 0:38===n&&12===eb1()&&(t[r]=1),e[r]+=eb7(ebY-1,t,r);break;case 2:e[r]+=eb3(n);break;case 4:if(44===n){e[++r]=58===eb1()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=ebF(n)}while(n=eb0());return e},ewt=function(e,t){var r;return r=ewe(eb5(e),t),ebX="",r},ewr=new WeakMap,ewn=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ewr.get(r))&&!n){ewr.set(e,!0);for(var a=[],i=ewt(t,a),o=r.props,s=0,l=0;s<i.length;s++)for(var u=0;u<o.length;u++,l++)e.props[l]=a[s]?i[s].replace(/&\f/g,o[u]):o[u]+" "+i[s]}}},ewa=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},ewi=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case ebL:e.return=function e(t,r){switch(45^ebU(t,0)?(((r<<2^ebU(t,0))<<2^ebU(t,1))<<2^ebU(t,2))<<2^ebU(t,3):0){case 5103:return ebO+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ebO+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ebO+t+ebD+t+eb_+t+t;case 6828:case 4268:return ebO+t+eb_+t+t;case 6165:return ebO+t+eb_+"flex-"+t+t;case 5187:return ebO+t+ebj(t,/(\w+).+(:[^]+)/,ebO+"box-$1$2"+eb_+"flex-$1$2")+t;case 5443:return ebO+t+eb_+"flex-item-"+ebj(t,/flex-|-self/,"")+t;case 4675:return ebO+t+eb_+"flex-line-pack"+ebj(t,/align-content|flex-|-self/,"")+t;case 5548:return ebO+t+eb_+ebj(t,"shrink","negative")+t;case 5292:return ebO+t+eb_+ebj(t,"basis","preferred-size")+t;case 6060:return ebO+"box-"+ebj(t,"-grow","")+ebO+t+eb_+ebj(t,"grow","positive")+t;case 4554:return ebO+ebj(t,/([^-])(transform)/g,"$1"+ebO+"$2")+t;case 6187:return ebj(ebj(ebj(t,/(zoom-|grab)/,ebO+"$1"),/(image-set)/,ebO+"$1"),t,"")+t;case 5495:case 3959:return ebj(t,/(image-set\([^]*)/,ebO+"$1$`$1");case 4968:return ebj(ebj(t,/(.+:)(flex-)?(.*)/,ebO+"box-pack:$3"+eb_+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ebO+t+t;case 4095:case 3583:case 4068:case 2532:return ebj(t,/(.+)-inline(.+)/,ebO+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ebH(t)-1-r>6)switch(ebU(t,r+1)){case 109:if(45!==ebU(t,r+4))break;case 102:return ebj(t,/(.+:)(.+)-([^]+)/,"$1"+ebO+"$2-$3$1"+ebD+(108==ebU(t,r+3)?"$3":"$2-$3"))+t;case 115:return~ebW(t,"stretch")?e(ebj(t,"stretch","fill-available"),r)+t:t}break;case 4949:if(115!==ebU(t,r+1))break;case 6444:switch(ebU(t,ebH(t)-3-(~ebW(t,"!important")&&10))){case 107:return ebj(t,":",":"+ebO)+t;case 101:return ebj(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ebO+(45===ebU(t,14)?"inline-":"")+"box$3$1"+ebO+"$2$3$1"+eb_+"$2box$3")+t}break;case 5936:switch(ebU(t,r+11)){case 114:return ebO+t+eb_+ebj(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ebO+t+eb_+ebj(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ebO+t+eb_+ebj(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return ebO+t+eb_+t+t}return t}(e.value,e.length);break;case ebN:return eb6([ebQ(e,{value:ebj(e.value,"@","@"+ebO)})],n);case ebR:if(e.length){var a,i;return a=e.props,i=function(t){var r;switch(r=t,(r=/(::plac\w+|:read-\w+)/.exec(r))?r[0]:r){case":read-only":case":read-write":return eb6([ebQ(e,{props:[ebj(t,/:(read-\w+)/,":"+ebD+"$1")]})],n);case"::placeholder":return eb6([ebQ(e,{props:[ebj(t,/:(plac\w+)/,":"+ebO+"input-$1")]}),ebQ(e,{props:[ebj(t,/:(plac\w+)/,":"+ebD+"$1")]}),ebQ(e,{props:[ebj(t,/:(plac\w+)/,eb_+"input-$1")]})],n)}return""},a.map(i).join("")}}}],ewo=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},ews=function(e,t,r){ewo(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next;while(void 0!==a)}},ewl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ewu=/[A-Z]|^ms/g,ewd=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ewc=function(e){return 45===e.charCodeAt(1)},ewh=function(e){return null!=e&&"boolean"!=typeof e},ewp=(P=function(e){return ewc(e)?e:e.replace(ewu,"-$&").toLowerCase()},_=Object.create(null),function(e){return void 0===_[e]&&(_[e]=P(e)),_[e]}),ewm=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ewd,function(e,t,r){return B={name:t,styles:r,next:B},t})}return 1===ewl[e]||ewc(e)||"number"!=typeof t||0===t?t:t+"px"};function ewf(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return B={name:r.name,styles:r.styles,next:B},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)B={name:n.name,styles:n.styles,next:B},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=ewf(e,t,r[a])+";";else for(var i in r){var o=r[i];if("object"!=typeof o)null!=t&&void 0!==t[o]?n+=i+"{"+t[o]+"}":ewh(o)&&(n+=ewp(i)+":"+ewm(i,o)+";");else if(Array.isArray(o)&&"string"==typeof o[0]&&(null==t||void 0===t[o[0]]))for(var s=0;s<o.length;s++)ewh(o[s])&&(n+=ewp(i)+":"+ewm(i,o[s])+";");else{var l=ewf(e,t,o);switch(i){case"animation":case"animationName":n+=ewp(i)+":"+l+";";break;default:n+=i+"{"+l+"}"}}}return n}(e,t,r);case"function":if(void 0!==e){var a=B,i=r(e);return B=a,ewf(e,t,i)}}if(null==t)return r;var o=t[r];return void 0!==o?o:r}var ewg=/label:\s*([^\s;{]+)\s*(;|$)/g;function ewy(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n,a=!0,i="";B=void 0;var o=e[0];null==o||void 0===o.raw?(a=!1,i+=ewf(r,t,o)):i+=o[0];for(var s=1;s<e.length;s++)i+=ewf(r,t,e[s]),a&&(i+=o[s]);ewg.lastIndex=0;for(var l="";null!==(n=ewg.exec(i));)l+="-"+n[1];return{name:function(e){for(var t,r=0,n=0,a=e.length;a>=4;++n,a-=4)t=(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))*0x5bd1e995+((t>>>16)*59797<<16),t^=t>>>24,r=(65535&t)*0x5bd1e995+((t>>>16)*59797<<16)^(65535&r)*0x5bd1e995+((r>>>16)*59797<<16);switch(a){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r^=255&e.charCodeAt(n),r=(65535&r)*0x5bd1e995+((r>>>16)*59797<<16)}return r^=r>>>13,(((r=(65535&r)*0x5bd1e995+((r>>>16)*59797<<16))^r>>>15)>>>0).toString(36)}(i)+l,styles:i,next:B}}var ewv=!!ed.useInsertionEffect&&ed.useInsertionEffect,ewb=ewv||function(e){return e()};ewv||ed.useLayoutEffect;var eww=ed.createContext("u">typeof HTMLElement?function(e){var t,r,n,a,i,o=e.key;if("css"===o){var s=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(s,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var l=e.stylisPlugins||ewi,u={},d=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)u[t[r]]=!0;d.push(e)});var c=(r=(t=[ewn,ewa].concat(l,[eb9,(n=function(e){i.insert(e)},function(e){!e.root&&(e=e.return)&&n(e)})])).length,function(e,n,a,i){for(var o="",s=0;s<r;s++)o+=t[s](e,n,a,i)||"";return o}),h=function(e){var t,r;return eb6((r=function e(t,r,n,a,i,o,s,l,u){for(var d,c=0,h=0,p=s,m=0,f=0,g=0,y=1,v=1,b=1,w=0,x="",C=i,k=o,M=a,S=x;v;)switch(g=w,w=eb0()){case 40:if(108!=g&&58==ebU(S,p-1)){-1!=ebW(S+=ebj(eb3(w),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:S+=eb3(w);break;case 9:case 10:case 13:case 32:S+=function(e){for(;ebZ=eb1();)if(ebZ<33)eb0();else break;return eb2(e)>2||eb2(ebZ)>3?"":" "}(g);break;case 92:S+=function(e,t){for(var r;--t&&eb0()&&!(ebZ<48)&&!(ebZ>102)&&(!(ebZ>57)||!(ebZ<65))&&(!(ebZ>70)||!(ebZ<97)););return r=ebY+(t<6&&32==eb1()&&32==eb0()),ebz(ebX,e,r)}(ebY-1,7);continue;case 47:switch(eb1()){case 42:case 47:ebG((d=function(e,t){for(;eb0();)if(e+ebZ===57)break;else if(e+ebZ===84&&47===eb1())break;return"/*"+ebz(ebX,t,ebY-1)+"*"+ebF(47===e?e:eb0())}(eb0(),ebY),ebJ(d,r,n,ebA,ebF(ebZ),ebz(d,2,-2),0)),u);break;default:S+="/"}break;case 123*y:l[c++]=ebH(S)*b;case 125*y:case 59:case 0:switch(w){case 0:case 125:v=0;case 59+h:-1==b&&(S=ebj(S,/\f/g,"")),f>0&&ebH(S)-p&&ebG(f>32?eb8(S+";",a,n,p-1):eb8(ebj(S," ","")+";",a,n,p-2),u);break;case 59:S+=";";default:if(ebG(M=eb4(S,r,n,c,h,i,l,x,C=[],k=[],p),o),123===w)if(0===h)e(S,r,M,M,C,o,p,l,k);else switch(99===m&&110===ebU(S,3)?100:m){case 100:case 108:case 109:case 115:e(t,M,M,a&&ebG(eb4(t,M,M,0,0,i,l,x,i,C=[],p),k),i,k,p,l,a?C:k);break;default:e(S,M,M,M,[""],k,0,l,k)}}c=h=f=0,y=b=1,x=S="",p=s;break;case 58:p=1+ebH(S),f=g;default:if(y<1){if(123==w)--y;else if(125==w&&0==y++&&125==(ebZ=ebY>0?ebU(ebX,--ebY):0,eb$--,10===ebZ&&(eb$=1,ebq--),ebZ))continue}switch(S+=ebF(w),w*y){case 38:b=h>0?1:(S+="\f",-1);break;case 44:l[c++]=(ebH(S)-1)*b,b=1;break;case 64:45===eb1()&&(S+=eb3(eb0())),m=eb1(),h=p=ebH(x=S+=function(e){for(;!eb2(eb1());)eb0();return ebz(ebX,e,ebY)}(ebY)),w++;break;case 45:45===g&&2==ebH(S)&&(y=0)}}return o}("",null,null,null,[""],t=eb5(t=e),0,[0],t),ebX="",r),c)},p={key:o,sheet:new ebP({key:o,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:u,registered:{},insert:function(e,t,r,n){i=r,h(e?e+"{"+t.styles+"}":t.styles),n&&(p.inserted[t.name]=!0)}};return p.sheet.hydrate(d),p}({key:"css"}):null);eww.Provider;var ewx=ed.createContext({}),ewC={}.hasOwnProperty,ewk="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",ewM=function(e,t){var r={};for(var n in t)ewC.call(t,n)&&(r[n]=t[n]);return r[ewk]=e,r},ewS=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return ewo(t,r,n),ewb(function(){return ews(t,r,n)}),null},ewE=(D=function(e,t,r){var n,a,i,o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var s=e[ewk],l=[o],u="";"string"==typeof e.className?(n=t.registered,a=e.className,i="",a.split(" ").forEach(function(e){void 0!==n[e]?l.push(n[e]+";"):e&&(i+=e+" ")}),u=i):null!=e.className&&(u=e.className+" ");var d=ewy(l,void 0,ed.useContext(ewx));u+=t.key+"-"+d.name;var c={};for(var h in e)ewC.call(e,h)&&"css"!==h&&h!==ewk&&(c[h]=e[h]);return c.className=u,r&&(c.ref=r),ed.createElement(ed.Fragment,null,ed.createElement(ewS,{cache:t,serialized:d,isStringTag:"string"==typeof s}),ed.createElement(s,c))},(0,ed.forwardRef)(function(e,t){return D(e,(0,ed.useContext)(eww),t)})),ewT=function(e,t){var r=arguments;if(null==t||!ewC.call(t,"css"))return ed.createElement.apply(void 0,r);var n=r.length,a=Array(n);a[0]=ewE,a[1]=ewM(e,t);for(var i=2;i<n;i++)a[i]=r[i];return ed.createElement.apply(null,a)};function ewI(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return ewy(t)}O=ewT||(ewT={}),A||(A=O.JSX||(O.JSX={}));var ewP=ed.useLayoutEffect,ew_=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ewD=function(){};function ewO(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var i=[].concat(n);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&i.push("".concat(o?"-"===o[0]?e+o:e+"__"+o:e));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var ewA=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===ebp(e)&&null!==e?[e]:[]},ewR=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,eby({},ebx(e,ew_))},ewL=function(e,t,r){var n=e.cx,a=e.getStyles,i=e.getClassNames,o=e.className;return{css:a(t,e),className:n(null!=r?r:{},i(t,e),o)}};function ewN(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ewV(e){return ewN(e)?window.pageYOffset:e.scrollTop}function ewF(e,t){ewN(e)?window.scrollTo(0,t):e.scrollTop=t}function ewB(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ewD,a=ewV(e),i=t-a,o=0;!function t(){var s;o+=10,ewF(e,i*((s=(s=o)/r-1)*s*s+1)+a),o<r?window.requestAnimationFrame(t):n(e)}()}function ewj(e,t){var r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),a=t.offsetHeight/3;n.bottom+a>r.bottom?ewF(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+a,e.scrollHeight)):n.top-a<r.top&&ewF(e,Math.max(t.offsetTop-a,0))}function ewW(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var ewU=!1,ewz="u">typeof window?window:{};ewz.addEventListener&&ewz.removeEventListener&&(ewz.addEventListener("p",ewD,{get passive(){return ewU=!0}}),ewz.removeEventListener("p",ewD,!1));var ewH=ewU;function ewG(e){return null!=e}var ewq=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Object.entries(e).filter(function(e){var t=ebw(e,1)[0];return!r.includes(t)}).reduce(function(e,t){var r=ebw(t,2),n=r[0],a=r[1];return e[n]=a,e},{})},ew$=["children","innerProps"],ewK=["children","innerProps"],ewY=function(e){return"auto"===e?"bottom":e},ewZ=(0,ed.createContext)(null),ewX=function(e){var t=e.children,r=e.minMenuHeight,n=e.maxMenuHeight,a=e.menuPlacement,i=e.menuPosition,o=e.menuShouldScrollIntoView,s=e.theme,l=((0,ed.useContext)(ewZ)||{}).setPortalPlacement,u=(0,ed.useRef)(null),d=ebw((0,ed.useState)(n),2),c=d[0],h=d[1],p=ebw((0,ed.useState)(null),2),m=p[0],f=p[1],g=s.spacing.controlHeight;return ewP(function(){var e=u.current;if(e){var t="fixed"===i,s=function(e){var t,r=e.maxHeight,n=e.menuEl,a=e.minHeight,i=e.placement,o=e.shouldScroll,s=e.isFixedPosition,l=e.controlHeight,u=function(e){var t=getComputedStyle(e),r="absolute"===t.position,n=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var a=e;a=a.parentElement;)if(t=getComputedStyle(a),(!r||"static"!==t.position)&&n.test(t.overflow+t.overflowY+t.overflowX))return a;return document.documentElement}(n),d={placement:"bottom",maxHeight:r};if(!n||!n.offsetParent)return d;var c=u.getBoundingClientRect().height,h=n.getBoundingClientRect(),p=h.bottom,m=h.height,f=h.top,g=n.offsetParent.getBoundingClientRect().top,y=s||ewN(t=u)?window.innerHeight:t.clientHeight,v=ewV(u),b=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),x=g-w,C=y-f,k=x+v,M=c-v-f,S=p-y+v+b,E=v+f-w;switch(i){case"auto":case"bottom":if(C>=m)return{placement:"bottom",maxHeight:r};if(M>=m&&!s)return o&&ewB(u,S,160),{placement:"bottom",maxHeight:r};if(!s&&M>=a||s&&C>=a)return o&&ewB(u,S,160),{placement:"bottom",maxHeight:s?C-b:M-b};if("auto"===i||s){var T=r,I=s?x:k;return I>=a&&(T=Math.min(I-b-l,r)),{placement:"top",maxHeight:T}}if("bottom"===i)return o&&ewF(u,S),{placement:"bottom",maxHeight:r};break;case"top":if(x>=m)return{placement:"top",maxHeight:r};if(k>=m&&!s)return o&&ewB(u,E,160),{placement:"top",maxHeight:r};if(!s&&k>=a||s&&x>=a){var P=r;return(!s&&k>=a||s&&x>=a)&&(P=s?x-w:k-w),o&&ewB(u,E,160),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:r};default:throw Error('Invalid placement provided "'.concat(i,'".'))}return d}({maxHeight:n,menuEl:e,minHeight:r,placement:a,shouldScroll:o&&!t,isFixedPosition:t,controlHeight:g});h(s.maxHeight),f(s.placement),null==l||l(s.placement)}},[n,a,i,o,r,l,g]),t({ref:u,placerProps:eby(eby({},e),{},{placement:m||ewY(a),maxHeight:c})})},ewJ=function(e,t){var r=e.theme,n=r.spacing.baseUnit,a=r.colors;return eby({textAlign:"center"},t?{}:{color:a.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px")})},ewQ=["size"],ew0=["innerProps","isRtl","size"],ew1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ew2=function(e){var t=e.size,r=ebx(e,ewQ);return ewT("svg",ebk({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ew1},r))},ew5=function(e){return ewT(ew2,ebk({size:20},e),ewT("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},ew3=function(e){return ewT(ew2,ebk({size:20},e),ewT("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ew4=function(e,t){var r=e.isFocused,n=e.theme,a=n.spacing.baseUnit,i=n.colors;return eby({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?i.neutral60:i.neutral20,padding:2*a,":hover":{color:r?i.neutral80:i.neutral40}})},ew8=function(){var e=ewI.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(j||(R=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],L||(L=R.slice(0)),j=Object.freeze(Object.defineProperties(R,{raw:{value:Object.freeze(L)}})))),ew6=function(e){var t=e.delay,r=e.offset;return ewT("span",{css:ewI({animation:"".concat(ew8," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},ew9=["data"],ew7=["innerRef","isDisabled","isHidden","inputClassName"],exe={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},ext={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":eby({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},exe)},exr=function(e){var t=e.children,r=e.innerProps;return ewT("div",r,t)},exn={ClearIndicator:function(e){var t=e.children,r=e.innerProps;return ewT("div",ebk({},ewL(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||ewT(ew5,null))},Control:function(e){var t=e.children,r=e.isDisabled,n=e.isFocused,a=e.innerRef,i=e.innerProps,o=e.menuIsOpen;return ewT("div",ebk({ref:a},ewL(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":n,"control--menu-is-open":o}),i),t)},DropdownIndicator:function(e){var t=e.children,r=e.innerProps;return ewT("div",ebk({},ewL(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||ewT(ew3,null))},DownChevron:ew3,CrossIcon:ew5,Group:function(e){var t=e.children,r=e.cx,n=e.getStyles,a=e.getClassNames,i=e.Heading,o=e.headingProps,s=e.innerProps,l=e.label,u=e.theme,d=e.selectProps;return ewT("div",ebk({},ewL(e,"group",{group:!0}),s),ewT(i,ebk({},o,{selectProps:d,theme:u,getStyles:n,getClassNames:a,cx:r}),l),ewT("div",null,t))},GroupHeading:function(e){var t=ewR(e);t.data;var r=ebx(t,ew9);return ewT("div",ebk({},ewL(e,"groupHeading",{"group-heading":!0}),r))},IndicatorsContainer:function(e){var t=e.children,r=e.innerProps;return ewT("div",ebk({},ewL(e,"indicatorsContainer",{indicators:!0}),r),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ewT("span",ebk({},t,ewL(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,r=e.value,n=ewR(e),a=n.innerRef,i=n.isDisabled,o=n.isHidden,s=n.inputClassName,l=ebx(n,ew7);return ewT("div",ebk({},ewL(e,"input",{"input-container":!0}),{"data-value":r||""}),ewT("input",ebk({className:t({input:!0},s),ref:a,style:eby({label:"input",color:"inherit",background:0,opacity:+!o,width:"100%"},exe),disabled:i},l)))},LoadingIndicator:function(e){var t=e.innerProps,r=e.isRtl,n=e.size,a=ebx(e,ew0);return ewT("div",ebk({},ewL(eby(eby({},a),{},{innerProps:t,isRtl:r,size:void 0===n?4:n}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ewT(ew6,{delay:0,offset:r}),ewT(ew6,{delay:160,offset:!0}),ewT(ew6,{delay:320,offset:!r}))},Menu:function(e){var t=e.children,r=e.innerRef,n=e.innerProps;return ewT("div",ebk({},ewL(e,"menu",{menu:!0}),{ref:r},n),t)},MenuList:function(e){var t=e.children,r=e.innerProps,n=e.innerRef,a=e.isMulti;return ewT("div",ebk({},ewL(e,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:n},r),t)},MenuPortal:function(e){var t=e.appendTo,r=e.children,n=e.controlElement,a=e.innerProps,i=e.menuPlacement,o=e.menuPosition,s=(0,ed.useRef)(null),l=(0,ed.useRef)(null),u=ebw((0,ed.useState)(ewY(i)),2),d=u[0],c=u[1],h=(0,ed.useMemo)(function(){return{setPortalPlacement:c}},[]),p=ebw((0,ed.useState)(null),2),m=p[0],f=p[1],g=(0,ed.useCallback)(function(){if(n){var e,t={bottom:(e=n.getBoundingClientRect()).bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width},r="fixed"===o?0:window.pageYOffset,a=t[d]+r;(a!==(null==m?void 0:m.offset)||t.left!==(null==m?void 0:m.rect.left)||t.width!==(null==m?void 0:m.rect.width))&&f({offset:a,rect:t})}},[n,o,d,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);ewP(function(){g()},[g]);var y=(0,ed.useCallback)(function(){"function"==typeof l.current&&(l.current(),l.current=null),n&&s.current&&(l.current=ok(n,s.current,g,{elementResize:"ResizeObserver"in window}))},[n,g]);ewP(function(){y()},[y]);var v=(0,ed.useCallback)(function(e){s.current=e,y()},[y]);if(!t&&"fixed"!==o||!m)return null;var b=ewT("div",ebk({ref:v},ewL(eby(eby({},e),{},{offset:m.offset,position:o,rect:m.rect}),"menuPortal",{"menu-portal":!0}),a),r);return ewT(ewZ.Provider,{value:h},t?(0,rS.createPortal)(b,t):b)},LoadingMessage:function(e){var t=e.children,r=void 0===t?"Loading...":t,n=e.innerProps,a=ebx(e,ewK);return ewT("div",ebk({},ewL(eby(eby({},a),{},{children:r,innerProps:n}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),r)},NoOptionsMessage:function(e){var t=e.children,r=void 0===t?"No options":t,n=e.innerProps,a=ebx(e,ew$);return ewT("div",ebk({},ewL(eby(eby({},a),{},{children:r,innerProps:n}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),r)},MultiValue:function(e){var t=e.children,r=e.components,n=e.data,a=e.innerProps,i=e.isDisabled,o=e.removeProps,s=e.selectProps,l=r.Container,u=r.Label,d=r.Remove;return ewT(l,{data:n,innerProps:eby(eby({},ewL(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),a),selectProps:s},ewT(u,{data:n,innerProps:eby({},ewL(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),ewT(d,{data:n,innerProps:eby(eby({},ewL(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},o),selectProps:s}))},MultiValueContainer:exr,MultiValueLabel:exr,MultiValueRemove:function(e){var t=e.children,r=e.innerProps;return ewT("div",ebk({role:"button"},r),t||ewT(ew5,{size:14}))},Option:function(e){var t=e.children,r=e.isDisabled,n=e.isFocused,a=e.isSelected,i=e.innerRef,o=e.innerProps;return ewT("div",ebk({},ewL(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":n,"option--is-selected":a}),{ref:i,"aria-disabled":r},o),t)},Placeholder:function(e){var t=e.children,r=e.innerProps;return ewT("div",ebk({},ewL(e,"placeholder",{placeholder:!0}),r),t)},SelectContainer:function(e){var t=e.children,r=e.innerProps,n=e.isDisabled,a=e.isRtl;return ewT("div",ebk({},ewL(e,"container",{"--is-disabled":n,"--is-rtl":a}),r),t)},SingleValue:function(e){var t=e.children,r=e.isDisabled,n=e.innerProps;return ewT("div",ebk({},ewL(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),n),t)},ValueContainer:function(e){var t=e.children,r=e.innerProps,n=e.isMulti,a=e.hasValue;return ewT("div",ebk({},ewL(e,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":a}),r),t)}},exa=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function exi(e,t){if(e.length!==t.length)return!1;for(var r,n,a=0;a<e.length;a++)if(!((r=e[a])===(n=t[a])||exa(r)&&exa(n))&&1)return!1;return!0}for(var exo={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},exs=function(e){return ewT("span",ebk({css:exo},e))},exl={guidance:function(e){var t=e.isSearchable,r=e.isMulti,n=e.isDisabled,a=e.tabSelectsValue;switch(e.context){case"menu":return"Use Up and Down to choose options".concat(n?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,n=void 0===r?"":r,a=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return i?"option ".concat(n," is disabled. Select another option."):"option ".concat(n,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,n=e.options,a=e.label,i=void 0===a?"":a,o=e.selectValue,s=e.isDisabled,l=e.isSelected,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&o)return"value ".concat(i," focused, ").concat(u(o,r),".");if("menu"===t){var d="".concat(l?"selected":"focused").concat(s?" disabled":"");return"option ".concat(i," ").concat(d,", ").concat(u(n,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},exu=function(e){var t=e.ariaSelection,r=e.focusedOption,n=e.focusedValue,a=e.focusableOptions,i=e.isFocused,o=e.selectValue,s=e.selectProps,l=e.id,u=s.ariaLiveMessages,d=s.getOptionLabel,c=s.inputValue,h=s.isMulti,p=s.isOptionDisabled,m=s.isSearchable,f=s.menuIsOpen,g=s.options,y=s.screenReaderStatus,v=s.tabSelectsValue,b=s["aria-label"],w=s["aria-live"],x=(0,ed.useMemo)(function(){return eby(eby({},exl),u||{})},[u]),C=(0,ed.useMemo)(function(){var e="";if(t&&x.onChange){var r=t.option,n=t.options,a=t.removedValue,i=t.removedValues,s=t.value,l=a||r||(Array.isArray(s)?null:s),u=l?d(l):"",c=n||i||void 0,h=c?c.map(d):[],m=eby({isDisabled:l&&p(l,o),label:u,labels:h},t);e=x.onChange(m)}return e},[t,x,p,o,d]),k=(0,ed.useMemo)(function(){var e="",t=r||n,i=!!(r&&o&&o.includes(r));if(t&&x.onFocus){var s={focused:t,label:d(t),isDisabled:p(t,o),isSelected:i,options:a,context:t===r?"menu":"value",selectValue:o};e=x.onFocus(s)}return e},[r,n,d,p,x,a,o]),M=(0,ed.useMemo)(function(){var e="";if(f&&g.length&&x.onFilter){var t=y({count:a.length});e=x.onFilter({inputValue:c,resultsMessage:t})}return e},[a,c,f,x,g,y]),S=(0,ed.useMemo)(function(){var e="";if(x.guidance){var t=n?"value":f?"menu":"input";e=x.guidance({"aria-label":b,context:t,isDisabled:r&&p(r,o),isMulti:h,isSearchable:m,tabSelectsValue:v})}return e},[b,r,n,h,p,m,f,x,o,v]),E="".concat(k," ").concat(M," ").concat(S),T=ewT(ed.Fragment,null,ewT("span",{id:"aria-selection"},C),ewT("span",{id:"aria-context"},E)),I=(null==t?void 0:t.action)==="initial-input-focus";return ewT(ed.Fragment,null,ewT(exs,{id:l},I&&T),ewT(exs,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text"},i&&!I&&T))},exd=[{base:"A",letters:"AⒶA\xc0\xc1\xc2ẦẤẪẨ\xc3ĀĂẰẮẴẲȦǠ\xc4ǞẢ\xc5ǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"\xc6ǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČ\xc7ḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺE\xc8\xc9\xcaỀẾỄỂẼĒḔḖĔĖ\xcbẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾI\xcc\xcd\xceĨĪĬİ\xcfḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃ\xd1ṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄO\xd2\xd3\xd4ỒỐỖỔ\xd5ṌȬṎŌṐṒŎȮȰ\xd6ȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬ\xd8ǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊU\xd9\xda\xdbŨṸŪṺŬ\xdcǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲ\xddŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚ\xe0\xe1\xe2ầấẫẩ\xe3āăằắẵẳȧǡ\xe4ǟả\xe5ǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"\xe6ǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċč\xe7ḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔe\xe8\xe9\xeaềếễểẽēḕḗĕė\xebẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘi\xec\xed\xeeĩīĭ\xefḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹń\xf1ṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞo\xf2\xf3\xf4ồốỗổ\xf5ṍȭṏōṑṓŏȯȱ\xf6ȫỏőǒȍȏơờớỡởợọộǫǭ\xf8ǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢs\xdfśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤu\xf9\xfa\xfbũṹūṻŭ\xfcǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳ\xfdŷỹȳẏ\xffỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],exc=RegExp("["+exd.map(function(e){return e.letters}).join("")+"]","g"),exh={},exp=0;exp<exd.length;exp++)for(var exm=exd[exp],exf=0;exf<exm.letters.length;exf++)exh[exm.letters[exf]]=exm.base;var exg=function(e){return e.replace(exc,function(e){return exh[e]})},exy=function(e,t){void 0===t&&(t=exi);var r=null;function n(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r&&r.lastThis===this&&t(n,r.lastArgs))return r.lastResult;var i=e.apply(this,n);return r={lastResult:i,lastArgs:n,lastThis:this},i}return n.clear=function(){r=null},n}(exg),exv=function(e){return e.replace(/^\s+|\s+$/g,"")},exb=function(e){return"".concat(e.label," ").concat(e.value)},exw=["innerRef"];function exx(e){var t=e.innerRef,r=ewq(ebx(e,exw),"onExited","in","enter","exit","appear");return ewT("input",ebk({ref:t},r,{css:ewI({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var exC=function(e){e.preventDefault(),e.stopPropagation()},exk=["boxSizing","height","overflow","paddingRight","position"],exM={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function exS(e){e.preventDefault()}function exE(e){e.stopPropagation()}function exT(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;0===e?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function exI(){return"ontouchstart"in window||navigator.maxTouchPoints}var exP=!!("u">typeof window&&window.document&&window.document.createElement),ex_=0,exD={capture:!1,passive:!1},exO=function(){return document.activeElement&&document.activeElement.blur()},exA={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function exR(e){var t,r,n,a,i,o,s,l,u,d,c,h,p,m,f,g,y,v,b,w,x,C,k,M,S=e.children,E=e.lockEnabled,T=e.captureEnabled,I=(r=(t={isEnabled:void 0===T||T,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}).isEnabled,n=t.onBottomArrive,a=t.onBottomLeave,i=t.onTopArrive,o=t.onTopLeave,s=(0,ed.useRef)(!1),l=(0,ed.useRef)(!1),u=(0,ed.useRef)(0),d=(0,ed.useRef)(null),c=(0,ed.useCallback)(function(e,t){if(null!==d.current){var r=d.current,u=r.scrollTop,c=r.scrollHeight,h=r.clientHeight,p=d.current,m=t>0,f=c-h-u,g=!1;f>t&&s.current&&(a&&a(e),s.current=!1),m&&l.current&&(o&&o(e),l.current=!1),m&&t>f?(n&&!s.current&&n(e),p.scrollTop=c,g=!0,s.current=!0):!m&&-t>u&&(i&&!l.current&&i(e),p.scrollTop=0,g=!0,l.current=!0),g&&exC(e)}},[n,a,i,o]),h=(0,ed.useCallback)(function(e){c(e,e.deltaY)},[c]),p=(0,ed.useCallback)(function(e){u.current=e.changedTouches[0].clientY},[]),m=(0,ed.useCallback)(function(e){var t=u.current-e.changedTouches[0].clientY;c(e,t)},[c]),f=(0,ed.useCallback)(function(e){if(e){var t=!!ewH&&{passive:!1};e.addEventListener("wheel",h,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}},[m,p,h]),g=(0,ed.useCallback)(function(e){e&&(e.removeEventListener("wheel",h,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))},[m,p,h]),(0,ed.useEffect)(function(){if(r){var e=d.current;return f(e),function(){g(e)}}},[r,f,g]),function(e){d.current=e}),P=(v=(y={isEnabled:E}).isEnabled,w=void 0===(b=y.accountForScrollbars)||b,x=(0,ed.useRef)({}),C=(0,ed.useRef)(null),k=(0,ed.useCallback)(function(e){if(exP){var t=document.body,r=t&&t.style;if(w&&exk.forEach(function(e){var t=r&&r[e];x.current[e]=t}),w&&ex_<1){var n=parseInt(x.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,i=window.innerWidth-a+n||0;Object.keys(exM).forEach(function(e){var t=exM[e];r&&(r[e]=t)}),r&&(r.paddingRight="".concat(i,"px"))}t&&exI()&&(t.addEventListener("touchmove",exS,exD),e&&(e.addEventListener("touchstart",exT,exD),e.addEventListener("touchmove",exE,exD))),ex_+=1}},[w]),M=(0,ed.useCallback)(function(e){if(exP){var t=document.body,r=t&&t.style;ex_=Math.max(ex_-1,0),w&&ex_<1&&exk.forEach(function(e){var t=x.current[e];r&&(r[e]=t)}),t&&exI()&&(t.removeEventListener("touchmove",exS,exD),e&&(e.removeEventListener("touchstart",exT,exD),e.removeEventListener("touchmove",exE,exD)))}},[w]),(0,ed.useEffect)(function(){if(v){var e=C.current;return k(e),function(){M(e)}}},[v,k,M]),function(e){C.current=e});return ewT(ed.Fragment,null,E&&ewT("div",{onClick:exO,css:exA}),S(function(e){I(e),P(e)}))}var exL={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},exN=function(e){var t=e.name,r=e.onFocus;return ewT("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:exL,value:"",onChange:function(){}})},exV={clearIndicator:ew4,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var r=e.isDisabled,n=e.isFocused,a=e.theme,i=a.colors,o=a.borderRadius;return eby({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:n?i.primary:i.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:n?i.primary:i.neutral30}})},dropdownIndicator:ew4,group:function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:2*r.baseUnit,paddingTop:2*r.baseUnit}},groupHeading:function(e,t){var r=e.theme,n=r.colors,a=r.spacing;return eby({label:"group",cursor:"default",display:"block"},t?{}:{color:n.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*a.baseUnit,paddingRight:3*a.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var r=e.isDisabled,n=e.theme,a=n.spacing.baseUnit,i=n.colors;return eby({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?i.neutral10:i.neutral20,marginBottom:2*a,marginTop:2*a})},input:function(e,t){var r=e.isDisabled,n=e.value,a=e.theme,i=a.spacing,o=a.colors;return eby(eby({visibility:r?"hidden":"visible",transform:n?"translateZ(0)":""},ext),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:o.neutral80})},loadingIndicator:function(e,t){var r=e.isFocused,n=e.size,a=e.theme,i=a.colors,o=a.spacing.baseUnit;return eby({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?i.neutral60:i.neutral20,padding:2*o})},loadingMessage:ewJ,menu:function(e,t){var r,n=e.placement,a=e.theme,i=a.borderRadius,o=a.spacing,s=a.colors;return eby((ebf(r={label:"menu"},n?({bottom:"top",top:"bottom"})[n]:"bottom","100%"),ebf(r,"position","absolute"),ebf(r,"width","100%"),ebf(r,"zIndex",1),r),t?{}:{backgroundColor:s.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:o.menuGutter,marginTop:o.menuGutter})},menuList:function(e,t){var r=e.maxHeight,n=e.theme.spacing.baseUnit;return eby({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:n,paddingTop:n})},menuPortal:function(e){var t=e.rect,r=e.offset,n=e.position;return{left:t.left,position:n,top:r,width:t.width,zIndex:1}},multiValue:function(e,t){var r=e.theme,n=r.spacing,a=r.borderRadius,i=r.colors;return eby({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:a/2,margin:n.baseUnit/2})},multiValueLabel:function(e,t){var r=e.theme,n=r.borderRadius,a=r.colors,i=e.cropWithEllipsis;return eby({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:n/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var r=e.theme,n=r.spacing,a=r.borderRadius,i=r.colors,o=e.isFocused;return eby({alignItems:"center",display:"flex"},t?{}:{borderRadius:a/2,backgroundColor:o?i.dangerLight:void 0,paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:ewJ,option:function(e,t){var r=e.isDisabled,n=e.isFocused,a=e.isSelected,i=e.theme,o=i.spacing,s=i.colors;return eby({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:a?s.primary:n?s.primary25:"transparent",color:r?s.neutral20:a?s.neutral0:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),":active":{backgroundColor:r?void 0:a?s.primary:s.primary50}})},placeholder:function(e,t){var r=e.theme,n=r.spacing,a=r.colors;return eby({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:a.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},singleValue:function(e,t){var r=e.isDisabled,n=e.theme,a=n.spacing,i=n.colors;return eby({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?i.neutral40:i.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},valueContainer:function(e,t){var r=e.theme.spacing,n=e.isMulti,a=e.hasValue,i=e.selectProps.controlShouldRenderValue;return eby({alignItems:"center",display:n&&a&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(2*r.baseUnit,"px")})}},exF={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},exB={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ewW(),captureMenuScroll:!ewW(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var r=eby({ignoreCase:!0,ignoreAccents:!0,stringify:exb,trim:!0,matchFrom:"any"},void 0),n=r.ignoreCase,a=r.ignoreAccents,i=r.stringify,o=r.trim,s=r.matchFrom,l=o?exv(t):t,u=o?exv(i(e)):i(e);return n&&(l=l.toLowerCase(),u=u.toLowerCase()),a&&(l=exy(l),u=exg(u)),"start"===s?u.substr(0,l.length)===l:u.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function exj(e,t,r,n){var a=exq(e,t,r),i=ex$(e,t,r),o=exH(e,t),s=exG(e,t);return{type:"option",data:t,isDisabled:a,isSelected:i,label:o,value:s,index:n}}function exW(e,t){return e.options.map(function(r,n){if("options"in r){var a=r.options.map(function(r,n){return exj(e,r,t,n)}).filter(function(t){return exz(e,t)});return a.length>0?{type:"group",data:r,options:a,index:n}:void 0}var i=exj(e,r,t,n);return exz(e,i)?i:void 0}).filter(ewG)}function exU(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,ebI(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function exz(e,t){var r=e.inputValue,n=t.data,a=t.isSelected,i=t.label,o=t.value;return(!exY(e)||!a)&&exK(e,{label:i,value:o,data:n},void 0===r?"":r)}var exH=function(e,t){return e.getOptionLabel(t)},exG=function(e,t){return e.getOptionValue(t)};function exq(e,t,r){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,r)}function ex$(e,t,r){if(r.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,r);var n=exG(e,t);return r.some(function(t){return exG(e,t)===n})}function exK(e,t,r){return!e.filterOption||e.filterOption(t,r)}var exY=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},exZ=1,exX=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&&ebS(i,e);var t,r,n,a=(t=ebT(),function(){var e,r=ebE(i);e=t?Reflect.construct(r,arguments,ebE(this).constructor):r.apply(this,arguments);if(e&&("object"==ebp(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===this)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return this});function i(e){var t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");if((t=a.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,r){var n=t.props,a=n.onChange;r.name=n.name,t.ariaOnChange(e,r),a(e,r)},t.setValue=function(e,r,n){var a=t.props,i=a.closeMenuOnSelect,o=a.isMulti,s=a.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(t.setState({inputIsHiddenAfterUpdate:!o}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:r,option:n})},t.selectOption=function(e){var r=t.props,n=r.blurInputOnSelect,a=r.isMulti,i=r.name,o=t.state.selectValue,s=a&&t.isOptionSelected(e,o),l=t.isOptionDisabled(e,o);if(s){var u=t.getOptionValue(e);t.setValue(o.filter(function(e){return t.getOptionValue(e)!==u}),"deselect-option",e)}else{if(l)return void t.ariaOnChange(e,{action:"select-option",option:e,name:i});a?t.setValue([].concat(ebI(o),[e]),"select-option",e):t.setValue(e,"select-option")}n&&t.blurInput()},t.removeValue=function(e){var r,n=t.props.isMulti,a=t.state.selectValue,i=t.getOptionValue(e),o=a.filter(function(e){return t.getOptionValue(e)!==i}),s=(r=o[0]||null,n?o:r);t.onChange(s,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e,r,n=t.state.selectValue;t.onChange((e=t.props.isMulti,r=[],e?r:null),{action:"clear",removedValues:n})},t.popValue=function(){var e,r=t.props.isMulti,n=t.state.selectValue,a=n[n.length-1],i=n.slice(0,n.length-1),o=(e=i[0]||null,r?i:e);t.onChange(o,{action:"pop-value",removedValue:a})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return ewO.apply(void 0,[t.props.classNamePrefix].concat(r))},t.getOptionLabel=function(e){return exH(t.props,e)},t.getOptionValue=function(e){return exG(t.props,e)},t.getStyles=function(e,r){var n=t.props.unstyled,a=exV[e](r,n);a.boxSizing="border-box";var i=t.props.styles[e];return i?i(a,r):a},t.getClassNames=function(e,r){var n,a;return null==(n=(a=t.props.classNames)[e])?void 0:n.call(a,r)},t.getElementId=function(e){return"".concat(t.instancePrefix,"-").concat(e)},t.getComponents=function(){var e;return e=t.props,eby(eby({},exn),e.components)},t.buildCategorizedOptions=function(){return exW(t.props,t.state.selectValue)},t.getCategorizedOptions=function(){return t.props.menuIsOpen?t.buildCategorizedOptions():[]},t.buildFocusableOptions=function(){return exU(t.buildCategorizedOptions())},t.getFocusableOptions=function(){return t.props.menuIsOpen?t.buildFocusableOptions():[]},t.ariaOnChange=function(e,r){t.setState({ariaSelection:eby({value:e},r)})},t.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),t.focusInput())},t.onMenuMouseMove=function(e){t.blockOptionHover=!1},t.onControlMouseDown=function(e){if(!e.defaultPrevented){var r=t.props.openMenuOnClick;t.state.isFocused?t.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&t.onMenuClose():r&&t.openMenu("first"):(r&&(t.openAfterFocus=!0),t.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},t.onDropdownIndicatorMouseDown=function(e){if((!e||"mousedown"!==e.type||0===e.button)&&!t.props.isDisabled){var r=t.props,n=r.isMulti,a=r.menuIsOpen;t.focusInput(),a?(t.setState({inputIsHiddenAfterUpdate:!n}),t.onMenuClose()):t.openMenu("first"),e.preventDefault()}},t.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(t.clearValue(),e.preventDefault(),t.openAfterFocus=!1,"touchend"===e.type?t.focusInput():setTimeout(function(){return t.focusInput()}))},t.onScroll=function(e){"boolean"==typeof t.props.closeMenuOnScroll?e.target instanceof HTMLElement&&ewN(e.target)&&t.props.onMenuClose():"function"==typeof t.props.closeMenuOnScroll&&t.props.closeMenuOnScroll(e)&&t.props.onMenuClose()},t.onCompositionStart=function(){t.isComposing=!0},t.onCompositionEnd=function(){t.isComposing=!1},t.onTouchStart=function(e){var r=e.touches,n=r&&r.item(0);n&&(t.initialTouchX=n.clientX,t.initialTouchY=n.clientY,t.userIsDragging=!1)},t.onTouchMove=function(e){var r=e.touches,n=r&&r.item(0);if(n){var a=Math.abs(n.clientX-t.initialTouchX),i=Math.abs(n.clientY-t.initialTouchY);t.userIsDragging=a>5||i>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var r=t.props.inputValue,n=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(n,{action:"input-change",prevInputValue:r}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var r=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:r}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return exY(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var r=t.props,n=r.isMulti,a=r.backspaceRemovesValue,i=r.escapeClearsValue,o=r.inputValue,s=r.isClearable,l=r.isDisabled,u=r.menuIsOpen,d=r.onKeyDown,c=r.tabSelectsValue,h=r.openMenuOnFocus,p=t.state,m=p.focusedOption,f=p.focusedValue,g=p.selectValue;if(!l){if("function"==typeof d&&(d(e),e.defaultPrevented))return;switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||o)return;t.focusValue("previous");break;case"ArrowRight":if(!n||o)return;t.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(f)t.removeValue(f);else{if(!a)return;n?t.popValue():s&&t.clearValue()}break;case"Tab":if(t.isComposing||e.shiftKey||!u||!c||!m||h&&t.isOptionSelected(m,g))return;t.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m||t.isComposing)return;t.selectOption(m);break}return;case"Escape":u?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:o}),t.onMenuClose()):s&&i&&t.clearValue();break;case" ":if(o)return;if(!u){t.openMenu("first");break}if(!m)return;t.selectOption(m);break;case"ArrowUp":u?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":u?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!u)return;t.focusOption("pageup");break;case"PageDown":if(!u)return;t.focusOption("pagedown");break;case"Home":if(!u)return;t.focusOption("first");break;case"End":if(!u)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++exZ),t.state.selectValue=ewA(e.value),e.menuIsOpen&&t.state.selectValue.length){var r=t.buildFocusableOptions(),n=r.indexOf(t.state.selectValue[0]);t.state.focusedOption=r[n]}return t}return r=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ewj(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isDisabled,n=t.menuIsOpen,a=this.state.isFocused;(a&&!r&&e.isDisabled||a&&n&&!e.menuIsOpen)&&this.focusInput(),a&&r&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):a||r||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ewj(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,r=this.state,n=r.selectValue,a=r.isFocused,i=this.buildFocusableOptions(),o="first"===e?0:i.length-1;if(!this.props.isMulti){var s=i.indexOf(n[0]);s>-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[o]},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,r=t.selectValue,n=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=r.indexOf(n);n||(a=-1);var i=r.length-1,o=-1;if(r.length){switch(e){case"previous":o=0===a?0:-1===a?i:a-1;break;case"next":a>-1&&a<i&&(o=a+1)}this.setState({inputIsHidden:-1!==o,focusedValue:r[o]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,r=this.state.focusedOption,n=this.getFocusableOptions();if(n.length){var a=0,i=n.indexOf(r);r||(i=-1),"up"===e?a=i>0?i-1:n.length-1:"down"===e?a=(i+1)%n.length:"pageup"===e?(a=i-t)<0&&(a=0):"pagedown"===e?(a=i+t)>n.length-1&&(a=n.length-1):"last"===e&&(a=n.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:n[a],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(exF):eby(eby({},exF),this.props.theme):exF}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,r=this.getStyles,n=this.getClassNames,a=this.getValue,i=this.selectOption,o=this.setValue,s=this.props,l=s.isMulti,u=s.isRtl,d=s.options;return{clearValue:e,cx:t,getStyles:r,getClassNames:n,getValue:a,hasValue:this.hasValue(),isMulti:l,isRtl:u,options:d,selectOption:i,selectProps:s,setValue:o,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,r=e.isMulti;return void 0===t?r:t}},{key:"isOptionDisabled",value:function(e,t){return exq(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ex$(this.props,e,t)}},{key:"filterOption",value:function(e,t){return exK(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"!=typeof this.props.formatOptionLabel)return this.getOptionLabel(e);var r=this.props.inputValue,n=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:r,selectValue:n})}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,r=e.isSearchable,n=e.inputId,a=e.inputValue,i=e.tabIndex,o=e.form,s=e.menuIsOpen,l=e.required,u=this.getComponents().Input,d=this.state,c=d.inputIsHidden,h=d.ariaSelection,p=this.commonProps,m=n||this.getElementId("input"),f=eby(eby(eby({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":l,role:"combobox"},s&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!r&&{"aria-readonly":!0}),this.hasValue()?(null==h?void 0:h.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return r?ed.createElement(u,ebk({},p,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:c,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:o,type:"text",value:a},f)):ed.createElement(exx,ebk({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ewD,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:o,value:""},f))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),r=t.MultiValue,n=t.MultiValueContainer,a=t.MultiValueLabel,i=t.MultiValueRemove,o=t.SingleValue,s=t.Placeholder,l=this.commonProps,u=this.props,d=u.controlShouldRenderValue,c=u.isDisabled,h=u.isMulti,p=u.inputValue,m=u.placeholder,f=this.state,g=f.selectValue,y=f.focusedValue,v=f.isFocused;if(!this.hasValue()||!d)return p?null:ed.createElement(s,ebk({},l,{key:"placeholder",isDisabled:c,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),m);if(h)return g.map(function(t,o){var s=t===y,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return ed.createElement(r,ebk({},l,{components:{Container:n,Label:a,Remove:i},isFocused:s,isDisabled:c,key:u,index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(p)return null;var b=g[0];return ed.createElement(o,ebk({},l,{data:b,isDisabled:c}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||n||!this.hasValue()||a)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return ed.createElement(e,ebk({},t,{innerProps:o,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,i=this.state.isFocused;return e&&a?ed.createElement(e,ebk({},t,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,r=e.IndicatorSeparator;if(!t||!r)return null;var n=this.commonProps,a=this.props.isDisabled,i=this.state.isFocused;return ed.createElement(r,ebk({},n,{isDisabled:a,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,r=this.props.isDisabled,n=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return ed.createElement(e,ebk({},t,{innerProps:a,isDisabled:r,isFocused:n}))}},{key:"renderMenu",value:function(){var e,t=this,r=this.getComponents(),n=r.Group,a=r.GroupHeading,i=r.Menu,o=r.MenuList,s=r.MenuPortal,l=r.LoadingMessage,u=r.NoOptionsMessage,d=r.Option,c=this.commonProps,h=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,f=p.inputValue,g=p.isLoading,y=p.loadingMessage,v=p.minMenuHeight,b=p.maxMenuHeight,w=p.menuIsOpen,x=p.menuPlacement,C=p.menuPosition,k=p.menuPortalTarget,M=p.menuShouldBlockScroll,S=p.menuShouldScrollIntoView,E=p.noOptionsMessage,T=p.onMenuScrollToTop,I=p.onMenuScrollToBottom;if(!w)return null;var P=function(e,r){var n=e.type,a=e.data,i=e.isDisabled,o=e.isSelected,s=e.label,l=e.value,u=h===a,p=i?void 0:function(){return t.onOptionHover(a)},m=i?void 0:function(){return t.selectOption(a)},f="".concat(t.getElementId("option"),"-").concat(r);return ed.createElement(d,ebk({},c,{innerProps:{id:f,onClick:m,onMouseMove:p,onMouseOver:p,tabIndex:-1},data:a,isDisabled:i,isSelected:o,key:f,label:s,type:n,value:l,isFocused:u,innerRef:u?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())e=this.getCategorizedOptions().map(function(e){if("group"===e.type){var r=e.data,i=e.options,o=e.index,s="".concat(t.getElementId("group"),"-").concat(o),l="".concat(s,"-heading");return ed.createElement(n,ebk({},c,{key:s,data:r,options:i,Heading:a,headingProps:{id:l,data:e.data},label:t.formatGroupLabel(e.data)}),e.options.map(function(e){return P(e,"".concat(o,"-").concat(e.index))}))}if("option"===e.type)return P(e,"".concat(e.index))});else if(g){var _=y({inputValue:f});if(null===_)return null;e=ed.createElement(l,c,_)}else{var D=E({inputValue:f});if(null===D)return null;e=ed.createElement(u,c,D)}var O={minMenuHeight:v,maxMenuHeight:b,menuPlacement:x,menuPosition:C,menuShouldScrollIntoView:S},A=ed.createElement(ewX,ebk({},c,O),function(r){var n=r.ref,a=r.placerProps,s=a.placement,l=a.maxHeight;return ed.createElement(i,ebk({},c,O,{innerRef:n,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:g,placement:s}),ed.createElement(exR,{captureEnabled:m,onTopArrive:T,onBottomArrive:I,lockEnabled:M},function(r){return ed.createElement(o,ebk({},c,{innerRef:function(e){t.getMenuListRef(e),r(e)},isLoading:g,maxHeight:l,focusedOption:h}),e)}))});return k||"fixed"===C?ed.createElement(s,ebk({},c,{appendTo:k,controlElement:this.controlRef,menuPlacement:x,menuPosition:C}),A):A}},{key:"renderFormField",value:function(){var e=this,t=this.props,r=t.delimiter,n=t.isDisabled,a=t.isMulti,i=t.name,o=t.required,s=this.state.selectValue;if(o&&!this.hasValue()&&!n)return ed.createElement(exN,{name:i,onFocus:this.onValueInputFocus});if(i&&!n)if(a)if(r){var l=s.map(function(t){return e.getOptionValue(t)}).join(r);return ed.createElement("input",{name:i,type:"hidden",value:l})}else{var u=s.length>0?s.map(function(t,r){return ed.createElement("input",{key:"i-".concat(r),name:i,type:"hidden",value:e.getOptionValue(t)})}):ed.createElement("input",{name:i,type:"hidden",value:""});return ed.createElement("div",null,u)}else{var d=s[0]?this.getOptionValue(s[0]):"";return ed.createElement("input",{name:i,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,r=t.ariaSelection,n=t.focusedOption,a=t.focusedValue,i=t.isFocused,o=t.selectValue,s=this.getFocusableOptions();return ed.createElement(exu,ebk({},e,{id:this.getElementId("live-region"),ariaSelection:r,focusedOption:n,focusedValue:a,isFocused:i,selectValue:o,focusableOptions:s}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,r=e.IndicatorsContainer,n=e.SelectContainer,a=e.ValueContainer,i=this.props,o=i.className,s=i.id,l=i.isDisabled,u=i.menuIsOpen,d=this.state.isFocused,c=this.commonProps=this.getCommonProps();return ed.createElement(n,ebk({},c,{className:o,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:d}),this.renderLiveRegion(),ed.createElement(t,ebk({},c,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:d,menuIsOpen:u}),ed.createElement(a,ebk({},c,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),ed.createElement(r,ebk({},c,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){var r,n=t.prevProps,a=t.clearFocusValueOnUpdate,i=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,s=t.isFocused,l=t.prevWasFocused,u=e.options,d=e.value,c=e.menuIsOpen,h=e.inputValue,p=e.isMulti,m=ewA(d),f={};if(n&&(d!==n.value||u!==n.options||c!==n.menuIsOpen||h!==n.inputValue)){var g,y=c?exU(exW(e,m)):[],v=a?function(e,t){var r=e.focusedValue,n=e.selectValue.indexOf(r);if(n>-1){if(t.indexOf(r)>-1)return r;if(n<t.length)return t[n]}return null}(t,m):null;f={selectValue:m,focusedOption:(g=t.focusedOption)&&y.indexOf(g)>-1?g:y[0],focusedValue:v,clearFocusValueOnUpdate:!1}}var b=null!=i&&e!==n?{inputIsHidden:i,inputIsHiddenAfterUpdate:void 0}:{},w=o,x=s&&l;return s&&!x&&(w={value:(r=m[0]||null,p?m:r),options:m,action:"initial-input-focus"},x=!l),(null==o?void 0:o.action)==="initial-input-focus"&&(w=null),eby(eby(eby({},f),b),{},{prevProps:e,ariaSelection:w,prevWasFocused:x})}}],r&&ebM(i.prototype,r),n&&ebM(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(ed.Component);exX.defaultProps=exB;var exJ=(0,ed.forwardRef)(function(e,t){var r,n,a,i,o,s,l,u,d,c,h,p,m,f,g,y,v,b,w,x,C,k,M,S,E,T,I,P=(r=e.defaultInputValue,n=e.defaultMenuIsOpen,a=e.defaultValue,i=e.inputValue,o=e.menuIsOpen,s=e.onChange,l=e.onInputChange,u=e.onMenuClose,d=e.onMenuOpen,c=e.value,h=ebx(e,ebC),m=(p=ebw((0,ed.useState)(void 0!==i?i:void 0===r?"":r),2))[0],f=p[1],y=(g=ebw((0,ed.useState)(void 0!==o?o:void 0!==n&&n),2))[0],v=g[1],w=(b=ebw((0,ed.useState)(void 0!==c?c:void 0===a?null:a),2))[0],x=b[1],C=(0,ed.useCallback)(function(e,t){"function"==typeof s&&s(e,t),x(e)},[s]),k=(0,ed.useCallback)(function(e,t){var r;"function"==typeof l&&(r=l(e,t)),f(void 0!==r?r:e)},[l]),M=(0,ed.useCallback)(function(){"function"==typeof d&&d(),v(!0)},[d]),S=(0,ed.useCallback)(function(){"function"==typeof u&&u(),v(!1)},[u]),E=void 0!==i?i:m,T=void 0!==o?o:y,I=void 0!==c?c:w,eby(eby({},h),{},{inputValue:E,menuIsOpen:T,onChange:C,onInputChange:k,onMenuClose:S,onMenuOpen:M,value:I}));return ed.createElement(exX,ebk({ref:t},P))});let exQ=e=>{let t=e.selectProps.value,r=t[t.length-1],n=e.data.label;return r.label!==n&&(n+=", "),eh().createElement("span",null,n)},ex0=e=>eh().createElement(exn.Option,e,eh().createElement("div",{className:"flex items-center"},eh().createElement("div",{className:"h-2 w-2"},e.isSelected?eh().createElement(hO.ByName,{name:"checkbox-active"}):eh().createElement(hO.ByName,{name:"checkbox-default"})),eh().createElement("label",{id:e.data.value,className:"ml-3 mt-1"},eh().createElement("span",null,e.value)))),ex1=({id:e,className:t="",closeMenuOnSelect:r=!0,hideSelectedOptions:n=!1,isClearable:a=!0,isDisabled:i=!1,isMulti:o=!1,isSearchable:s=!0,onChange:l,options:u,placeholder:d,noIcons:c=!1,menuPlacement:h="auto",components:p={},value:m=[]})=>{let[f,g]=(0,ed.useState)(""),y=s?function(e,t){if(!e?.length||!t?.trim())return e??[];let r=t.trim().toLowerCase(),n=e.filter(e=>(e.label??e.value??"").toString().toLowerCase().startsWith(r)),a=e.filter(e=>{let t=(e.label??e.value??"").toString().toLowerCase();return t.includes(r)&&!t.startsWith(r)}),i=e.filter(e=>!(e.label??e.value??"").toString().toLowerCase().includes(r));return n.sort((e,t)=>(e.label??e.value??"").toString().length-(t.label??t.value??"").toString().length),[...n,...a,...i]}(u,f):u,v=o?{Option:ex0,MultiValue:exQ}:{};v=c?{...v,DropdownIndicator:()=>null,IndicatorSeparator:()=>null}:{...v,...p};let b=[];return m&&Array.isArray(m)&&m.forEach(e=>{let t=u.find(t=>t.value===e);t&&b.push(JSON.parse(JSON.stringify(t)))}),eh().createElement(exJ,{inputId:`input-${e}`,className:em()(t,"ohif-select customSelect__wrapper flex flex-1 flex-col"),"data-cy":`input-${e}`,classNamePrefix:"customSelect",isDisabled:i,isClearable:a,isMulti:o,isSearchable:s,menuPlacement:h,closeMenuOnSelect:r,hideSelectedOptions:n,components:v,placeholder:d,options:y,blurInputOnSelect:!0,menuPortalTarget:document.body,onInputChange:s?g:void 0,onMenuClose:s?()=>g(""):void 0,styles:{menuPortal:e=>({...e,zIndex:9999})},value:m&&Array.isArray(m)?b:m,onChange:(e,{action:t})=>{if(null===e)return l(null,t);l(e.length?e.reduce((e,t)=>e.concat([t.value]),[]):e,t)}})};ex1.propTypes={className:ei().string,closeMenuOnSelect:ei().bool,hideSelectedOptions:ei().bool,isClearable:ei().bool,isDisabled:ei().bool,isMulti:ei().bool,isSearchable:ei().bool,noIcons:ei().bool,menuPlacement:ei().oneOf(["auto","bottom","top"]),onChange:ei().func.isRequired,options:ei().arrayOf(ei().shape({value:ei().string,label:ei().string})),placeholder:ei().string,value:ei().oneOfType([ei().arrayOf(ei().string),ei().any])};let ex2=ex1,ex5=({id:e,label:t,isSortable:r,sortDirection:n,onLabelClick:a,value:i=[],placeholder:o="",options:s=[],onChange:l})=>eh().createElement(ebt,{label:t,isSortable:r,sortDirection:n,onLabelClick:a},eh().createElement(ex2,{id:e,placeholder:o,className:"mt-2",options:s,value:i,isMulti:!0,isClearable:!1,isSearchable:!0,closeMenuOnSelect:!1,hideSelectedOptions:!1,onChange:(e,t)=>{switch(t){case"select-option":case"remove-value":case"deselect-option":case"clear":l(e)}}}));ex5.propTypes={id:ei().string,label:ei().string.isRequired,isSortable:ei().bool.isRequired,sortDirection:ei().oneOf(["ascending","descending","none"]).isRequired,onLabelClick:ei().func.isRequired,onChange:ei().func.isRequired,placeholder:ei().string,options:ei().arrayOf(ei().shape({value:ei().string,label:ei().string})),value:ei().arrayOf(ei().string)};let ex3=ex5,ex4=({inputMeta:e,values:t,onValuesChange:r,sorting:n,onSortingChange:a,isSortingEnabled:i})=>{let{sortBy:o,sortDirection:s}=n;return eh().createElement("div",{className:"container relative m-auto flex flex-col"},eh().createElement("div",{className:"flex w-full flex-row"},e.map(e=>eh().createElement("div",{key:e.name,className:em()("pl-4 first:pl-12",eba(e.gridCol))},(({name:e,displayName:n,inputProps:l,isSortable:u,inputType:d})=>{let c=u&&i,h=o!==e?"none":s,p=()=>{if(i){let t="descending";o===e&&("ascending"===s?t="descending":"descending"===s&&(t="ascending")),a({sortBy:"none"!==t?e:"",sortDirection:t})}},m=n=>{r({...t,[e]:n})};switch(d){case"Text":return eh().createElement(ebh,{id:e,key:e,label:n,isSortable:c,sortDirection:h,onLabelClick:p,value:t[e],onChange:m});case"MultiSelect":return eh().createElement(ex3,{id:e,key:e,label:n,isSortable:c,sortDirection:h,onLabelClick:p,value:t[e],onChange:m,options:l.options});case"DateRange":return eh().createElement(ebn,{id:e,key:e,label:n,isSortable:c,sortDirection:h,onLabelClick:p,value:t[e],onChange:({startDate:n,endDate:a})=>{r({...t,[e]:{startDate:n,endDate:a}})}});case"None":return eh().createElement(ebt,{key:e,label:n,isSortable:c,sortDirection:h,onLabelClick:p})}})(e)))))};ex4.propTypes={inputMeta:ei().arrayOf(ei().shape({name:ei().string.isRequired,displayName:ei().string.isRequired,inputType:ei().oneOf(["Text","MultiSelect","DateRange","None"]).isRequired,isSortable:ei().bool.isRequired,gridCol:ei().oneOf([1,2,3,4,5,6,7,8,9,10,11,12]).isRequired,option:ei().arrayOf(ei().shape({value:ei().string,label:ei().string}))})).isRequired,values:ei().object.isRequired,onValuesChange:ei().func.isRequired,sorting:ei().shape({sortBy:ei().string,sortDirection:ei().oneOf(["ascending","descending","none"])}).isRequired,onSortingChange:ei().func.isRequired,isSortingEnabled:ei().bool.isRequired};let ex8=ex4;function ex6(){return(ex6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let ex9="default",ex7=!1,eCe=!1,eCt="medium",eCr="none",eCn="medium",eCa="button",eCi="contained",eCo={none:"",small:"rounded",medium:"rounded-md",large:"rounded-lg",full:"rounded-full"},eCs={text:{default:"text-primary-light hover:bg-primary-light hover:text-white active:opacity-80 focus:bg-primary-light focus:text-white",primary:"text-primary-main hover:bg-primary-main hover:text-white active:opacity-80 focus:bg-primary-main focus:text-white",secondary:"text-secondary-light hover:bg-secondary-light hover:text-white active:opacity-80 focus:bg-secondary-light focus:text-white",white:"text-white hover:bg-white hover:text-black active:opacity-80 focus:bg-white focus:text-black",black:"text-black hover:bg-black hover:text-white focus:bg-black focus:text-white active:opacity-80"},outlined:{default:"text-primary-light hover:bg-primary-light hover:text-black focus:text-black focus:bg-primary-light active:opacity-80",primary:"text-primary-main hover:opacity-80 active:opacity-100 focus:opacity-80",secondary:"text-secondary-light hover:opacity-80 active:opacity-100 focus:opacity-80",translucent:"text-white hover:opacity-80 active:opacity-100 focus:opacity-80",white:"text-black hover:bg-primary-main focus:bg-primary-main hover:border-black focus:border-black",black:"text-white hover:bg-primary-main focus:bg-primary-main hover:border-black focus:border-black",primaryActive:"text-primary-active hover:opacity-80 active:opacity-100 focus:opacity-80",primaryLight:"border bg-transparent border-primary-main text-white hover:opacity-80 active:opacity-100 focus:opacity-80"},contained:{default:"text-black hover:opacity-80 active:opacity-100 focus:opacity-80",primary:"text-white hover:opacity-80 active:opacity-100 focus:opacity-80",primaryDark:"text-primary-active hover:opacity-80 active:opacity-100 focus:opacity-80",secondary:"text-white hover:opacity-80 active:opacity-100 focus:opacity-80",white:"text-black hover:opacity-80 active:opacity-100 focus:opacity-80",black:"text-white hover:opacity-80 active:opacity-100 focus:opacity-80",light:"border text-black hover:opacity-80 active:opacity-100 focus:opacity-80"},disabled:{default:"cursor-not-allowed opacity-50 text-black",primary:"cursor-not-allowed opacity-50 text-white",secondary:"cursor-not-allowed opacity-50 text-white",white:"cursor-not-allowed opacity-50 text-black",black:"cursor-not-allowed opacity-50 text-white",light:"cursor-not-allowed opacity-50 border text-black"}},eCl={text:{default:"",primary:"",secondary:"",white:"",black:""},outlined:{default:"bg-transparent",primary:"bg-transparent",secondary:"bg-transparent",black:"bg-black",white:""},contained:{default:"bg-primary-light",primary:"bg-primary-main",primaryDark:"bg-primary-dark",secondary:"bg-secondary-light",white:"bg-white",black:"bg-black",light:"bg-primary-light"},disabled:{default:"bg-primary-light",primary:"bg-primary-main",secondary:"bg-secondary-light",white:"bg-white",black:"bg-black",light:"bg-primary-light"}},eCu={none:"",light:"border border-primary-light",primary:"border border-primary-main",primaryActive:"border border-primary-active",secondary:"border border-secondary-light",white:"border border-white",black:"border border-black"},eCd={small:"py-2 px-2 text-sm min-w-md",medium:"py-2 px-2 text-lg min-w-md",large:"py-2 px-6 text-xl min-w-md",initial:""},eCc={true:"flex w-full",false:"inline-flex"},eCh=({children:e="",variant:t=eCi,color:r=ex9,border:n=eCr,size:a=eCn,rounded:i=eCt,disabled:o=ex7,type:s=eCa,fullWidth:l=eCe,bgColor:u=null,startIcon:d,endIcon:c,name:h,className:p,onClick:m=()=>{},...f})=>{let g=d&&eh().createElement("div",{className:"mr-2"},eh().cloneElement(d,{className:em()("w-4 h-4 fill-current")})),y=c&&eh().createElement("div",{className:"ml-2"},eh().cloneElement(c,{className:em()("w-4 h-4 fill-current")})),v=(0,ed.useRef)(null),b=em()("leading-none font-sans text-center justify-center items-center outline-none transition duration-300 ease-in-out focus:outline-none",((e,t,r=null)=>{let n=eCl[e][t];return r||(r=n),`${eCs[e][t]} ${r}`})(t,r,u),eCu[n],eCo[i],eCd[a],eCc[l],p);return eh().createElement("button",ex6({className:b,disabled:o,ref:v,onClick:e=>{v.current.blur(),o||m(e)},type:s,"data-cy":`${h}-btn`},f),g,e,y)};eCh.propTypes={children:ei().node,onClick:ei().func.isRequired,size:ei().oneOf(["small","medium","large","initial","inherit"]),rounded:ei().oneOf(["none","small","medium","large","full"]),variant:ei().oneOf(["text","outlined","contained","disabled"]),color:ei().oneOf(["default","primary","primaryDark","primaryActive","secondary","white","black","inherit","light","translucent"]),border:ei().oneOf(["none","light","default","primary","primaryActive","secondary","white","black"]),fullWidth:ei().bool,disabled:ei().bool,type:ei().string,name:ei().string,startIcon:ei().node,endIcon:ei().node,className:ei().string,bgColor:ei().string};let eCp=eCh;function eCm(){return(eCm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let eCf={vertical:{none:"",small:"first:rounded-t last:rounded-b",medium:"first:rounded-t-md last:rounded-b-md",large:"first:rounded-t-lg last:rounded-b-lg",full:"first:rounded-t-full last:rounded-b-full"},horizontal:{none:"",small:"first:rounded-l last:rounded-r",medium:"first:rounded-l-md last:rounded-r-md",large:"first:rounded-l-lg last:rounded-r-lg",full:"first:rounded-l-full last:rounded-r-full"}},eCg={text:{vertical:"border-t-0 border-l-0 border-r-0 last:border-b-0",horizontal:"border-l-0 border-t-0 border-b-0 last:border-r-0"},outlined:{vertical:"border border-b-0 last:border-b",horizontal:"border border-r-0 last:border-r"},contained:{vertical:"border-t-0 border-l-0 border-r-0 last:border-b-0",horizontal:"border-l-0 border-t-0 border-b-0 last:border-r-0"}},eCy={text:{default:"border-primary-light",primary:"border-primary-main",secondary:"border-secondary-light",white:"border-white",black:"border-primary-main"},outlined:{default:"",primary:"",secondary:"border border-secondary-light",white:"",black:"border-primary-main group-hover:bg-primary-main group-hover:border-black"},contained:{default:"border-white\xa0",primary:"border-white\xa0",secondary:"border-white\xa0",white:"border-black",black:"border-primary-main"}},eCv={vertical:"flex-col",horizontal:"flex-row"},eCb={vertical:"border-t-0 border-b-0",horizontal:"border-l-0 last:border-r-0"},eCw=({children:e,className:t,disabled:r=!1,fullWidth:n=!1,color:a="default",orientation:i="horizontal",rounded:o="medium",size:s="medium",variant:l="outlined",splitBorder:u=!0,...d})=>{let c=(0,ed.useRef)(null),h=em()("border outline-none",eCg[l]&&eCg[l][i],eCy[l]&&eCy[l][a],eCf[i]&&eCf[i][o]);return eh().createElement("div",eCm({role:"group",className:em()("group",t,eCv[i],n?"flex":"inline-flex"),ref:c},d),eh().Children.map(e,(t,o)=>{let d=o===eh().Children.count(e)-1;return eh().isValidElement(t)?eh().cloneElement(t,{className:em()(h,t.props.className,!u&&0!==o&&!d&&eCb[i],!u&&d&&"last:border-l-0"),disabled:t.props.disabled||r,color:t.props.color||a,fullWidth:n,rounded:"none",size:t.props.size||s,variant:t.props.variant||l}):null}))};eCw.propTypes={children:ei().node.isRequired,className:ei().string,color:ei().oneOf(["default","inherit","primary","secondary","white","black"]),disabled:ei().bool,fullWidth:ei().bool,orientation:ei().oneOf(["vertical","horizontal"]),rounded:ei().oneOf(["none","small","medium","large","full"]),size:ei().oneOf(["small","medium","large","inherit"]),variant:ei().oneOf(["text","outlined","contained"])};let eCx=eCw,eCC=({children:e,className:t="",fullWidth:r=!0,style:n={}})=>eh().createElement("div",{className:em()("text-lg text-white",{true:"w-full",false:""}[r],t),style:n},e);eCC.propTypes={fullWidth:ei().bool,children:ei().node.isRequired,className:ei().string,style:ei().object};let eCk=eCC,eCM=({children:e,className:t="",style:r={}})=>eh().createElement("div",{className:em()("bg-secondary-dark border-secondary-light flex border-b pr-2 font-bold",t),style:r},eh().isValidElement(e)?eh().cloneElement(e,{isTableHead:!0}):e);eCM.propTypes={children:function(e,t,r){let n=eh().Children.toArray(e.children);return n.some(e=>"string"==typeof e)?Error(`Failed prop type: Invalid prop ${t} supplied to ${r}, expected a valid element instead of a string.`):n.some(e=>!eh().isValidElement(e))?Error(`Failed prop type: Invalid prop ${t} supplied to ${r}, expected a valid node element.`):void 0},className:ei().string,style:ei().object};let eCS=eCM,eCE=({children:e,className:t="",style:r={}})=>eh().createElement("div",{className:em()("ohif-scrollbar mt-2 max-h-48 overflow-y-scroll",t),style:r},eh().isValidElement(e)?eh().cloneElement(e,{isTableHead:!1}):e);eCE.propTypes={children:function(e,t,r){let n=eh().Children.toArray(e.children);return n.some(e=>"string"==typeof e)?Error(`Failed prop type: Invalid prop ${t} supplied to ${r}, expected a valid element instead of a string.`):n.some(e=>!eh().isValidElement(e))?Error(`Failed prop type: Invalid prop ${t} supplied to ${r}, expected a valid node element.`):void 0},className:ei().string,style:ei().object};let eCT=eCE,eCI=({children:e,className:t="",isTableHead:r=!1,style:n={}})=>{let a=eh().Children.map(e,t=>eh().isValidElement(t)?eh().cloneElement(t,{isTableHead:r,cellsNum:e.length}):e);return eh().createElement("div",{className:em()("flex w-full",t),style:n},a)};eCI.propTypes={isTableHead:ei().bool,children:function(e,t,r){let n=eh().Children.toArray(e.children);return n.some(e=>"string"==typeof e)?Error(`Failed prop type: Invalid prop ${t} supplied to ${r}, expected a valid element instead of a string.`):n.some(e=>!eh().isValidElement(e))?Error(`Failed prop type: Invalid prop ${t} supplied to ${r}, expected a valid node element.`):void 0},className:ei().string,style:ei().object};let eCP=eCI,eC_=({children:e,className:t="",colSpan:r=1,cellsNum:n,isTableHead:a=!1,align:i="left",style:o={}})=>eh().createElement("div",{className:em()("break-all px-2 last:border-r-0",`w-${r}/${n}`,{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}[i],{true:"",false:"border-r border-secondary-light"}[a],t),style:o},e);eC_.propTypes={align:ei().oneOf(["left","center","right","justify"]),children:ei().node.isRequired,className:ei().string,colSpan:ei().number,isTableHead:ei().bool,style:ei().object};let eCD=eC_,eCO=({seriesTableColumns:e,seriesTableDataSource:t,children:r})=>eh().createElement("div",{className:"w-full bg-black py-4 pl-12 pr-2"},eh().createElement("div",{className:"block"},r),eh().createElement("div",{className:"mt-4"},eh().createElement(eCk,null,eh().createElement(eCS,null,eh().createElement(eCP,null,Object.keys(e).map(t=>eh().createElement(eCD,{key:t},e[t])))),eh().createElement(eCT,null,t.map((e,t)=>eh().createElement(eCP,{key:t},Object.keys(e).map(t=>{let r=e[t];return eh().createElement(eCD,{key:t,className:"truncate"},r)})))))));eCO.propTypes={seriesTableDataSource:ei().arrayOf(ei().object).isRequired,seriesTableColumns:ei().object.isRequired,children:ei().node.isRequired};let eCA=eCO,eCR=({filtersMeta:e,filterValues:t,onChange:r,clearFilters:n,isFiltering:a,numOfStudies:i,onUploadClick:o,getDataSourceConfigurationComponent:s})=>{let{t:l}=eA("StudyList"),{sortBy:u,sortDirection:d}=t;return eh().createElement(eh().Fragment,null,eh().createElement("div",null,eh().createElement("div",{className:"bg-black"},eh().createElement("div",{className:"container relative mx-auto flex flex-col pt-5"},eh().createElement("div",{className:"mb-5 flex flex-row justify-between"},eh().createElement("div",{className:"flex min-w-[1px] shrink flex-row items-center gap-6"},eh().createElement(eX,{variant:"h6",className:"text-white"},l("StudyList")),s&&s(),o&&eh().createElement("div",{className:"text-primary-active flex cursor-pointer items-center gap-2 self-center text-lg font-semibold",onClick:o},eh().createElement(hO.Upload,null),eh().createElement("span",null,l("Upload")))),eh().createElement("div",{className:"flex h-[34px] flex-row items-center"},a&&eh().createElement(eCp,{rounded:"full",variant:"outlined",color:"primaryActive",border:"primaryActive",className:"mx-8",startIcon:eh().createElement(hO.Cancel,null),onClick:n},l("ClearFilters")),eh().createElement(eX,{variant:"h6",className:"mr-2","data-cy":"num-studies"},i>100?">100":i),eh().createElement(eX,{variant:"h6",className:"text-primary-light"},`${l("Studies")}\xa0`)))))),eh().createElement("div",{className:"sticky -top-1 z-10 mx-auto border-b-4 border-black"},eh().createElement("div",{className:"bg-primary-dark pt-3 pb-3"},eh().createElement(ex8,{inputMeta:e,values:t,onValuesChange:r,sorting:{sortBy:u,sortDirection:d},onSortingChange:e=>{r({...t,...e})},isSortingEnabled:i>0&&i<=100})),i>100&&eh().createElement("div",{className:"container m-auto"},eh().createElement("div",{className:"bg-primary-main rounded-b py-1 text-center text-base"},eh().createElement("p",{className:"text-white"},l("Filter list to 100 studies or less to enable sorting"))))))};eCR.propTypes={filtersMeta:ei().arrayOf(ei().shape({name:ei().string.isRequired,displayName:ei().string.isRequired,inputType:ei().oneOf(["Text","MultiSelect","DateRange","None"]).isRequired,isSortable:ei().bool.isRequired,gridCol:ei().oneOf([1,2,3,4,5,6,7,8,9,10,11,12]).isRequired,option:ei().arrayOf(ei().shape({value:ei().string,label:ei().string}))})).isRequired,filterValues:ei().object.isRequired,numOfStudies:ei().number.isRequired,onChange:ei().func.isRequired,clearFilters:ei().func.isRequired,isFiltering:ei().bool.isRequired,onUploadClick:ei().func,getDataSourceConfigurationComponent:ei().func};let eCL=eCR,eCN=({onChangePage:e,currentPage:t,perPage:r,onChangePerPage:n})=>{let{t:a}=eA("StudyList"),i=t=>{e(t<1?1:t)},o=[{value:"25",label:"25"},{value:"50",label:"50"},{value:"100",label:"100"}],[s,l]=(0,ed.useState)(o.find(e=>e.value===r));return eh().createElement("div",{className:"bg-black py-10"},eh().createElement("div",{className:"container relative m-auto px-8"},eh().createElement("div",{className:"flex justify-between"},eh().createElement("div",{className:"flex items-center"},eh().createElement(ex2,{id:"rows-per-page",className:"border-primary-main relative mr-3 w-24",options:o,value:s,isMulti:!1,isClearable:!1,isSearchable:!1,closeMenuOnSelect:!1,hideSelectedOptions:!0,onChange:e=>{l(e),n(e.value)}}),eh().createElement(eX,{className:"text-base opacity-60"},a("Results per page"))),eh().createElement("div",{className:""},eh().createElement("div",{className:"flex items-center"},eh().createElement(eX,{className:"mr-4 text-base opacity-60"},a("Page")," ",t),eh().createElement(eCx,null,eh().createElement(eCp,{size:"initial",className:"px-4 py-2 text-base",color:"translucent",border:"primary",variant:"outlined",onClick:()=>i(1)},"<<"),eh().createElement(eCp,{size:"initial",className:"py-2 px-2 text-base",color:"translucent",border:"primary",variant:"outlined",onClick:()=>i(t-1)},a("Previous")),eh().createElement(eCp,{size:"initial",className:"py-2 px-4 text-base",color:"translucent",border:"primary",variant:"outlined",onClick:()=>i(t+1)},a("Next"))))))))};eCN.propTypes={onChangePage:ei().func.isRequired,currentPage:ei().number.isRequired,perPage:ei().number.isRequired,onChangePerPage:ei().func.isRequired};let eCV=eCN,eCF=e=>{let{tableData:t}=e,{row:r,expandedContent:n,onClickRow:a,isExpanded:i,dataCY:o,clickableCY:s}=t;return eh().createElement(eh().Fragment,null,eh().createElement("tr",{className:"select-none","data-cy":o},eh().createElement("td",{className:em()("border-0 p-0",{"border-secondary-light bg-primary-dark border-b":i})},eh().createElement("div",{className:em()("w-full transition duration-300",{"border-primary-light hover:border-secondary-light mb-2 overflow-visible rounded border":i},{"border-transparent":!i})},eh().createElement("table",{className:em()("w-full p-4")},eh().createElement("tbody",null,eh().createElement("tr",{className:em()("hover:bg-secondary-main cursor-pointer transition duration-300",{"bg-primary-dark":!i},{"bg-secondary-dark":i}),onClick:a,"data-cy":s},r.map((e,t)=>{let{content:r,title:n,gridCol:a}=e;return eh().createElement("td",{key:t,className:em()("truncate px-4 py-2 text-base",{"border-secondary-light border-b":!i},eba(a)||""),style:{maxWidth:0},title:n},eh().createElement("div",{className:"flex"},0===t&&eh().createElement("div",null,i?eh().createElement(hO.ChevronOpen,{className:"-mt-1 mr-4 inline-flex"}):eh().createElement(hO.ChevronClosed,{className:"-mt-1 mr-4 inline-flex rotate-180"})),eh().createElement("div",{className:em()({"overflow-hidden":!0},{truncate:!0})},r)))})),i&&eh().createElement("tr",{className:"max-h-0 w-full select-text overflow-hidden bg-black"},eh().createElement("td",{colSpan:r.length},n))))))))};eCF.propTypes={tableData:ei().shape({row:ei().arrayOf(ei().shape({key:ei().string.isRequired,content:ei().node,title:ei().string,gridCol:ei().number.isRequired})).isRequired,expandedContent:ei().node.isRequired,onClickRow:ei().func.isRequired,isExpanded:ei().bool.isRequired,dataCY:ei().string,clickableCY:ei().string})};let eCB=eCF,eCj=({tableDataSource:e,querying:t})=>eh().createElement("div",{className:"bg-black"},eh().createElement("div",{className:"container relative m-auto"},eh().createElement("table",{className:"w-full text-white"},eh().createElement("tbody",{"data-cy":"study-list-results","data-querying":t},e.map((e,t)=>eh().createElement(eCB,{tableData:e,key:t}))))));eCj.propTypes={tableDataSource:ei().arrayOf(ei().shape({row:ei().array.isRequired,expandedContent:ei().node.isRequired,querying:ei().bool,onClickRow:ei().func.isRequired,isExpanded:ei().bool.isRequired}))};let eCW=eCj;var eCU=((N=eCU||{}).primary="primary",N.secondary="secondary",N),eCz=((V=eCz||{}).medium="medium",V.smallTall="smallTall",V.small="small",V),eCH=((F=eCH||{}).horizontal="horizontal",F.vertical="vertical",F);let eCG={bottom:{top:-15,left:"50%",transform:"translateX(-50%)"},"bottom-left":{top:-15,left:5},"bottom-right":{top:-15,right:5},right:{top:"calc(50% - 8px)",left:-15,transform:"rotate(270deg)"},left:{top:"calc(50% - 8px)",right:-15,transform:"rotate(-270deg)"},top:{bottom:-15,left:"50%",transform:"translateX(-50%) rotate(180deg)"}},eCq=({content:e,secondaryContent:t=null,isSticky:r=!1,position:n="bottom",className:a,tight:i=!1,children:o,isDisabled:s=!1,tooltipBoxClassName:l,showHideDelay:u=300,onHide:d})=>{let[c,h]=(0,ed.useState)(!1),p=(0,ed.useMemo)(()=>(r||c)&&!s,[r,c,s]),{t:m}=eA("Buttons"),f=document.getElementById("react-portal"),[g,y]=(0,ed.useState)({x:999999,y:999999}),v=(0,ed.useRef)(null),b=(0,ed.useRef)(null),w=(0,ed.useMemo)(()=>MI()(()=>h(!0),u),[u]),x=(0,ed.useMemo)(()=>MI()(()=>h(!1),u),[u]),C=()=>{x.cancel(),w()},k=()=>{w.cancel(),x()};(0,ed.useEffect)(()=>()=>{w.cancel(),x.cancel()},[w,x]),(0,ed.useEffect)(()=>{!p&&d&&d()},[p,d]),(0,ed.useEffect)(()=>{if(v.current&&b.current){let e=v.current.getBoundingClientRect(),t=b.current.getBoundingClientRect(),r=e.width,a=e.height,i=t.width,o=0,s=0;switch(n){case"bottom":o=e.left+r/2,s=e.top+a;break;case"top":o=e.left+r/2,s=e.top-2*a;break;case"right":o=e.left+r,s=e.top+a/2;break;case"left":o=e.left-i-10,s=e.top+a/2;break;case"bottom-left":o=e.left,s=e.top+a;break;case"bottom-right":o=e.left-i+r,s=e.top+a}y({x:o,y:s})}},[p,n,v.current,b.current]);let M=eh().createElement("div",{className:em()(`tooltip tooltip-${n} block`,"z-50"),style:{position:"fixed",top:g.y,left:p?g.x:999999}},eh().createElement("div",{ref:b,className:em()("tooltip-box bg-primary-dark border-secondary-light w-max-content relative inset-x-auto top-full rounded border text-base text-white",{"py-[6px] px-[8px]":!i},l)},eh().createElement("div",null,"string"==typeof e?m(e):e),eh().createElement("div",{className:"text-aqua-pale"},"string"==typeof t?m(t):t),eh().createElement("svg",{className:"text-primary-dark stroke-secondary-light absolute h-4",style:eCG[n],xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},eh().createElement("path",{fill:"currentColor",d:"M24 22l-12-20l-12 20"}))));return eh().createElement("div",{ref:v,className:em()("relative",a),onMouseOver:C,onFocus:C,onMouseOut:k,onBlur:k,role:"tooltip"},o,f&&rE().createPortal(M,f))};eCq.propTypes={isDisabled:ei().bool,content:ei().oneOfType([ei().node,ei().func]),secondaryContent:ei().oneOfType([ei().node,ei().func]),position:ei().oneOf(["bottom","bottom-left","bottom-right","left","right","top"]),isSticky:ei().bool,tight:ei().bool,children:ei().node.isRequired,className:ei().string,tooltipBoxClassName:ei().string,showHideDelay:ei().number,onHide:ei().func};let eC$={[eCz.small]:"h-[26px] text-[13px]",[eCz.smallTall]:"h-[32px] text-[13px]",[eCz.medium]:"h-[32px] text-[14px]"},eCK="leading-[1.2] font-sans text-center whitespace-nowrap",eCY={[eCU.primary]:em()(eCK,"font-semibold"),[eCU.secondary]:em()(eCK,"font-400")},eCZ="transition duration-300 ease-in-out focus:outline-none",eCX={[eCU.primary]:em()(eCZ,"hover:bg-customblue-80 active:bg-customblue-40"),[eCU.secondary]:em()(eCZ,"hover:bg-customblue-50 active:bg-customblue-20")},eCJ="text-white",eCQ={[eCU.primary]:em()("bg-primary-main",eCJ,eCX[eCU.primary]),[eCU.secondary]:em()("bg-customblue-30",eCJ,eCX[eCU.secondary])},eC0={color:"default",disabled:!1,rounded:"small",size:eCz.medium,type:eCU.primary},eC1=({children:e="",size:t=eC0.size,disabled:r=eC0.disabled,type:n=eC0.type,startIcon:a,endIcon:i,name:o,className:s,onClick:l=()=>{},dataCY:u,startIconTooltip:d=null,endIconTooltip:c=null})=>{u=u||`${o}-btn`;let h=a&&eh().createElement(eh().Fragment,null,eh().cloneElement(a,{className:em()("w-4 h-4 fill-current",a?.props?.className)})),p=i&&eh().createElement(eh().Fragment,null,eh().cloneElement(i,{className:em()("w-4 h-4 fill-current",i?.props?.className)})),m=(0,ed.useRef)(null),f=em()("box-content inline-flex flex-row items-center justify-center gap-[5px] justify center px-[10px] outline-none rounded",eCY[n],r?"bg-inputfield-placeholder text-common-light cursor-default":eCQ[n],eC$[t],e?"min-w-[32px]":"",s);return eh().createElement("button",{className:f,disabled:r,ref:m,onClick:e=>{m.current.blur(),r||l(e)},"data-cy":u},d?eh().createElement(eCq,{content:d},h):h,e,c?eh().createElement(eCq,{content:c},p):p)};eC1.propTypes={children:ei().node,onClick:ei().func.isRequired,size:ei().oneOf([eCz.medium,eCz.small]),disabled:ei().bool,type:ei().oneOf([eCU.primary,eCU.secondary]),name:ei().string,startIcon:ei().node,endIcon:ei().node,className:ei().string,startIconTooltip:ei().node,endIconTooltip:ei().node,dataCY:ei().string};let eC2=eC1,eC5=({items:e,...t})=>e?eh().createElement("div",{"data-cy":"context-menu",className:"bg-secondary-dark relative z-50 block w-48 rounded",onContextMenu:e=>e.preventDefault()},e.map((e,r)=>eh().createElement("div",{key:r,"data-cy":"context-menu-item",onClick:()=>e.action(e,t),style:{justifyContent:"space-between"},className:"hover:bg-primary-dark border-primary-dark flex cursor-pointer items-center border-b px-4 py-3 transition duration-300 last:border-b-0"},eh().createElement(eX,null,e.label),e.iconRight&&eh().createElement(hO.ByName,{name:e.iconRight,className:"inline text-white"})))):null;eC5.propTypes={defaultPosition:ei().shape({x:ei().number,y:ei().number}),items:ei().arrayOf(ei().shape({label:ei().string.isRequired,action:ei().func.isRequired}))};let eC3=eC5,eC4=({className:e,value:t="",placeholder:r,onDebounceChange:n,onChange:a,debounceTime:i=200})=>{let[o,s]=(0,ed.useState)(t),l=(0,ed.useRef)(null),u=(0,ed.useMemo)(()=>MI()(n||(()=>{}),i),[]);(0,ed.useEffect)(()=>s(t),[t]),(0,ed.useEffect)(()=>u?.cancel(),[]);let d=(0,ed.useCallback)(e=>{s(e),a&&a(e),n&&u(e)},[]);return eh().createElement("label",{className:em()("relative",e)},eh().createElement("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2"},eh().createElement(hO.Search,null)),eh().createElement("input",{ref:l,type:"text",className:"border-inputfield-main focus:border-inputfield-focus disabled:border-inputfield-disabled placeholder:text-inputfield-placeholder block w-full appearance-none rounded-md border bg-black py-2 px-9 text-base leading-tight shadow transition duration-300 focus:outline-none",placeholder:r,onChange:e=>d(e.target.value),autoComplete:"off",value:o}),eh().createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2"},eh().createElement(hO.Clear,{className:em()("cursor-pointer",o?"":"hidden"),onClick:()=>{l.current.value="",d("")}})))}})(),d})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohif/ui",
3
- "version": "3.13.0-beta.132",
3
+ "version": "3.13.0-beta.134",
4
4
  "description": "A set of React components for Medical Imaging Viewers",
5
5
  "author": "OHIF Contributors",
6
6
  "license": "MIT",